factor/library/collections/arrays.facts

43 lines
2.0 KiB
Plaintext
Raw Normal View History

IN: arrays
2006-05-17 14:55:46 -04:00
USING: help kernel kernel-internals prettyprint strings
2006-05-16 16:50:51 -04:00
vectors ;
2006-08-15 21:23:05 -04:00
HELP: array
{ $description "The class of fixed-length arrays. See " { $link "syntax-arrays" } " for syntax and " { $link "arrays" } " for general information." } ;
2006-08-15 21:23:05 -04:00
HELP: <array> ( n elt -- array )
{ $values { "n" "a non-negative integer" } { "elt" "an initial element" } { "array" "a new array" } }
2006-01-02 00:51:03 -05:00
{ $description "Creates a new array with the given length and all elements initially set to " { $snippet "elt" } "." }
{ $see-also <quotation> <string> <sbuf> <vector> } ;
2006-08-15 21:23:05 -04:00
HELP: >array
{ $values { "seq" "a sequence" } { "array" "an array" } }
{ $description "Outputs a freshly-allocated array with the same elements as a given sequence." }
2006-05-16 16:50:51 -04:00
{ $see-also >string >sbuf >vector >quotation } ;
2006-08-15 21:23:05 -04:00
HELP: 1array
{ $values { "x" "an object" } { "array" "an array" } }
{ $description "Create a new array with one element." }
{ $see-also 2array 3array ch>string } ;
2006-08-15 21:23:05 -04:00
HELP: 2array
{ $values { "x" "an object" } { "y" "an object" } { "array" "an array" } }
{ $description "Create a new array with two elements." }
{ $see-also 1array 3array ch>string } ;
2006-08-15 21:23:05 -04:00
HELP: 3array
{ $values { "x" "an object" } { "y" "an object" } { "z" "an object" } { "array" "an array" } }
{ $description "Create a new array with three elements." }
{ $see-also 1array 2array ch>string } ;
2006-08-15 21:23:05 -04:00
HELP: resize-array ( n array -- newarray )
{ $values { "n" "a non-negative integer" } { "array" "an array" } { "newarray" "a new array" } }
{ $description "Creates a new array of " { $snippet "n" } " elements. The contents of the existing array are copied into the new array; if the new array is shorter, only an initial segment is copied, and if the new array is longer the remaining space is filled in with "{ $link f } "." } ;
2006-08-15 21:23:05 -04:00
HELP: byte-array
{ $description "The class of byte arrays." } ;
2006-08-15 21:23:05 -04:00
HELP: <byte-array> ( n -- byte-array )
{ $values { "n" "a non-negative integer" } { "byte-array" "a new byte array" } }
2006-07-04 17:23:51 -04:00
{ $description "Creates a new byte array holding " { $snippet "n" } " bytes." } ;