lua-users home
lua-l archive

Re: Stack

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


> 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

AltStyle によって変換されたページ (->オリジナル) /