[plt-scheme] require-for-syntax issues

From: Felix Klock's PLT scheme proxy (pltscheme at pnkfx.org)
Date: Wed Jul 9 23:09:44 EDT 2003


Okay, I can see where inconsistencies between the REPL and the module 
executions can come up.

But, can you explain to me what was wrong with the original code?

My thought process was something like: mod2:opaque-2 declares a 
particular syntax transformer.  The RHS for the DEFINE-SYNTAX command 
uses the transformer environment to lookup free identifiers.  So, if I 
want to abstract out a particular syntax transformer (which I thought 
was just another function, just of type Syntax -> Syntax), then I can 
just put its functional definition into a separate module (mod3, using 
a normal DEFINE command) and then use REQUIRE-FOR-SYNTAX to import that 
function definition into the transformer environment for mod2.

That's why the definitions for mod2:opaque-2 and mod2:opaque-3 look so 

My goal is to generate new syntax transformers through various 
compile-time combinators that produce functions of type Syntax -> 
Syntax.  But my methodology is obviously flawed.   What is wrong with 
my reasoning above?  What would you do to achieve an effect like this?


Posted on the users mailing list.