I will cross-post to the iterate mailing list. Stay tuned ...<br><br><div class="gmail_quote">On Sun, Feb 7, 2010 at 6:21 PM, Liam Healy <span dir="ltr"><<a href="mailto:lhealy@common-lisp.net">lhealy@common-lisp.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Mirko,<br>
<br>
This appears to be a bug in iterate, or maybe an iterate misuse in grid.<br>
I am told that the "#" means print level exceeded. The real error is that<br>
the iterate macroexpansion is inserting a function directly in the output.<br>
SBCL will accept that "live" but won't write a FASL that way. It isn't<br>
interpreted vs. compiled, because SBCL always compiles unless you<br>
go out of your way to get it to interpret. The error is:<br>
"Objects of type FUNCTION can't be dumped into fasl files."<br>
<br>
In CCL, I get the expansion<br>
<br>
(macroexpand '(iter:iter (iter:for e :matrix-row *array-3-4-double-float*)<br>
(princ e) (princ " ")))<br>
(LET* ((#:SEQUENCE8 NIL) (#:LIMIT9 NIL) (E NIL) (#:INDEX7 NIL))<br>
(BLOCK NIL<br>
(TAGBODY (SETQ #:SEQUENCE8 *ARRAY-3-4-DOUBLE-FLOAT*)<br>
(SETQ #:LIMIT9<br>
(FUNCALL #<Compiled-function (:INTERNAL<br>
<br>
ITERATE::CLAUSE-FOR-MATRIX-ROW-1) (Non-Global) #x30004154224F><br>
#:SEQUENCE8))<br>
(SETQ #:INDEX7 -1)<br>
LOOP-TOP-NIL (SETQ #:INDEX7 (+ #:INDEX7 1))<br>
(IF (>= #:INDEX7 #:LIMIT9) (GO LOOP-END-NIL))<br>
(SETQ E<br>
(FUNCALL #<Compiled-function (:INTERNAL<br>
<br>
ITERATE::CLAUSE-FOR-MATRIX-ROW-1) (Non-Global) #x30004154283F><br>
#:SEQUENCE8<br>
#:INDEX7))<br>
(PRINC E)<br>
(PRINC " ")<br>
(GO LOOP-TOP-NIL)<br>
LOOP-END-NIL)<br>
NIL))<br>
This pretty clearly shows that it is producing a function, not an<br>
S-expression as you see,<br>
but this is all in the iterate code.<br>
<br>
Did you cross-post to the iterate list? I don't belong to that list so maybe<br>
you can pass the information on to them and see if the have a suggestion.<br>
<font color="#888888"><br>
Liam<br>
</font><div><div></div><div class="h5"><br>
<br>
On Fri, Jan 29, 2010 at 3:38 PM, Mirko Vukovic <<a href="mailto:mirko.vukovic@gmail.com">mirko.vukovic@gmail.com</a>> wrote:<br>
> Apologies for cross posting, but I am not sure where this problem belongs<br>
> (iterage or gsll). I use slime (updated a few days ago) on sbcl 1.031 on<br>
> linux. I have problems compiling the following file:<br>
><br>
>>>><br>
> (in-package :grid)<br>
><br>
> (defun foo ()<br>
> (iter:iter (iter:for e :Matrix-row grid::*array-3-4-double-float*)<br>
> (princ e) (princ " ")))<br>
> <<<<br>
> (the code is from the iterate.lisp file of the distribution)<br>
><br>
> Now in slime, I have problems. Evaluation works:<br>
><br>
> I can do C-x C-e to compile `foo'<br>
> I can also do C-M-x<br>
><br>
> But compilation does not. Both C-c C-c and C-c C-k will flag a compiler<br>
> error:<br>
> note:<br>
> The first argument never returns a value.<br>
> --> LET* BLOCK TAGBODY PROGN SETQ THE FUNCALL SB-C::%FUNCALL THE<br>
> ==><br>
> (SB-KERNEL:%COERCE-CALLABLE-TO-FUN #<FUNCTION # {10030285A9}>)<br>
><br>
> Same story in raw sbcl.<br>
><br>
> I looked at the iterate.lisp source code and see nothing obvious. But, I am<br>
> not sure what to make of the following: If I macro-expand the above code<br>
> (iter:iter ... (iter:for ... :matrix-row ...(...))) I get the following<br>
> expansion. The puzzling thing is thta the first argument to `funcall' is a<br>
> single hash character `#':<br>
><br>
> (let* ((#:sequence208 nil) (#:limit209 nil) (e nil) (#:index207 nil))<br>
> (block nil<br>
> (tagbody<br>
> (progn<br>
> (setq #:sequence208 *array-3-4-double-float*)<br>
> (setq #:limit209 (funcall # #:sequence208)) ;; <-----<br>
> (setq #:index207 -1))<br>
> loop-top-nil<br>
> (progn<br>
> (setq #:index207 (+ #:index207 1))<br>
> (if (>= #:index207 #:limit209)<br>
> (go loop-end-nil))<br>
> (setq e (funcall # #:sequence208 #:index207)) ;; <-----<br>
> (princ e)<br>
> (princ " "))<br>
> (progn)<br>
> (go loop-top-nil)<br>
> loop-end-nil<br>
> (progn))<br>
> nil))<br>
><br>
> Instead of the single hash mark, I would have expected the :access-fn and<br>
> :size-fn `lambda's from the (defclause-sequence matrix-row matrix-row-index<br>
> ...) in iterate.lisp.<br>
><br>
> So, lots of puzzles. Not sure where this bug belongs: iterate or grid?<br>
><br>
> Thanks,<br>
><br>
> Mirko<br>
><br>
</div></div></blockquote></div><br>