3 ms·
The format library is a pre-existing library which is being standardized. String interpolation cannot be implemented in a library, and requires language extensi
by plorkyeran 7y ago
The format library is a pre-existing library which is being standardized. String interpolation cannot be implemented in a library, and requires language extensions. Perhaps they should have done that instead, but that's a significantly more complicated task than merely adopting something that's already well tested and proven (and even that was far from trivial).
- hawski 7y agoI am not necessarily opposing string interpolation as a language feature, but I have an idea how could it work as a library. Implement string suffix and overload comma operator or overload reminder operator. It would look like this: "Hello {} {}!"i, 2, "worlds" Or with reminder operator as in Python: "Hello {} {}!"istr % istr(2, "worlds") But yeah, enough of this.