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 21:02:10 +0200 Message-ID: <87r3m8lop9.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> <8737ypm547.fsf@petton.fr> <87pp1s976u.fsf@fencepost.gnu.org> <3dc0f1d9-caf1-446a-ab14-2b3e210a02e7@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 1441738970 15805 80.91.229.3 (8 Sep 2015 19:02:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Sep 2015 19:02:50 +0000 (UTC) Cc: Mark Oteiza , emacs-devel@gnu.org To: Drew Adams , David Kastrup , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 08 21:02:37 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 1ZZO9y-0008BT-DW for ged-emacs-devel@m.gmane.org; Tue, 08 Sep 2015 21:02:26 +0200 Original-Received: from localhost ([::1]:36731 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZO9x-00083Q-SS for ged-emacs-devel@m.gmane.org; Tue, 08 Sep 2015 15:02:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZO9o-00082d-4t for emacs-devel@gnu.org; Tue, 08 Sep 2015 15:02:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZO9k-0005rw-W9 for emacs-devel@gnu.org; Tue, 08 Sep 2015 15:02:16 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:60003) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZO9k-0005ro-NB for emacs-devel@gnu.org; Tue, 08 Sep 2015 15:02:12 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 8A676210AF for ; Tue, 8 Sep 2015 15:02:12 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Tue, 08 Sep 2015 15:02:12 -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=EBYBbbRKJPpT9Vf+foRg8YD1DpQ=; b=lOj3L M5bPjRxF6XFUzfnK4//3w5OiuGAzM8vUE5sGhBqYbtELBmTfQv3a4WubK3T06dfi /uYHN5IiLWRqaNEl7NdxVyVnUSZPpqWZA/oH8N5M8g7jiFbuZYPH6jMMMV4tq4AA rfePP4CndiXnJ0svaE9cXnyXIA4xequlZk3CKE= X-Sasl-enc: SmqY3itPy9oOdolE8uBoqD2LZgU5ZWfLGiSaJV/8PM9s 1441738932 Original-Received: from blueberry (arennes-658-1-183-218.w92-139.abo.wanadoo.fr [92.139.0.218]) by mail.messagingengine.com (Postfix) with ESMTPA id 8B064C00287; Tue, 8 Sep 2015 15:02:11 -0400 (EDT) In-Reply-To: <3dc0f1d9-caf1-446a-ab14-2b3e210a02e7@default> 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:189733 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Drew Adams writes: >> >> 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. It would work, and I believe Scheme has a similar function, but I don't want seq-some to have this extra complexity. It could be another function though, just like in Scheme. 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 iQEcBAEBCAAGBQJV7zCyAAoJECM1h6R8IHkQ3uYIAKvshPmTVWq16BFTEDDIT/cj ngzEzV9T/IcChmMA05m0gqWsmvqkYEzfZRqTpFIq+A3w8AMn/VAuThbOfmkVwY7u 8lxfsMFJ0sn46PITXkhjjOc/ba2DncaxgC6sSRR+MO4dlail50kDqo6XS2j/fzID if2gVQJxjO5wZBS3q8tORbPWyOWsZu9tiTUxjXrYpHeJ3aUFzMqggNrsAvx398kW t28vWIz1qEAf2RpCI9Jq7BpV718UgW0hKWqF4Stdx+VhPeiw99Q5jVD4w9yK9iZi 2i7NwESpoD8Kjvr/xuN2TGmfxhLltURQxRy2m46c4A+U1hDAt4eKg7gfzV2jGmM= =yQZC -----END PGP SIGNATURE----- --=-=-=--