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.

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

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to