<div class="gmail_quote">On 13 January 2012 17:56, Don Clugston <span dir="ltr"><<a href="mailto:dac@nospam.com">dac@nospam.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 13/01/12 14:47, Manu wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
On 13 January 2012 14:48, bearophile <<a href="mailto:bearophileHUGS@lycos.com" target="_blank">bearophileHUGS@lycos.com</a><br></div><div><div class="h5">
<mailto:<a href="mailto:bearophileHUGS@lycos.com" target="_blank">bearophileHUGS@lycos.<u></u>com</a>>> wrote:<br>
<br>
    This is the third time I see people trip on power operator precedence:<br>
    <a href="http://d.puremagic.com/issues/show_bug.cgi?id=7268" target="_blank">http://d.puremagic.com/issues/<u></u>show_bug.cgi?id=7268</a><br>
<br>
    Some people expect this:<br>
    (-10 ^^ 2)<br>
    To be 100 instead of -100<br>
    (Note: Python here uses the same operator precedences.)<br>
<br>
    Do you think it's worth (and possible) to help D programmers avoid<br>
    this mistake in their code?<br>
<br>
<br></div></div><div class="im">
I would certainly have made this mistake if I tried it. And knowing this<br>
information will not cause me to do it properly, it will simply make me<br>
question my code, and become very suspicious every time I ever use the<br>
operator (ie. I will never understand the proper precedence, I don't<br>
think it makes sense).<br>
I'm fairly amazed it's not the other way around... what's the logic<br>
behind this?<br>
</div></blockquote>
<br>
Originally it worked the other way, but bearophile complained about it, so it got changed to this way <g>.<br></blockquote><div><br></div><div>Well... he should obviously be shot! </div></div>