Module pl.Map
A Map class.
Functions
Map:iter () | return an iterator over all key-value pairs. |
Map:items () | return a List of all key-value pairs, sorted by the keys. |
Map:len () | size of map. |
Map:set (key, val) | put a value into the map. |
Map:get (key) | get a value from the map. |
Functions
- Map:iter ()
- return an iterator over all key-value pairs.
- Map:items ()
- return a List of all key-value pairs, sorted by the keys.
- Map:len ()
- size of map. note: this is a relatively expensive operation!
- Map:set (key, val)
-
put a value into the map.
Parameters:
key
: the keyval
: the value
- Map:get (key)
-
get a value from the map.
Parameters:
key
: the key
Returns:
-
the value, or nil if not found.