Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

:VECTOR-PUSH and -POP

source files: x01v.[ch] xflv.[ch] x32v.[ch] xcsy.[ch] xgrl.[ch]

SYNTAX

(SEND <ary> :VECTOR-POP)
(SEND <ary> :VECTOR-PUSH <val>)
(SEND <ary> :VECTOR-PUSH-EXTEND <val>)

DESCRIPTION

The given array or relation must be one-dimensional. For vector-pop, the fill pointer is decremented, and then the array value corresponding to the new fillpointer value is returned, exactly as with :AREF.

For vector-push, the given value (type as in :SETF) is stored at the offset in the array specified by fillpointer, and the fillpointer is incremented. The original value of the fillpointer is returned. If the array is full, nothing is done and NIL is returned.

Vector-push-extend is just like vector-push, except that it always succeeds, because it expands the vector if needed. Note that the vector does *not* expand by a single slot in this case (which would be intolerably inefficient), but by some reasonably large but unspecified number of slots. This conforms to the CommonLisp standard.


Go to the first, previous, next, last section, table of contents.