parrotcode: Lua Table | |
Contents | Language Implementations | Lua |
pmc/luatable.pmc - Lua Table
LuaTable
extends LuaBase
to provide a class with the behaviour of the Lua Table
type.
TRIVIAL IMPLEMENTATION : Table
is just a Parrot Hash
,
like in Lua 4.0.
Now,
Lua 5.0 uses a hybrid data structure with a Hash part and an Array part.
void init()
void morph(INTVAL type)
void mark()
void destroy()
STRING *name()
PMC *clone()
STRING *get_string()
PMC *get_pmc_keyed (PMC *key)
table
accessor. temp = table[key]
temp = <some other value>
temp2 = table[key]
# temp2 is now <some other value> due to the by-reference semantics of PMCs
void set_pmc_keyed (PMC *key, PMC *value)
table
mutator. table[key] = value
value = <some other value>
temp = table[key]
# temp is now <some other value> due to the by-reference semantics of PMCs
INTVAL elements()
INTVAL is_equal (PMC *value)
==
operation. Compares reference (not in depth).INTVAL cmp (PMC *value)
PMC *get_metatable()
PMC *len()
PMC *next(PMC *index)
PMC *rawequal (PMC *value)
PMC *rawget (PMC *key)
void rawset (PMC *key, PMC *value)
void set_metatable(PMC *meta)
Francois Perrad
Klaas-Jan Stol
|