It's oh so convenient until it isn't; until you need to make distinctions between missing values and booleans.
I still haven't decided if it's a good idea or not, and I've been hacking Common Lisp for more than 20 years.
I still haven't decided if it's a good idea or not, and I've been hacking Common Lisp for more than 20 years.
We see here also the distinction between sum types and union types: Maybe Maybe a has three variants: None, Some None, and Some Some a; but (T | null) | null collapses to just T | null.
None -> '()
Some None -> '(nil)
Some Some a -> '(a)The nil / null value is an attempt to cheaply produce from type T a type like Maybe T, or Optional<T>, or basically T | nil. It's sort of practical. OTOH making false and nil indistinguishable is much less convenient than one might think, and leads to subtle errors.
They're just minor culture clashes that add up...
So this would be a good example the culture clashes I mentioned, handled badly.