<div dir="ltr">2008/7/27 YC <span dir="ltr"><<a href="mailto:yinso.chen@gmail.com">yinso.chen@gmail.com</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr"><br>
<div class="gmail_quote"><div class="Ih2E3d"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">It's just as bad when there's code like this:<br>
<br>
T2 = something(T),<br>
T3 = something(T2),<br>
T4 = something(T3),<br>
T5 = something(T4),<br>
T6 = something(T5)<br>
<br>
You may laugh at that code, but it's hardly uncommon, even in code<br>
written by experienced programmers. It's very easy to accidentally<br>
use T4 in a spot when you meant T3, or to have to renumber things and<br>
make a mistake.<br>
<br>
Please note that I am not arguing for changes in Erlang. I truly am<br>
not. But I can understand why this request comes up regularly.<br>
<div><div></div><div><br></div></div></blockquote></div><div><br>There is a way to satisfy this request without breaking single assignment, and that is to have a more sophisticated scoping. <br><br>For example, the above in lisp/scheme are:<br>
<br>(let ((t (something t)))<br> (let ((t (something t)))<br> (let ((t (something t)))<br>...)))<br><br>No mutabilities involved - just better scopes - can't be that bad for Erlang, right? ;)</div></div></div></blockquote>
<div><br>Shameless plug:<br><br>Well you can do this today if you use LFE. Plus ti gives you a lot of other lisp goddies as well.<br><br>Robert<br><br></div></div></div>