[racket] Plea for neologism (was: Re: letoverlambda)

From: Joe Marshall (jmarshall at alum.mit.edu)
Date: Wed Nov 24 14:23:00 EST 2010

On Wed, Nov 24, 2010 at 11:05 AM, Robby Findler
<robby at eecs.northwestern.edu> wrote:
> On Wed, Nov 24, 2010 at 12:55 PM, Joe Marshall <jmarshall at alum.mit.edu> wrote:
>>> On Nov 20, 2010, at 6:58 PM, Matthias Felleisen wrote:
>>>
>>>> Hygiene is a technical term.  The idea is roughly that
>>>> the __macro system__ (as a whole) should respect the
>>>> lexical structure of your program.
>>
>> It is somewhat unfortunate that the name `hygiene' has caught
>> on here.  It really ought to be called `lexical scoping' (with the
>> understanding that macros have no special permission to violate
>> lexical scope any more than lambda bindings do).
>
> You know about Oleg's macro called, bind-x-to-5 that has one
> subexpression does exactly its name claims, but in a hygenic macro
> system?

Yes.  And I have to admit that I've used this trick myself to write
some questionable (but useful) macros.

> That example suggests to me that what is called hygiene should
> probably not be called lexical scope.

I'm not sure.  Certainly the r5rs hygienic macro system has the
ability to mimic non hygienic use.

But consider these statements:

  `Any sufficiently powerful macro system can appear to break
   lexical scope.'

  `Any macro system weak enough to preserve lexical scope is
   too weak to do X'  (where X is something one would normally
   expect to be able to do with a macro)

I have not seen a claim or proof of either of these or a denial
of either.  In other words, perhaps there is a macro system that
is both sufficiently powerful and general that we'd all agree it
qualifies as a macro system, yet is weak enough that we all agree
it cannot violate what we consider `lexical scope'.

Alternatively, perhaps one could argue that our understanding of
`lexical scope' is too narrow and primitive, and that Oleg's
bind-x-to-5 macro is simply a surprising, but consequential artifact
of the true meaning of `lexical scope'.

I rather prefer the former alternative.  The current macro system is
an amazing piece of insight and engineering, but it does have a few
dark corners:  Oleg's bind-x-to-5 is one, accidental export of internal
bindings is another.

-- 
~jrm


Posted on the users mailing list.