]> gitweb.factorcode.org Git - factor.git/blob - basis/bit-vectors/bit-vectors-docs.factor
core, basis, extra: Remove DOS line endings from files.
[factor.git] / basis / bit-vectors / bit-vectors-docs.factor
1 USING: help.markup help.syntax sequences ;
2 IN: bit-vectors
3
4 ARTICLE: "bit-vectors" "Bit vectors"
5 "A bit vector is a resizable mutable sequence of bits. Bit vector words are found in the " { $vocab-link "bit-vectors" } " vocabulary."
6 $nl
7 "Bit vectors form a class:"
8 { $subsections
9     bit-vector
10     bit-vector?
11 }
12 "Creating bit vectors:"
13 { $subsections
14     >bit-vector
15     <bit-vector>
16 }
17 "Literal syntax:"
18 { $subsections POSTPONE: ?V{ }
19 "If you don't care about initial capacity, a more elegant way to create a new bit vector is to write:"
20 { $code "?V{ } clone" } ;
21
22 ABOUT: "bit-vectors"
23
24 HELP: bit-vector
25 { $description "The class of resizable bit vectors. See " { $link "bit-vectors" } " for information." } ;
26
27 HELP: <bit-vector>
28 { $values { "capacity" "a positive integer specifying initial capacity" } { "vector" bit-vector } }
29 { $description "Creates a new bit vector that can hold " { $snippet "n" } " bits before resizing." } ;
30
31 HELP: >bit-vector
32 { $values { "seq" sequence } { "vector" bit-vector } }
33 { $description "Outputs a freshly-allocated bit vector with the same elements as a given sequence." } ;
34
35 HELP: ?V{
36 { $syntax "?V{ elements... }" }
37 { $values { "elements" "a list of booleans" } }
38 { $description "Marks the beginning of a literal bit vector. Literal bit vectors are terminated by " { $link POSTPONE: } } "." } 
39 { $examples { $code "?V{ t f t }" } } ;
40