On Saturday, 28 December 2013 at 16:59:51 UTC, bearophile wrote:
void main() {
    import std.stdio, std.string;
    immutable txt = readln.chomp;
    writeln(">", txt, "<");
}


Bye,
bearophile

These examples are cute, but I think in real programs it's usually important to handle `stdin` being exhausted. With `readln`, such code is prone to go into an infinite loop.

Of course in these same real programs, `byLine` is often the better choice anyway...

Reply via email to