[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Idea. Removing nils from the language.
- From: Dirk Laurie <dirk.laurie@...>
- Date: Fri, 9 Jan 2015 23:17:58 +0200
2015-01-09 22:44 GMT+02:00 Enrique Arizón Benito
> The idea is to remove from the syntax and from the virtual machine. Since
> nil doesn't exists, mathematically it's not possible to have nil errors. nil
> must be replaced, but are replaced with default sensible (from the program
> point of view) values. Looks strange but it's always possible to replace a
> nil with a default value.
> Actually the program is always trying to solve an algorithm and nil, being
> and undefined variable that can not even be read (just compared), will
> not help at all to solve the problem.
It seems appropriate to read `always` as a synonym for `IMHO`.
It's perfectly possible to design a language that has no `nil`.
Python, for example. It has `none` instead :-)
But given that Lua is a dynamically typed language, the concept
of a value that is so nonexistent that it does not even have a type
is a very useful abstraction.