fix: (push (assoc-value ... :test 'foo) ...) ignored :test when looking up the value
[alexandria.git] / arrays.lisp
blob146d7d30d6bfe191fe6e1505ee6ce40a7e3ab30f
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)
6 (fill-pointer 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.
14 (adjust-array
15 (make-array dims
16 :element-type element-type :fill-pointer fill-pointer
17 :adjustable adjustable :displaced-to array)
18 dims)))