C++

Chris Nicholson-Sauls ibisbasenji at gmail.com
Sat Jul 1 13:38:54 PDT 2006


Walter Bright wrote:
> Lucas Goss wrote:
> 
>> Also I did sort of agree with snk_kid on one point... I don't 
>> understand why D uses "~" for adding words together instead of "+". It 
>> seems like all the other languages I use all use + for adding words. 
>> Adding makes sense for words...
>>
>> I added on to what he said.
>> I added some words to his sentence.
>> If you add these two phrases together...
>>
>> Is there any benefit to having a separate symbol for adding (ok, 
>> concatenating)? If not feel free to break the language here too.
> 
> 
> Concatenation is quite different from addition:
> 
> int[3] a = [1,2,3];
> int[3] b = [4,5,6];
> 
> int[] c = a + b;    // c[] = [5,7,9]
> int[] d = a ~ b;    // d[] = [1,2,3,4,5,6]
> 
> Two distinct operators are necessary.

Amen.  Disambiguation is a Good Thing(tm).

Except for "Array operations not implemented" as yet.  Any idea when this much-coveted, 
much-anticipated feature will come to life?  I don't mean to push, but I've dreamt of 
array-ops nearly since I first got involved with D back in 2003.

-- Chris Nicholson-Sauls



More information about the Digitalmars-d mailing list