On Mar 27, 5:14 pm, "leppie" <[email protected]> wrote:
> > ;; a test
> > (define-syntax macro-using-foo
> > (let ()
> > (display (foo))
> > (syntax-rules () ((_) 'dummy))))
>
> > This prints "bar", as expected. Not tested more than you.
>
> That looked like a bug to me! I didnt know there was a 'place' (lexical
> scope) between define-syntax and the transformer function. I wonder what
> phase that is in? It seems it will happen BEFORE the transformer is created.
> I am not sure I will ever use that though :)
It is the compile time phase. In general the right hand side of define-
syntax is one
level up with respect to the left hand side. For instance
(define-syntax foo1
(let()
(define-syntax foo2
something)))
here 'something' is a phase 2 object (runtime is phase 0, compile time
is phase 1).
If 'something' invokes functions, you must import them with level
(meta 2) in Larceny
or PLT Scheme. I wonder how IronScheme works with respect to phase
separation.
Is it the same as Ikarus?
Michele Simionato