A tutorial on D templates

Philippe Sigaud philippe.sigaud at gmail.com
Sun Jan 15 05:33:02 PST 2012


On Sun, Jan 15, 2012 at 12:26, Jacob Carlborg <doob at me.com> wrote:
> I see that you have referenced my Orange library, cool.

As for Orange, is it OK with you if I show a small part of it? Is it
OK for me to link to the github project?
Mainly, I wanted to show some tricks you used in util/Reflection.d and
util/Traits.d. I should rummage in your code again.


Btw, I think that by using the technics shown in Nick's last year
article (generating switch/cases from CT information), it would be
possible to make some parameters of Reflection.d be runtime parameters
instead of compile-time.

That is, from hasField!(T, "field") to hasField!T("field"). I do not
know if for serializing it's interesting or not.

> Looking at the
> example for emitting events. I'm not completely sure how it works but it
> looks like that Fields mixin can be replace with the code you have
> referenced from my Orange library and opDispatch. Then you could write the
> Point and Size structs just as regular structs without the mixin.

This mixin comes from Andrej Mitrovic. You should see with him the
difference with Orange, I admit not knowing much about this.

Philippe


More information about the Digitalmars-d-announce mailing list