Please read my email about why * is not good for string concatenation. Then
reread the same email replacing * with +.


On Thu, Jul 3, 2014 at 11:09 AM, yi lu <zhiwudazhanjiang...@gmail.com>
wrote:

> I know abstract algebra. When talking about string concatenation, a monoid
> <http://en.wikipedia.org/wiki/Monoid> is enough. It is true that in a
> ring, "+" is a commutative operator, and "*" no commutative required,
> however, a ring is far beyond what needed to do a string concatenation job.
>
>
> On Thu, Jul 3, 2014 at 10:59 PM, John Myles White <
> johnmyleswh...@gmail.com> wrote:
>
>> This is just the standard convention in mathematics. See just about any
>> textbook on abstract algebra for a discussion of the reasons.
>>
>> I think it's safe to say that `+` will never be string concatenation, so
>> it's better to focus energy on other proposals.
>>
>>  -- John
>>
>> On Jul 3, 2014, at 7:57 AM, yi lu <zhiwudazhanjiang...@gmail.com> wrote:
>>
>> @John I know that "*" means no commutative, but I see no reason "+" has a
>> meaning of commutative.
>>
>>
>> On Thu, Jul 3, 2014 at 10:53 PM, Stefan Karpinski <ste...@karpinski.org>
>> wrote:
>>
>>> That's even worse.
>>>
>>>
>>> On Thu, Jul 3, 2014 at 10:52 AM, yi lu <zhiwudazhanjiang...@gmail.com>
>>> wrote:
>>>
>>>> I will vote for "+", although I learn mathematics. Maybe that is why I
>>>> am not a mathematician.
>>>>
>>>> Yi
>>>>
>>>>
>>>> On Thu, Jul 3, 2014 at 10:45 PM, Stefan Karpinski <ste...@karpinski.org
>>>> > wrote:
>>>>
>>>>> On Thu, Jul 3, 2014 at 9:42 AM, Ivar Nesje <iva...@gmail.com> wrote:
>>>>>
>>>>>> We should really create a simple system where you can get those hints
>>>>>> printed in the REPL, without defining more methods.
>>>>>
>>>>>
>>>>> Yes, I think we should really pursue this avenue.
>>>>>
>>>>> For what it's worth – and perhaps something since I'm the original
>>>>> perpetrator of the str*str concatenation syntax – I've come to regret this
>>>>> operator choice. My reasoning at this point is that we want our operators
>>>>> to have fairly "pure" meanings. I chose str*str because concatenation can
>>>>> be viewed as a kind of multiplication in the ring of string patterns
>>>>> (alternation in the regex sense is the addition operation, the empty 
>>>>> string
>>>>> is the unit and the non-matching pattern is the zero). However, many
>>>>> operations can be viewed as a form of multiplication. In the max-plus
>>>>> algebra <http://en.wikipedia.org/wiki/Max-plus_algebra>, for example,
>>>>> addition is the multiplication operator. So, at this point I think we
>>>>> should stick to very pure classical meanings for operators in Base – the
>>>>> Base.* function should be just addition of numbers in the classical sense,
>>>>> not the broader sense of addition in any conceivable ring.
>>>>>
>>>>>
>>>>
>>>
>>
>>
>

Reply via email to