factor/basis/float-vectors/float-vectors-docs.factor

38 lines
1.6 KiB
Factor
Raw Normal View History

2008-01-30 00:13:47 -05:00
USING: arrays float-arrays help.markup help.syntax kernel
2008-07-02 16:57:38 -04:00
combinators ;
2008-01-30 00:13:47 -05:00
IN: float-vectors
ARTICLE: "float-vectors" "Float vectors"
2008-04-23 03:46:35 -04:00
"A float vector is a resizable mutable sequence of unsigned floats. Float vector words are found in the " { $vocab-link "float-vectors" } " vocabulary."
2008-01-30 00:13:47 -05:00
$nl
"Float vectors form a class:"
{ $subsection float-vector }
{ $subsection float-vector? }
"Creating float vectors:"
{ $subsection >float-vector }
{ $subsection <float-vector> }
"Literal syntax:"
{ $subsection POSTPONE: FV{ }
2008-01-30 00:13:47 -05:00
"If you don't care about initial capacity, a more elegant way to create a new float vector is to write:"
2008-02-04 20:42:35 -05:00
{ $code "FV{ } clone" } ;
2008-01-30 00:13:47 -05:00
ABOUT: "float-vectors"
HELP: float-vector
2008-04-23 03:46:35 -04:00
{ $description "The class of resizable float vectors. See " { $link "float-vectors" } " for information." } ;
2008-01-30 00:13:47 -05:00
HELP: <float-vector>
2008-01-30 02:10:58 -05:00
{ $values { "n" "a positive integer specifying initial capacity" } { "float-vector" float-vector } }
2008-01-30 00:13:47 -05:00
{ $description "Creates a new float vector that can hold " { $snippet "n" } " floats before resizing." } ;
HELP: >float-vector
2008-01-30 02:22:29 -05:00
{ $values { "seq" "a sequence" } { "float-vector" float-vector } }
2008-01-30 00:13:47 -05:00
{ $description "Outputs a freshly-allocated float vector with the same elements as a given sequence." }
{ $errors "Throws an error if the sequence contains elements other than real numbers." } ;
HELP: FV{
{ $syntax "FV{ elements... }" }
{ $values { "elements" "a list of real numbers" } }
{ $description "Marks the beginning of a literal float vector. Literal float vectors are terminated by " { $link POSTPONE: } } "." }
{ $examples { $code "FV{ 1.0 2.0 3.0 }" } } ;