The state of string interpolation

Dennis dkorpel at gmail.com
Thu Dec 6 23:32:41 UTC 2018


On Thursday, 6 December 2018 at 23:10:48 UTC, o wrote:
> "forcing the use of phobos" does not only apply to 
> lower-to-string interpolation. Tuple and 'text()' functionality 
> all comes from phobos in the first place.

But `text` is something you choose to import and call yourself. 
You are free to implement your own text function for a BetterC / 
WebAssembly environment. And, as Adam clarified, it's not lowered 
to a Phobos Tuple but a 'compiler tuple'.

> If we used 2 different string prefixes, ie `i"..."` for 
> lower-to-string interpolation and `t"..."` for lower-to-tuple, 
> then 100% of the use cases are covered and everyone is happy.

I think we can be happy if we can make a convincing case that one 
of these is worth the extra complexity. Trying to get in two new 
string types with huge overlap is probably not worth it. It also 
raises the question 'when to use which' which will not be obvious 
to many users.


More information about the Digitalmars-d mailing list