A list whose members are the remainder of the association list starting at the element whose car is eq or equal to the s_exp.
An association list is a list whose elements are also lists, each of which typically contains exactly two elements. assoc searches an association list for a sublist whose car is eq to the given s_exp. assoc_equal uses equal instead of eq for the comparison. If no matching sublist is found, returns nil.
A symbol-indexed association list (or sym-alist) is an association list where the car of each element is a symbol. This is a common construct for implementing property lists and lookup tables. Since symbols are always unique, sym-alists can be searched with assoc instead of assoc_equal.
Gamma> a = 10;
10
Gamma> b = 20;
20
Gamma> c = 30;
30
Gamma> x = list (list(a,15), list(b,25), list(c, 35));
((10 15) (20 25) (30 35))
Gamma> assoc (b,x);
((20 25) (30 35))
Gamma> assoc (20,x);
nil
Gamma> assoc_equal(20,x);
((20 25) (30 35))
Gamma>
See the Handling Terminated Processes section of Common Functions for Any Program chapter in the Cogent Tools Demo and Tutorials book for an example of assoc_equal used in context.