factor/library/collections/vectors.facts

18 lines
979 B
Plaintext
Raw Normal View History

2006-06-04 16:20:40 -04:00
USING: arrays help kernel strings vectors ;
2006-01-02 00:51:03 -05:00
HELP: <vector> "( n -- vector )"
{ $values { "n" "a positive integer specifying initial capacity" } { "vector" "a new vector" } }
{ $description "Creates a new vector that can hold " { $snippet "n" } " elements before resizing." }
{ $see-also <array> <string> <sbuf> } ;
HELP: >vector "( seq -- vector )"
{ $values { "seq" "a sequence" } { "vector" "a new vector" } }
{ $description "Outputs a freshly-allocated vector with the same elements as a given sequence." } ;
2006-06-04 16:20:40 -04:00
HELP: with-datastack "( stack word -- newstack )"
{ $values { "stack" "a sequence" } { "word" "a word" } { "newstack" "a sequence" } }
{ $description "Executes " { $snippet "word" } " with the given data stack contents, and outputs the new data stack after the word returns. Does not affect the data stack in surrounding code, other than consuming the two inputs and pushing the output." }
{ $examples
{ $example "{ 3 7 } \ + with-datastack ." "V{ 10 }" }
} ;