www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - D 1.0 - object(.d) and print(f)

Now that we have the new "writef",
how long is it until D 1.0 is here -
is it time to start deprecating "printf"
and "Object.print()" in object.d just yet ?

Like Kris asked, last year:
http://www.digitalmars.com/d/archives/digitalmars/D/bugs/255.html


That is:

 extern (C)
 {   int printf(char *, ...);
 }

and
 class Object
 {
     void print()
     {
 	printf("%.*s\n", toString());
     }

I know they are just "while debugging", but isn't D getting stable real soon ? :-) ("print" is totally not needed, and "printf" really lives in std.c.stdio) Couldn't they at least be wrapped in a debug( ) { } statement, or something ? So that they'll both be stripped out of the release builds, when done debugging deprecated could probably work meanwhile for printf, for the non-debug version ? (object.printf that is, not the final std.c.stdio.printf location of course)
 extern(C)
 {
   debug
   {
     int printf(char *, ...);
   }
   else
   {
     deprecated int printf(char *, ...);
   }
 }

printf can be a good help while debugging/unittesting, but it shouldn't be included in the release builds... It has to go eventually, so better start preparing for it already ? (will be a huge effort to clean all code up later, if it remains...) Thomas started to clean up Phobos: digitalmars.D.bugs/2026 What else is holding off 1.0, besides shared libraries and debugging information (-g) on Linux ? Phobos, still ? (I posted patches to a few of the shortcomings of it, such as for std.format:unittest and std.stdio:writeln) --anders
Feb 11 2005