<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Aug 21, 2010, at 3:32 AM, Eduardo Cavazos wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">(let ((a 20))</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">&nbsp; </span>(let ((a 30))</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">&nbsp; &nbsp; </span>...))</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">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.)</div></blockquote><br></div><div>Nested scope isn't allowed in Beginning Student Language (since there is no "let" or "local" at all -- all definitions are at the top level).</div><div><br></div><div>Wait: that's not quite true. &nbsp;In Beginning Student Language, you can define a function with parameters whose names shadow a global variable. &nbsp;This is just an instance of the more general phenomenon that parameter names in a function have no interaction with names anywhere outside that function, and students don't seem to have much trouble with it in practice.</div><div><br></div><div>Later on, when they get "local" and "let", they have enough programming maturity to handle the shadowing phenomenon you describe.</div><br><div> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div>Stephen Bloch</div><div><a href="mailto:sbloch@adelphi.edu">sbloch@adelphi.edu</a></div><div><br class="webkit-block-placeholder"></div></span><br class="Apple-interchange-newline"> </div><br></body></html>