lua-users home
lua-l archive

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


2015-08-17 20:21 GMT+02:00 Mason Bogue <scythe+lua@ortsz.com>:

> if i == 2 then
>   goto label
> elseif i == 1 then
>   code()
> label:
>   more_code()
> end
>
> The above pattern can be easily extended to handle an arbitrary number
> of cases. Fallthrough can be nice but it's so rarely useful it's hard
> to justify adding a new language feature to handle it when the "same"
> performance effects (but conditions are now checked in reverse) can be
> achieved thusly with goto.

Have you actually tried that code? I don't think it works
under current Lua.