My two cents

Atila Neves atila.neves at gmail.com
Tue Oct 24 08:06:55 UTC 2017


On Tuesday, 24 October 2017 at 07:17:08 UTC, Satoshi wrote:
> On Monday, 23 October 2017 at 21:42:03 UTC, Atila Neves wrote:
>> On Monday, 23 October 2017 at 21:14:18 UTC, bauss wrote:
>>> On Monday, 23 October 2017 at 12:48:33 UTC, Atila Neves wrote:
>>>> On Monday, 23 October 2017 at 09:13:45 UTC, Satoshi wrote:
>>>>> On Wednesday, 18 October 2017 at 08:56:21 UTC, Satoshi 
>>>>> wrote:
>>>>>> [...]
>>>>>
>>>>> Whats about this one?
>>>>>
>>>>> auto foo = 42;
>>>>> auto bar = "bar";
>>>>> writeln(`Foo is {foo} and bar is {bar}`);
>>>>
>>>> writeln("Foo is ", foo, "and bar is ", bar");
>>>>
>>>> Two more characters.
>>>>
>>>> Atila
>>>
>>> Okay, but what about now?
>>>
>>> void sendAMessage(string message)
>>> {
>>>     ....
>>> }
>>
>> sendAMessage(text(...));
>>
>> Atila
>
> boilerplate...

True, but in my opinion not enough to justify complicating the 
language. One could also always do:

import std.conv: t = text;
sendAMessage(t("Foo is ", foo, " and bar is ", bar"));

If it were me I'd just make `sendAMessage` take a variadic 
template and call text internally.

Atila


More information about the Digitalmars-d mailing list