[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJIT and Lua 5.2?
- From: Francesco Abbate <francesco.bbt@...>
- Date: Wed, 1 Feb 2012 13:50:37 +0100
2012/2/1 Dirk Laurie <firstname.lastname@example.org>:
> 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".
It seems to me that this is an ad hoc definitions that goes against
the intuitive, simple logic. Even if it is correct from the formal
point of view yet it does constitute a problem in my point of view
because it is against common understanding.
I'm also wondering what about the repeat/until construct where the
until branch sees all the local declarations inside the body of the
local i = 0
if i % 2 == 0 then goto a end
local j = 10 - i
i = i + 1
until j <= 0
should be considered valid ?
The until statement sees the j variable but when the goto statement is
given the local declaration of j is skipped. Is the code above valid
or not ?
Please note that this was exactly the same reason the prevented the
introduction of the continue statement. I don't understand why this
was a good reason against the reasonable "continue" statement and it
does not hold for the much worst goto statement.