On Sat, Jul 13, 2019 at 02:12:48PM +0200, Marco Maggi wrote:
> Peter Bex wrote:
> 
> > This won't work.  "rename" is operating in the syntactic environment
> > of the transformer.  You can pass it as a procedure to some other module,
> > but that won't change its internal state.
> 
> So, is RENAME closed upon  the environment in which ER-MACRO-TRANSFORMER
> is called?  So I can do something like:

Yes, that's how it should work.

>   I'm  not  trying   to  inject  syntactic  bindings   in  the  original
> environment, I just want to put as much as possible of a macro body into
> a separate library to be imported "for syntax".

Personally, I find that confusing, because the module containing the
macro definition determines the available identifiers.  If you then move
the actual expansion code to another module, that doesn't give a clue as
to which identifiers are available in the expansion.

So for stylistic reasons I'd avoid that.  You can still move processing
code to another module, but I would pass the renamed identifiers to the
helper procedure, instead of the "rename" procedure itself.

Cheers,
Peter

Attachment: signature.asc
Description: PGP signature

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

Reply via email to