5 ms·
It's interesting that this feature is essentially a clone of how string interpolation has been made extensible in Scala. However, the JEP only mentions Scala on
by clhodapp 4y ago
It's interesting that this feature is essentially a clone of how string interpolation has been made extensible in Scala. However, the JEP only mentions Scala once.... in the form of an example which has been made strangely more complex than it has to be (it would be much shorter if they had used the s interpolator instead of the f interpolator).
The one major difference is that, because Scala has macros and typeclasses, it can turn malformed interpolations for things like JSON or SQL into compile-time errors instead of runtime errors.