String interpolation, after a healthy debate on discord
Ogi
ogion.art at gmail.com
Tue Dec 14 09:10:07 UTC 2021
On Friday, 10 December 2021 at 18:39:32 UTC, WebFreak001 wrote:
> if that's your pain point, check out this proposal here:
> https://forum.dlang.org/thread/kivjspiezjvqxjkhiugj@forum.dlang.org :)
It’s not just my pain point though. We need to convert stuff to
strings all the time. For example, every time we want a
meaningful message in an assertion or an exception. Many Phobos
modules have to import `std.format` or `std.conv` just for that.
To my understanding, this proposal already requires moving `text`
functionality into compiler (if it’s not there already, I don’t
know). So why not just make one more step forward and allow
converting istrings to strings? If implicit conversion is too
much to ask for, it could be an explicit cast to string, or some
property. Maybe `stringof` should do exactly that?
More information about the Digitalmars-d
mailing list