[Issue 5237] writefln doesn't respect Complex.toString

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 19 04:33:37 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=5237



--- Comment #5 from Lars T. Kyllingstad <bugzilla at kyllingen.net> 2010-11-19 04:32:21 PST ---
(In reply to comment #4)
> My guess is that positional parameters will make it more complicated,
> but possibly it's really simple.

Regarding positional parameters, allow me to restate a point I made in the DIP9
thread on the newsgroup:

I think it's best to leave out the '%' from the format string that is sent to
toString().  This will facilitate the use of positional parameters, in which
the percent is followed by a position specifier which necessarily has to be
handled at a higher level than toString().  Example:

  BigInt i = "456";
  BigInt j = "123";
  writefln("%2$s %1$s", i, j);  // Prints "123 456"

The only thing BigInt.writeTo() needs to see is the part after the '$'
character.

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


More information about the Digitalmars-d-bugs mailing list