lua-users home
lua-l archive

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


Roberto Ierusalimschy wrote:
> 
> This was "corrected" in the final version. There is no implicit calls
> from getn to setn anymore. To traverse sparse arrays, however, you still
> need to set its size:
> 

Great!  I'm glad that iterating through a table won't set the size.

I would like to point out to Daniel Silverstone that unless something
else is changing, his code example will continue to function the same
way it does now.  That is, you still need to be careful to use
table.setn if you are mixing table.insert/table.remove calls with direct
assignment to numerical indices.

I have not found this to be a problem in practice as I usually use one
method of access exclusively, depending on what the table is for.  I
was only concerned about the "getn" behavior.

Gordon