[OT] ISO C++ 17 changes

Russel Winder via Digitalmars-d digitalmars-d at puremagic.com
Tue Apr 4 08:41:08 PDT 2017


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:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20170404/374902d5/attachment.sig>


More information about the Digitalmars-d mailing list