String interpolation, after a healthy debate on discord

Ogi ogion.art at gmail.com
Tue Dec 14 14:19:50 UTC 2021


On Tuesday, 14 December 2021 at 12:55:30 UTC, WebFreak001 wrote:

> I think it would only work at compile time though if you use 
> .stringof

Ouch, you’re right, we can’t reuse `stringof` for this. Some 
other name then, like `str` or something.

> otherwise you need a runtime function - like text - that 
> allocates the memory somehow, which is none of the compiler's 
> business

YAIDIP requires istring processing both at compile-time (`mixin` 
and `static assert`) and runtime (regular `assert` and 
`pragma(msg)`).


More information about the Digitalmars-d mailing list