DIP 1027--String Interpolation--Final Review Discussion Thread

Claude claudemr at live.fr
Thu Feb 6 08:08:41 UTC 2020


On Thursday, 6 February 2020 at 07:43:38 UTC, Johannes Loher 
wrote:
> Am 05.02.20 um 23:30 schrieb Adam D. Ruppe:
>> I'm not convinced that assigning to a string variable will 
>> actually be the most common usage though. You're surely 
>> creating this string to do something... and the variable 
>> doesn't actually do anything. You're surely going to pass it 
>> to a function eventually.. and often sooner rather than later.
>
> A use case which I already had a few times already is templated 
> strings for mixins.
>
> I also just noticed that for this particular case, there is 
> another problem. Usually for such strings, I would use the q{} 
> syntax. As far as I understand, the current proposal does not 
> allow mixing those 2. Is that correct? What would the syntax be 
> anyways if we allow mixing those 2? iq{}?
>
> Not being able to mix them would be very sad because this is 
> the main use case where I have wished for string interpolation 
> in the past.

I also have the same use-case but - if I remember correctly - 
it's been said in that thread that it could be implemented later 
once we already have an working interpolated-string 
implementation.

It is a reasonable answer to me.


More information about the Digitalmars-d mailing list