lua-users home
lua-l archive

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


Mark Hamburg <mark@grubmah.com> dixit:

> There are times when I miss JavaScript's distinction between nil and undefined. 

Same for me. In // worlds ;-) there are loads of discussions about semantic overloading of null/nil/none, which cause difficult to understand/debug issues.
I long for a "non-settable" (*) value meaning undefined, and only that, that can safely be used with a semantics similar to #ifdef.

Denis

(*)
x = undef    --> error
return undef --> error
so we cannot charge "undef" with undue semantic meaning (eg "special case", "not found", "exception", "to-be-provided-later"). These are roles for "nil", or better for user-defined or builtin flag values.
________________________________

la vita e estrany

http://spir.wikidot.com/