<div dir="ltr">Well, I know that Python uses references, so that wouldn't be possible in normal Python code without using stack inspection.<div><br></div><div>In RPython, which restricts all of that, it'd have to be another translator feature that uses magic to get things done.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 21, 2014 at 6:39 PM, Timothy Baldridge <span dir="ltr"><<a href="mailto:tbaldridge@gmail.com" target="_blank">tbaldridge@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">It'd be nice to be able to do something like this in rpython:<br><br>compare_and_swap(foo.bar, oldval, newval) <div>
<br>Or basically the cmpxchg. How hard would it be to get this in?<span class="HOEnZb"><font color="#888888"><br><br>Timothy<br clear="all">
<div><br></div>-- <br>“One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.”<br>(Robert Firth)
</font></span></div></div>
<br>_______________________________________________<br>
pypy-dev mailing list<br>
<a href="mailto:pypy-dev@python.org">pypy-dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/pypy-dev" target="_blank">https://mail.python.org/mailman/listinfo/pypy-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Ryan<div><div>If anybody ever asks me why I prefer C++ to C, my answer will be simple: "It's becauseslejfp23(@#Q*(E*EIdc-SEGFAULT. Wait, I don't think that was nul-terminated."</div>
</div><div><br></div></div>
</div>