lua-users home
lua-l archive

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


> My reaction was: What would you call this new language?

I think "Lua" would be a great name :-)

Every year or so the list has its recurrent discussion about the length
operator and holes in sequences. Quite often, this discussion leads some
people to propose that Lua needs an array type, different from tables.

My current view is quite the opposite. The implementation of arrays on
top of tables is not the source of the problem with holes. The tendency
to view them as a different type is what blinds us to the real problem,
which is that tables cannot have nils. Tables also have problems with
holes, but they are less annoying, and so we think about it as a problem
with arrays.

Many years ago, we added booleans to the language exactly because we
could not store nil in tables. 'false' is just a 'nil' that we can store
in tables. ('true' is useless in Lua.) If tables could store nils, the
language would not need 'false'.

We will not make this change now, because of compatibility. But, the
next time the list gets its annual discussion about length, it would
be good to recall this proposal.

-- Roberto