Thread overview | |||||
---|---|---|---|---|---|
|
December 14, 2005 printf. Must. Die. | ||||
---|---|---|---|---|
| ||||
OK, not really perish - just move back to std.c.stdio ? Having it "implicitly" defined in object.d only: 1) Promotes old bad D coding behaviour ("forgetting" to import std.c.stdio) 2) Makes moving to writef seem harder (since you have to import std.stdio) 3) Adds bloat to the std/Phobos library (by linking in the floating-point stuff) Might as well remove the print() methods, as well... Perhaps even move all of Phobos over to using writef ? It should *definitely* be out before any "D 1.0" release. --anders PS. It's used all over the place: http://www.digitalmars.com/d/overview.html http://www.digitalmars.com/d/wc.html http://www.digitalmars.com/d/sdwest/index.html object.printf: "Die! Die! Die!" http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/255 http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/3170 http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/3438 |
December 14, 2005 Re: printf. Must. Die. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Anders F Björklund | Anders F Björklund wrote:
> OK, not really perish - just move back to std.c.stdio ?
>
>
> Having it "implicitly" defined in object.d only:
>
> 1) Promotes old bad D coding behaviour
> ("forgetting" to import std.c.stdio)
> 2) Makes moving to writef seem harder
> (since you have to import std.stdio)
> 3) Adds bloat to the std/Phobos library
> (by linking in the floating-point stuff)
>
> Might as well remove the print() methods, as well...
> Perhaps even move all of Phobos over to using writef ?
It seems to be mostly used in unit tests.
I think we really need some way of importing stdio only during unit tests. Since you can do
debug import std.stdio;
how about something like:
unittest import std.stdio;
or allow:
unittest {
import std.stdio;
}
or at the very least, define version UnitTest so that you can write:
version(UnitTest) {
import std.stdio;
}
It is common for unit tests to have dependencies which are different from the rest of the module.
In any case, I agree that this should be a 1.0 feature removal.
|
December 18, 2005 Re: printf. Must. Die. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Anders F Björklund | Anders F Björklund wrote: > PS. It's used all over the place: > > http://www.digitalmars.com/d/overview.html > http://www.digitalmars.com/d/wc.html > http://www.digitalmars.com/d/sdwest/index.html Also used here http://www.digitalmars.com/d/code_coverage.html |
Copyright © 1999-2021 by the D Language Foundation