http://d.puremagic.com/issues/show_bug.cgi?id=5231
Steven Schveighoffer <schvei...@yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |schvei...@yahoo.com --- Comment #6 from Steven Schveighoffer <schvei...@yahoo.com> 2010-11-18 05:10:23 PST --- (In reply to comment #2) > That's not really the correct solution. > BigInt should act like an int. Specifically, > > BigInt b; > writefln(" b = %d, %x", b, b); > should just work. > > This issue cannot be resolved until the definition of toString() is changed. > void toString() is a fundamentally broken design. It's wrong on many levels. So BigInt's aren't printable via writeln in protest? I guess I don't understand why you can't do this: string toString() { string retval; void sink(const(char)[] data) { retval ~= data; } toString(&sink, null); return retval; } It doesn't hurt/limit the current toString, does it? And then it makes bigints printable via writeln. BTW, toString's delegate is not scope, so you are going to allocate a closure for that... -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------