I\'ve often wondered why languages with a null
representing \"no value\" don\'t differentiate between the passive \"I don\'t know what the value is\"
Given how long it took Western philosophy to figure out how it was possible to talk about the concept of "nothing"... Yeah, I'm not too surprised the distinction got overlooked for a while.
Existence of value:
vars().has_key('variableName')
isset(variable)
typeof(variable) != 'undefined'
(variable != undef)
or if you wish: (defined variable)
Of course, when variable is undefined, it's not NULL
You can always create an object and assign it to same static field to get a 2nd null.
For example, this is used in collections that allow elements to be null. Internally they use a private static final Object UNSET = new Object
which is used as unset value and thus allows you to store null
s in the collection. (As I recall, Java's collection framework calls this object TOMBSTONE instead of UNSET. Or was this Smalltalk's collection framework?)