lua-users home
lua-l archive

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


On 12/11/2010 06:40 PM, Florian Weimer wrote:
* Richard Hundt:

On 12/11/2010 03:51 PM, Florian Weimer wrote:
* Richard Hundt:

My point is that, although there is a way of creating a sparse table
which works in a numeric for loop which (i.e. the # operator respects
the number of elements the table was constructed with barring trailing
nil's),

This is simply not true, it's an artifact of some Lua implementation,
in some cases.


This is Lua 5.2 for which there is a canonical implementation nearing
release readiness. Surely conscious effort went into supporting the
new table semantics?

I don't think there was a change in 5.2 in this particular area.


Okay, so that brings us to the crux. The question is whether sparse tables are an implementation Artifact or a Feature.

If it were a Feature then I'd argue for a programmatic way of creating a sparse table (without a metatable), but it seems that it's generally considered an Artifact. Perhaps the Lua authors could clarify this?

Thanks for humoring this discussion so far.