lua-users home
lua-l archive

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


> I personally hope that with the introduction of a boolean type, people
> completely stop using nil for anything other than deletion, becauase I
> think the Lua world will be a more sane place for everyone. :)

No I don't think so: I need optional parameters and the following simple
check is compatible with Lua 4.1 e.g.

function foo(string,flag) -- flag is optional
   if flag==nil then flag=true end
-- ...
end

Only the "parameter" nil isn't possible as optional parameters. But from
my point of view, nil stands for "not existing" like "not given" and so
it means exactly the same like a "missing" parameter.

Until Lua 4.1 I will use

true=1
false=0

with some limitations, yes, but its not hard to live with. I like nil
and I need false and true. But I think like others that Lua 4.1 seems to
be correct.


Markus