Function: rassq
rassq is a function defined in fns.c.
Signature
(rassq KEY ALIST)
Documentation
Return non-nil if KEY is eq to the cdr of an element of ALIST.
The value is actually the first element of ALIST whose cdr is KEY.
Other relevant functions are documented in the list and alist groups.
Probably introduced at or before Emacs version 30.1.
Shortdoc
;; alist
(rassq 'bar '((foo . bar) (zot . baz)))
=> (foo . bar)
;; list
(rassq 'b '((1 . a) (2 . b)))
=> (2 . b)
Source Code
// Defined in /usr/src/emacs/src/fns.c
{
Lisp_Object tail = alist;
FOR_EACH_TAIL (tail)
if (CONSP (XCAR (tail)) && EQ (XCDR (XCAR (tail)), key))
return XCAR (tail);
CHECK_LIST_END (tail, alist);
return Qnil;
}