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: Wed, 9 Sep 2015 06:26:42 -0700 (PDT) Message-ID: <86617ca2-a339-4df0-ba05-7f33c2b2cfd0@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> <3dc0f1d9-caf1-446a-ab14-2b3e210a02e7@default> <87r3m8lop9.fsf@petton.fr> <87y4ggf2km.fsf@petton.fr> 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 1441805251 26431 80.91.229.3 (9 Sep 2015 13:27:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Sep 2015 13:27:31 +0000 (UTC) Cc: Mark Oteiza , emacs-devel@gnu.org To: Nicolas Petton , David Kastrup , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 09 15:27:19 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 1ZZfOu-0002zL-FY for ged-emacs-devel@m.gmane.org; Wed, 09 Sep 2015 15:27:00 +0200 Original-Received: from localhost ([::1]:42669 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZfOu-0002Kz-Q0 for ged-emacs-devel@m.gmane.org; Wed, 09 Sep 2015 09:27:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZfOp-0002Fd-48 for emacs-devel@gnu.org; Wed, 09 Sep 2015 09:26:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZfOj-00005R-WF for emacs-devel@gnu.org; Wed, 09 Sep 2015 09:26:54 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:18054) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZfOj-000053-Ql; Wed, 09 Sep 2015 09:26:49 -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 t89DQkLi021950 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 9 Sep 2015 13:26:47 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t89DQjVR013555 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 9 Sep 2015 13:26:46 GMT Original-Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t89DQhBZ025962; Wed, 9 Sep 2015 13:26:45 GMT In-Reply-To: <87y4ggf2km.fsf@petton.fr> 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: 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:189760 Archived-At: > I meant extra complexity for the user. If seq-some was returning a > value, I wouldn't expect it to be a cons cell, I'd almost always want > the element of the sequence straight away. Well, yes. But what if the user wants the value returned by the function? And what if the element is nil? 1. You need a way to always return non-nil when an element is found. This includes the case where the element is nil - you cannot just return nil as the element. 2. You (I) want to be able to use the the `some' function to either get the element or get the return value of the predicate, which can be an arbitrary function that could return a rich value. Or both: get and use both the element and the value. Conclusion: return both the element and the predicate value, as a non-nil Lisp value. (ELEMENT . VALUE) is one such simple value.