[r6rs-discuss] Is Scheme lexically scoped? [was Re: Proposed features for small Scheme, part 1: a stake in the ground]

David Van Horn dvanhorn at ccs.neu.edu
Sat Sep 5 10:52:16 EDT 2009


John Cowan wrote:
> Brian Harvey scripsit:
> 
>> I know everyone disagrees with me about that, but isn't it how we Lispians all
>> feel about requiring variable type declarations?  Macro hygiene -- just listen
>> to the sound of the name, for heaven's sake! -- was and is supported by
>> arguments not so very different from the arguments for type declarations.
> 
> [snip]
> 
>> P.S.  Yes, I do understand that hygienic macros can be viewed as a virtually
>> inevitable extension of Scheme's jewel-like lexical scope.  That's the only
>> benefit of being old; I can now see more than one point of view about things.
> 
> Indeed.  How much better it would have been if hygienic macros had been
> called "lexically scoped macro parameters" to begin with.  How simple
> the argument: "Our procedure parameters are lexically scoped, but our
> macro parameters are still dynamically scoped, even though they don't
> superficially appear to be.  Let's fix that."  Everyone would have nodded
> their heads and gone back to working on their all-day suckers.

I keep hearing this stuff about Scheme being a lexically scoped 
language.  I don't buy it (or at least, I think it's more subtle than 
one might believe).

What is the definition of lexical scope being employed here?

David




More information about the r6rs-discuss mailing list