String Interpolation Compare - DIP1027 and YAIDIP

Dadoum dadoum at protonmail.com
Sat Oct 21 12:14:00 UTC 2023


On Saturday, 21 October 2023 at 01:50:33 UTC, Walter Bright wrote:
> https://github.com/dlang/DIPs/blob/master/DIPs/rejected/DIP1027.md
>
> https://github.com/John-Colvin/YAIDIP
>
> [...]

I personally find the swift approach more natural and pretty.

Instead of using a character like `$` or `%`, it uses `\` as in 
`"Section count: \(sectionCount)"`. \
It does not give a way to format them, so I think that maybe a 
second fmt function should be implemented to wrap toString and 
get something like `"Downloading \(completion.format("%.2f"))%"` 
(here there could be another problem if we can't put quotes in 
here, but I don't know how D parses string in general and if it 
would be a problem).


More information about the Digitalmars-d mailing list