Strings are do not form a ring, but just a monoid
<http://en.wikipedia.org/wiki/Monoid>.
On Monday, 27 April 2015 15:01:06 UTC+2, François Fayard wrote:
>
>
>
> While I agree that * for strings is unfortunate (in fact, I don't think
>> that strinng concatenation warrants infix syntax), IMO this whole issue
>> is a red herring: all languages have quirks like this, and while
>> minimizing the number of them is a worthy goal, I wouldn't think that
>> these pose the greatest conceptual difficulty when learning Julia.
>>
>
> It did not know the * convention. It is more than unfortunate. I think it
> is a major mistake. I have seen Stefan Kaprinski talking about a ring of
> strings. It does not make any sense as a ring needs 2 operations + and *.
> If one want to go into mathematics, the set of strings looks more like a
> Z-module (a kind of vector space over the ring Z).
>
> 1) "ab" + "" = "ab"
> 2) "abc" + "def" = "abcdef"
> 3) 3 * "abc" = "abcabcabc"
>
> Well it not even true as 2 * ("ab" + "cd") = 2 * "abcd" = "abcdabcd" which
> is different from 2 * "ab" + 2 * "cd" = "ababcdcd". And there is no string
> s such that "ab" + s = "". So this all story of "math" is just wrong.
>
> Isn't there a way to fix it ?
>