4 ms·
The non-Python-specific term is string interpolation, and it should be in every language. From a language design perspective, the problem is that the compiler
by ahaferburg 8y ago
The non-Python-specific term is string interpolation, and it should be in every language.
From a language design perspective, the problem is that the compiler needs to know about it, so it's a core feature, but for maximal efficiency it might require some feature that isn't part of a language's core, like string streams. Another possibility would be a powerful macro system that allows the transformation of a format string into code, but few languages offer that.