Why is the identifier "printf" known by the frontend?

Anders F Björklund afb at algonet.se
Fri Oct 27 07:21:14 PDT 2006


Walter Bright wrote:

>> What is the reason for that? "import std.stdio" is not a real
>> difficult thing to type.
> 
> Because I find it verrryy handy in writing minimal test cases. writefln, 
> in order to work, requires much of D and Phobos to be working properly. 
> printf, being part of the C library, doesn't require any of Phobos and 
> very little of D to work, so it's handy when things are broken.

But the "import std.c.stdio;" isn't so very hard to type either ?

It's not so much about the usage of good ole printf, as it is about
the placement of printf in the "object.d" file. But you knew that...

--anders



More information about the Digitalmars-d mailing list