From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: member returns list (was: Re: To `boundp' or not to `boundp'?) Date: Wed, 02 Sep 2015 18:56:45 -0400 Organization: A noiseless patient Spider Message-ID: References: <55E5C99B.3020608@yandex.ru> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1441234826 4093 80.91.229.3 (2 Sep 2015 23:00:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 2 Sep 2015 23:00:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 03 01:00:20 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 1ZXH0t-00061a-Ns for geh-help-gnu-emacs@m.gmane.org; Thu, 03 Sep 2015 01:00:19 +0200 Original-Received: from localhost ([::1]:42206 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXH0t-0000jj-Fx for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Sep 2015 19:00:19 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!barmar.motzarella.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 46 Injection-Info: barmar.motzarella.org; posting-host="2be9e9f5dd9af768b8861af71b85fc28"; logging-data="13136"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Oqit53J5wSPX+Ouwx6Npw" User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Cancel-Lock: sha1:mSlnPuCMsj+/ekMnhiDccgbDr2k= Original-Xref: usenet.stanford.edu gnu.emacs.help:214716 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:107000 Archived-At: In article , Emanuel Berg wrote: > Barry Margolin writes: > > > It could be useful for something like > > > > (length (member item list)) > > > > Or it could be used in a loop, where you repeat the > > operation with the list that it returned. > > Yes, I understand it can be used in many situations. > The sky is the limit. What I thought, I thought it was > either an "inverted optimization" (i.e., the > optimization is not to make it intuitive but leave it > as it is which is faster and works the same) *or* if > there was one (1), or but a few cases where it is very > useful, simple combinations like the 1-2 of boxing or > one-timer in ice hockey, that would be interesting > to see. > > We can compare it to something else and you will > understand immediately what I mean: `or' is > intuitively a boolean, but in practice it is a boolean > AND the item which was first found to be true, > returned. I.e., it is just like `member' in that > sense. However, with `or' if anyone asked the question > I asked about `member', I would answer without > blinking, because then you can do > > (or title "The boring standard title that should never appear") > > The examples provided hasn't been as straightforward > as that, at least not to me, but it is OK. They don't > have to be. The basic idea of all these things is that if a function can easily return something more detailed and potentially useful than just true/false, it might as well do so. There's no downside, and potential upside. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***