dup length [ nip malloc dup ] 2keep memcpy ;
: memory>byte-array ( alien len -- byte-array )
- [ nip <byte-array> dup ] 2keep memcpy ;
+ [ nip (byte-array) dup ] 2keep memcpy ;
: byte-array>memory ( byte-array base -- )
swap dup length memcpy ;
"output-image" get save-image-and-exit
] if
-] [ drop "resource:basis/bootstrap/bootstrap-error.factor" run-file ] recover
+] [
+ drop
+ load-help? off
+ "resource:basis/bootstrap/bootstrap-error.factor" run-file
+] recover
UNION: fixed-length-sequence array byte-array string ;
: sequence-constructor? ( word -- ? )
- { <array> <byte-array> <string> } memq? ;
+ { <array> <byte-array> (byte-array) <string> } memq? ;
: constructor-output-class ( word -- class )
{
{ <array> array }
{ <byte-array> byte-array }
+ { (byte-array) byte-array }
{ <string> string }
} at ;
USING: arrays help.markup help.syntax math
sequences.private vectors strings kernel math.order layouts
-quotations ;
+quotations generic.standard ;
IN: sequences
HELP: sequence
HELP: set-length
{ $values { "n" "a non-negative integer" } { "seq" "a resizable sequence" } }
-{ $contract "Resizes the sequence. Not all sequences are resizable." }
-{ $errors "Throws a " { $link bounds-error } " if the new length is negative." }
+{ $contract "Resizes a sequence. The initial contents of the new area is undefined." }
+{ $errors "Throws a " { $link no-method } " error if the sequence is not resizable, and a " { $link bounds-error } " if the new length is negative." }
{ $side-effects "seq" } ;
HELP: lengthen
primitive_wrapper,
primitive_clone,
primitive_string,
- primitive_uninitialized_string,
primitive_array_to_quotation,
primitive_quotation_xt,
primitive_tuple,
to_copy = capacity;
REGISTER_UNTAGGED(array);
- F_BYTE_ARRAY *new_array = allot_byte_array(capacity);
+ F_BYTE_ARRAY *new_array = allot_byte_array_internal(capacity);
UNREGISTER_UNTAGGED(array);
memcpy(new_array + 1,array + 1,to_copy);