@starblue yes, I did see that. The instruction limit solution should prevent this behaviour in Air Code, too. (We can re-enable an instruction limit as default behaviour but I don’t like that.)
There is no way to interrupt your program during an infinite loop because it runs on the main thread. While it would be possible to run the Lua interpreter in a different thread and queue all drawing commands on the main thread, I am unsure of how that would effect performance (it would also be a big rewrite).
If you suspect you might inadvertently construct an infinite loop I suggest using setInstructionLimit to prevent it from locking up interaction. You can then remove it when you are confident in your code.
@Simeon, no, I don’t want an execution limit. (My current project is a program to do data collection over a period of hours–I don’t want it to die at hour 7 and lose everything.) I’m just saying that a switch to set live-ness on/off may be useful to have in AirCode after all.
Incidentally, although this thread may seem to indicate otherwise, I think AirCode is the best thing to happen for development in Codea since Zagg Bluetooth keyboards. It’s a bit rough around the edges currently (I’ve been keeping a list of things that could be made smoother) but I use it almost exclusively now and only revert back to the code editor for things you just can’t do in AirCode yet (like tab management). It’s a great idea you had there (apart from Codea itself, of course)!
@starblue I am not suggesting the instruction limit for your actual release code, just for while you are working / debugging so you don’t stumble into an infinite loop — if you are expecting that to be a problem. (The instruction limit should also be reset each draw call, so it shouldn’t matter how long your program runs so long as you don’t perform a massive series of operations in a single draw call.)
I have similar problem with Air Code, it is a bit annoying. I can’t “trust” interface because it is invisible for user what it behind user don’t see feedback. Another unintuitive thing that when I switch between tabs it is not always that I completed my changes, often it is impossible to have working state of your code between changes. For example during refactoring, when you are moving code from one tab to another. You cut code and then switch between tabs and see that Codea rollback your changes.
iPad interface isn’t best, Air Code supposed to help here, but in current state AC doesn’t fix that. I very like Codea, and very thankful for this great product, but this part just doesn’t work.
@Simeon please, do NOT re-introduce instructionlimit by default. None of my project would work and i would have to add instructionlimit(0) in all of them. I dont have any problems due to the current settings.