On 03/15/2017 09:50 AM, Inquie wrote:
e.g., string s = "smile"; enum code1 = @# void happyCode = "Makes me @@s@@"; #@ enum code2 = code1 ~ @# int ImThisHappy = @@s.length@@; #@ mixin(code);
import scriptlike; // https://github.com/Abscissa/scriptlike string s = "smile"; // http://semitwist.com/scriptlike/scriptlike/core/interp.html enum code1 = mixin(interp!q{ void happyCode = "Makes me ${s}"; }); enum code2 = code1 ~ mixin(interp!q{ int ImThisHappy = ${s.length}; }); mixin(code2); Wish I could get rid of the need for "mixin(...)" in interp though.
