DMD 1.005 release

Chris Nicholson-Sauls ibisbasenji at gmail.com
Tue Feb 6 21:56:36 PST 2007


Jarrett Billingsley wrote:
> "Jari-Matti Mäkelä" <jmjmak at utu.fi.invalid> wrote in message 
> news:eqaban$2l90$1 at digitaldaemon.com...
>> BCS kirjoitti:
>>> Without the gratuitous stuff that has to be the cleanest quine outside
>>> of bash (in bash an empty file prints nothing)
>>>
>>> import std.stdio;
>>> void main(){writef(import(__FILE__));}
>> And if the strings don't mess up with printf, it can be made even shorter:
>>
>> void main(){printf(import(__FILE__));}
> 
> "writef".length == "printf".length 
> 
> 

But the "printf" version is -= "import std.stdio;".length + 1;

That said, for examplar|demonstrative D code I'd just assume avoid printf regardless.  It 
just isn't "the D way."  Personal preferance, though, would be:

import tango.io.Stdout;
void main(){Stdout(import(__FILE__));}

-- Chris Nicholson-Sauls



More information about the Digitalmars-d-announce mailing list