digitalmars.D.bugs - [patch] Phobos without print/printf
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (17/19) Mar 14 2005 Modified the Phobos library to
- Stewart Gordon (15/17) Mar 14 2005 Do we have a consensus on the idea of making std.stdio or at least
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (6/12) Mar 14 2005 Not that I've heard of. (Theoretically you can still use std.c.stdio)
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (4/8) Mar 14 2005 Here is the exact patch to reroute exceptions to standard error stream:
Modified the Phobos library to remove Object.print method, and to move printf back into std.c.stdio... (based on earlier Phobos patches from Thomas Kuehne, updated for DMD 0.118 and other D wishlists from last year) http://www.algonet.se/~afb/d/dmd-0.118-print.patchRemoves Object.print method, uses Object.toString() nowhttp://www.algonet.se/~afb/d/dmd-0.118-printf.patchRemoves global printf, uses writef or std.c.stdio.printfTo use printf now, first "import std.c.stdio;" Or do "import std.stdio;" and just use writef? I did not change the unittest and debugging code, just the ones that were always on... Compiles without warnings, and passes Phobos unittest : http://www.algonet.se/~afb/d/dmd.spec http://www.algonet.se/~afb/d/dmd-0.118-11.nosrc.rpm Tested on Linux (Fedora Core 1), not tested on Windows. --anders
Mar 14 2005
Anders F Björklund wrote: <snip>To use printf now, first "import std.c.stdio;" Or do "import std.stdio;" and just use writef?Do we have a consensus on the idea of making std.stdio or at least writef/writefln implicitly imported? Just looking at this - printf("Error: %.*s\n", o.toString()); + writefln("Error: %s", o.toString()); how about figuring out how to get these going to the right place (i.e. stderr) while we're at it? (_Is_ this the code that main is implicitly wrapped in, or does that only apply when you start a thread other than the main one?) Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Mar 14 2005
Stewart Gordon wrote:Do we have a consensus on the idea of making std.stdio or at least writef/writefln implicitly imported?Not that I've heard of. (Theoretically you can still use std.c.stdio) I think you still need to "import std.stdio;"how about figuring out how to get these going to the right place (i.e. stderr) while we're at it? (_Is_ this the code that main is implicitly wrapped in, or does that only apply when you start a thread other than the main one?)This was not that patch, but it would be something like fwritefln... fwritefln(stderr, "Error: %s", o.toString()); --anders
Mar 14 2005
Here is the exact patch to reroute exceptions to standard error stream: http://www.algonet.se/~afb/d/dmd-0.118-stderr.patch (it assumes that the print and printf patches have been applied first) --andershow about figuring out how to get these going to the right place (i.e. stderr) while we're at it?This was not that patch, but it would be something like fwritefln...
Mar 14 2005