3 ms·
D accomplishes this by using Compile Time Function Execution to build D source code from strings, and then inline compiling the D code. Learning a macro languag
by WalterBright 10mo ago
D accomplishes this by using Compile Time Function Execution to build D source code from strings, and then inline compiling the D code. Learning a macro language is unnecessary, as it's just more D code.
This kind of thing is very popular among D users.
https://dlang.org/spec/statement.html#mixin-statement https://dlang.org/spec/statement.html#mixin-statement
https://dlang.org/spec/expression.html#mixin_expressions https://dlang.org/spec/expression.html#mixin_expressions