[r6rs-discuss] expansion process and syntax-case?
Per Bothner
per at bothner.com
Thu Jan 15 21:43:31 EST 2009
Eli Barzilay wrote:
> On Jan 15, Per Bothner wrote:
>> Is this (rough sketch) supposed to work:
>>
>> (define (process form)
>> ... do something with form ...)
>>
>> (define-syntax foo
>> (lambda (form)
>> (syntax-case form ()
>> ((_ . f) (process form)))))
>>
>> (foo ...)
>>
>> I.e. can a syntax-case macros make use of a function
>> define in the same module or top-level?
>
> Yes, but syntax processing still happens at a different phase, so you
> need to lift the `process' definition.
Chapter 10 does not contain the word "phase". Where is this
concept described in the R6RS documents?
> The easiest way to do this is
> by changing the `define' above to `define-for-syntax'.
- which does not appear to be part of R6RS - at least I can't find it
in the index of either the Core Language Report or the
"Standard Libraries" Report.
Oh well, this is the sort of thing the new committee will
need to fix.
--
--Per Bothner
per at bothner.com http://per.bothner.com/
More information about the r6rs-discuss
mailing list