Next: Selecting Vector Components, Previous: Vectors, Up: Vectors

— procedure: **make-vector**` k `[`object`]

Returns a newly allocated vector of

kelements. Ifobjectis specified,`make-vector`

initializes each element of the vector toobject. Otherwise the initial elements of the result are unspecified.

— procedure: **vector**` object ...`

Returns a newly allocated vector whose elements are the given arguments.

`vector`

is analogous to`list`

.(vector 'a 'b 'c) => #(a b c)

— procedure: **list->vector**` list`

Returns a newly allocated vector initialized to the elements of

list. The inverse of`list->vector`

is`vector->list`

.(list->vector '(dididit dah)) => #(dididit dah)

— procedure: **make-initialized-vector**` k initialization`

Similar to

`make-vector`

, except that the elements of the result are determined by calling the procedureinitializationon the indices. For example:(make-initialized-vector 5 (lambda (x) (* x x))) => #(0 1 4 9 16)

— procedure: **vector-grow**` vector k`

Kmust be greater than or equal to the length ofvector. Returns a newly allocated vector of lengthk. The first`(vector-length`

vector`)`

elements of the result are initialized from the corresponding elements ofvector. The remaining elements of the result are unspecified.

— procedure: **vector-map**` procedure vector`

Proceduremust be a procedure of one argument.`vector-map`

appliesprocedureelement-wise to the elements ofvectorand returns a newly allocated vector of the results, in order from left to right. The dynamic order in whichprocedureis applied to the elements ofvectoris unspecified.(vector-map cadr '#((a b) (d e) (g h))) => #(b e h) (vector-map (lambda (n) (expt n n)) '#(1 2 3 4)) => #(1 4 27 256) (vector-map + '#(5 7 9)) => #(5 7 9)