Can I convert string to expression somehow?

Godnyx rempas at tutanota.com
Sat Dec 12 13:55:23 UTC 2020


On Saturday, 12 December 2020 at 11:03:06 UTC, Tobias Pankrath 
wrote:
> 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

Thanks for your time man. I'm gonna check it out! Have a great 
day!


More information about the Digitalmars-d-learn mailing list