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


8.4.10 Bit Vector Type

A bit vector is a one-dimensional array of 1’s and 0’s. It takes a constant amount of time to access any element of a bit vector, as for vectors. Bit vectors have an extremely compact internal representation (one machine bit per element), which makes them ideal for keeping track of unordered sets, large collections of boolean values, etc.

The printed representation of a bit vector consists of ‘#*’ followed by the bits in the vector. This is also the read syntax. Like numbers, strings, and vectors, bit vectors are considered constants for evaluation.

#*00101000      ; A bit vector of eight elements.
     ⇒ #*00101000

See Bit Vectors, for functions that work with bit vectors.