new-element | a object |
vector | a vector with fill pointer |
extension | a positive integer |
VECTOR-PUSH-EXTEND function pushes new-element into specified vector. Supplied vector must be adjustable (see MAKE-ARRAY) and have fill-pointer. New element is placed at last fill-pointer position and fill-pointer is incremented. Vector size is adjusted a number of items as specified by extension argument, if necessary. See also MAKE-ARRAY, VECTOR-POP and VECTOR-PUSH. Return value is index at which the new item was placed.
(defparameter *v* (make-array 2 :fill-pointer 0 :adjustable t)) => *V* (vector-push-extend 4 *v*) => 0 (vector-push-extend 3 *v*) => 1 (vector-push-extend 2 *v*) => 2 *v* => #(4 3 2) (vector-pop *v*) => 2 (vector-pop *v*) => 3 (vector-pop *v*) => 4