2005-12-29 19:01:19 -05:00
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 ;
2005-12-29 19:01:19 -05:00
2006-08-15 21:23:05 -04:00
HELP: array
2006-06-05 22:50:16 -04:00
{ $description "The class of fixed-length arrays. See " { $link "syntax-arrays" } " for syntax and " { $link "arrays" } " for general information." } ;
2006-06-04 17:13:34 -04:00
2006-08-15 21:23:05 -04:00
HELP: <array> ( n elt -- array )
2006-06-04 17:13:34 -04:00
{ $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" } "." }
2006-06-04 17:13:34 -04:00
{ $see-also <quotation> <string> <sbuf> <vector> } ;
2005-12-29 19:01:19 -05:00
2006-08-15 21:23:05 -04:00
HELP: >array
2005-12-29 19:01:19 -05:00
{ $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 } ;
2005-12-29 19:01:19 -05:00
2006-08-15 21:23:05 -04:00
HELP: 1array
2005-12-29 19:01:19 -05:00
{ $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
2005-12-29 19:01:19 -05:00
{ $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
2005-12-29 19:01:19 -05:00
{ $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-06-05 22:04:49 -04:00
2006-08-15 21:23:05 -04:00
HELP: resize-array ( n array -- newarray )
2006-06-05 22:04:49 -04:00
{ $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-06-05 22:50:16 -04:00
2006-08-15 21:23:05 -04:00
HELP: byte-array
2006-06-05 22:50:16 -04:00
{ $description "The class of byte arrays." } ;
2006-08-15 21:23:05 -04:00
HELP: <byte-array> ( n -- byte-array )
2006-06-05 22:50:16 -04:00
{ $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." } ;