[racket] Nested scope in D vs Racket

From: Eduardo Cavazos (wayo.cavazos at gmail.com)
Date: Sat Aug 21 03:32:34 EDT 2010

Hello,

The first example in this note is illegal in the D programming language:

http://lists.puremagic.com/pipermail/digitalmars-d/2010-August/081424.html

Coming from a Scheme background, I was surprised as this is allowed in 
Scheme. I.e. this is the quivalent code in Scheme:

(let ((a 20))
   (let ((a 30))
     ...))

Andrei Alexandrescu pointed out the rationale for this design decision here:

http://lists.puremagic.com/pipermail/digitalmars-d/2010-August/081430.html

It sounds like the D designers are "protecting" the programmers. The 
Racket team is of course concerned with the "teachability" of their 
languages and have experience with the known pitfalls in languages. So 
my question is, do any Racket people agree with the rationale provided 
by the D guys? In all your years of teaching Scheme/Racket, has this 
situation of shadowing names been a problem? (I've always seen it as a 
feature, even C supports it.)

Ed


Posted on the users mailing list.