DIP 1027--String Interpolation--Final Review Discussion Thread

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Feb 3 19:22:43 UTC 2020


On Mon, Feb 03, 2020 at 07:10:54PM +0000, Sebastiaan Koppe via Digitalmars-d wrote:
> On Monday, 3 February 2020 at 14:52:24 UTC, Adam D. Ruppe wrote:
> > On Monday, 3 February 2020 at 14:37:22 UTC, Steven Schveighoffer wrote:
> > > I'd do it a little different, so we don't throw away the work the
> > > compiler already did:
> > > 
> > > i"$apples and ${%d}bananas"
> > > 
> > > =>
> > > 
> > > (__d_format_literal!(Format.init, " and ", Format("%d")), apples,
> > > bananas)
> > 
> > Yes, that would be excellent. If you make a motion to amend the DIP,
> > I'll withdraw my motion and second yours. Let's form a coalition and
> > get Walter onboard!
> 
> This looks really good. When using it as a DSL, there is no need to
> parse the '%s' the compiler just inserted.
> 
> Plus it is a bit more structured than the bare tuple there was before.
> 
> Best of both worlds, I would say.

+1, this proposal trumps all the other ones I've seen so far.


T

-- 
Let X be the set not defined by this sentence...


More information about the Digitalmars-d mailing list