lua-users home
lua-l archive

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


2012/12/4 spir <denis.spir@gmail.com>:


> PS: The more I think at it, the more imposes itself the idea
> we need 2 nils: one "nullnil" for required data, meaning a real
> error, "too bad, missing, try again another day"; one "nonenil"
> for optional data, thus just meaning "not there!".

The distinction between "none" and "nil" is available in the C API, with
explicit equivalence only on request (lua_isnil, lua_isnone, lua_isnoneornil).
In Lua itself, the idiom for customized missing data is a dedicated
identifier, e.g.

    none = {}

Do you have an application in mind where you are in Lua all the time
and where the "none" idiom would not be sufficient?