humm, I'm tempted to say multiplication is generally (if not
always) commutative too.
Anyway, some very interesting discussions, surely the point is that there
should be a concise explanation about string concatenation in the docs
somewhere, something like:
"you can do "hello"*"world" which is the same as string("hello", "world"),
the reason we don't use + is ..., for performance you should use IOBuffer
for repeated string concatenation, example..."
Also a more instructive error on "hello"+"world" would make since.
On Wednesday, 2 July 2014 20:48:26 UTC+1, 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.
>
> -- John
>
> On Jul 2, 2014, at 12:45 PM, Ivar Nesje <[email protected] <javascript:>>
> wrote:
>
> Not everybody is convinced there is a good reason. See some discussion
> about it in https://github.com/JuliaLang/julia/issues/1771
>
> kl. 21:17:25 UTC+2 onsdag 2. juli 2014 skrev Samuel Colvin følgende:
>>
>> There's no method +(s1::String, s2::String) instead string concatenation
>> has to be done with
>>
>> a="hello "*"world
>>
>> This is pretty unusual and unintuitive, so I'm guessing there a really
>> good reason for it?
>>
>
>