<div class="gmail_quote">On Thu, Mar 19, 2009 at 11:18 AM, James Hague <span dir="ltr"><<a href="mailto:james.hague@gmail.com">james.hague@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
You can ALREADY simulate imperative updates using function calls (see<br>
<a href="http://prog21.dadgum.com/5.html" target="_blank">http://prog21.dadgum.com/5.html</a>). Adding some syntactic sugar to make<br>
this easiest is a good thing.</blockquote></div><br>You can also implement destructive assignments with a parse transform by adding version numbers to variables and incrementing the version number whenever they are used in match expressions, which is how Reia works. This approach is a bit trickier than it sounds as there are various scopes (e.g. lambdas, list comprehensions) where your transform needs to act differently than it would otherwise.<br>
<br>Again, I would not recommend using this to add destructive updates to Erlang. In my totally unbiased opinion, if someone really has a hankering for doing destructive assignments I suggest you point them at Reia.<br clear="all">
<br>-- <br>Tony Arcieri<br><a href="http://medioh.com">medioh.com</a><br>