Hi,
I want to do something like this:
void main()
{
enum letters = ['A', 'B', 'C'];
static foreach(ch; letter)
{
void mixin("print" ~ ch)(uint i)
{
writeln(ch, " - ", i);
}
}
printB(6);
}
Create some function in loop and use it. But I don't know how to
mixin names?
Output:
onlineapp.d(59): Error: no identifier for declarator void
onlineapp.d(59): Error: found i when expecting . following uint
onlineapp.d(59): Error: found ) when expecting identifier
following uint.
onlineapp.d(60): Error: found { when expecting ,
onlineapp.d(61): Error: found ; when expecting ,
onlineapp.d(62): Error: expression expected, not }
onlineapp.d(63): Error: found } when expecting ,
onlineapp.d(65): Error: found ; when expecting ,
onlineapp.d(66): Error: expression expected, not }
onlineapp.d(67): Error: found End of File when expecting ,
onlineapp.d(67): Error: found End of File when expecting )
onlineapp.d(67): Error: found End of File when expecting ;
onlineapp.d(67): Error: found End of File when expecting }
following compound statement
onlineapp.d(67): Error: found End of File when expecting }
following compound statement