Zep, I think I have found a bug but I don't know whether you would agree.
First, here's what happens when I type the "dir" in the console:
Which is what I expected, only this cart is saved. Here's the code entered into the editor to reproduce this bug:
and the result is it prints (on a clear screen) the following:
I suppose the value of x is nil because dir() doesn't return anything. And I suppose the dir contents are printed after because the threading model is weird.