lua-users home
lua-l archive

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


Snapshots. Now I see use to the static random* response.

-----Mensagem original-----
De: [email protected]
[mailto:[email protected]] Em nome de Philippe Lhoste
Enviada em: quinta-feira, 5 de julho de 2007 11:15
Para: [email protected]
Assunto: Re: Table boundaries

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



__________ NOD32 2379 (20070704) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com