lua-users home
lua-l archive

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


On Wed, Mar 14, 2018 at 11:55:13AM -0300, Roberto Ierusalimschy wrote:
> > 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'.

That explanation provides more context and explains more about Lua's design
than I've gleaned from years lurking on this list and reading reference
material.[1] I hope it ends up in the book, verbatim, or somewhere equally
prominent and authoritative.

> 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.

Is that a threat? ;)


[1] I'd use the word 'perspicuous' but I just learned it, and 'gleaned' is
probably already unfair to some non-native English readers.