A
/ \ _ Play Now Nemesis on
| | | | _______ _ _ _______ _______ _ _______
| |\ | | | ____| | \ / | | ____| / ____| | | / ____|
/-------/-------------------------------------------------------------------,
O= Home <=XX| About News Pics Adventurers Wizards Download Connect >
\-------\-------------------------------------------------------------------'
| | \ | | |____ | | | | | |____ ___ \ \ | | ___ \ \
| | \_| |_______| |_| |_| |_______| |_______/ |_| |_______/
\ /
V
Documentation Area
Document Path: /doc/LPC/alists
ALISTS
Alists provide a fast and convenient way to access data associatively.
Alists are implemented as arrays of arrays, the first being the array holding
the keys, the others arrays holding associated data.
An empty alist is an array of empty arrays.
Note that the the dimensions of the arrays are used the other way than in lisp
to allow for faster searching.
Keys have to be of type integer, string or object. Types can be mixed.
The search functions return an undefined value when another list is given
in place of a presorted key list.
A list with non-numeric keys retrieved by restore_object has to be
readjusted by using order_alist, especially after reboot.
Deleting an entry can safely be done with exclude_array as long as
all associated data lists are treated like the key array;
index finding for such purposes can be done with assoc.
Typical applications: holding administrary information about wizards,
list of visitors in a pub, list of customers having some sort of
credit, information remembered about items etc.
caveats: a maximum array size of 1000 might prove to be to small.
See also:
This page was generated in LPC
Imprint / Impressum