I've played with the recent PS with lexical scoping, and it's grown on me. My concerns about the readability of gensym'd suffixes are not turning out to be as bad as I worried, and I'm noticing several benefits to the idea. I'm hoping the recent batch of bugs we've reported can be fixed so we can upgrade to the latest.

In the meantime, I'm trying to understand the intent behind this bit of language redesign. Consider the following:

(ps (let ((a 123))
      (blah a))
    (alert a))

If this were really lexically scoped, the a in the alert form would be undefined. But ps generates:

"var a = 123;
blah(a);
alert(a);"

Does this reflect what is intended? If so, is there a clear explanation of just what "lexical scoping" is now offered by PS, i.e. what the rules are, what we should expect, and what we should not expect?

Daniel