No, that's not laziness per se, that's "lazy IO", something somewhat different.
EDIT: It's not even a lazy IO problem since no lazy IO functions are used there.
EDIT: It's not even a lazy IO problem since no lazy IO functions are used there.
To tell you the true, I can't understand why the code the OP talks about has a problem, and I can't even reproduce the problem (and never saw any of the problems of lazy IO in practice either). But I also can not say the code has no problem, and that is a big issue with the language.
I think there's a significant difference between undefined behavior (hello security flaws!) and the program crashing in a (reasonably) well-defined way.
That's what I get for not reading the code carefully...