Getting only the data members of a type

Jacob Carlborg doob at me.com
Sun Apr 1 23:42:01 PDT 2012


On 2012-04-02 02:43, Ary Manzana wrote:

> This is what I don't like about D. It gives you a hammer and everyone
> tries to solve all problems with that single hammer. Then you get
> duplicated code for basic stuff, like getting the type of a field, in
> many projects.
>
> It's a waste of time for a developer to have to sit down and think how
> we can cheat the compiler or make it talk to give us something it
> already knows, but only having a hammer to do so.
>
> Either put that in the language, or in the core library. But don't make
> people waste time.
>
> I'd suggest sending pull request with methods that accomplish those
> annoyances.
>
> On the other hand, take a look at the implementation of std.traits. Is
> it really a win to implement functionLinkage in D? Right here:
>
> https://github.com/D-Programming-Language/phobos/blob/master/std/traits.d#L704
>
>
> you are repeating the linkages with their names, when that information
> is already available to the compiler. What's the point in duplicating
> information? The compiler already knows it, and much better than D. It
> could be implemented in a much simpler way. Is it just the pride of
> saying "Look what I can do with my powerful compile time reflection
> capabilities (basically stringof in that module)?"
>
> I'm not angry, but I don't think things are taking the correct direction...

I agree.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list