On Sat, 2 Jul 2016, Sven Schreiber wrote:
> "Kind of". But couldn't this be interpreted as a
case of simple
> left-to-right evaluation in the absence of another deciding criterion?
Well, I admit that according to table 3.1 in the command reference the unary
transpose and the binary transpose-multiply have the same priority, and so it
would boil down to left-to-right.
But I'm not sure that's right. Semantically it's clear that
transpose-multiply just exists to mimick mathematical handwriting (on the
blackboard or on paper). So wherever it's meaningful, "'" must be
replaced by
"'*". And then in the expression "a'*b'" the right
precedence kicks in.
Or to put it differently: Nobody would ever write "(a'b)'" on the
blackboard
as "a'b'", because I think it's a broad consensus that the two
expressions
are different.
I agree with Sven on this, but OTOH what people expect on the basis of
their mathematical background counts up to a point. The important thing is
to stick as closely as possible to the principle of least surprise, which
is, in turn, dictated by what other matrix-oriented languages do: as far
as I can tell, the expression
a'b'
* is equivalent to (a') * (b') in Ox, Gauss and Julia
* is illegal in Octave (which doesn't have, I think, the binary ' operator)
so we're the exception. So I guess it's just another case of choice
between backward-compatibility and pragamtism.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------