I have some code which currently uses syntax-case, and because it has
nested macro definitions, it needs the (... ...) hack.  

When we migrate to Chicken 4.0, we'll need to convert that to the
superior srfi 46 choose-your-own-ellipsis method.  What I'd like to do,
to facilitate migrate, is write a version of syntax-rules, for
syntax-case, that accepts the CYOE parameter.

At present, the syntax-case egg defines syntax-rules thus:

(define-syntax syntax-rules
  (lambda (x)
    (syntax-case x ()
      ((_ (k ...) ((keyword . pattern) template) ...)
       (syntax (lambda (x)
                (syntax-case x (k ...)
                  ((dummy . pattern) (syntax template))
                  ...)))))

I would like to add a clause something like:
 ((_ ellipsis (k ...) ((keyword . pattern) template) ...)
       (syntax
        (lambda (x)
          (with-syntax ((ellipsis (syntax (... ...))))
            (syntax-case x (k ...)
              ((dummy . pattern) (syntax template))
              ...)))))))

to match the CYOE pattern.  But try as I might, it doesn't work.  good
grief, I do dislike syntax-case.  But in any case, does anyone have any
idea what I should be doing?

Thomas





_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to