On Tuesday, 3 September 2013 at 04:15:17 UTC, Timothee Cour wrote:Kenji had apparently implemented this:
I'd like to be able to declare a function with a special @mixin property
that will auto-mixin at call site
https://github.com/D-Programming-Language/dmd/pull/459
But pulled out. This recent thread should sum it up:
http://forum.dlang.org/thread/yaasjclvyobpeftgwmke@forum.dlang.org
Long story short, you are basically asking for macro. If we
allowed this, than anything could actually be code injection, and
mean anything.
I'm not sure this us very interesting (why not though), since
If for some reason we can't have @mixin special property, can we at least
have UFCS for mixin, so that we could write:
"variables: x1=$x1, x2=$x2, sum=$(x1+x2)".embed.mixin
nothing would ever come after the mixin.
I'd still rather have "typeof" be UFCS-able:
5.typeof.stringof.writeln();
If we only got to choose 1 that is ;)