resize-array ( n array -- new-array )
Factor handbook » The language » Collections » Arrays

Prev:4array ( w x y z -- array )
Next:pair


Vocabulary
arrays

Inputs
na non-negative integer
arrayan array


Outputs
new-arrayan array


Word description
Resizes the array to have a length of n elements. When making the array shorter, this word may either create a new array or modify the existing array in place. When making the array longer, this word always allocates a new array, filling remaining space with f.

Side effects
Modifies array

Definition

PRIMITIVE: resize-array ( n array -- new-array )