www.delorie.com/gnu/docs/guile/guile_226.html   search  
Buy GNU books!

Guile Reference Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

22.3 Vectors

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 some array procedures operate happily on vectors (see section 22.6 Arrays).

22.3.1 Read Syntax for Vectors  Read syntax for vectors.
22.3.2 Dynamic Vector Creation and Validation  Dynamic vector creation and validation.
22.3.3 Accessing and Modifying Vector Contents  Accessing and modifying vector contents.

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003