__traits so long and ugly, what about ::?

Nick Sabalausky a at a.a
Wed Mar 30 12:59:15 PDT 2011


"Ary Manzana" <ary at esperanto.org.ar> wrote in message 
news:in0169$5sb$1 at digitalmars.com...
> On 3/30/11 4:32 PM, David Nadlinger wrote:
>> You are not the only one to find __traits ugly - although not directly
>> related to your question, it has been proposed several times to ditch
>> is(typeof()) and __traits and replace them with a magic »meta«
>> namespace. There is even a bug report about it:
>> http://d.puremagic.com/issues/show_bug.cgi?id=3702
>>
>> David
>
> David, thanks for the answer. I am aware of that proposal, but I don't 
> like it because it's not very readble. You have to read "meta isArithmetic 
> int", kind of like how yoda speaks, but in the other case, 
> "int::isArithmetic" is much more natural and shorter and nicer.
>
> I'm just suggesting a syntax for accessing compile-time things. It seems 
> :: is unused...

I've always felt the meta namespace should be member-call syntax: 
int.meta.whatever

Your suggestion is a nice shortcut to that, though.




More information about the Digitalmars-d mailing list