Accessor fill-pointer

Syntax:

17.5.0 7

fill-pointer vector fill-pointer

(setf (fill-pointer vector) new-fill-pointer)

Arguments and Values:

vector—a vector with a fill pointer.

fill-pointer, new-fill-pointer—a valid fill pointer for the vector.

Description:

17.5.0 6Accesses the fill pointer of vector.

Examples:

 (setq a (make-array 8 :fill-pointer 4)) → #(NIL NIL NIL NIL)
 (fill-pointer a) → 4
 (dotimes (i (length a)) (setf (aref a i) (* i i))) → NIL
 a → #(0 1 4 9)
 (setf (fill-pointer a) 3) → 3
 (fill-pointer a) → 3
 a → #(0 1 4)
 (setf (fill-pointer a) 8) → 8
 a → #(0 1 4 9 NIL NIL NIL NIL)

Side Effects:

None.

Affected By:

None.

Exceptional Situations:

Should signal an error of type type-error if vector is not a vector with a fill pointer.

See Also:

make-array, length

Notes:

There is no operator that will remove a vector's fill pointer.