From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: member returns list Date: Wed, 2 Sep 2015 15:11:37 -0700 (PDT) Message-ID: <2b470271-c248-403b-82d4-9bf4d9dfb26d@default> References: <55E5C99B.3020608@yandex.ru> <87lhcpu2wb.fsf_-_@debian.uxu> <874mjchisl.fsf@web.de> <87pp20jxy7.fsf@debian.uxu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1441231930 25396 80.91.229.3 (2 Sep 2015 22:12:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 2 Sep 2015 22:12:10 +0000 (UTC) To: Emanuel Berg , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 03 00:11:57 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZXGG3-0003Pf-Ve for geh-help-gnu-emacs@m.gmane.org; Thu, 03 Sep 2015 00:11:56 +0200 Original-Received: from localhost ([::1]:41908 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXGG3-0001yI-Ny for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Sep 2015 18:11:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33976) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXGFs-0001y0-TQ for help-gnu-emacs@gnu.org; Wed, 02 Sep 2015 18:11:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXGFp-0003Tm-NN for help-gnu-emacs@gnu.org; Wed, 02 Sep 2015 18:11:44 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:42329) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXGFp-0003TZ-FC for help-gnu-emacs@gnu.org; Wed, 02 Sep 2015 18:11:41 -0400 Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t82MBdLu020584 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 2 Sep 2015 22:11:40 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t82MBc2o021496 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 2 Sep 2015 22:11:39 GMT Original-Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t82MBcn0022491; Wed, 2 Sep 2015 22:11:38 GMT In-Reply-To: <87pp20jxy7.fsf@debian.uxu> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:106997 Archived-At: > 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) =3D=3D (cl-member x xs :test #'equal) (memq x xs) =3D=3D (cl-member x xs :test #'eq)