On 12/07/2012 08:31 PM, Alan G Isaac wrote:
On 12/7/2012 1:52 PM, Summers, Peter wrote:
> But your example holds true whether or not we write x'y or x'*y
Absolutely. I was addressing only the issue of
how to handle a 1 x 1 matrix, not the core question.
I agree that many matrix programming languages special case
the 1x1 matrix. I guess it is convenient enough to introduce
the risk I illustrated, at least in the opinion of some.
Not in mine.
I also have an opinion the topic question (explicit is better than implicit),
but not a strong one. One thing is for sure, x'*y needs to be legal.
The question is whether x'y is a legal "shorthand".
To me it would seem that if somebody writes <m'>, the script author is
treating m as a matrix. Because why would you use a transpose if the
object is always expected to be a scalar? Therefore it would seem
appropriate to always treat <m'y> as a matrix multiplication even in the
special case when m is 1x1.
Apart from that, this type of discussion has been led on the mailing
lists of other open-source projects. Maybe we should all study the
arguments and results of those discussions, before trying to re-invent
the wheel... (But you will notice that I, too, was too lazy and instead
wrote this message straight away :-)
cheers,
sven