I want to add a Phobos module with template mixins for common idioms.

Diggory diggsey at googlemail.com
Mon May 6 12:47:32 PDT 2013


It's a nice idea but personally I don't like the syntax much, for 
example it's completely non-obvious what "true" does when passed 
to the singleton mixin, or that the parameters to the property 
mixin are "type, name, condition, initial value".

I suppose you could do something like this:
mixin property!`int x = 1`;

The other problem is that I don't think it's beneficial to invite 
the use of mixins for such simple substitutions. I'd rather see 
the majority of code be standard D syntax, and the use of mixins 
be the exception rather than the rule. It's similar to how 
excessive use of macros in C++ is generally considered bad 
practice.


More information about the Digitalmars-d mailing list