DEFUN ("assoc", Fassoc, Sassoc, 2, 2, 0,
"Return non-nil if KEY is `equal' to the car of an element of LIST.\n\
-The value is actually the element of LIST whose car is KEY.")
+The value is actually the element of LIST whose car equals KEY.")
(key, list)
register Lisp_Object key;
Lisp_Object list;
}
return Qnil;
}
+
+DEFUN ("rassoc", Frassoc, Srassoc, 2, 2, 0,
+ "Return non-nil if KEY is `equal' to the cdr of an element of LIST.\n\
+The value is actually the element of LIST whose cdr equals KEY.")
+ (key, list)
+ register Lisp_Object key;
+ Lisp_Object list;
+{
+ register Lisp_Object tail;
+ for (tail = list; !NILP (tail); tail = Fcdr (tail))
+ {
+ register Lisp_Object elt, tem;
+ elt = Fcar (tail);
+ if (!CONSP (elt)) continue;
+ tem = Fequal (Fcdr (elt), key);
+ if (!NILP (tem)) return elt;
+ QUIT;
+ }
+ return Qnil;
+}
\f
DEFUN ("delq", Fdelq, Sdelq, 2, 2, 0,
"Delete by side effect any occurrences of ELT as a member of LIST.\n\
defsubr (&Sassq);
defsubr (&Sassoc);
defsubr (&Srassq);
+ defsubr (&Srassoc);
defsubr (&Sdelq);
defsubr (&Sdelete);
defsubr (&Snreverse);