[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Explicit Renaming Macros Help/Tutorial?
From: |
John Cowan |
Subject: |
Re: [Chicken-users] Explicit Renaming Macros Help/Tutorial? |
Date: |
Sun, 7 Jun 2009 19:08:57 -0400 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Jack Trades scripsit:
> I managed something similar in Chicken 3 + syntax-case (with an extra level
> of parens around optional arguments) but cannot figure how to do the same in
> Chicken 4. I can't find any documentation (at least that I can understand)
> on explicit renaming macros. The Chicken 3 code I had is below, but it
> doesn't work in 4.
>
> (use syntax-case)
> (define-syntax def
> (syntax-rules (*args)
> ((def (name arg ... ((opt val) ...) *args) body ...)
> (define (name arg ... #!optional (opt val) ... #!rest args) body
> ...))))
If your macro is defined in syntax-rules, there should be no need to use
explicit renaming at all. The above code should just work in Chicken
4 after you remove the "(use syntax-case)". If not, there is a bug in
the Chicken 4 implementation of syntax-rules, which would not surprise
anybody too much.
--
My confusion is rapidly waxing John Cowan
For XML Schema's too taxing: address@hidden
I'd use DTDs http://www.ccil.org/~cowan
If they had local trees --
I think I best switch to RELAX NG.
[Chicken-users] Re: Explicit Renaming Macros Help/Tutorial?, felix, 2009/06/08