lua-users home
lua-l archive

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

On 20 August 2016 at 16:40, ThePhD <> wrote:
> As another side note, has there ever been consideration for a better "key
> detection" function? For example, lua_gettable returning the `none` type if
> the requested key doesn't exist, but still pushing `nil`, so that people
> could differentiate between the presence of a nil value mapped to a key
> versus a non-existent key?

A "missing" key *is* a value of nil. there is no difference. (unlike
in JS where you can assign `undefined` which is treated differently to
the `delete` operator)