Can we make mixin applications first class at the type level?
sighoya
sighoya at gmail.com
Wed Mar 20 17:34:49 UTC 2019
Allowing
mixin template GenInt()
{
const char[] type="Int";
}
void f(T)(T a)
{
return;
}
void main()
{
f!(GenInt!()) //or
f!(mixin GenInt!());
return ;
}
opens the door for quasi first class type calculus. Type mappings
can be saved as strings and can be instantiated as types where it
needs to be, e.g. passing two computed types to a trait function
and determine their compatibility.
Why isn't it possible in D.
Further, why wee need to state mixin GenInt!() if GenInt is
already a mixin? Isn't it just redundant?
More information about the Digitalmars-d
mailing list