foreach thoughts

Timon Gehr timon.gehr at gmx.ch
Tue Jan 14 08:32:54 PST 2014


On 01/14/2014 04:40 PM, "Ola Fosheim Grøstad" 
<ola.fosheim.grostad+dlang at gmail.com>" wrote:
> On Tuesday, 14 January 2014 at 15:34:40 UTC, Dominikus Dittes Scherkl
> wrote:
>> I think it is. It would be far worse if the semantics were related.
>
> No. Array sub script and array initialization are both array-like, so no
> confusion. Same with "+" for concatenation (if you don't do implicit
> casting) and addition, they are both additive-like.

Nope. They are both monoid operations. Addition is commutative, and it 
is conventional in abstract algebra to use "+" to denote commutative 
operations only. eg. http://en.wikipedia.org/wiki/Abelian_group#Notation .

assert("123abc" == "123" + "abc"); hurts my eyes.

> The human mind categorize in a fuzzy fashion.
>




More information about the Digitalmars-d mailing list