xxxxxxxxxx
string i(string mx)() {
// this is just a very basic simple example implementation
import std.algorithm;
import std.array;
string get() { return mx;}
return `
(){
import std.algorithm;
import std.meta;
import std.array;
import std.conv;
import std.functional;
enum SPL = aliasSeqOf!("`~mx~`".splitter(" ").array);
template REPL(string e) {
import std.algorithm;
static if(e.startsWith("$")) {
import std.conv;
mixin("enum REPL = ()=>"~e[1..$]~".to!string;");
}
else {
string fn(){ return e;}
enum REPL = &fn;
}
}
enum SS = staticMap!(REPL, SPL);
return "\""~[staticMap!(REPL, SPL)].map!(fn=>fn()).join(" ")~"\"";
}()
`;
}
int main() {
import std.stdio;
float var = 42;
writeln(mixin(i!"stop $var days of bikeshedding"));
// with lowering __"" to mixin(__!""); we could simply write:
// writeln(i"stop $var days of bikeshedding");
// but we could also implement a yadip template so we can write
// yadip"this will return adams template as defined in YADIP";
return 0;
}