Let's see the following example:

```d
import std.stdio;

static foreach(i; 0 .. 10) {
  mixin(create_fn!(i.stringof));
}

enum create_fn(string num) = `
void function_`~ num ~`() { writeln("Hello from function `~ num ~`!"); }
`;

void main() {
  function10();
}
```

I'm trying to create a series of function. There will be ten of them, and they will be called `function_0`, `function_1`, etc. However, in my example, "stringof" returns the character "i" itself and turns that into a string instead of getting its actual value (number).

Any ideas how I can achieve what I'm trying to achieve?

Reply via email to