[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Is Lua the next big thing?
- From: Mike Pall <mikelu-0703@...>
- Date: Thu, 15 Mar 2007 13:30:11 +0100
Hi,
Kristofer Karlsson wrote:
> >The simplest way to check if a table is empty is probably this:
> function IsTableEmpty(t) return not next(t) end
> Of course, the negated function is much easier to define:
> function IsTableNotEmpty = next
Recurring discussion #42. That's wrong: false is a valid key.
You have to use next(t) == nil.
Recurring followup discussion #43 and #44: why both false and nil
are logically "false" and why nil is special. Please have a look
at the list archives and save us some bandwidth. Thank you. :-)
Bye,
Mike
- References:
- Re: Is Lua the next big thing?, therandthem
- Re: Is Lua the next big thing?, Johann Hibschman
- RE: Is Lua the next big thing?, Grellier, Thierry
- Re: Is Lua the next big thing?, Brent Fulgham
- Re[2]: Is Lua the next big thing?, Lothar Scholz
- Re: Is Lua the next big thing?, Roberto Ierusalimschy
- Re: Is Lua the next big thing?, Sam Roberts
- Re: Is Lua the next big thing?, Philippe Lhoste
- Re: Is Lua the next big thing?, Kristofer Karlsson