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