]> gitweb.factorcode.org Git - factor.git/blob - basis/specialized-vectors/specialized-vectors-docs.factor
5c0a15cb7557f9ff341794c4b4b0475d8dc0c376
[factor.git] / basis / specialized-vectors / specialized-vectors-docs.factor
1 USING: help.markup help.syntax byte-vectors ;
2 IN: specialized-vectors
3
4 ARTICLE: "specialized-vectors" "Specialized vectors"
5 "The " { $vocab-link "specialized-vectors" } " vocabulary implements resizable sequence types for storing machine values in a space-efficient manner without boxing."
6 $nl
7 "For each primitive C type " { $snippet "T" } ", a set of words are defined:"
8 { $table
9     { { $snippet "T-vector" } { "The class of vectors with elements of type " { $snippet "T" } } }
10     { { $snippet "<T-vector>" } { "Constructor for vectors with elements of type " { $snippet "T" } "; stack effect " { $snippet "( len -- vector )" } } }
11     { { $snippet ">T-vector" } { "Converts a sequence into a specialized vector of type " { $snippet "T" } "; stack effect " { $snippet "( seq -- vector )" } } }
12     { { $snippet "T-vector{" } { "Literal syntax, consists of a series of values terminated by " { $snippet "}" } } }
13 }
14 "The primitive C types for which specialized vectors exist:"
15 { $list
16     { $snippet "char" }
17     { $snippet "uchar" }
18     { $snippet "short" }
19     { $snippet "ushort" }
20     { $snippet "int" }
21     { $snippet "uint" }
22     { $snippet "long" }
23     { $snippet "ulong" }
24     { $snippet "longlong" }
25     { $snippet "ulonglong" }
26     { $snippet "float" }
27     { $snippet "double" }
28     { $snippet "void*" }
29     { $snippet "bool" }
30 }
31 "Specialized vectors are generated with a functor in the " { $vocab-link "specialized-vectors.functor" } " vocabulary."
32 $nl
33 "The " { $vocab-link "specialized-arrays" } " vocabulary provides fixed-length versions of the above." ;
34
35 ABOUT: "specialized-vectors"