[iterate-devel] Problem with DEFCLAUSE-DRIVER

Chris Dean ctdean at sokitomi.com
Fri Mar 21 17:46:33 UTC 2008


Marco Antoniotti <antoniotti.marco at disco.unimib.it> writes:
> Well....  any suggestions?

Here's some untested code, let me know if there are any problems with
it:

    (defmacro-driver (FOR var IN-ENUM e)
      "All elements in the enum"
      (let ((enum (gensym "ENUM-"))
            (kwd (if generate 'generate 'for)))
        `(progn
           (with ,enum = ,e)
           (,kwd ,var next (if (enum:has-more-elements-p ,enum)
                               (enum:next ,enum)
                               (terminate))))))

    (iter (for x :in-enum (enum:range 3 8))
          (collect (1+ x)))

> Please note that the manual pages in HTML are not that useful.

http://common-lisp.net/project/iterate/doc/Writing-Drivers.html#Writing-Drivers

works for me

Cheers,
Chris Dean



More information about the iterate-devel mailing list