Of course, 2str, 2*str and str*2 could be equivalent, as they are for other 
data types. For me two (copies of) str is just more natural than str1 times 
str2. Similarly, "add" str2 to str1 for concatenation follows the natural 
language better. Also, you could define str1-str2 as deleting str2 from 
(the beginning/end of) str1, if it was there. (even though str2/str1 works, 
too). You can find in algebra ample examples for both multiplicative and 
additive notations for structures, but either way the notation of string 
concatenation is the least of our difficulties when learning Julia.

On Thursday, July 3, 2014 10:12:47 AM UTC-6, Stefan Karpinski wrote:
>
> On Thu, Jul 3, 2014 at 12:09 PM, Patrick O'Leary <patrick...@gmail.com 
> <javascript:>> wrote:
>
>> I do find the generalization to string exponentiation -> repetition is 
>> pretty beautiful.
>
>
> This is my favorite part about the * choice. From str+str it's not at all 
> obvious whether 2str or str*2 is the right choice for string repetition. I 
> also agree that's fascinating how attached people get to string 
> concatenation operators. Don't get Jeff started on string interpolation, 
> which is essentially a fancy string concatenation syntax.
>  

Reply via email to