in reply to Re: Without trying; what do you think this would print?
in thread Without trying; what do you think this would print?

While it might be “inconsistent behavior,” it is also, clearly, “unpredictable code” that is dependent upon (and thus, vulnerable to) language implementation quirks.   If it matters what the language is to do, “when, and in what order,” then you are obliged to say so.   Otherwise, the optimizer can, and will, make sometimes-arbitrary decisions.   (“Heads, or tails?   If it doesn’t seem to matter, then I (the optimizer...) get to choose, and by the way, to do my job I must do so.”)   And when that happens, “whose fault is it, really?”   You knew ... you were warned.   Code like that is curious, maybe, but it’s also intrinsically defective.   It’s fun to play “Perl golf,” but don’t make your daily bread that way.

(And although that statement as-writ might sound like some kind of weighty pronouncement ... I’m really in a very pleasant mood, with good music playing and good coffee in my hand.   It’s just an observation.)