From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: seq-some-p and nil Date: Tue, 8 Sep 2015 10:08:41 -0700 (PDT) Message-ID: <3dc0f1d9-caf1-446a-ab14-2b3e210a02e7@default> References: <1441295429.4215.0@smtp.gmail.com> <87si6vl21r.fsf@petton.fr> <878u8k2vnp.fsf@udel.edu> <878u8i69ok.fsf@petton.fr> <674102d7-0e97-478a-af05-ca6d82c17c28@default> <87mvwym01x.fsf@petton.fr> <87h9n5mloa.fsf@petton.fr> <8737ypm547.fsf@petton.fr> <87pp1s976u.fsf@fencepost.gnu.org> 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 1441732172 30912 80.91.229.3 (8 Sep 2015 17:09:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Sep 2015 17:09:32 +0000 (UTC) Cc: Mark Oteiza , Nicolas Petton , emacs-devel@gnu.org To: David Kastrup , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 08 19:09:20 2015 Return-path: Envelope-to: ged-emacs-devel@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 1ZZMOO-0005dg-F5 for ged-emacs-devel@m.gmane.org; Tue, 08 Sep 2015 19:09:12 +0200 Original-Received: from localhost ([::1]:35920 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZMOO-0005F5-3y for ged-emacs-devel@m.gmane.org; Tue, 08 Sep 2015 13:09:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZMO6-0005EJ-Oy for emacs-devel@gnu.org; Tue, 08 Sep 2015 13:08:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZMNy-0000JD-2W for emacs-devel@gnu.org; Tue, 08 Sep 2015 13:08:54 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:19002) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZMNx-0000J4-T1; Tue, 08 Sep 2015 13:08:46 -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 t88H8hpG017121 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 8 Sep 2015 17:08:44 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 t88H8hYV014398 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 8 Sep 2015 17:08:43 GMT Original-Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t88H8g7j022988; Tue, 8 Sep 2015 17:08:42 GMT In-Reply-To: <87pp1s976u.fsf@fencepost.gnu.org> 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: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:189724 Archived-At: > >> To make things easier to understand, I'm taking the example of finding > >> the first odd number in a seq: > > > > I've never needed to do that. >=20 > Marvelous. ;-) Was there something wrong with the suggestion to return, as the non-nil value, a cons (ELEMENT . VALUE)? (Where ELEMENT is the sequence element that satisfies the predicate, and VALUE is the return value of the predicate for that element.) That gives you "some" element that satisfies the predicate (the first such). And it gives you the result of the test. Each of these can be useful, depending on the context.