Re: orif
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: orif
- From: Dirk Laurie <dirk.laurie@...>
- Date: 2015年8月17日 21:18:04 +0200
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.