On Tue, Dec 31, 2002 at 03:50:04PM +0100, Niels Möller () @ Pike (-) developers forum wrote:
foreach(Stdio.stdin.line_iterator();; string x) write("%s\n", process_line(x)); must do the right thing.
The iterator you're arguing for simply doesn't do that.
but which one will?
if there is no \n at the very end, you get two options: either the last line will be dropped, which is bad, or your code above will add an extra \n at the end, which is not the right thing either.
greetings, martin.