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

Jacob Carlborg doob at me.com
Sat Dec 14 13:34:03 UTC 2019


On 2019-12-14 09:36, Walter Bright wrote:

> I've thought about this for the last week. The most practical idea is to 
> simply concatenate adjacent strings, as in:
> 
>    database.exec(i"UPDATE %table SET key=%key, value=%{f}value "
>                    "WHERE index < %{d}index AND "
>                    "timestamp > %{D}lastTime");
> 
> I.e. the 'i' string comes first, and gets concatenated with any 
> following string literals. This also enables using 'q' strings as 
> interpolated strings:
> 
>      i"" q{a + b}

Implicit string concatenation is deprecated and gives an error.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list