lua-users home
lua-l archive

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


Alexandr Leykin wrote:
I want to get "is_key(table,key)->boolean" function, but not use full select (using pairs or select operator)

Such a function isn't necessary. One can test the presence
of a key directly:
  if table[key] ~= nil then ...
or:
  if rawget(table,key) ~= nil then ...
(depending on what information is needed).

P.S.
a) (Re)reading the Lua Manual and PiL is strongly recommended.
b) Could you not break threads on this list, or at least put
in the same subject as in the message you're responding to?

--
Shmuel