Re: Dynamic Template-Expansion of (Token) Strings

2020-10-27 Thread Per Nordlöw via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 10:46:42 UTC, Jacob Carlborg wrote: [1] http://mustache.github.io/mustache.5.html [2] https://code.dlang.org/packages/mustache-d Thanks

Re: Dynamic Template-Expansion of (Token) Strings

2020-10-27 Thread Jacob Carlborg via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 08:33:08 UTC, Per Nordlöw wrote: I'm looking for elegant ways of expressing expansion of parameterized strings written to a file at run-time. My primary use case is run-time generation of D code. In the lazy case, something like import std.file : write;

Dynamic Template-Expansion of (Token) Strings

2020-10-27 Thread Per Nordlöw via Digitalmars-d-learn
I'm looking for elegant ways of expressing expansion of parameterized strings written to a file at run-time. My primary use case is run-time generation of D code. In the lazy case, something like import std.file : write; import std.algorithm : substitute; const s = q{int $X =