This is in 0.8.2 and I _think_ it's a bug. At least it works in CMUCL,
LW, AllegroCL, and CLISP.
I'll probably build 0.8.3 tomorrow, so if it's fixed there please
ignore my mail.
Cheers,
Edi.
edi@... > sbcl
This is SBCL 0.8.2, an implementation of ANSI Common Lisp.
SBCL is derived from the CMU CL system created at Carnegie Mellon University.
Besides software and documentation originally created at Carnegie Mellon
University, SBCL contains some software originally from the Massachusetts
Institute of Technology, Symbolics Incorporated, and Xerox Corporation, and
material contributed by volunteers since the release of CMU CL into the
public domain. See the CREDITS file in the distribution for more information.
SBCL is a free software system, provided as is, with absolutely no warranty.
It is mostly in the public domain, but also includes some software copyrighted
Massachusetts Institute of Technology, 1986;
Symbolics, Inc., 1989, 1990, 1991, 1992; and
Xerox Corporation, 1985, 1986, 1987, 1988, 1989, 1990
used under BSD-style licenses allowing copying only under certain conditions.
See the COPYING file in the distribution for more information.
More information about SBCL is available at <http://sbcl.sourceforge.net/>.
* (defun foo ()
(loop for i below 10
for x downfrom 255 by -20
collect x))
; in: LAMBDA NIL
; (LOOP FOR I BELOW 10 FOR X DOWNFROM 255 BY ...)
;
; caught WARNING:
; (in macroexpansion of (LOOP FOR I ...))
; (hint: For more precise location, try *BREAK-ON-SIGNALS*.)
; The form -20 evaluated to -20, which was not of the anticipated type
; (AND NUMBER (REAL #)).
; current LOOP context: FOR X DOWNFROM 255 BY -20 COLLECT.
; --> BLOCK LET LET SB-LOOP::WITH-LOOP-LIST-COLLECTION-HEAD LET*
; --> SB-LOOP::LOOP-BODY TAGBODY SB-LOOP::LOOP-REALLY-DESETQ SETQ THE -
; ==>
; X
;
; note: deleting unreachable code
; --> BLOCK LET
; ==>
; (LET ((X 255) (#:LOOP-STEP-BY-2 -20))
; (DECLARE (TYPE (OR # #) #:LOOP-STEP-BY-2) (TYPE NUMBER X))
; (SB-LOOP::WITH-LOOP-LIST-COLLECTION-HEAD
; (#:LOOP-LIST-HEAD-3 #:LOOP-LIST-TAIL-4)
; (SB-LOOP::LOOP-BODY NIL
; (NIL NIL NIL NIL NIL NIL NIL NIL)
; (#)
; (NIL # # NIL NIL # NIL NIL)
; (#))))
;
; caught WARNING:
; Asserted type (OR (DOUBLE-FLOAT (0.0d0)) (SINGLE-FLOAT (0.0)) (RATIONAL 0))
; conflicts with derived type (VALUES (INTEGER -20 -20) &OPTIONAL).
; compilation unit finished
; caught 2 WARNING conditions
; printed 1 note
FOO
* (foo)
debugger invoked on condition of type TYPE-ERROR:
The value -20
is not of type
(OR (DOUBLE-FLOAT (0.0d0)) (SINGLE-FLOAT (0.0)) (RATIONAL 0)).
Within the debugger, you can type HELP for help. At any command prompt (within
the debugger or not) you can type (SB-EXT:QUIT) to terminate the SBCL
executable. The condition which caused the debugger to be entered is bound to
*DEBUG-CONDITION*. You can suppress this message by clearing
*DEBUG-BEGINNER-HELP-P*.
restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT ] Reduce debugger level (leaving debugger, returning to toplevel).
1: [TOPLEVEL] Restart at toplevel READ/EVAL/PRINT loop.
(SB-C::%COMPILE-TIME-TYPE-ERROR
3
(-20)
(OR (DOUBLE-FLOAT (0.0d0)) (SINGLE-FLOAT (0.0)) (RATIONAL 0))
#<unavailable argument>)[:EXTERNAL]
|