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