lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On Wed, Jun 10, 2009 at 11:30 PM, David Given <dg@cowlark.com> wrote:

goto is particularly handy for implementing complex state machines;
these particularly tend to be machine generated, so readability isn't a
problem (and adding the logic to decompose the block graph into
traditional call graphs is astonishingly non-trivial and, I believe,
downright impossible in places).


If I remember correctly, Lua optimises tail calls. In my experience, using tail calls for state transitions is way easier to understand and code than using goto's. But YMMV, I guess.

Or is your problem, that you've already got lots of machine generated goto-state machines that you'd like to "translate" to Lua?

Robby