Closed Arkoniak closed 10 years ago
You're using the library correctly, but tail recursion is not support by lua-state-machine. The reason I don't support tail recursion is due to the calling location for callbacks. The 'onroomN' callbacks are called in this location, which is not an actual return statement.
As support for tail recursion would require a signification rewrite, I won't be able to fix this problem. Sorry!
According to http://www.lua.org/pil/6.3.html lua supports tail calls, and the following example really gives infinite loop
Yet, direct implementation of this code using lua-state-machine yields stack overflow
Well, may be I am not using it properly...