[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Ideas for auto BSX
From: |
Dan Davis |
Subject: |
Re: Ideas for auto BSX |
Date: |
Sat, 1 Oct 2011 12:41:32 -0400 |
2011/10/1 Jordi Gutiérrez Hermoso <address@hidden>:
>>
>> Why not introduce five new two-character infix operators, like for
>> example $+, $-, $*, $/, $^, or whatever instead of $ fits in the
>> first position?
>
> I would like to avoid introducing more obscure notation. Obscure
> notation was why I implemented this feature in the first place. Auto
> BSX is simply that -- more convenient notation.
>
> Do you think most users of numpy are horribly confused by what numpy
> calls broadcasting? Do you think this is a reason to avoid numpy? It
> seems to work for them and its users seem to love it. Do you think
> people bring different expectations to Octave and would thus hate BSX?
>
> - Jordi G. H.
>
As a user of Octave, I would prefer keeping the operator behavior as
is. bsxfun works fine for me, and I have frequently depended on the
operators throwing errors when array orientations are mismatched.
Also, it would be one more place where Octave and Matlab behavior
would differ. I'm not a user of numpy, so I can't comment on that
part, but I would actually prefer a third set of operators for bsx
operations. Would that be any more obscure than the existing * and .*
level of obscurity? Certainly it would be new, but as people became
aware of it, the obscurity would fade. Also, if it's a significant
enough change, it should be broadly announced.
I will say that if the behavior of the operators is changed, that
should be very prominently displayed. I would actually suggest a big
message be displayed to the user on Octave startup for a few versions.
Something along the lines of,
WARNING: Behavior has changed for the +, -, .*, and ./ operators in
this version and is no longer MATLAB compatible. See the
documentation for details.
Sincerely,
Dan Davis