On Tue, 2017-04-04 at 12:46 +0000, Xinok via Digitalmars-d wrote: > On Tuesday, 4 April 2017 at 02:43:26 UTC, evilrat wrote: > > String interpolation would be nice too, it would really help > > with readability! > > This really isn't in the spirit of D and is better left to > library functions which give the user far more power and > flexibility. Incorporating such a feature into the language > raises many questions and concerns:
Interestingly, or not, Python 3.6 introduces string interpolation even though Python already has the format function. And pythonistas are happy about this. > * It becomes a language feature thereby further bloating the > language and runtime > * What if you want it to be @nogc? > * What if you want to combine it with allocators? > * What if you want to store the result in a particular buffer? > * What if you want the result to be lazily evaluated? > * What if you want an input range of chars? ... that is lazily > evaluated? > * What if you want to format the arguments in a specific way? > > Given the ease in which such a feature can be implemented and > used as a library function, I don't see interpolated strings as > being a necessary feature in D. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:[email protected] 41 Buckmaster Road m: +44 7770 465 077 xmpp: [email protected] London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
signature.asc
Description: This is a digitally signed message part
