eliminate writeln et comp?
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Tue Mar 17 17:26:16 PDT 2009
Denis Koroskin wrote:
> That's not a very frequent operation. In most cases you should use
> Cout("Hello"); instead. An ideal design solution, imo (fast, short and
> clear).
Interesting. Should I do the same in phobos?
stdout("wyda");
I'd like that particularly because write() is too common a name to place
at namespace level for my taste. So then we'd have:
stdout("wyda"); // no newline
stdout("wyda\n"); // newline but no flushing on binary stream
stdout("wyda", newline); // write'n'flush
stdout.writeln("wyda"); // same
If we go that route I'll even drop writeln and rely on passing newline.
For formatting there'd be stdout.format and stdout.formatln or something.
> Back on topic, in most cases I use:
>
> debug writefln("hello");
>
> because I have no console in release version (and it throws when there
> is no stdout, look in the bugzilla for a bug report). It is already long
> enough, so I wouldn't like it to be even longer:
>
> debug stdio.writefln("hello");
>
> My 0.02 rubles.
>
Got them.
Andrei
More information about the Digitalmars-d
mailing list