<div dir="ltr">On Wed, Jul 10, 2013 at 9:47 AM, <span dir="ltr"><<a href="mailto:oleg@okmij.org" target="_blank">oleg@okmij.org</a>></span> wrote:<br>
<div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Jon Fairbairn wrote:<br>
> It just changes forgetting to use different variable names because of<br>
> recursion (which is currently uniform throughout the language) to<br>
> forgetting to use non recursive let instead of let.<br>
<br>
Let me bring to the record the message I just wrote on Haskell-cafe<br>
<a href="http://www.haskell.org/pipermail/haskell-cafe/2013-July/109116.html" target="_blank">http://www.haskell.org/pipermail/haskell-cafe/2013-July/109116.html</a><br>
<br>
and repeat the example:<br>
<br>
In OCaml, I can (and often do) write<br>
<br>
let (x,s) = foo 1 [] in<br>
let (y,s) = bar x s in<br>
let (z,s) = baz x y s in ...<br>
<br>
In Haskell I'll have to uniquely number the s's:<br>
<br>
let (x,s1) = foo 1 [] in<br>
let (y,s2) = bar x s1 in<br>
let (z,s3) = baz x y s2 in ...<br>
<br>
and re-number them if I insert a new statement.<br>
<br>
</blockquote></div><br><br></div><div class="gmail_extra">Usage of shadowing is generally bad practice. It is error-prone. Hides obnoxious bugs like file descriptors leaks.<br></div><div class="gmail_extra">The correct way is to give different variables that appear in different contexts a different name, although this is arguably less convenient and more verbose.<br>
</div></div>