lua-users home
lua-l archive

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

On 14/01/15 16:13, tomas wrote:
And if a
application has some other meaning for nil besides "absence of value",
perhaps something from the application domain, then I think said
application is badly designed. In that sense, in application domain,
nil is not a "perfectly valid return"
In SQL, NULL is that kind of value. And the mapping of NULL to nil is quite natural, although sometimes the programmer have to take care (for instance, not to make a query that could result in NULL at the first column of a valid row).

This is a case of bad design I was thinking of. A NULL from a database query is not a nil in the language, but a singleton (say local DBNULL={}). Tough my thinking on this is more on the arrays-with-holes line (but as Roberto said, they're related).