shouting versus dotting

KennyTM~ kennytm at gmail.com
Sun Oct 5 23:34:38 PDT 2008


Vincent Richomme wrote:
> KennyTM~ a écrit :
>> Vincent Richomme wrote:
>>> Michel Fortin a écrit :
>>>> On 2008-10-05 20:57:31 -0400, "Chris R. Miller" 
>>>> <lordsauronthegreat at gmail.com> said:
>>>>
>>>>> The !() syntax seems to serve only as a heads up that it's a 
>>>>> template. Otherwise (as far as I can tell) a simple foo(int)(bar, 
>>>>> baaz) would work just as well as foo!(int)(bar, baaz).
>>>
>>> What about the ^ ? I think it's not worst than !
>>>
>>> foo^(int)(bar) but maybe this symbol is already used by D ?
>>> Personally I would prefer to keep the C++, Java, C# syntax with <> 
>>> because people are used to it even if in some cases it looks like a 
>>> bit shift op.
>>
>> ^ is for bitwise XOR!
> Yes and ! is for what ?
> Just look at managed c++ in .NET and tell me if ^ is always a  bitwise XOR.

OK. The *binary* operator ^ is for bitwise XOR!

And the ^ in foo^(int) acts as a *binary* operator also.

And in C++/CLI the ^ in int^ and ^x acts as a *unary* operator, so no 
problem in this case.

AFAIK one of the reason ! was chosen because a!b doesn't make sense in 
C, so D is free to use ! as a *binary* operator.

> 
>> Unless you use ^^
>>
>>   foo^^(int)(bar)
>>
>> Not my cup of tea though.
> don't like either ^^



More information about the Digitalmars-d mailing list