<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 16, 2014 at 10:03 PM, Nick Coghlan <span dir="ltr"><<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="overflow:hidden">There are plenty of existing left-associative operators that could be<br>



used for that if Mike Bayer wanted (or could be convinced) to do so,<br>
so I don't see how that observation is relevant to the question of<br>
whether or not this particular proposal should be for a<br>
right-associative operator.</div></blockquote></div><br>I knew I might get in trouble by giving such a specific example. My view is that a new <font face="courier new, monospace">@</font> operator is "baggage free" in terms of implied semantics -- since it has defined semantics only for matrices.<br>


<br>To the extent that it has implied semantics of being multiplication-like, I think it would be surprising that one multiplication operator is left-associative and one is right-associative. Does <font face="courier new, monospace">@</font> have higher or lower precedence than <font face="courier new, monospace">*</font>? The draft PEP says <span style="font-family:'courier new',monospace">@</span> is the same as <font face="courier new, monospace">*</font> but it can't be if it has opposite associativity. The interpretations of these two expressions depends on the precedence:</div>

<div class="gmail_extra"><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_extra"><font face="courier new, monospace">A @ B * C</font></div><div class="gmail_extra"><font face="courier new, monospace">A * B @ C</font></div>

</blockquote><div class="gmail_extra"><br></div><div class="gmail_extra">Someone mentioned that APL is right-associative and has no operator-precedence. Those two things are related. There's no operator precedence because there are too many operators for everyone to remember the exact order of precedence. Given that, all operators need to be left or right associative. I don't know the reason for sure but I have heard that one reason is that and given that monadic (unary) operators are right associative, making all operators right associative means that you can simply interpret an APL statement reading from right to left. I don't think APL is the right model to look at.<br>

</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div><div dir="ltr"><font face="arial, helvetica, sans-serif">--- Bruce<br></font><div><div><font face="arial, helvetica, sans-serif">Learn how hackers think: <a href="http://j.mp/gruyere-security" target="_blank">http://j.mp/gruyere-security</a></font></div>


</div><div><div style="font-family:arial;font-size:small"><a href="https://www.linkedin.com/in/bruceleban" style="color:rgb(17,85,204)" target="_blank">https://www.linkedin.com/in/bruceleban</a><br></div></div><div><br></div>


</div></div>
</div></div>