[racket-dev] syntax-property guards? (was: Re: The Stepper strikes again)

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Tue Aug 16 19:39:28 EDT 2011

On Aug 16, 2011, at 5:42 PM, Sam Tobin-Hochstadt wrote:

> On Tue, Aug 16, 2011 at 5:31 PM, Matthias Felleisen
> <matthias at ccs.neu.edu> wrote:
>> Eli is right in principle. I sense that we are facing the same kind of problems we faced when we created mixins and then again when we created continuation marks.  We need annotations time and again and they couple parts of our system more closely than necessary. Problem is, we don't seem to see or have an abstraction that eliminates this coupling.
> Aren't syntax properties precisely this abstraction?

It is a mechanism and as such it is an abstraction. But is it the best possible abstraction? 

The use of symbols means the use of a protocol: "when I see 'x, I will perform action A."  So the identity of the symbol is critical. And that means we're tying together the two (+) components that are subject to the protocol. If the symbol changes in one of them, the other one breaks (the type checker, the stepper). 

That's Dan's rule: don't use symbols to impose protocols. (Today's add1 day for Dan.) 

What you really want is a name (variable). So at a minimum, two components should rely on a shared module that exports a variable to be used instead of a symbol. Then you could use (gensym) and nobody could mess with the symbol. Identity would be enforced afresh every time you start the system. 

But once you introduce a random name, you see that you want some other mechanism that 'mixes' into the compilation process as needed. 

-- Matthias

Posted on the dev mailing list.