diff options
| author | Richard M. Stallman | 1995-01-29 22:04:10 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-01-29 22:04:10 +0000 |
| commit | 0fb5a19cb51008207cf11d3ce56fc22bcdf3a014 (patch) | |
| tree | 055adb8cd9c8675a5112fa946bc419a621beb66d /src/fns.c | |
| parent | c6f5b077fe35302ee05d3273d61f78745b2a8881 (diff) | |
| download | emacs-0fb5a19cb51008207cf11d3ce56fc22bcdf3a014.tar.gz emacs-0fb5a19cb51008207cf11d3ce56fc22bcdf3a014.zip | |
(Frassoc): New function.
(syms_of_fns): defsubr it.
Diffstat (limited to 'src/fns.c')
| -rw-r--r-- | src/fns.c | 23 |
1 files changed, 22 insertions, 1 deletions
| @@ -569,7 +569,7 @@ assq_no_quit (key, list) | |||
| 569 | 569 | ||
| 570 | DEFUN ("assoc", Fassoc, Sassoc, 2, 2, 0, | 570 | DEFUN ("assoc", Fassoc, Sassoc, 2, 2, 0, |
| 571 | "Return non-nil if KEY is `equal' to the car of an element of LIST.\n\ | 571 | "Return non-nil if KEY is `equal' to the car of an element of LIST.\n\ |
| 572 | The value is actually the element of LIST whose car is KEY.") | 572 | The value is actually the element of LIST whose car equals KEY.") |
| 573 | (key, list) | 573 | (key, list) |
| 574 | register Lisp_Object key; | 574 | register Lisp_Object key; |
| 575 | Lisp_Object list; | 575 | Lisp_Object list; |
| @@ -606,6 +606,26 @@ The value is actually the element of LIST whose cdr is ELT.") | |||
| 606 | } | 606 | } |
| 607 | return Qnil; | 607 | return Qnil; |
| 608 | } | 608 | } |
| 609 | |||
| 610 | DEFUN ("rassoc", Frassoc, Srassoc, 2, 2, 0, | ||
| 611 | "Return non-nil if KEY is `equal' to the cdr of an element of LIST.\n\ | ||
| 612 | The value is actually the element of LIST whose cdr equals KEY.") | ||
| 613 | (key, list) | ||
| 614 | register Lisp_Object key; | ||
| 615 | Lisp_Object list; | ||
| 616 | { | ||
| 617 | register Lisp_Object tail; | ||
| 618 | for (tail = list; !NILP (tail); tail = Fcdr (tail)) | ||
| 619 | { | ||
| 620 | register Lisp_Object elt, tem; | ||
| 621 | elt = Fcar (tail); | ||
| 622 | if (!CONSP (elt)) continue; | ||
| 623 | tem = Fequal (Fcdr (elt), key); | ||
| 624 | if (!NILP (tem)) return elt; | ||
| 625 | QUIT; | ||
| 626 | } | ||
| 627 | return Qnil; | ||
| 628 | } | ||
| 609 | 629 | ||
| 610 | DEFUN ("delq", Fdelq, Sdelq, 2, 2, 0, | 630 | DEFUN ("delq", Fdelq, Sdelq, 2, 2, 0, |
| 611 | "Delete by side effect any occurrences of ELT as a member of LIST.\n\ | 631 | "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'."); | |||
| 1464 | defsubr (&Sassq); | 1484 | defsubr (&Sassq); |
| 1465 | defsubr (&Sassoc); | 1485 | defsubr (&Sassoc); |
| 1466 | defsubr (&Srassq); | 1486 | defsubr (&Srassq); |
| 1487 | defsubr (&Srassoc); | ||
| 1467 | defsubr (&Sdelq); | 1488 | defsubr (&Sdelq); |
| 1468 | defsubr (&Sdelete); | 1489 | defsubr (&Sdelete); |
| 1469 | defsubr (&Snreverse); | 1490 | defsubr (&Snreverse); |