On Tuesday, 10 October 2023 at 05:32:52 UTC, Imperatorn wrote:
If count < 10 then why not just

```d
import std;

    static foreach(c; "0123456789")
    {
      mixin(create_fn!(c));
    }

    enum create_fn(char num) = `
      auto function_`~ num ~`()
        => "Hello from function `~ num ~`!";
    `;

    void main()
    {
      assert(function_9() == "Hello from function 9!");
    }
```

Thank you! Yeah, the most clean code wins for me, so I'll use yours (if it's open source, lol)! Thank you and have an amazing day!

Reply via email to