Hi,
Marco Antoniotti wrote: (defclause-driver (FOR var OVER enum) `(progn (with ,e = ,enum) (,kwd ,var next ... defclause-driver is NOT the form you need when you want to supply code which must be macro-expanded in turn.
I feel there is a but either in the manual or in the code. Which is which?
Which part of the manual (or examples) lead you to believe you need defclause-driver? Do you have suggestions for improving the manual?
Regards, Jorg Hohle.
On Mar 17, 2008, at 14:11 , Hoehle, Joerg-Cyril wrote:
Hi,
Marco Antoniotti wrote: (defclause-driver (FOR var OVER enum) `(progn (with ,e = ,enum) (,kwd ,var next ... defclause-driver is NOT the form you need when you want to supply code which must be macro-expanded in turn.
I feel there is a but either in the manual or in the code. Which is which?
Which part of the manual (or examples) lead you to believe you need defclause-driver? Do you have suggestions for improving the manual?
The web pages.
I was just fishing. So, how do I do it?
Cheers
Marco
-- Marco Antoniotti
Well.... any suggestions?
Please note that the manual pages in HTML are not that useful.
Cheers
Marco
On Mar 17, 2008, at 15:52 , Marco Antoniotti wrote:
On Mar 17, 2008, at 14:11 , Hoehle, Joerg-Cyril wrote:
Hi,
Marco Antoniotti wrote: (defclause-driver (FOR var OVER enum) `(progn (with ,e = ,enum) (,kwd ,var next ... defclause-driver is NOT the form you need when you want to supply code which must be macro-expanded in turn.
I feel there is a but either in the manual or in the code. Which is which?
Which part of the manual (or examples) lead you to believe you need defclause-driver? Do you have suggestions for improving the manual?
The web pages.
I was just fishing. So, how do I do it?
Cheers
Marco
-- Marco Antoniotti
iterate-devel site list iterate-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/iterate-devel
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 Viale Sarca 336 I-20126 Milan (MI) ITALY
Please note that I am not checking my Spam-box anymore.
Marco Antoniotti antoniotti.marco@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-Driv...
works for me
Cheers, Chris Dean
Ok.
Yours works. Why? I fail to see the difference with mine.
Cheers
Marco
On Mar 21, 2008, at 19:46 , Chris Dean wrote:
Marco Antoniotti antoniotti.marco@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
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 Viale Sarca 336 I-20126 Milan (MI) ITALY
Please note that I am not checking my Spam-box anymore.
Sorry. My bad. Now I notice the DEFMACRO-DRIVER.
Cheers
Marco
On Mar 21, 2008, at 19:46 , Chris Dean wrote:
Marco Antoniotti antoniotti.marco@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
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 Viale Sarca 336 I-20126 Milan (MI) ITALY
Please note that I am not checking my Spam-box anymore.