DIP 1027---String Interpolation---Community Review Round 1

Bastiaan Veelo Bastiaan at Veelo.net
Wed Dec 11 23:17:37 UTC 2019


On Wednesday, 11 December 2019 at 20:57:35 UTC, Ola Fosheim 
Grøstad wrote:
> On Wednesday, 11 December 2019 at 20:46:03 UTC, Meta wrote:
>> Really, though, all that's needed is to allow mixin templates 
>> to be mixed in without using the `mixin` keyword (I say "all", 
>> but that's quite a large language change):
>
> Could one option be to use another symbol than «!» and make it 
> imply the mixin?
>
> … f = some_formatter_that_builds_a_string …;
>
> immutable s = f!!"My name is {this.name}";

I like this. A universal improvement that also happens to enable 
all kinds of string interpolation, including SQL.

Bastiaan.


More information about the Digitalmars-d mailing list