This is caused, in part, by repeated references inside Codea to the undefined global collide, as reported back in March. I think there are others that I haven’t found yet.
It would be nice to be able to run elements of strict Lua like this one. Probably not a high priority.
I like the idea of locking globals! I’ll give it a try and see where we should be checking in the runtime for the existence of something before using it
setting collide (global) to false has stopped most of my crashes, though i did see one.
I’m going to try putting all my highly visible objects into a single global for the application. That does cost another table access, but I think it’s safer, and one can almost always cache the value locally or pass as a param if it’s accessed all that much.
I used a simple global checker from lua.org. I haven’t tried anything fancy. There’s even a way to do it that allows you to define a global nil and have it not look like a fresh access next time around.
Unrelated to that but to another thing. I think you mentioned losing work in a tab that was in Working Copy. I’ve seen something like that, but not quite. What I saw was roughly this:
Create and work on a project for a while
Decide to put it in Working Copy;
Create Repo in WC;
Link it to the project in that weird way WC has for Codea;
Commit it;
Work some more
After a while, it seemed like new stuff wasn’t even showing up in the tests.
When I looked at the code in the tab it was there, when I ran the tests Codea wasn’t seeing it. I even tried the Save Project and Run, and it wasn’t there.
Exited the project and came back: The tab didn’t have any of my new code.
Pasted the code back from the article I was writing (yay, spare backup) and the tests began to see the new code. Working Copy saw the new code for a commit.
Unfortunately I didn’t check WC before I exited or came back to see what it saw.
I’m not sure whether WC has done something or Codea. If it was WC it’s almost be like an automatic revert. That’s almost inconceivable, so I suspect it was Codea but the hookup between the two could be confusing Codea.
I think what I’ll try to do when I create new Working Copy repos is to be exited from the project in Codea, to be sure everything is flushed for WC to look up.
So … no answer, but I’ve seen something like you saw. I’ll look for your report and underline it.