(rontolisp) docs
← Functions

adjust-array

(adjust-array array new-dimensions &key initial-element fill-pointer)

Resizes array to new-dimensions (an integer for a vector, or a list of the same rank as array), preserving the elements at the subscripts valid in both shapes -- resizing a matrix keeps (i, j) at (i, j), not at the same flat position. New cells are set to :initial-element (default nil). An array created :adjustable is adjusted in place and returned itself (eq to the argument), so every reference sees the new shape; otherwise a fresh array is returned and the original is left untouched -- use the return value either way. Without an explicit :fill-pointer the array's own fill pointer carries over (an error if it no longer fits); t sets it to the new size, an integer to that position. Adjusting a displaced view or passing :displaced-to is not supported and signals an error.