[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Stack
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 14 Jul 2004 13:31:00 -0300
> If I add stuff to a list/queue/stack as done in the Lua book (page
> 94), when I retrieve them does Lua need to traverse a linked list
> internally or are all indices hashed and accessed directly?
All indices in a table are either hashed or directly accessed. (Tables
that "look like" an array has an array to store integer indices.)
> How do negative indices figure into this?
Negative indices are hashed like most other indices.
-- Roberto