lua-users home
lua-l archive

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

Is the problem (supposing there is one) really the existence of nil or the fact that there are too many use cases for nil?

The main case I see against nil are that:
 1) it can mean different things
 2) it is not a real first-class value

Instead of removing nil, would it not be a better idea to add *more* kinds of "nil" values to differentiate between its uses? I think that's the approch taken by Haskell's Maybe monad (

For those interrested, here is a post that compares "nil" values in different languages:

 original in French:
Google translation: