lua-users home
lua-l archive

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


On Tue, May 10, 2011 at 9:03 AM, Dirk Laurie <dpl@sun.ac.za> wrote:
> In addition, if the language is Lua, try to start a debate on lua-l on
> how the language should be changed to make the feature less hazardous.

Hah, too true!

Avoid nils if you can, which is wise (especially if arrays are involved).

But nils have a way of finding you when you aren't prepared for them!

For example, a simple function sum(...) can be easily confused by
sum(a,b,c) where b happens to be undefined. The worst thing is to
silently calculate the wrong answer - you have to at least check that
select('#',...) is not greater than #{...} to know that you have not
been passed nils.

steve d.