The state of string interpolation

Adam D. Ruppe destructionator at gmail.com
Thu Dec 6 19:39:17 UTC 2018


On Thursday, 6 December 2018 at 19:12:52 UTC, Paul Backus wrote:
> If users want to opt in to that extra complexity, it can always 
> be made available as a library.

Well, maybe, but libraries can't get the info if it isn't there.

We might be able to alias this the FromInterpolation thing so it 
just works in most places where you would use something else... 
but indeed, perhaps would be nice to do it in __traits.

(Or just abandon it and settle for the basic thing, I am OK with 
that too.)

> The actual solution here is to use the type system to 
> distinguish between trusted and untrusted strings. E.g.,

If you do that, then you really must forbid any plain string to 
force the programmer to declare it...


More information about the Digitalmars-d mailing list