From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 8aa0386: Add seq-find Date: Fri, 11 Sep 2015 09:45:02 -0400 Message-ID: References: <20150910221007.23863.13601@vcs.savannah.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1441979130 14415 80.91.229.3 (11 Sep 2015 13:45:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Sep 2015 13:45:30 +0000 (UTC) Cc: Nicolas Petton To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 11 15:45:17 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 1ZaOdd-0004UL-Fp for ged-emacs-devel@m.gmane.org; Fri, 11 Sep 2015 15:45:13 +0200 Original-Received: from localhost ([::1]:56446 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaOdc-00078E-PC for ged-emacs-devel@m.gmane.org; Fri, 11 Sep 2015 09:45:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaOdZ-00075u-ER for emacs-devel@gnu.org; Fri, 11 Sep 2015 09:45:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZaOdT-0002VB-Ow for emacs-devel@gnu.org; Fri, 11 Sep 2015 09:45:09 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:25712) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaOdT-0002UV-Kw for emacs-devel@gnu.org; Fri, 11 Sep 2015 09:45:03 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0ArEwA731xV/zi6xEVcgxCEAoVVuzcJh0sEAgKBPDkUAQEBAQEBAYEKQQWDXQEBAwFWIwULCzQSFBgNiFsIzyMBAQEBBgEBAQEeizqFBQcWhBcFsz+BRSOBZoIuIoJ4AQEB X-IPAS-Result: A0ArEwA731xV/zi6xEVcgxCEAoVVuzcJh0sEAgKBPDkUAQEBAQEBAYEKQQWDXQEBAwFWIwULCzQSFBgNiFsIzyMBAQEBBgEBAQEeizqFBQcWhBcFsz+BRSOBZoIuIoJ4AQEB X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="164553856" Original-Received: from 69-196-186-56.dsl.teksavvy.com (HELO ceviche.home) ([69.196.186.56]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 11 Sep 2015 09:45:02 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id C1EF066203; Fri, 11 Sep 2015 09:45:02 -0400 (EDT) In-Reply-To: (Nicolas Petton's message of "Thu, 10 Sep 2015 22:10:08 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:189835 Archived-At: > Add seq-find > This function is similar to `seq-some' but returns the found element. > In the cases where nil can be the found element, a sentinel optional > argument can be provided to avoid ambiguities. This text was not needed here. It's already present in the code (where it belongs). > + "Return the first element for which (PRED element) is non-nil in SEQ. > +If no element is found, return SENTINEL or nil. "return SENTINEL or nil" should be just "return SENTINEL". Not only it's shorter, but it's also more precise (the current text doesn't say when it returns SENTINEL and when it returns nil). > +Note that `seq-find' has an ambiguity if the found element is nil > +and if no SENTINEL is specified, as it cannot be known if an > +element was found or not." It's not just for nil but for the case where the found value is identical to SENTINEL. Stefan