DIP 1027---String Interpolation---Community Review Round 1
Walter Bright
newshound2 at digitalmars.com
Sat Dec 14 08:54:10 UTC 2019
On 12/11/2019 2:37 PM, H. S. Teoh wrote:
> 1) Change the interpretation of `%({X}varname)` to mean "use `X` instead
> of %s as placeholder in output string", rather than "use `%X` ...".
> I.e.:
>
> i"%abc" == tuple("%s", abc);
> i"%({%x}abc)" == tuple("%x", abc);
> i"%({?}abc)" == tuple("?", abc); // bingo, SQL syntax!
>
> 2) Then, in light of the %%%% problem, and to fix the repeated % in
> "%{%x}abc", change the default metacharacter to something like $:
>
> i"$abc" == tuple("%s", abc);
> i"$({%d}abc)" == tuple("%d", abc);
> i"$({?}abc)" == tuple("?", abc);
I agree, except don't need the extra ( ).
More information about the Digitalmars-d
mailing list