robust unhygienic macros Chris Hanson (21 Aug 2022 22:29 UTC)
Re: robust unhygienic macros Ray Dillinger (22 Aug 2022 00:59 UTC)
Re: robust unhygienic macros Marc Nieper-Wißkirchen (22 Aug 2022 06:17 UTC)
Re: robust unhygienic macros Ray Dillinger (23 Aug 2022 02:05 UTC)
Re: robust unhygienic macros Chris Hanson (27 Aug 2022 21:49 UTC)
Re: robust unhygienic macros Marc Nieper-Wißkirchen (28 Aug 2022 15:20 UTC)
Re: robust unhygienic macros Arthur A. Gleckler (28 Aug 2022 20:51 UTC)
Re: robust unhygienic macros Chris Hanson (29 Aug 2022 08:25 UTC)
Re: robust unhygienic macros Marc Nieper-Wißkirchen (29 Aug 2022 15:42 UTC)
Re: robust unhygienic macros Chris Hanson (29 Aug 2022 20:43 UTC)
Re: robust unhygienic macros Marc Nieper-Wißkirchen (07 Nov 2022 13:44 UTC)

Re: robust unhygienic macros Ray Dillinger 22 Aug 2022 00:59 UTC

On 8/21/22 15:29, Chris Hanson wrote:
> I’m not familiar with the term "robust unhygienic macros” and an internet
> search didn’t reveal any definitions.

There are a couple of ways to achieve Scheme's normal macro semantics. 
The one we usually think of is renaming; all variables are renamed to
avoid scope conflicts.  The other formulation, which achieves
approximately the same thing, is to convert arguments to
'name+environment reference' promises and ensure that all evaluations of
named arguments are handled as evaluations of the name (from the
promise) in its own environment (to which the promise refers).  The
macro therefore has no access to anything in the lexical environment at
the call site except what was explicitly passed to it. All other
expressions are evaluated in the lexical environment visible at the
macro definition site.

"Robust unhygienic macros" IIRC is an extension to the second
formulation that adds a rule allowing *assignments* to those promises,
before, after, or instead of evaluating them.  The extension uses the
promises to make assignments to the original variables in their own
lexical scopes.

If I recall correctly, this was developed by John Shutt as part of the
work that led up to his formulation of the vau-calculus (and his
vau-calculus lisp, which he named Kernel.)

         Bear