lua-users home
lua-l archive

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


On Sat, 28 Jul 2007, Gavin Wraith wrote:
>
> There is a long history of confusion, even in the purely theoretical
> considerations of the semantics of type theories, about bottom
> elements denoting undefined data, exceptions etc. The difficulty seems
> to be that nil is being stretched to rather a lot of uses.

It's worth comparing Lua with Javascript in this area. JS has both
undefined (which is similar to Lua's nil since it is the vaue used for
unset variables and elements) and null (which is like null in Java: it
only applies to objects not native types - typeof(null) == "object"). This
was somewhat confusing to me when I first learned JS, since I was
expecting something more like Lua's semantics. (I learned Lua after JS and
I think it's cleaner in almost every way.)

Tony.
-- 
f.a.n.finch  <dot@dotat.at>  http://dotat.at/
IRISH SEA: SOUTHERLY, BACKING NORTHEASTERLY FOR A TIME, 3 OR 4. SLIGHT OR
MODERATE. SHOWERS. MODERATE OR GOOD, OCCASIONALLY POOR.