[racket] Nested scope in D vs Racket

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


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


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:


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.)


Posted on the users mailing list.