On Monday, 8 June 2015 at 21:32:52 UTC, Timon Gehr wrote:
On 06/08/2015 10:16 PM, Idan Arye wrote:
It would be nice together with this feature to be able to mixin
identifiers:
static foreach (ident; ["foo", "bar"])
{
auto mixin(ident)()
{
// code for foo/bar
}
}
+1. Other use cases:
auto mixin(ident) = x;
identifier.list.mixin(ident).foo();
import std.mixin(ident);
Browsing bugzilla, I've discovered Idan's feature was actually
proposed in 2009, but with different syntax:
int __ident(name)() {...}
This seems better syntax, see:
https://issues.dlang.org/show_bug.cgi?id=2698#c3