shouting versus dotting

Benji Smith dlanguage at benjismith.net
Tue Oct 7 07:29:59 PDT 2008


Andrei Alexandrescu wrote:
> Alexander Pánek wrote:
>> Benji Smith wrote:
>>> Andrei Alexandrescu wrote:
>>>> I'd want to give it a try. How do others feel about 
>>>> Template{arguments}?
>>>
>>>
>>> At first glance, I like it better than !(), especially since it saves 
>>> a character, making nested templates much nicer:
>>>
>>>    auto map = new Map{T[], List{MyType}}();     // not too bad
>>>    auto map = new Map!(T[], List!(MyType))();   // not too good
>>>    auto map = new Map<T[], List<MyType>>();     // still my favorite
>>>
>>> It's too bad the shift operators can't be changed. Personally, I 
>>> think the angle brackets are more valuable as a matched pair of 
>>> enclosures.
>>>
>>> We could redefine the shift operators to be:
>>>
>>>    -->  RIGHT SHIFT
>>>    <--  LEFT SHIFT
>>>    -->> SIGNED RIGHT SHIFT
>>>
>>> And then the angle brackets could be coopted for templates.
>>
>> No way! :(
>> ’em pointed brackets are way too pointy. I like having parenthesis for 
>> templates.
> 
> Well another problem is we'd need to redefine the less-than and 
> greater-than operators too.
> 
> Andrei

Oh yeah. I don't know how I missed that. <smacks forehead>

--benji



More information about the Digitalmars-d mailing list