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 15:07:36 +0200 Message-ID: <8737ypm547.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> <87h9n5mloa.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 1441717681 4947 80.91.229.3 (8 Sep 2015 13:08:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Sep 2015 13:08:01 +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 15:07:50 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 1ZZIck-0005Jf-Tg for ged-emacs-devel@m.gmane.org; Tue, 08 Sep 2015 15:07:47 +0200 Original-Received: from localhost ([::1]:33956 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZIcl-0007o0-1D for ged-emacs-devel@m.gmane.org; Tue, 08 Sep 2015 09:07:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZIch-0007nW-2V for emacs-devel@gnu.org; Tue, 08 Sep 2015 09:07:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZIcd-0005TI-Rw for emacs-devel@gnu.org; Tue, 08 Sep 2015 09:07:43 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:60888) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZIcd-0005T5-OU for emacs-devel@gnu.org; Tue, 08 Sep 2015 09:07:39 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id F3D0820773 for ; Tue, 8 Sep 2015 09:07:38 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Tue, 08 Sep 2015 09:07:38 -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=wCEgyQ1n6FYPYIWs6hLImqeWGyY=; b=J0G+F ph+uCYuhaU88bPd8eNNFU2v2ypUYztMwWGYK4LbjmuLIwLHnA2RzMm7/kzq5E+Ld UYnx0wkW9/q52pg1Q/ta/1FuxWKg1fKHsWNtKer0Kkstgj/OV0kbQ1QsZOfFwnDp rZAodAN4NQQ2MqLXI+xYj27Jb52Ut/mmzwQuNI= X-Sasl-enc: DYKWZFhMwNRgMtrMYXLwX7onaAJgHgyTyIy0TsalZZDR 1441717658 Original-Received: from blueberry (89-156-196-194.rev.numericable.fr [89.156.196.194]) by mail.messagingengine.com (Postfix) with ESMTPA id 3E459C00290; Tue, 8 Sep 2015 09:07:38 -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:189705 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Stefan Monnier writes: >> Can you elaborate on why you think it's not worth it? > >> IMO, finding an element in a sequence is a very common operation, > > Conceptually, yes, but if you take into account the details of how you > specify which element you want, as well as what you want to do with it, > then in most cases, I think the code ends up just as simple with > seq-some as with seq-find. I don't follow. How can the code end up just as simple when finding an element matching a predicate? To make things easier to understand, I'm taking the example of finding the first odd number in a seq: (seq-some (lambda (elt) (and (oddp elt) elt)) '(0 1 2 3)) (seq-find #'oddp '(0 1 2 3)) The first version is not only much harder to read, it also IMO shows that the lambda mostly re-implement what a `seq-find' function should provide by default in the library. 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 iQEcBAEBCAAGBQJV7t2YAAoJECM1h6R8IHkQU2UH/3cwPPjL7LkNf5ifgY6NYept DHWwgsAQfyIlvBW4yYZJOYp203ilSSioMV4M6ecSTJ0TItyU9/vZvfPm/Sni8ryL V1MO5/67C79XKB+mfbaalzAdsEXjzvqx0jjWkEKTWnkfheZ5hMArPmUOYGdwg4wU TLlp6RCogCM2la9iZLQW/ecZd9jXIgIYfdbCxIVZ4G6LX2FM53iY2pAb4zexbK2L 6zwd2O8mMv6bnXSD1WmKcljyLrfJV1b0sqAwfmd9OLlVYef1yok/P6tIq4Oav5l9 6OxaYv6Ar2pu/F+PkE7owk+VPjibUHjJizsg96QWjhj60pOiVeL9+OuHVtc6+Wg= =S1VU -----END PGP SIGNATURE----- --=-=-=--