From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Simen =?iso-8859-1?q?Heggest=F8yl?= Newsgroups: gmane.emacs.devel Subject: seq-some-p and nil Date: Thu, 03 Sep 2015 17:50:29 +0200 Message-ID: <1441295429.4215.0@smtp.gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=-6SJkvYhOGLnJcRfehYQW" X-Trace: ger.gmane.org 1441296606 25098 80.91.229.3 (3 Sep 2015 16:10:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Sep 2015 16:10:06 +0000 (UTC) Cc: emacs-devel@gnu.org To: nicolas@petton.fr Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 03 18:10:01 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 1ZXX5H-000424-JE for ged-emacs-devel@m.gmane.org; Thu, 03 Sep 2015 18:09:55 +0200 Original-Received: from localhost ([::1]:49797 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXX5H-0007TP-RX for ged-emacs-devel@m.gmane.org; Thu, 03 Sep 2015 12:09:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXWma-0007Lz-Ku for emacs-devel@gnu.org; Thu, 03 Sep 2015 11:50:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXWmX-00046j-EA for emacs-devel@gnu.org; Thu, 03 Sep 2015 11:50:36 -0400 Original-Received: from mail-lb0-x235.google.com ([2a00:1450:4010:c04::235]:34962) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXWmX-00045i-45 for emacs-devel@gnu.org; Thu, 03 Sep 2015 11:50:33 -0400 Original-Received: by lbpo4 with SMTP id o4so26990032lbp.2 for ; Thu, 03 Sep 2015 08:50:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:subject:to:cc:message-id:mime-version:content-type; bh=won/y38qq64lcclH/064PfRquE3ogCfyK7slWS47l88=; b=Vx3Ls8a6AjTqmGygtTvTRUzBpFJL7kp3GOdT1blDv8k2nQWzH8R+hrXREFRScKAFa5 6gtWzfwfLagwT8mLgZyS8kBt88dz8UQ7kC6Ybn77OJywB9brIcYH9d36yOyk8e1z3vvX 8t67WPG8UKoLoGNSYiwOLnjzog9IuS3k4iQlVPUtDMLeqjkuOQ4qg4k72/+emSfZmpHy il5ks1Qn2Ny4ZKXrutFwbw7KBkzAINUDJjS5+5UJlPM+9EAEc8yjRtPkYbiMEVAnuK4P ssHbaeG82Hl3GQVRtrdSYScGEz7ePI5hfWV4YCWekKr0vx2NOT/Rgel0MtPc6GheCu6Q vIjA== X-Received: by 10.152.23.234 with SMTP id p10mr192319laf.52.1441295431800; Thu, 03 Sep 2015 08:50:31 -0700 (PDT) Original-Received: from [192.168.101.25] ([77.40.215.202]) by smtp.gmail.com with ESMTPSA id jc10sm6508981lac.12.2015.09.03.08.50.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Sep 2015 08:50:31 -0700 (PDT) X-Mailer: geary/0.10.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::235 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:189515 Archived-At: --=-6SJkvYhOGLnJcRfehYQW Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Hi! Currently it's not possible to use `seq-some-p' to check if a sequence contains some `nil' value. For instance: (seq-some-p #'null '(1 2)) =E2=87=92 nil Which is good, but: (seq-some-p #'null '(1 nil 2)) =E2=87=92 nil How to distinguish the two cases? Two solutions come to my mind: 1) Make `seq-some-p' a pure t/nil predicate, or 2) Make it behave like `some' in Common Lisp, which is to return the first non-nil value which is returned by an invocation of the predicate. So in CL: (some #'null '(1 2)) =E2=87=92 nil And: (some #'null '(1 nil 2)) =E2=87=92 t And even: (some #'1+ '(5 4 3)) =E2=87=92 6 What do you think? -- Simen = --=-6SJkvYhOGLnJcRfehYQW Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Hi!

Currently it's not possible to use `seq-s= ome-p' to check if a sequence
contains some `nil' value. For inst= ance:

(seq-some-p #'null '(1 2))
  =    =E2=87=92 nil

Which is good, but:

(seq-some-p #'null '(1 nil 2))
   = ;  =E2=87=92 nil

How to distinguish the two c= ases?

Two solutions come to my mind: 1) Make `seq-= some-p' a pure t/nil
predicate, or 2) Make it behave like `some' = in Common Lisp, which is
to return the first non-nil value which = is returned by an invocation
of the predicate. So in CL:

(some #'null '(1 2))
     =E2=87= =92 nil

And:

(some #'null= '(1 nil 2))
     =E2=87=92 t

=
And even:

(some #'1+ '(5 4 3))
&nbs= p;    =E2=87=92 6

What do you think?

-- Simen
= --=-6SJkvYhOGLnJcRfehYQW--