(make-vector
length
val)
length,
containing only copies of val.
(vector
val_0
val_1 ...
val_n)
n+1 of the form
#(val_0 val_1
... val_n).
(vector-ref
vec
n)
nth element of
vec. Note that elements are numbered
starting at 0.
(vector-set!
vec
k
val)
kth element of
vec to val.
(Note that vectors use 0-based indexing.)
(list->vector
lst)
lst to a vector so that
the ith value in the vector is the same as the ith value in the lst.
(vector->list
vec)
vec to a list so that
the ith value in the list is the same as the ith value in the vector.
(vector?
val)
val is a vector.
(vector-fill!
vec
val)
vec with multiple copies of
val.
(vector-length
vec)
vec.
Copyright © 2007-2011 Janet Davis, Matthew Kluber, Samuel A. Rebelsky, and Jerod Weinman. (Selected materials copyright by John David Stone and Henry Walker and used by permission.)
This material is based upon work partially supported by the National Science Foundation under Grant No. CCLI-0633090. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.
This work is licensed under a
Creative Commons Attribution-NonCommercial 2.5 License
.