mirror of
git://git.code.sf.net/p/sbcl/sbcl
synced 2026-09-10 07:26:40 -04:00
Fix probable copy-paste error in list iterator, from end
The following code failed:
(sb-sequence:with-sequence-iterator-functions
(next stop value _set _index _copy)
('(a b c d) :from-end t)
(loop until (stop) collect (value) do (next)))
... with the following error:
The value
(D)
is not of type
NUMBER
when binding SB-KERNEL::X
[Condition of type TYPE-ERROR]
This commit is contained in:
parent
5b620aad83
commit
5760fe4fc1
|
|
@ -216,8 +216,7 @@
|
|||
(if (eq iterator list)
|
||||
*exhausted*
|
||||
(do* ((cdr list (cdr cdr)))
|
||||
((eq (cdr cdr) iterator) cdr)))
|
||||
(1+ iterator))
|
||||
((eq (cdr cdr) iterator) cdr))))
|
||||
(lambda (list iterator from-end)
|
||||
(declare (ignore list from-end))
|
||||
(cdr iterator)))
|
||||
|
|
|
|||
|
|
@ -85,3 +85,13 @@
|
|||
(with-test (:name (concatenate :result-type class))
|
||||
(assert (typep (concatenate (find-class 'extended-sequence) '(1 2) '(3 4))
|
||||
'extended-sequence)))
|
||||
|
||||
(with-test (:name :list-iterator-from-end)
|
||||
(checked-compile-and-assert
|
||||
()
|
||||
`(lambda (x)
|
||||
(sb-sequence:with-sequence-iterator-functions
|
||||
(next stop value _set _index _copy)
|
||||
(x :from-end t)
|
||||
(loop until (stop) collect (value) do (next))))
|
||||
(('(a b c d)) '(d c b a) :test #'equal)))
|
||||
|
|
|
|||
Loading…
Reference in a new issue