The state of string interpolation

Steven Schveighoffer schveiguy at gmail.com
Sat Dec 8 02:29:10 UTC 2018


On 12/7/18 9:04 PM, Jonathan M Davis wrote:
> On Friday, December 7, 2018 5:58:43 PM MST o via Digitalmars-d wrote:
>> On Friday, 7 December 2018 at 23:56:48 UTC, Adam D. Ruppe wrote:
>>> On Friday, 7 December 2018 at 23:46:45 UTC, o wrote:
>>>> Also, see Andrei's comment:
>>>> https://github.com/dlang/dmd/pull/7988#issuecomment-375760720
>>>
>>> He seems to also have the misunderstanding that was common
>>> earlier in this thread that tuple == std.typecons.
>>
>> This is probably going to confuse more people, so we should refer
>> to them as "sequences" in the DIP. Also, I am calling it "String
>> Sequence Literals" instead of "String Interpolation" because it
>> is more broad - more than just interpolation can be done with
>> this.
> 
> Personally, I'd just use the term AliasSeq, because that's what the
> associated template for them in Phobos is called. Just about anything else
> is going to be confusing. It's really unfortunate that Walter originally
> decided to call them tuples given that they aren't quite tuples, but there
> really isn't a good term for them ultimately. As it is, AliasSeq was just
> the best of a bad set of choices, but at least it's clear what you mean what
> you use the term, whereas just about anything else breeds confusion.

But it's not an AliasSeq. It's simply a list of items.

for example, I want this to work:

writeln(i"a + b = ${a+b}");

And this compiles:

writeln("a + b = ", a + b);

But this does not:

writeln(AliasSeq!("a + b = ", a + b));

-Steve


More information about the Digitalmars-d mailing list