Commit 008ef0ef authored by Kim F. Storm's avatar Kim F. Storm
Browse files

(Fmemq): Refill doc string.

(Fmemql): New defun, like memq but using eql.
(syms_of_fns): Defsubr it.
parent 0aad54a5
...@@ -1464,11 +1464,10 @@ The value is actually the tail of LIST whose car is ELT. */) ...@@ -1464,11 +1464,10 @@ The value is actually the tail of LIST whose car is ELT. */)
} }
DEFUN ("memq", Fmemq, Smemq, 2, 2, 0, DEFUN ("memq", Fmemq, Smemq, 2, 2, 0,
doc: /* Return non-nil if ELT is an element of LIST. doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eq'.
Comparison done with `eq'. The value is actually the tail of LIST The value is actually the tail of LIST whose car is ELT. */)
whose car is ELT. */)
(elt, list) (elt, list)
Lisp_Object elt, list; register Lisp_Object elt, list;
{ {
while (1) while (1)
{ {
...@@ -1491,6 +1490,30 @@ whose car is ELT. */) ...@@ -1491,6 +1490,30 @@ whose car is ELT. */)
return list; return list;
} }
DEFUN ("memql", Fmemql, Smemql, 2, 2, 0,
doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eql'.
The value is actually the tail of LIST whose car is ELT. */)
(elt, list)
register Lisp_Object elt;
Lisp_Object list;
{
register Lisp_Object tail;
if (!FLOATP (elt))
return Fmemq (elt, list);
for (tail = list; !NILP (tail); tail = XCDR (tail))
{
register Lisp_Object tem;
CHECK_LIST_CONS (tail, list);
tem = XCAR (tail);
if (FLOATP (tem) && internal_equal (elt, tem, 0, 0))
return tail;
QUIT;
}
return Qnil;
}
DEFUN ("assq", Fassq, Sassq, 2, 2, 0, DEFUN ("assq", Fassq, Sassq, 2, 2, 0,
doc: /* Return non-nil if KEY is `eq' to the car of an element of LIST. doc: /* Return non-nil if KEY is `eq' to the car of an element of LIST.
The value is actually the first element of LIST whose car is KEY. The 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,6 +5856,7 @@ used if both `use-dialog-box' and this variable are non-nil. */);
defsubr (&Selt); defsubr (&Selt);
defsubr (&Smember); defsubr (&Smember);
defsubr (&Smemq); defsubr (&Smemq);
defsubr (&Smemql);
defsubr (&Sassq); defsubr (&Sassq);
defsubr (&Sassoc); defsubr (&Sassoc);
defsubr (&Srassq); defsubr (&Srassq);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment