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

mipri mipri at minimaltype.com
Mon Dec 16 22:12:37 UTC 2019


On Monday, 16 December 2019 at 22:02:05 UTC, Steven Schveighoffer 
wrote:
> Might I suggest we come up with a new name for this technique?
> I see there is going to be a lot of users who want true string
> interpolation, e.g.:
>
> string str = i"My name is $name";
>
> and be very confused that D string interpolation isn't like
> https://en.wikipedia.org/wiki/String_interpolation
>
> Maybe something like "format tuple expansion" or "formatted
> interpolation"?
>
> -Steve

Programming language terminology is so random already that
this isn't going to help. Perl has 'hashes' and Python has
'dicts' and other languages have 'maps', but when I read about
AAs in D I just said "oh, hash tables" and mentally translated
all references from then on. People are going to do exactly the
same thing to "tuple expansion strings" and still complain that
"string interpolation in D" doesn't work as they expect.

But if it's called "tuple expansion strings", they'll *also*
complain about the weird name.

There might be some satisfaction in saying "you *should* have
expected something different because of the different name",
or in giving an explanation of the different name, but this
would all be a distraction from explaining why D's string
interpolation is different.



More information about the Digitalmars-d mailing list