Scriptlike v0.9.4 - Perl-like interpolated strings, full examples and more.

Meta via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Fri Sep 25 10:50:01 PDT 2015


On Friday, 25 September 2015 at 14:38:33 UTC, Nick Sabalausky 
wrote:
> I like that idea. It it feasible? I'd always assumed the 
> syntaxes were different because they needed to be for some sort 
> of technical reason. But now that I look at it...maybe that 
> could work after all?

At first glance I can't see any problem with it, other than the 
fact that it makes it somewhat ambiguous whether you're mixing in 
a string returned from a CTFE function or a template mixin in 
some cases.

mixin template mixable()
{
     int i = 0;
}

string mixable()()
{
     return "int i = 0;";
}

However, this currently causes a compile time error anyway, so I 
don't believe it's a problem.

//Error, two templates with the same name
mixin mixable!();



More information about the Digitalmars-d-announce mailing list