lua-users home
lua-l archive

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

In Lua programs, I often see code like the following:

  if host.devices and host.devices.bridge and host.devices.bridge.friendlyName then

In Php, I have seen this:

  if (isset($host['devices']['bridge']['friendlyName']))

In Python, I have seen this:

    if host['devices']['bridge']['friendlyName']:
  except KeyError:

Are there other ways in Lua to check for a key existence ?