duh. use the right feature check for package-locks on SBCL
[alexandria.git] / arrays.lisp
blob670880fe996c1a9d770040823a0a26c9e3ee9199
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 and
9 adjustability (if any) as the original, unless overridden by the keyword
10 arguments. Performance depends on efficiency of general ADJUST-ARRAY in the
11 host lisp -- for most cases a special purpose copying function is likely to
12 perform better."
13 (let ((dims (array-dimensions array)))
14 ;; Dictionary entry for ADJUST-ARRAY requires adjusting a
15 ;; displaced array to a non-displaced one to make a copy.
16 (adjust-array
17 (make-array dims
18 :element-type element-type :fill-pointer fill-pointer
19 :adjustable adjustable :displaced-to array)
20 dims)))