Changeset 12928
- Timestamp:
- 09/28/10 18:21:06 (13 years ago)
- Location:
- trunk/abcl/src/org/armedbear/lisp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/extensible-sequences.lisp
r12517 r12928 997 997 (defmacro dovector ((elt vector &optional result) &body body) 998 998 (multiple-value-bind (forms decls) 999 (sys:parse-body body :doc-string-allowednil)999 (sys:parse-body body nil) 1000 1000 (let ((index (gensym "INDEX")) (length (gensym "LENGTH")) (vec (gensym "VEC"))) 1001 1001 `(let ((,vec ,vector)) … … 1016 1016 (declare (ignore from-end start end)) 1017 1017 (multiple-value-bind (forms decls) 1018 (sys:parse-body body :doc-string-allowednil)1018 (sys:parse-body body nil) 1019 1019 (let ((s sequence) 1020 1020 (sequence (gensym "SEQUENCE"))) -
trunk/abcl/src/org/armedbear/lisp/java-collections.lisp
r12833 r12928 65 65 ((s (jclass "java.util.List")) &key from-end (start 0) end) 66 66 (let* ((end (or end (length s))) 67 (index (if from-end (1- end)start))67 (index (if from-end end start)) 68 68 (it (jcall "listIterator" s index)) 69 69 (iter (make-jlist-iterator :native-iterator it 70 :index (if from-end (1+ index) 71 (1- index)))) 72 (limit (if from-end start (1- end)))) 70 :index (if from-end (1+ index) (1- index)))) 71 (limit (if from-end (1+ start) (1- end)))) 73 72 ;;CL iterator semantics are that first element is present from the start 74 73 (unless (sequence:iterator-endp s iter limit from-end) … … 79 78 (defmethod sequence:iterator-step 80 79 ((s (jclass "java.util.Collection")) it from-end) 81 (if from-end 82 (progn 83 (setf (jlist-it-element it) 84 (jcall "previous" (jlist-it-native-iterator it))) 85 (decf (jlist-it-index it))) 86 (progn 87 (setf (jlist-it-element it) 88 (jcall "next" (jlist-it-native-iterator it))) 89 (incf (jlist-it-index it)))) 80 (let ((native-it (jlist-it-native-iterator it))) 81 (if from-end 82 (progn 83 (setf (jlist-it-element it) 84 (when (jcall "hasPrevious" native-it) 85 (jcall "previous" native-it))) 86 (decf (jlist-it-index it))) 87 (progn 88 (setf (jlist-it-element it) 89 (when (jcall "hasNext" native-it) 90 (jcall "next" native-it))) 91 (incf (jlist-it-index it))))) 90 92 it) 91 93 … … 93 95 ((s (jclass "java.util.Collection")) it limit from-end) 94 96 (if from-end 95 (< =(jlist-it-index it) limit)96 (> =(jlist-it-index it) limit)))97 (< (jlist-it-index it) limit) 98 (> (jlist-it-index it) limit))) 97 99 98 100 (defmethod sequence:iterator-element
Note: See TracChangeset
for help on using the changeset viewer.