On Saturday, 11 January 2014 at 07:50:51 UTC, Jakob Ovrum wrote:
Your problem is probably better solved without string mixins, but we'd probably need to see some code or more elaboration to accurately suggest a solution.

enum semanticArray = ["test"];

mixin(`T ` ~ semanticArray[0] ~ `(T)(T t) {
        t.name ~= "` ~ semanticArray[0] ~ `";
        return t;
}`);

This will mixin a single templated function named "test", which changes an AST node's name to whatever it was concatenated with "test". I want this to happen automatically for any length of semanticArray.

Reply via email to