__traits so long and ugly, what about ::?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Mar 30 20:24:51 PDT 2011


On 3/30/11 8:42 PM, Ary Manzana wrote:
> I just hate it when you have to write too much to get simple things
> done.
>
> Does this type have a member? Current approach:
>
> 1. import std.traits;
> 2. invoke hasMember!(S, "m")
>
> Another approach:
>
> 1. I have the type, let's ask it: S::hasMember("m")
>
> Map's thought to code.
>
> My problem is that when you start using D's cool features you end up
> with a really hard to understand and obscure code...

I understand and to a good extent agree with the sentiment.

However, right now GSoC with student proposals to attract and review, an 
undergoing Phobos proposal review, one or a couple more waiting in the 
queue, good progress in core areas (64 bit stabilization, rigorous 
deterministic destruction, important bug fixes, and to follow the 
immutability subsystem and shared libraries) I can't stop feeling many 
of such discussions do more harm than good. There's always a better way 
to express a frequent idiom, and we may as well adopt one later. But 
this is the time to act, and there's plenty to act on.

Let's focus on getting real work done. This is the D Summer of Code. :o)


Andrei


More information about the Digitalmars-d mailing list