[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Table boundaries
- From: Philippe Lhoste <PhiLho@...>
- Date: Thu, 05 Jul 2007 16:14:35 +0200
On 05/07/2007 15:29, Luís Santos wrote:
Isn´t it confusing?
Confusing, perhaps, but it still have some logic...
This allows to manage hollow tables (few values scattered in a big range
of indexes) efficiently, while managing full tables (almost all indexes
having a value) efficiently too (numerical indexes instead of hashed ones).
I believe that Lua is able to smartly switch from the first type to the
second, which is a good thing.
You can still pre-fill your array with 0s if you want your table to act
like a classical array in most other languages.
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --