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: Mon, 07 Sep 2015 22:44:42 +0200 Message-ID: <87mvwym01x.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> 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 1441658708 29636 80.91.229.3 (7 Sep 2015 20:45:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Sep 2015 20:45:08 +0000 (UTC) Cc: Mark Oteiza , emacs-devel@gnu.org To: Stefan Monnier , Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 07 22:44:58 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 1ZZ3Hc-0000zA-5D for ged-emacs-devel@m.gmane.org; Mon, 07 Sep 2015 22:44:56 +0200 Original-Received: from localhost ([::1]:58711 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZ3Hb-0000HV-Mi for ged-emacs-devel@m.gmane.org; Mon, 07 Sep 2015 16:44:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44140) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZ3HW-0000EA-Si for emacs-devel@gnu.org; Mon, 07 Sep 2015 16:44:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZ3HR-0002mx-Qd for emacs-devel@gnu.org; Mon, 07 Sep 2015 16:44:50 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:46572) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZ3HR-0002mj-LZ for emacs-devel@gnu.org; Mon, 07 Sep 2015 16:44:45 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3F7B121A34 for ; Mon, 7 Sep 2015 16:44:45 -0400 (EDT) Original-Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Mon, 07 Sep 2015 16:44:45 -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=sM/12HPDCzBnwruTgPcp6HnsxlY=; b=o8qLl fdvdnBBw+bgDRGZq07RgedyTmdSMc+xIFeiCpWLCpbsLf8R4gnR5LzQpv6f3PVC8 XIHgyUu1mKUxlMUYP3+ETdE5S4wrDyhgoMUuHrx9EAt73pddpFOQ/AvWswzobdjQ hDku47I2KK6JYi0aKw/RHYU3vtshclTU37fZ1w= X-Sasl-enc: 7JO8gs7kiAlkB3JKCehjbvMbV3ugbRD0p229JSUa24qt 1441658684 Original-Received: from blueberry (arennes-658-1-104-170.w83-199.abo.wanadoo.fr [83.199.55.170]) by mail.messagingengine.com (Postfix) with ESMTPA id 6B88068015A; Mon, 7 Sep 2015 16:44:44 -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:189674 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Stefan Monnier writes: >>> If the function is not supposed to return non-nil if an element is >>> matched but the element itself, then would it be ok? OTOH there would be >>> again no way to differentiate between no element found and nil being >>> found in the sequence. > > 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'. This new function would be used to find an element in a seq using a predicate. CL has `find-if,' Scheme has `find', Clojure has `some', Smalltalk has `detect:', etc. Also, both the CL and scheme versions have the nil value ambiguity, but since these functions are not supposed to return the logical truth on a match, it is in my opinion fine. I think I could name this function `seq-find'. Cheers, 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 iQEcBAEBCAAGBQJV7fc6AAoJECM1h6R8IHkQlUQIAIk2lXEw8O1YrQr+4XBUMvtM FThwyHYRyavb3ZB4xFhEmJYwLKGPc61/z0dEa808kL7YuAb/d7h8gm5adC88RC6u +H24MFijoXmc+7Mx+VSFeP9Bax7jdj1bhhe6kdJCyQ/5Xv4VY2EV+vd2u+ZypY9v 6CILVyp7Djl2ahlZBOpBQzl5TFtMgaAtdGmfs0sgPOGF6164F/R/cKvWyhFyX1xw ExjkCUJ9aJ09YN3YVVaZofJq9WINVZhByBZ1rjhEyxAULjklMi1n8YkQuylXIuBU 3nBl+Vh1BqQpRLbkYqy0C6/hC2+EC8hlanci7WlvxA0ITPASlzhiraSt8nqWyfg= =Eq0s -----END PGP SIGNATURE----- --=-=-=--