On Thursday, 20 June 2019 at 19:09:11 UTC, Emmanuelle wrote:
Is there any trait or Phobos function for transforming a function/delegate/lambda/whatever's body into a string suitable for `mixin(...)`? For example:
See: https://forum.dlang.org/post/[email protected]
If not, is there any way to do this _without_ using strings?
Depends on what you are trying to achieve with mixing in function body code. If you just want to execute the function code, you can just call it (obviously), so I assume you want dynamic scoping (that global variables are overridden by local variables from the caller) or something?
