From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.devel Subject: Re: seq-some-p and nil Date: Wed, 9 Sep 2015 00:57:59 -0400 Message-ID: <20150909045759.GA19828@holos> References: <87mvwym01x.fsf@petton.fr> <87h9n5mloa.fsf@petton.fr> <87zj0xkpx0.fsf@petton.fr> <20150908133729.GA20184@holos> <20150909021959.GA1494@holos> <878u8g1ain.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1441774734 28012 80.91.229.3 (9 Sep 2015 04:58:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Sep 2015 04:58:54 +0000 (UTC) Cc: Nicolas Petton , Stefan Monnier , Drew Adams To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 09 06:58:42 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 1ZZXSj-0002gu-6s for ged-emacs-devel@m.gmane.org; Wed, 09 Sep 2015 06:58:25 +0200 Original-Received: from localhost ([::1]:39710 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZXSi-0004QG-ST for ged-emacs-devel@m.gmane.org; Wed, 09 Sep 2015 00:58:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZXSQ-0004E7-Cd for emacs-devel@gnu.org; Wed, 09 Sep 2015 00:58:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZXSM-0002oA-Bj for emacs-devel@gnu.org; Wed, 09 Sep 2015 00:58:06 -0400 Original-Received: from mail-qg0-f51.google.com ([209.85.192.51]:33342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZXSM-0002o3-90 for emacs-devel@gnu.org; Wed, 09 Sep 2015 00:58:02 -0400 Original-Received: by qgev79 with SMTP id v79so101314364qge.0 for ; Tue, 08 Sep 2015 21:58:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=8Eil6KyHWfumfO0lnRIITUpknyeedTv7YWGuGBRouG8=; b=Vo8sMl8iBiKKdDZQcr7udJKtJhDYcwleK1wvYNOKfMqNAvh/im7q59+FeoM80XLlG/ aXspVav/BLz7NJ0pFPRsRUNNGY0GVcjAX0BsJFnGSC8JdgCzrp+G2pzlIciQ8Fd+p2tK GQcr1DUt/wEV67P9vGmk9gDWoWkQQzjDGwHvLt17c45PcVOQvoUHAJRxgHwt6hnN4I/C ERB0kGXvV+RH+tcYkb90qvXrZNS5td38Pv+aOjZgz+nfq0iij9k/aedrvmIXznovvXaE SLNuja9cnBHvRLPuRntgKKm2zXPg6TBEi7rX3grl/Jm9cZATwR0wiBeK3cBZ4Mjju2IP orJg== X-Gm-Message-State: ALoCoQkFvIAnhG2AWmEhTOgZSHj34UqqjcAykiNtcV8yXxdgM/Ljvdo+twoUjnuF+12TtIJgV+5Q X-Received: by 10.140.40.100 with SMTP id w91mr40627140qgw.73.1441774680824; Tue, 08 Sep 2015 21:58:00 -0700 (PDT) Original-Received: from holos.localdomain (c-73-128-248-14.hsd1.md.comcast.net. [73.128.248.14]) by smtp.gmail.com with ESMTPSA id s64sm3235201qgs.33.2015.09.08.21.58.00 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Sep 2015 21:58:00 -0700 (PDT) Original-Received: by holos.localdomain (Postfix, from userid 1000) id CB6CE68971; Wed, 9 Sep 2015 00:57:59 -0400 (EDT) Content-Disposition: inline In-Reply-To: <878u8g1ain.fsf@uwakimon.sk.tsukuba.ac.jp> User-Agent: Mutt/1.5.24+9 (2dac9fa02842) (2015-08-30) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.192.51 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:189753 Archived-At: On 09/09/15 at 01:28pm, Stephen J. Turnbull wrote: > Mark Oteiza writes: > > On 08/09/15 at 01:50pm, Stefan Monnier wrote: > > > > (defun seq-some (pred seq) > > > > (funcall pred (seq-find (pred seq))) > > > > > > But that fails for the case where the element found is nil. > > > > Works as expected > > [...] > > (seq-find 'null [1 2 nil]) > > ;; => nil > > > > (seq-some 'null [1 2 nil]) > > ;; => t > > You have a test coverage problem. > > (seq-find 'null [1 2]) > ;; => nil > > (seq-some 'null [1 2]) > ;; => t > > I suppose this is the corner case Stefan meant, in the sense that when > seq-find "finds" (ie, "returns") nil it's impossible to distinguish > finding nil from not finding nil. Thanks, that makes sense. I misunderstood