This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]