VECTOR-PUSH-EXTEND should only grow 'actually adjustable' vectors?
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hello,
I may be mistaken, but I think that I have found a bug in SBCL-2.3.4 x86_64 (Linux fedora 6.2.14-
*FEEATURES*: (:QUICKLISP :ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-UNIX
:NON-BASE-
:ANSI-CL :COMMON-LISP :ELF :IEEE-FLOATING-
:PACKAGE-
:SB-THREAD :SB-UNICODE :SBCL :UNIX)
This is what happens:
CL-USER> (defparameter *x* (make-array 2 :fill-pointer 0 :adjustable nil))
*X*
CL-USER> (vector-push-extend 1 *x*)
0
CL-USER> (vector-push-extend 1 *x*)
1
CL-USER> (vector-push-extend 1 *x*)
2
CLHS says, on 'Function VECTOR-PUSH, VECTOR-
"Exceptional Situations:
An error of type error is signaled by vector-push-extend if it
tries to extend vector and vector is not /actually adjustable/."
'actually adjustable' is defined as:
"actually adjustable /adj./ (of an array) such that adjust-array can
adjust its characteristics by direct modification. A conforming
program may depend on an array being actually adjustable only if
either that array is known to have been /expressly adjustable/ or
if that array has been explicitly tested by adjustable-
'expressly adjustable' is defined as:
"expressly adjustable /adj./ (of an array) being actually adjustable
by virtue of an explicit request for this characteristic having
been made at the time of its creation. All arrays that are
expressly adjustable are actually adjustable, but not necessarily
vice versa."
The way I read the above leads me to believe that since I did not ask
for *X* to be adjustable, my third call of VECTOR-PUSH-EXTEND should
have resulted in an error being signaled. Is my reading correct?
(adjustable-array-p (make-array 2 :fill-pointer 0 :adjustable nil)) => T