[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug in vector-push-extend
- To: info-macl@CAMBRIDGE.APPLE.COM
- Subject: bug in vector-push-extend
- From: Mark.Kantrowitz@A.GP.CS.CMU.EDU
- Date: Sun, 16 Dec 90 03:24:17 EST
I couldn't get vector-push-extend to work in 1.3.2, even when I created
an array with an explicit fill-pointer and :adjustable t, so I wrote
my own:
(defun vector-push-extend (new-element vector &optional extension)
(cond ((not (array-has-fill-pointer-p vector))
(format t "~&Error: ~A doesn't have a fill pointer in vector-push-exten
d!"
vector)
nil)
((not (adjustable-array-p vector))
(format t "~&Error: ~A must be an adjustable array in vector-push-exten
d!"
vector)
nil)
((= (array-total-size vector)
(fill-pointer vector))
;; we're at the limit
(adjust-array vector (list (or extension 10)))
(vector-push new-element vector))
(t
(vector-push new-element vector))))
--mark