Discussion Thread: DIP 1036--String Interpolation Tuple Literals--Community Review Round 2

Paul Backus snarwin at gmail.com
Fri Jan 29 20:01:54 UTC 2021


On Friday, 29 January 2021 at 19:51:52 UTC, Steven Schveighoffer 
wrote:
> https://github.com/dlang/DIPs/blob/344e00ee2d6683d61ee019d5ef6c1a0646570093/DIPs/DIP1036.md#a-string-interpolation-sequence-is-not-a-value-tuple
>
> The intention is for anything other than a function call or 
> template that accepts the expanded form to treat it as a string 
> type. This means typeof too. I should add it to the examples 
> there.

That just pushes the problem back one level:

     anySatisfy!(isSomeString, typeof(AliasSeq!(i"I have ${count} 
applies")))

Or, more realistically:

     template someTemplate(Args...) {
         static if (anySatisfy!(isSomeString, typeof(Args)) {
             // ...
         }
     }

     someTemplate!(i"I have ${count} apples")


More information about the Digitalmars-d mailing list