Is there a way to sort an association list? In my case I would like to sort the alist elements by the values in each list element (represented by the integers in the example below).
Example:
(setq my-alist '((red . 2) (blue . 1) (yellow . 8) )) ; make an alist
(sort my-alist '<) ; does not work
assq
and friends is the first matching element, and therefore changing the order of the list can (potentially, depending on the alist) change the value obtained.