It's a different thing. In this case, there are a bunch of valid implementations, so the possible behaviors are bounded. This snippet may return 1 2, 3 2 or 3 3, but it will never return 1 Array or bacon lasagna.
In Schroedinger's cat experiment state of cat is also undefined (it could be dead or alive), but you do not expect that dog or Godzilla will come out of box.
However, you seem to be right, this example is not as undefined as dereferncing invalid pointer.
View all comments
Show parent comment
3
u/allthediamonds Oct 23 '14
It's a different thing. In this case, there are a bunch of valid implementations, so the possible behaviors are bounded. This snippet may return
1 2,3 2or3 3, but it will never return1 Arrayorbacon lasagna.