[iterate-devel] Proposal for manual modification re defclause-sequence

Mirko Vukovic mirko.vukovic at gmail.com
Fri Feb 12 22:02:41 UTC 2010


Hello,

I recently had an issue of saving iterate extension code in sbcl fasl
files.  Several folks have commented that the documentation on
defclause-sequency could be more explicit on that topic.  Thus this email.

You can find the whole email thread here:
http://common-lisp.net/pipermail/iterate-devel/2010-February/000654.html
(the first email in that thread has an attachment with the original problem
file).

Basically the problem was the following defclause-sequence definition:

(defclause-sequence matrix-row matrix-row-index
  :access-fn
  (lambda (grid index)
    (assert (and (grid:gridp grid) (eql (grid:grid-rank grid) 2))
        (grid))
    (grid:row grid index))
  :size-fn
  (lambda (grid)
    (assert (and (grid:gridp grid) (eql (grid:grid-rank grid) 2))
        (grid))
... etc.

In an interpreted list, such as clisp, there were no problems with this
form.  But in a compiled list, such as sbcl, the form could be evaluated,
but could not be saved in a fasl. Thus compile file and asdf loading did not
work.

The solution was to quote the lambda forms:
(defclause-sequence matrix-row matrix-row-index
  :access-fn
  '(lambda (grid index)
    (assert (and (grid:gridp grid) (eql (grid:grid-rank grid) 2))
        (grid))
    (grid:row grid index))
  :size-fn
  '(lambda (grid)
    (assert (and (grid:gridp grid) (eql (grid:grid-rank grid) 2))
        (grid))
... etc.

Important to note, sharp-quoting -- #' -- such as in the example code in the
manual, did not work.

My (very incomplete understanding) is that storing lists (such as '(lambda
...) in fasl's is OK, and iter can figure out what to do with them once read
back in.  But not storing compiled objects (which a #'(lambda ...) cannot be
stored in fasl's.

I propose that the documentation be changed, with perhaps a few additional
examples.  I would be glad to work with one of the developers/maintainers
off-line on this issue.

Regards,

Mirko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/iterate-devel/attachments/20100212/8d8f6db8/attachment.html>


More information about the iterate-devel mailing list