1 USING: arrays bit-arrays help.markup help.syntax kernel
\r
5 ARTICLE: "bit-vectors" "Bit vectors"
\r
6 "A bit vector is a resizable mutable sequence of bits. Bit vector words are found in the " { $vocab-link "bit-vectors" } " vocabulary."
\r
8 "Bit vectors form a class:"
\r
9 { $subsection bit-vector }
\r
10 { $subsection bit-vector? }
\r
11 "Creating bit vectors:"
\r
12 { $subsection >bit-vector }
\r
13 { $subsection <bit-vector> }
\r
15 { $subsection POSTPONE: ?V{ }
\r
16 "If you don't care about initial capacity, a more elegant way to create a new bit vector is to write:"
\r
17 { $code "?V{ } clone" } ;
\r
19 ABOUT: "bit-vectors"
\r
22 { $description "The class of resizable bit vectors. See " { $link "bit-vectors" } " for information." } ;
\r
25 { $values { "n" "a positive integer specifying initial capacity" } { "bit-vector" bit-vector } }
\r
26 { $description "Creates a new bit vector that can hold " { $snippet "n" } " bits before resizing." } ;
\r
29 { $values { "seq" "a sequence" } { "bit-vector" bit-vector } }
\r
30 { $description "Outputs a freshly-allocated bit vector with the same elements as a given sequence." } ;
\r
33 { $syntax "?V{ elements... }" }
\r
34 { $values { "elements" "a list of booleans" } }
\r
35 { $description "Marks the beginning of a literal bit vector. Literal bit vectors are terminated by " { $link POSTPONE: } } "." }
\r
36 { $examples { $code "?V{ t f t }" } } ;
\r