[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJIT and Lua 5.2?
- From: Leo Razoumov <slonik.az@...>
- Date: Wed, 1 Feb 2012 07:17:57 -0500
On Wed, Feb 1, 2012 at 06:16, Dirk Laurie <email@example.com> wrote:
> Not so. The scope of the local stops just before the `::a::`, because a
> label is a void statement. The manual is clear on this point, as Xavier Wang
> has pointed out in the thread on "Clarification on goto scope".
IMHO, potentially scope violating jumps like goto should be avoided
like a plague.
We can argue all day long about label placement in 5-lines long code
snippets. In a real world project that choose to allow gotos a
programmer will be navigating a mine field scanning surrounding code
for labels and gotos each time before declaring a new local variable.
Otherwise, hard-to-find bugs will be inevitably introduced. Goto based
state-machines is a niche market. Is it really worth while making
everyone else's life more difficult? Besides, if one really needs a
fast-efficient state machine one can implement it in plain C and bind
it to Lua or LuaJIT (FFI will greatly help).
Francesco is right on point. Where did all the "continue" criticism
disappear? goto has all the continue problems plus more.