What do you thing about this string interpolation idea
something at something.com
Mon Dec 10 16:11:17 UTC 2018
On Monday, 10 December 2018 at 15:50:58 UTC, Steven Schveighoffer
> On 12/10/18 7:45 AM, FeepingCreature wrote:
>> On Monday, 10 December 2018 at 12:34:33 UTC, Daniel Kozak
>> While I'm not sure of all the details of the implementation, I
>> think the use of a mixed in templated nested function to
>> enable access to the local scope without string mixin is
>> inspired. Very clever idea.
> Yeah, this looks a lot better than mixing in every
> I tried it out with adding arbitrary expressions, and it works
> like a charm:
> It needs some polish around the parsing (need to handle
> parentheses and separating symbols with something other than
> space), but I'm pretty happy with the concept.
This is much better than having to mixin everywhere. A couple of
1) Can this be put in a module so that you don't have to
mixin(enableInterpolation) but instead "import interp =
std.interpolation;" or something similar?
2) This would unfortunately pollute the namespace and in code
that uses interpolation heavily, you'd have to rename it to
something non-clashy which I can see being quite annoying and a
maintenance burden if it turns out to be a common thing to do.
Maybe if it's just standardly called "interp" it may be alright
More information about the Digitalmars-d