On Thursday, July 3, 2014 6:59:54 AM UTC-5, Francesco Bonazzi wrote: > > On Wednesday, July 2, 2014 9:48:26 PM UTC+2, John Myles White wrote: >> >> String concatenation is not commutative. Addition is generally used for >> commutative operations. So if you're a mathematician, using addition for >> string concatentation seems very wrong. >> > > In Wolfram Mathematica there is a multiplication operator for scalars > (i.e. * or space), commutative, and a multiplication operator for matrices > (i.e. "."), non-commutative. In any case, Mathematica does not allow to > define custom types, maybe that's the reason they decided to have distinct > operators. In contrast, the commutativity of product arguments may be > determined by their types in Julia. >
Julia, following MATLAB, also has distinct operators: `*` and `.*`. The first implements matrix multiplication, and the second scalar/elementwise. Of course, when there is only one element--scalar arguments--these operations do the same thing.