[Gsll-devel] [iterate-devel] Fwd: iterate form evaluates but does not loadinto sbcl fasl

Mirko Vukovic mirko.vukovic at gmail.com
Tue Feb 9 18:11:29 UTC 2010


See below for the fix.  Thank's to everyone's help and suggestions.  I still
have only a dim understanding of what is going on.  But I am only in year
three of the 10-year lisp journey :-)

On Tue, Feb 9, 2010 at 9:54 AM, Mirko Vukovic <mirko.vukovic at gmail.com>wrote:

>
>
> On Tue, Feb 9, 2010 at 9:30 AM, <Joerg-Cyril.Hoehle at t-systems.com> wrote:
>
>> Mirko,
>>
>> >Are you implying that instead of lambda forms one should define the
>> >functions and use function names.
>> No. Just look at the examples in the source code, incl. tests.
>> The key is to write #'(lambda ...) aka. (function (lambda ...)), not
>> (lambda ...)
>>
>
> Like this?
>
>
> (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))
>     (first (grid:grid-dimensions grid)))
>
>   :element-type t :sequence-type t
>   :element-doc-string "(copied) rows of a matrix"
>   :index-doc-string "index of the rows in a matrix")
>
> Unfortunately, that did not help improve things.
>
> Also, the iterate documentation has an example of `defclause-sequence'
> (bottom of p.26 of the pdf file).  There is no #'(lambda ...), just plain
> (lambda ...)
>
> Thank you for your time,
>


The fix was to put a single quote in front of the (lambda ...) expressions
like this:

(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))
      (first (grid:grid-dimensions grid)))
  :element-type t :sequence-type t
  :element-doc-string "(copied) rows of a matrix"
  :index-doc-string "index of the rows in a matrix")

Not #'(lambda ...).  The same goes for named functions.  Thus 'foo and not
#'foo.

Mirko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/gsll-devel/attachments/20100209/be228a5d/attachment.html>


More information about the gsll-devel mailing list