Vector Functions

In Lisp, vectors are allocated at runtime as needed. In many languages, vectors must be pre-declared at compile time.

(make-vector k )
(make-vector k fill )
make a vector of length k whose initial contents are fill. The elements of the vector are numbered from 0 to k - 1.

(vector? obj )
tests whether obj is a vector.

'#( element_0 ... element_k-1 )
can be used to sepcify a constant vector.

Example: '#(0 (2 2 2 2) "Anna")

(vector element_0 ... element_k-1 )
creates a vector with a fixed number of elements.

Contents    Page-10    Prev    Next    Page+10    Index