On Sat, Apr 5, 2014, at 15:45, [1][email protected] wrote:
Sorry, the dot makes it not clear, but even more confusing. Actually,
".*" reads like dot (.) product (*).
E.g. in Python/Numpy and IDL +,-,*,/ are used for element-wise
operation.
Moreover,
julia> [1 2 3] + [1 2 3]
1x3 Array{Int64,2}:
2 4 6
julia> [1 2 3] * [1 2 3]
DimensionMismatch("*")
The more complicated symbols (as ".*") should be used for more
complicated operations like inner/outer product, i.e. when I have to
think about dimension shapes.
In which situation I can use "<" for arrays? Never? Then we carry all
the time the dot with us.
Just an idea: I don't know how common this use would be in code, but a
< b (without the dot) could be used to compare if array b dominates a
i.e. all elements of b are strictly greater than a. Likewise for >, <=
and >=. This is certainly used as mathematical notation and they're
currently not defined in Julia and could be implemented more
efficiently than the element-wise comparisons.
So I find a very inconvenient decision was made.
Friedrich
The `.` in `.<` makes it clear that the operation is element-wise; this
is especially important in `.*`, for example.
References
1. mailto:[email protected]