A tutorial on D templates

Jacob Carlborg doob at me.com
Sun Jan 15 06:28:06 PST 2012


On 2012-01-15 14:33, Philippe Sigaud wrote:
> 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.

Sure, go ahead and use whatever you want :)

> 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.

Do you have a link?

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

It might be, depends on how the implementation look like.

>> 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

Ok, I see.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-announce mailing list