1 (in-package :alexandria
)
3 (deftype array-index
(&optional
(length array-dimension-limit
))
4 "Type designator for an index into array of LENGTH: an integer between
5 0 (inclusive) and LENGTH (exclusive). LENGTH defaults to
6 ARRAY-DIMENSION-LIMIT."
7 `(integer 0 (,length
)))
9 (deftype array-length
(&optional
(length array-dimension-limit
))
10 "Type designator for a dimension of an array of LENGTH: an integer between
11 0 (inclusive) and LENGTH (inclusive). LENGTH defaults to
12 ARRAY-DIMENSION-LIMIT."
15 (defun copy-array (array &key
16 (element-type (array-element-type array
))
17 (fill-pointer (and (array-has-fill-pointer-p array
)
18 (fill-pointer array
)))
19 (adjustable (adjustable-array-p array
)))
20 "Returns an undisplaced copy of ARRAY, with same fill-pointer
21 and adjustability (if any) as the original, unless overridden by
22 the keyword arguments."
23 (let ((dims (array-dimensions array
)))
24 ;; Dictionary entry for ADJUST-ARRAY requires adjusting a
25 ;; displaced array to a non-displaced one to make a copy.
28 :element-type element-type
:fill-pointer fill-pointer
29 :adjustable adjustable
:displaced-to array
)