[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Idea. Removing nils from the language.
- From: Timothy Baldridge <tbaldridge@...>
- Date: Mon, 12 Jan 2015 14:27:58 -0700
Except it's not even about correct code. Depending on the implementation of a language its not unreasonable to attach methods to the nill type. This would make sense for something like string conversion:
nil.toString() == "nil"
Languages like Clojure also allow for this by simply extending most protocols to accept nils. So calling (count nil) returns 0. If you embrace nils, they stop becoming a hazard and start becoming just another value that has some methods and doesn't have others.
The whole deal about NULL being a "billion dollar mistake" is really completely bogus in a well designed dynamic language.
Timothy