Variable interpolation in strings

Justin Whear justin at economicmodeling.com
Thu Jul 26 14:07:12 PDT 2012


On Thu, 26 Jul 2012 22:40:25 +0200, Tobias Pankrath wrote:

>> My original thought was to allow cool syntax like x!"embedded variable:
>> $foo" but template instantiations don't have access to variables from
>> instantiation scope (unless you pass them explicitly via alias,
>> of course).
> 
> template mixins?

No, template mixins can only add declarations: "A Tem­plateMixin takes an 
ar­bi­trary set of de­c­la­ra­tions from the body of a Tem­plat­eDe­c­la­ra­tion and 
in­serts them into the cur­rent con­text." (http://dlang.org/template-
mixin.html)


More information about the Digitalmars-d mailing list