new-element | a object |
vector | a vector with fill pointer |
VECTOR-PUSH function pushes new-element into specified vector. Supplied vector must have fill-pointer (see MAKE-ARRAY). New element is placed at last fill-pointer position and fill-pointer is incremented. See also MAKE-ARRAY, VECTOR-POP and VECTOR-PUSH. Return value is index at which the new item was placed, or NIL if there is no room.
(defparameter *v* (make-array 2 :fill-pointer 0)) => *V* (vector-push 4 *v*) => 0 (vector-push 3 *v*) => 1 (vector-push 2 *v*) => NIL *v* => #(4 3) (vector-pop *v*) => 3 (vector-pop *v*) => 4