Next: , Previous: Predicates, Up: Top

9 Association Lists

Lisp offers the concept of association lists, with primitives such as assoc used to access them. The following functions can be used to manage association lists of EIEIO objects:

— Function: object-assoc key slot list

Return an object if key is equal to SLOT's value of an object in list. list is a list of objects whose slots are searched. Objects in list do not need to have a slot named slot, nor does slot need to be bound. If these errors occur, those objects will be ignored.

— Function: object-assoc-list slot list

Return an association list generated by extracting slot from all objects in list. For each element of list the car is the value of slot, and the cdr is the object it was extracted from. This is useful for generating completion tables.

— Function: eieio-build-class-alist &optional base-class

Returns an alist of all currently defined classes. This alist is suitable for completion lists used by interactive functions to select a class. The optional argument base-class allows the programmer to select only a subset of classes which includes base-class and all its subclasses.