On Thu, Nov 21, 2002 at 10:07:06PM +0300, Alexey Dejneka wrote:
> William Harold Newman <wnewman@...> writes:
> > +227: "compiler bewilderment with adjustable vectors and COPY-SEQ"
> > + In sbcl-0.7.9.54 on x86,
> > + (let ((v (make-array 0 :fill-pointer 0)))
> > + (vector-push-extend 1 v) (copy-seq v))
> > + fails with
> > + The value 336206758 is not of type VECTOR.
> Look at src/compiler/fndb.lisp:
> (defknown copy-seq (sequence) consed-sequence (flushable)
> :derive-type #'result-type-first-arg)
> The result is declared to be SIMPLE-ARRAY, but RESULT-TYPE-FIRST-ARG
> returns ``complex array''. The solution is to rewrite type deriver in
> this and related functions to ``simplify'' argument types. I'll take a
> look at it tomorrow, if it remain.
I believe the attached fixes the problem (and an analogous one with
The replacement :derive-type methods are in general not quite as smart
as they could be; it is possible that in some cases we could return
(SIMPLE-ARRAY ,type (*)), rather than (VECTOR ,type), from
SEQUENCE-RESULT-NTH-ARG. But before I start thinking about that, please
check the logic behind and test this patch.
PS: I have some more LOOP fixes in my tree; also, things that I think
probably ought to go in before release are Matthew Danish's PEEK-CHAR
patch (version 2) and the highly embarrassing "sbcl --core" Segmentation
fault bug... or have these been left too close to the wire?
http://www-jcsu.jesus.cam.ac.uk/~csr21/ +44 1223 510 299/+44 7729 383 757
(set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b)))
(defvar b "~&Just another Lisp hacker~%") (pprint #36rJesusCollegeCambridge)