[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Propsoal: a lua dialect without nil
- From: Pierre Chapuis <catwell@...>
- Date: Tue, 15 Feb 2011 22:58:54 +0100
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
(http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html).
For those interrested, here is a post that compares "nil" values in
different languages:
original in French: http://www.bortzmeyer.org/exprimer-neant.html
Google translation:
http://translate.google.fr/translate?js=n&prev=_t&hl=fr&ie=UTF-8&layout=2&eotf=1&sl=fr&tl=en&u=http%3A%2F%2Fwww.bortzmeyer.org%2Fexprimer-neant.html
--
catwell