Next: , Previous: , Up: Programming Types   [Contents][Index]


8.4.9 Vector Type

A vector is a one-dimensional array of elements of any type. It takes a constant amount of time to access any element of a vector. (In a list, the access time of an element is proportional to the distance of the element from the beginning of the list.)

The printed representation of a vector consists of a left square bracket, the elements, and a right square bracket. This is also the read syntax. Like numbers and strings, vectors are considered constants for evaluation.

[1 "two" (three)]      ; A vector of three elements.
     ⇒ [1 "two" (three)]

See Vectors, for functions that work with vectors.