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 (was: Re: To `boundp' or not to `boundp'?) Date: Tue, 1 Sep 2015 17:10:56 -0700 (PDT) Message-ID: <3c9412c3-3fff-446c-9e55-e8169b6a913d@default> References: <55E5C99B.3020608@yandex.ru> <87lhcpu2wb.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 1441152695 19550 80.91.229.3 (2 Sep 2015 00:11:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 2 Sep 2015 00:11:35 +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 Wed Sep 02 02:11:21 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 1ZWve5-0001T1-8k for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Sep 2015 02:11:21 +0200 Original-Received: from localhost ([::1]:59673 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWve5-0000CM-Lt for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Sep 2015 20:11:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46741) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWvdp-000094-LU for help-gnu-emacs@gnu.org; Tue, 01 Sep 2015 20:11:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWvdm-00037f-EM for help-gnu-emacs@gnu.org; Tue, 01 Sep 2015 20:11:05 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:51189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWvdl-00037T-Vd for help-gnu-emacs@gnu.org; Tue, 01 Sep 2015 20:11:02 -0400 Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t820B0qk000644 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 2 Sep 2015 00:11:01 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 t820Awn6009266 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 2 Sep 2015 00:10:59 GMT Original-Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t820Awob000782; Wed, 2 Sep 2015 00:10:58 GMT In-Reply-To: <87lhcpu2wb.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: 141.146.126.69 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:106972 Archived-At: > Yes, and I have wondered about that. Is it useful, > perhaps with the use of `car' (?) as in: > (car (member 2 '(1 2 3))) ; 2 > (car (member 0 '(1 2 3))) ; nil Yes, extremely useful. > Or is it some "leftover optimization" thing where > `cdr' is faster than returning `t', and can be used > the same way? Or is it something else? No and no. It's an access function, like `assoc' or `elt'. If no such member can be found then it returns nil, which means that it can also function as a simple membership test.