[Gsll-devel] iterate form evaluates but does not load into sbcl fasl
Mirko Vukovic
mirko.vukovic at gmail.com
Mon Feb 8 20:24:22 UTC 2010
Hello,
(I apologize for the wide email distribution. There is a small probability
the issue described here is due to a mismatch between iterate or sbcl).
The package gsd <http://repo.or.cz/w/gsd.git>, part of
gsll<http://common-lisp.net/project/gsll/>uses iterate to loop over
elements of vectors and matrices. I have attached
the part of the package that extends iterate to this email.
I am having the following issue on sbcl1.034 on RHEL5 64-bit linux, via
slime.
The following form evaluates OK at the REPL.
(iter:iter
(iter:for c :matrix-row grid::*array-3-4-double-float*
)
(print c))
But, if I embed it into a function:
(defun foo ()
(iter:iter
(iter:for c :matrix-row grid::*array-3-4-double-float*)
(print c)))
it will evaluate OK in slime (C-x C-e), but will not compile (C-c C-c). The
returned error is:
>>>
post-processing/xpdp-post-processing.lisp:75:3:
error:
Objects of type FUNCTION can't be dumped into fasl files.
--> LET* BLOCK TAGBODY PROGN SETQ THE FUNCALL SB-C::%FUNCALL THE
--> SB-KERNEL:%COERCE-CALLABLE-TO-FUN
==>
#<FUNCTION (LAMBDA #) {1002DD7AD9}>
note:
The first argument never returns a value.
--> LET* BLOCK TAGBODY PROGN SETQ THE FUNCALL SB-C::%FUNCALL THE
==>
(SB-KERNEL:%COERCE-CALLABLE-TO-FUN #<FUNCTION # {1002DD7AD9}>)
... more stuff
>>>
So, it seems that sbcl can digest it, but for some reason cannot write it to
a fasl.
The macroexpansion of the code above is:
(LET* ((#:SEQUENCE120 NIL) (#:LIMIT121 NIL) (C NIL) (#:INDEX119 NIL))
(BLOCK NIL
(TAGBODY
(PROGN
(SETQ #:SEQUENCE120 GRID::*ARRAY-3-4-DOUBLE-FLOAT*)
(SETQ #:LIMIT121 (FUNCALL # #:SEQUENCE120))
(SETQ #:INDEX119 -1))
LOOP-TOP-NIL
(PROGN
(SETQ #:INDEX119 (+ #:INDEX119 1))
(IF (>= #:INDEX119 #:LIMIT121)
(GO LOOP-END-NIL))
(SETQ C (FUNCALL # #:SEQUENCE120 #:INDEX119))
(PRINT C))
(PROGN)
(GO LOOP-TOP-NIL)
LOOP-END-NIL
(PROGN))
NIL))
Is this issue due to a malformed extension of iterate, or some misalignment
between iterate and sbcl?
Thank you,
Mirko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/gsll-devel/attachments/20100208/87eddcd3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iterate.lisp
Type: application/octet-stream
Size: 4392 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/gsll-devel/attachments/20100208/87eddcd3/attachment.obj>
More information about the gsll-devel
mailing list