help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: member returns list


From: Drew Adams
Subject: RE: member returns list
Date: Wed, 2 Sep 2015 15:11:37 -0700 (PDT)

> So then, is there a "member-whatever" that doesn't use
> `equal' but one of the many other functions available
> to compare items? Is there a "member" to which you can
> provide this function yourself?

Not sure what you are asking, but:

1. `memq' is the same as `member', but it compares using `eq'
   instead of `equal'.

2. Common Lisp `member' takes keyword :test, which lets you
   compare using any comparison predicate you like.  The default
   for :test is `eql'.  In Emacs you can get more or less the
   behavior of Common Lisp `meember' using `cl-member'.

   So (member x xs) == (cl-member x xs :test #'equal)
      (memq   x xs) == (cl-member x xs :test #'eq)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]