Re: sbcl bug in ppsition and/or find with :start, :end and :key
- From: Leandro Rios <leandroprogramador@xxxxxxxxx>
- Date: Tue, 23 Sep 2008 13:56:48 -0300
budden escribió:
Good time of day!
I failed to post this to sbcl-help mail list, so posting here
(find :a '((:c) 1) :start 0 :end 1 :key #'car)=>error (attempted to call (car 1))
My sbcl gives a more meaningul error message:
>The value 1 is not of type LIST.
> [Condition of type TYPE-ERROR]
It doesn't seem to be a bug in SBCL.
And even(defun foo () (declare (notinline find)) (find :a '((:c) 1) :start 0 :end 1 :key 'car))=>error (attempted to call (car 1))
(foo)
Why does sbcl access second element of list?
Because it can't find :a in the first. It keeps searching till :end is reached. You are using #'car to extract the value to be compared (the key) against :a from each element of the sequence. Try
(find :a '((:c) 1) :start 0 :end 1)
or
(find :a '((:c) (1)) :start 0 :end 1 :key #'car)
and you'll see.
hth,
Leandro
(lisp-implementation-type)"SBCL"(lisp-implementation-version)"1.0.20"
debian etch i686
.
- Follow-Ups:
- Re: sbcl bug in ppsition and/or find with :start, :end and :key
- From: Rainer Joswig
- Re: sbcl bug in ppsition and/or find with :start, :end and :key
- References:
- Prev by Date: Re: [Q] package-specific dispatch macro character
- Next by Date: Re: Closure web browser (was Re: where is the lisp operating system?)
- Previous by thread: sbcl bug in ppsition and/or find with :start, :end and :key
- Next by thread: Re: sbcl bug in ppsition and/or find with :start, :end and :key
- Index(es):
Relevant Pages
|