This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
macro defining macros
- From: Robert Nikander <rob at encodia dot biz>
- To: Kawa List <kawa at sources dot redhat dot com>
- Date: Thu, 23 Jun 2005 19:10:03 -0700
- Subject: macro defining macros
Is there a way to escape the ellipsis so that you can write a macro
that defines a macro? The "standard" is (... ...), but that doesn't
appear to work. Here is a demo of the problem...
;; macro that creates another macro that quotes its arguments
(define-syntax mac
(lambda (x)
(syntax-case x ()
((_ name)
(syntax
(define-syntax name
(lambda (x)
(syntax-case x ()
((_ e (... ...))
(syntax (quote (e (... ...)))))))))))))
(mac mac2)
(mac2 (1 2 (3))) ----> '(1 2 (3))
error: ssp.scm:116:8: ... follows template with no suitably-nested
pattern variable
error: ssp.scm:116:8: ... follows template with no suitably-nested
pattern variable
ssp.scm:116:8: ... follows template with no suitably-nested pattern
variable
ssp.scm:116:8: ... follows template with no suitably-nested pattern
variable
thanks,
Rob