lua-users home
lua-l archive

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


On Fri, Aug 14, 2015 at 7:48 PM, Andrew Starks <andrew.starks@trms.com> wrote:
> Points + AND - for being clever, though. This is one of the times when
> I *feel* like I'm inefficient in lua:
>
> local the_type = type(foo)
>
> if the_type == 'table' then
>   --- something
> elseif type == 'number' then
> --- blah

I don't see how the given proposal would affect this, though? The
proposal only adds the ability for switch-like fall-throughs, not
switch-like case syntax - you'd still have to do full (x == y)
comparisons in each clause.

-Duncan