This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
using Kawa's extended lambda formals syntax in macros
- From: Chris Dean <ctdean at sokitomi dot com>
- To: "Hoehle, Joerg-Cyril" <Joerg-Cyril dot Hoehle at t-systems dot com>
- Cc: kawa at sources dot redhat dot com
- Date: Tue, 09 Dec 2003 10:51:07 -0800
- Subject: using Kawa's extended lambda formals syntax in macros
- References: <9F8582E37B2EE5498E76392AEDDCD3FE087DE42B@G8PQD.blf01.telekom.de>
Hoehle, Joerg-Cyril <Joerg-Cyril.Hoehle@t-systems.com> wrote:
> (defmacro foo (stmt #!rest bar)
> `(list ,stmt ,@bar))
and
> b) Or use ancient-style dot-notation instead of #!rest destructuring
> (that's been in some Lisps for decades, and it's also the normal
> way in Scheme).
Exactly.
(defmacro foo (stmt . bar) `(list ,stmt ,@bar))
I hope that "ancient-style" doesn't mean anything pejorative.
If you're in the Scheme language this is the behavior I expect. If you
are in CL the right thing is to support the complete Macro Lambda Lists,
but I wouldn't expect that to work as the Kawa CL implementation is very
incomplete.
Please note the difference in the documentation between
defmacro name lambda-list form ...
and
LAMBDA-EXPRESSION ::= (lambda FORMALS [RTYPE] BODY)
one is for defmacro, the other for Scheme lambda forms.
Regards,
Chris Dean