Can I convert string to expression somehow?

Tobias Pankrath tobias+dlang at pankrath.net
Sat Dec 12 11:03:06 UTC 2020


On Saturday, 12 December 2020 at 09:05:19 UTC, Godnyx wrote:
> I'm trying to create a cool function that will let us do 
> formatting sorter and faster. The function will work like that:
>
> outln("My name is {name} and my age is {age}");
>
> this will be equivalent to:
>
> writeln("My name is ", name, " and my age is ", age);
>
> or:
>
> writefln("My name is %s and my age is %d", name, age);
>

There was a DIP to bring something akin to this into the 
language, but
there were also some decent counter proposals.

See for example here: 
http://dpldocs.info/this-week-in-d/Blog.Posted_2019_12_16.html




More information about the Digitalmars-d-learn mailing list