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

Steven Schveighoffer schveiguy at gmail.com
Sat Dec 14 15:07:59 UTC 2019


On 12/14/19 2:34 AM, Walter Bright wrote:
> On 12/11/2019 2:57 AM, Alexandru Ermicioi wrote:
>> Why not just split interpolated string into just a tuple of args & 
>> strings. For example:
>> Given: (i"I ate %apples and %bananas totalling %(apples + bananas) 
>> fruit.")
>> Is lowered to a tuple: ("I ate ", apples, " and ", bananas," totalling 
>> ", apples + bananas," fruit.")
> 
> I don't see the point of that. The user could write it that way to begin 
> with.

Walter, this is literally the point of string interpolation. A similar 
response to your entire proposal could be, why not just use writeln and 
write out all the items?

The point is not just to put the expressions where they belong, but to 
be less verbose about it. The dance of quotes and commas is hard to read 
and hard to write.

-Steve


More information about the Digitalmars-d mailing list