[Issue 12162] writeln(args) and writefln("%s", args) have different semantics with variadic args

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 14 12:55:29 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12162



--- Comment #6 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2014-02-14 12:55:28 PST ---
(In reply to comment #5)
> (In reply to comment #4)
> > Ah I know of a cute trick though:
> > 
> > writefln("%s", args.only);
> 
> And come to think of it, I think bearophile has a couple of format()
> enhancement requests specifically for tuples.

Specifically, the following works for arrays but not for tuples:

writefln("%(%s %)", [1, 2]);  // prints "1 2"

Perhaps if we could modify the syntax a little bit..

writefln("%!(%s %)", TypeTuple!(1, 2));  // would print "1 2"

Disregard the TypeTuple misnomer though. :)

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list