On Wednesday, 26 February 2020 at 11:13:12 UTC, Petar Kirov [ZombineDev] wrote:
On Wednesday, 26 February 2020 at 09:45:55 UTC, Walter Bright wrote:
It is lowered to:

  f("hello %s", a);

as designed. I don't know what's unwanted about it.

In all other languages with string interpolation that I'm familiar with, `a` is not passed to the `i` parameter.

---
[snip]

To be fair, none of those languages care about an extra string allocation.

But to be fair again, Adam/Steven's proposal can avoid the memory allocation while also not passing i implicitly, at the cost of not matching to the string type.

But to be thrice fair, Adam/Steven's proposal would work with the minor extension `f(i"hello $a".format)`/`f(i"hello $a".to!string)`, in keeping with the trend of GC use requiring explicit opt-in.

Reply via email to