[Issue 5231] BigInt lacks a normal toString()

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 18 08:44:02 PST 2010


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



--- Comment #9 from Don <clugdbug at yahoo.com.au> 2010-11-18 08:42:45 PST ---
(In reply to comment #8)

> Second, it's they way things currently work.  It's like saying you refuse to
> have const functions because they should be inout, but inout doesn't work. 
> When toString is fixed, then you can remove the crufty function, and nobody
> cares whether it was ever there or not.  It looks to the outside like phobos is
> immature when it can't even print its own types, regardless of how inefficient
> it is.

If it was just a question of inefficiency, I would have implemented it. The
issue is that it doesn't get the formatting string.
So
BigInt b;
writefln("%x %+d", b, b);

doesn't work, and cannot be made to work.

> Note that I 100% agree that the current system is crap, and needs to be
> completely redone similar to how you have implemented it, but it's not how it
> works now.  Can't BigInt just play along and we can push for changes to the
> system without making the library look like a stubborn child?

No. The format string is absolutely fundamental to the implementation of
outputting BigInt and BigFloat. It's not just "a crap implementation".

-- 
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