Subject: Re: anamorphic macros
From: rpw3@rpw3.org (Rob Warnock)
Date: Wed, 11 May 2005 05:44:33 -0500
Newsgroups: comp.lang.lisp
Message-ID: <NqKdnVHVgvGMfxzfRVn-1g@speakeasy.net>
Peter Seibel  <peter@gigamonkeys.com> wrote:
+---------------
| tfb@conquest.OCF.Berkeley.EDU (Thomas F. Burdick) writes:
| > But yuck, what's with all the gensyms?!?!  The whole point of lifting
| > the body of the code is to insulate it from the LOOP's lexical
| > environment:
| >   (defmacro dolist-by-cddr ((var list &optional retform) &body body)
| >     `(let ((body (lambda (,var) ,@body))
| >            (retval (lambda (,var) ,@retform))
| >            (list ,list))
| >        (loop for elt in list by #'cddr
| >              do (body elt)
| >              finally (return (retval nil)))))
| 
| Uh, don't you need some FUNCALLs? This isn't c.l.s you know.
+---------------

Or put the first two in an FLET instead of LET.
Then (BODY foo) & (RETVAL foo) would work.


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607