On Sat, Mar 15, 2014 at 1:28 PM, Nathaniel Smith <njs@pobox.com> wrote:
On Sat, Mar 15, 2014 at 3:41 AM, Nathaniel Smith <njs@pobox.com> wrote:
> Hi all,
> Here's the main blocker for adding a matrix multiply operator '@' to Python:
> we need to decide what we think its precedence and associativity should be.

Another data point that might be useful:

Matlab: same-left

R: tight-left

I was going to ask this earlier, but I was worried I was missing something major.

Why was "tight-left" not an option?

This means that if you don't use parentheses, you get:
   a @ b @ c  ->  (a @ b) @ c
   a * b @ c  ->  a * (b @ c)
   a @ b * c  ->  (a @ b) * c

In my (very inexperienced) opinion, it seems like the most intuitive option. 


IDL: same-left

GAUSS: same-left (IIUC -- any GAUSS experts please correct me if I
misunderstood the fine manual)

Mathematica: instead of having an associativity, a @ b @ c gets
converted into mdot([a, b, c])

Nathaniel J. Smith
Postdoctoral researcher - Informatics - University of Edinburgh
NumPy-Discussion mailing list