Next: , Previous: , Up: Sequences Arrays Vectors   [Contents][Index]


12.6 Bit Vectors

Bit vectors are specialized vectors that can only represent arrays of 1’s and 0’s. Bit vectors have a very efficient representation and are useful for representing sets of boolean (true or false) values.

There is no limit on the size of a bit vector. You could, for example, create a bit vector with 100,000 elements if you really wanted to.

Bit vectors have a special printed representation consisting of ‘#*’ followed by the bits of the vector. For example, a bit vector whose elements are 0, 1, 1, 0, and 1, respectively, is printed as

#*01101

Bit vectors are considered constants for evaluation, like vectors, strings, and numbers. See Self-Evaluating Forms.