Using a Dictionary
rex function assoc
lThe built-in function assoc behaves as follows:
lIt has two arguments:
lThe first argument is a member of a domain, say D.
lThe second argument is an association list with domain D.
lThe result is the first pair in the association list in which the first element matches the first argument.
lIf there is no match, [ ] is returned.
([ ] is not a pair, so the meaning is clear.)