lua-users home
lua-l archive

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

On Fri, Jan 9, 2015 at 12:08 PM, Enrique Arizón Benito
<> wrote:
> For a lot of years I've been interested in a language that fix "the biggest
> bug in History", the invention of null (nil) references

I think this critique only applies to type systems where NULL is a
special value of each type, and in C-like languages using as a pointer
(or reference) can crash the whole program.  calling a design flaw "a
bug" is just sensationalism.

In Lua (and several other dynamic type languages) nil is a separate,
single valued type, you don't have "NULL pointers", not even "NULL
tables" or "NULL numbers"  just that as usual you can get values of
any type at any point.  Not having nil wouldn't avoid you to get a
number when you'd like a table, or viceversa.  you'd still have to
check for boundary cases.