aboutsummaryrefslogtreecommitdiffstats
path: root/src/fns.c
diff options
context:
space:
mode:
authorKim F. Storm2006-09-20 23:07:17 +0000
committerKim F. Storm2006-09-20 23:07:17 +0000
commit008ef0efaab24b4d02cb2dfeb82cd050e08a21f3 (patch)
tree486161b4c7e263d4e07fd508a0301785cd483c04 /src/fns.c
parent0aad54a5a0a89c07ed00ab7d4bb8da93705aea7f (diff)
downloademacs-008ef0efaab24b4d02cb2dfeb82cd050e08a21f3.tar.gz
emacs-008ef0efaab24b4d02cb2dfeb82cd050e08a21f3.zip
(Fmemq): Refill doc string.
(Fmemql): New defun, like memq but using eql. (syms_of_fns): Defsubr it.
Diffstat (limited to 'src/fns.c')
-rw-r--r--src/fns.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/fns.c b/src/fns.c
index f9f4b72529e..e769f40cc88 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1464,11 +1464,10 @@ The value is actually the tail of LIST whose car is ELT. */)
1464} 1464}
1465 1465
1466DEFUN ("memq", Fmemq, Smemq, 2, 2, 0, 1466DEFUN ("memq", Fmemq, Smemq, 2, 2, 0,
1467 doc: /* Return non-nil if ELT is an element of LIST. 1467doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eq'.
1468Comparison done with `eq'. The value is actually the tail of LIST 1468The value is actually the tail of LIST whose car is ELT. */)
1469whose car is ELT. */)
1470 (elt, list) 1469 (elt, list)
1471 Lisp_Object elt, list; 1470 register Lisp_Object elt, list;
1472{ 1471{
1473 while (1) 1472 while (1)
1474 { 1473 {
@@ -1491,6 +1490,30 @@ whose car is ELT. */)
1491 return list; 1490 return list;
1492} 1491}
1493 1492
1493DEFUN ("memql", Fmemql, Smemql, 2, 2, 0,
1494doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eql'.
1495The value is actually the tail of LIST whose car is ELT. */)
1496 (elt, list)
1497 register Lisp_Object elt;
1498 Lisp_Object list;
1499{
1500 register Lisp_Object tail;
1501
1502 if (!FLOATP (elt))
1503 return Fmemq (elt, list);
1504
1505 for (tail = list; !NILP (tail); tail = XCDR (tail))
1506 {
1507 register Lisp_Object tem;
1508 CHECK_LIST_CONS (tail, list);
1509 tem = XCAR (tail);
1510 if (FLOATP (tem) && internal_equal (elt, tem, 0, 0))
1511 return tail;
1512 QUIT;
1513 }
1514 return Qnil;
1515}
1516
1494DEFUN ("assq", Fassq, Sassq, 2, 2, 0, 1517DEFUN ("assq", Fassq, Sassq, 2, 2, 0,
1495 doc: /* Return non-nil if KEY is `eq' to the car of an element of LIST. 1518 doc: /* Return non-nil if KEY is `eq' to the car of an element of LIST.
1496The value is actually the first element of LIST whose car is KEY. 1519The value is actually the first element of LIST whose car is KEY.
@@ -5833,6 +5856,7 @@ used if both `use-dialog-box' and this variable are non-nil. */);
5833 defsubr (&Selt); 5856 defsubr (&Selt);
5834 defsubr (&Smember); 5857 defsubr (&Smember);
5835 defsubr (&Smemq); 5858 defsubr (&Smemq);
5859 defsubr (&Smemql);
5836 defsubr (&Sassq); 5860 defsubr (&Sassq);
5837 defsubr (&Sassoc); 5861 defsubr (&Sassoc);
5838 defsubr (&Srassq); 5862 defsubr (&Srassq);