From 0fb5a19cb51008207cf11d3ce56fc22bcdf3a014 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 29 Jan 1995 22:04:10 +0000 Subject: [PATCH] (Frassoc): New function. (syms_of_fns): defsubr it. --- src/fns.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/fns.c b/src/fns.c index c17c62020a6..56b3f693d6e 100644 --- a/src/fns.c +++ b/src/fns.c @@ -569,7 +569,7 @@ assq_no_quit (key, list) 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; @@ -606,6 +606,26 @@ The value is actually the element of LIST whose cdr is ELT.") } 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; +} DEFUN ("delq", Fdelq, Sdelq, 2, 2, 0, "Delete by side effect any occurrences of ELT as a member of LIST.\n\ @@ -1464,6 +1484,7 @@ Used by `featurep' and `require', and altered by `provide'."); defsubr (&Sassq); defsubr (&Sassoc); defsubr (&Srassq); + defsubr (&Srassoc); defsubr (&Sdelq); defsubr (&Sdelete); defsubr (&Snreverse); -- 2.39.5