chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] About define-syntax and expansion environment


From: Xin Wang
Subject: Re: [Chicken-users] About define-syntax and expansion environment
Date: Fri, 14 Jun 2013 23:38:49 +0800




2013/6/14 Peter Bex <address@hidden>
On Fri, Jun 14, 2013 at 10:30:28PM +0800, Xin Wang wrote:
> Hi,
>
> I encountered a problem that previously defined macro can not be used
> inside other macro defination.
>
> It seems that newly defined syntax does not available in macro expansion
> environment, is it intended?

That's correct; this problem is known as "phasing"; macros are defined in
their own compilation phase.  Each phase can only see macros defined in
earlier phases.

To define a macro for the macro environment, you can wrap it in a
begin-for-syntax block, or put it inside its own module and then
use import-for-syntax to import it in the module that uses it.


Thanks, it works.
 
Cheers,
Peter
--
http://www.more-magic.net


reply via email to

[Prev in Thread] Current Thread [Next in Thread]