Update of /project/movitz/cvsroot/movitz/losp/muerte In directory common-lisp.net:/tmp/cvs-serv25889
Modified Files: sequences.lisp Log Message: Fill might concievably work now.
Date: Wed Jan 28 16:06:11 2004 Author: ffjeld
Index: movitz/losp/muerte/sequences.lisp diff -u movitz/losp/muerte/sequences.lisp:1.3 movitz/losp/muerte/sequences.lisp:1.4 --- movitz/losp/muerte/sequences.lisp:1.3 Wed Jan 28 15:25:58 2004 +++ movitz/losp/muerte/sequences.lisp Wed Jan 28 16:06:08 2004 @@ -10,7 +10,7 @@ ;;;; Author: Frode Vatvedt Fjeld frodef@acm.org ;;;; Created at: Tue Sep 11 14:19:23 2001 ;;;; -;;;; $Id: sequences.lisp,v 1.3 2004/01/28 20:25:58 ffjeld Exp $ +;;;; $Id: sequences.lisp,v 1.4 2004/01/28 21:06:08 ffjeld Exp $ ;;;; ;;;;------------------------------------------------------------------
@@ -651,19 +651,20 @@ (apply 'map-for-list function first-sequence more-sequences)) (t (error "MAP not implemented."))))
-(defun fill (sequence item &key (start 0) (end (length sequence))) +(defun fill (sequence item &key (start 0) end) "=> sequence" (sequence-dispatch sequence (list - (do ((p (nthcdr start sequence)) + (do ((p (nthcdr start sequence) (cdr p)) (i start (1+ i))) - ((and end (>= i end))) + ((or (null p) (and end (>= i end)))) (setf (car p) item))) (vector - (with-subvector-accessor (sequence-ref sequence start end) - (do ((i start (1+ i))) - ((>= i end)) - (setf (sequence-ref i) item))))) + (let ((end (or end (length sequence)))) + (with-subvector-accessor (sequence-ref sequence start end) + (do ((i start (1+ i))) + ((>= i end)) + (setf (sequence-ref i) item)))))) sequence)
(defun replace (sequence-1 sequence-2 &key (start1 0) end1 (start2 0) end2)