Next: Bit Vectors, Previous: Lists, Up: Data Types [Contents][Index]
Vectors are sequences of Scheme objects. Unlike lists, the length of a vector, once the vector is created, cannot be changed. The advantage of vectors over lists is that the time required to access one element of a vector given its position (synonymous with index), a zero-origin number, is constant, whereas lists have an access time linear to the position of the accessed element in the list.
Vectors can contain any kind of Scheme object; it is even possible to have different types of objects in the same vector. For vectors containing vectors, you may wish to use arrays, instead. Note, too, that vectors are the special case of one dimensional non-uniform arrays and that most array procedures operate happily on vectors (see Arrays).
Also see SRFI-43, for a comprehensive vector library.
• Vector Syntax | Read syntax for vectors. | |
• Vector Creation | Dynamic vector creation and validation. | |
• Vector Accessors | Accessing and modifying vector contents. | |
• Vector Accessing from C | Ways to work with vectors from C. | |
• Uniform Numeric Vectors | Vectors of unboxed numeric values. |