1 (in-package :alexandria
)
3 (defun copy-array (array &key
4 (element-type (array-element-type array
))
5 (fill-pointer (and (array-has-fill-pointer-p array
)
7 (adjustable (adjustable-array-p array
)))
8 "Returns an undisplaced copy of ARRAY, with same fill-pointer
9 and adjustability (if any) as the original, unless overridden by
10 the keyword arguments."
11 (let ((dims (array-dimensions array
)))
12 ;; Dictionary entry for ADJUST-ARRAY requires adjusting a
13 ;; displaced array to a non-displaced one to make a copy.
16 :element-type element-type
:fill-pointer fill-pointer
17 :adjustable adjustable
:displaced-to array
)