From: Lars B. <la...@no...> - 2006-08-17 21:13:08
|
Lars Brinkhoff <la...@no...> writes: > The CLHS page for ADJUST-ARRAY says: > > An error of type error is signaled if fill-pointer is supplied and > non-nil but array has no fill pointer. > > However: > > * (lisp-implementation-version) > "0.9.15" > * "foo" > "foo" > * (array-has-fill-pointer-p *) > NIL > * (adjust-array ** 3 :fill-pointer t) > "foo" > * (array-has-fill-pointer-p *) > NIL Here's a naive fix. run-tests.sh reports no difference in failures before or after the patch. diff -ru cvs-20060816.orig/src/code/array.lisp cvs-20060816/src/code/array.lisp --- cvs-20060816.orig/src/code/array.lisp 2005-11-21 15:00:30.000000000 +0100 +++ cvs-20060816/src/code/array.lisp 2006-08-17 20:21:20.000000000 +0200 @@ -758,6 +758,10 @@ displaced-to displaced-index-offset) #!+sb-doc "Adjust ARRAY's dimensions to the given DIMENSIONS and stuff." + (when (and (not (array-has-fill-pointer-p array)) + fill-pointer) + (error "Can't adjust the fill pointer, because array ~S doesn't have one." + array)) (let ((dimensions (if (listp dimensions) dimensions (list dimensions)))) (cond ((/= (the fixnum (length (the list dimensions))) (the fixnum (array-rank array))) |