eliminate writeln et comp?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Mar 17 13:56:14 PDT 2009


Sean Kelly wrote:
> Andrei Alexandrescu wrote:
>> Hey all y'all,
>>
>>
>> Here's another nice bicycle shed discussion. During the recent 
>> discussion about globals being harmful, Walter told me something that 
>> made me think. I said, hey, there are things that are global - look at 
>> stdout. He said, well, that's a bad thing. He then argued that it 
>> would be better and cleaner to write:
>>
>> stdout.writeln("Hello, world");
> 
> But then stdout is still global :-)  However, I do think an "fwritef" 
> routine would be good to have--I tend to write to stderr as often as 
> stdout.

Yah, there is in the elusive new Phobos which I still can't release due 
to compiler bugs:

auto f = File("foo.txt", "w");
f.writef("%s", 42);


Andrei



More information about the Digitalmars-d mailing list