From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Petton Newsgroups: gmane.emacs.devel Subject: Re: seq-some-p and nil Date: Tue, 08 Sep 2015 09:09:57 +0200 Message-ID: <87h9n5mloa.fsf@petton.fr> 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1441696238 16438 80.91.229.3 (8 Sep 2015 07:10:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Sep 2015 07:10:38 +0000 (UTC) Cc: Mark Oteiza , Drew Adams , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 08 09:10:28 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 1ZZD2r-0004za-AQ for ged-emacs-devel@m.gmane.org; Tue, 08 Sep 2015 09:10:21 +0200 Original-Received: from localhost ([::1]:60374 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZD2p-0000yj-W6 for ged-emacs-devel@m.gmane.org; Tue, 08 Sep 2015 03:10:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZD2a-0000ty-7x for emacs-devel@gnu.org; Tue, 08 Sep 2015 03:10:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZD2X-0001GH-2U for emacs-devel@gnu.org; Tue, 08 Sep 2015 03:10:04 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:41842) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZD2W-0001F5-Uu for emacs-devel@gnu.org; Tue, 08 Sep 2015 03:10:01 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 56A1D20B3B for ; Tue, 8 Sep 2015 03:09:59 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Tue, 08 Sep 2015 03:09:59 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=rvARCslFpB8FHANvYIrIoL1Jb0o=; b=CKm3z kyNTPX3sCZY9ZqdssYOW5OTmsmzgo/rcpo6B9sZCikiSki1izQCyBcbXZn0jrTaO umRUZ3H5YLwKpuXdAlLWttQqb8bvqllnJ0QAnZyCF3txoIuDL+7ke99rMkRmn9w6 AEZ5dQ1FhohMiHOQRtOP3BX2GoHX1htkOf7ug8= X-Sasl-enc: bOIlWoHIBYV7IylnsHV+bYo83kaWiHTUdKnn48m07plk 1441696198 Original-Received: from blueberry (89-156-196-194.rev.numericable.fr [89.156.196.194]) by mail.messagingengine.com (Postfix) with ESMTPA id 92B21C00294; Tue, 8 Sep 2015 03:09:58 -0400 (EDT) In-Reply-To: User-Agent: Notmuch/0.19 (http://notmuchmail.org) Emacs/25.0.50.4 (x86_64-unknown-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.28 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:189699 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Stefan Monnier writes: >>> Returning what FUN returned seems like a better choice. >>> If you need the element matched, then you can simply arrange for FUN >>> to return the element. >> There is a misunderstanding here I think. >> The way I see it, they are two different functions: the (new) seq-some, >> and this other function that is now missing in seq, with the new >> implementation of `seq-some'. > > I don't think so. Both functions can be one and the same. > If you really want seq-find, you can define it as > > (defun seq-find (pred seq) > (seq-some (lambda (x) (and (funcall pred x) x)) seq)) > > But I'm far from convinced it's worth having them both, Can you elaborate on why you think it's not worth it? IMO, finding an element in a sequence is a very common operation, and to do that now with `seq-some' one would have to add extra code to the lambda each time, which I find cumbersome, but more importantly is not very good in terms of code reuse. Nico =2D-=20 Nicolas Petton http://nicolas-petton.fr --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: GPGTools - http://gpgtools.org iQEcBAEBCAAGBQJV7onFAAoJECM1h6R8IHkQiGQH/Ax8N3Tn7qh2eib7SzDNqhTe T5tgL9rvfjQp28uTR20OP+/zhjHC5mQ5+kAlNyeCC/T04QlpWlbcXYBBVe3qbJ6+ TYMsq5J+lYfvL998GZQpKCe/rqWQ1HvB6LUVDKMYe3f+hExEp0oNDMwdBfxk9RQ8 A5PPWeutgOG1WAV1LjgdjJ3Kc2SizzlHaZPRjEJbcY68l9fJ/yCjWYuy5+WmjJ4v 2gmhP0Vp6IEmoMpJ2tOEUg4z7vpXSb7fKhdL6KqTaEQd1R4wlkYlxzvg3W9allGf q8pqGS0ubrtbyVAopY/sAcZiA7bPFKH1xFR+KzMxsb5hRSL5Se/QopqypU+ZbWM= =eW3I -----END PGP SIGNATURE----- --=-=-=--