From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Gnu Elpa: stream.el: Add some more basic stream operations Date: Sun, 25 Sep 2016 17:38:32 +0200 Message-ID: <878tug9eh3.fsf@web.de> References: <87twhbmwbx.fsf@web.de> <878tynl720.fsf@petton.fr> <8737onlapw.fsf@web.de> <87ziqu7ew9.fsf@petton.fr> <87mvmuxuyo.fsf@web.de> <8760tixi99.fsf@web.de> <87twh1kpem.fsf@web.de> <87y42r4d3a.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1474817980 28843 195.159.176.226 (25 Sep 2016 15:39:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 25 Sep 2016 15:39:40 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cc: Nicolas Petton , Emacs developers To: Yuri Khan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 25 17:39:36 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1boBWV-0005LY-5x for ged-emacs-devel@m.gmane.org; Sun, 25 Sep 2016 17:39:23 +0200 Original-Received: from localhost ([::1]:39359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boBWT-0005rl-Fu for ged-emacs-devel@m.gmane.org; Sun, 25 Sep 2016 11:39:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boBVt-0005rR-1L for emacs-devel@gnu.org; Sun, 25 Sep 2016 11:38:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1boBVp-0000yY-T4 for emacs-devel@gnu.org; Sun, 25 Sep 2016 11:38:44 -0400 Original-Received: from mout.web.de ([212.227.17.12]:54256) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boBVp-0000yS-IF for emacs-devel@gnu.org; Sun, 25 Sep 2016 11:38:41 -0400 Original-Received: from drachen.dragon ([90.186.2.21]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0MJCek-1bpp8Y2MFW-002pCl; Sun, 25 Sep 2016 17:38:37 +0200 In-Reply-To: (Yuri Khan's message of "Sat, 17 Sep 2016 12:22:29 +0600") X-Provags-ID: V03:K0:qh4M5Or/ZOTwyVulv7W0WyJSnZYvYT9bu26PwbmTlBtjgutjkI8 HrR1waXANtpFOaBVAcQt8McJc5Lb7tI+xDekZxw/kM5tN1UXffh3BZYMkO2DywrR+4/De4d 90ZHgaKDUaAJj4W7DfERk38no707oyF0mrTK2+5FpZcHbBTl/lLmYPEsfI+NbFuRoK0NU5u 929Vd8S1MrJ6M6z/VXotQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:cWsv2wQdsIc=:GvNn+4SJPc9CcnhY4hIJCm ZBJ+l7UZUaLS1xWH3AG39d/a0TobUrfe/4MjoXH6o4nBUyu+bCIYXzuuU48u3c+NeVZ1Opk6m FoGYZ6MI6MFRr+uWOouOBKQuoXP8JTLMbcf6iwfhi1uJ1vX9nMhC1bSZjzVhtRz0zGtm/4cIz A3IV2YmE1o90QefBrBSNriYOQqcPPcMWPVN6UyYY0P0uoP8OIaqF5CM1mND08kDPvbouBuc1/ P0aRJ6ob5xyj8FNGCdbJ9P8NXI/nIo4KGt7B+c3BV1MkdfN29JmV02i0VVi8m5P/yNUC83Cru k/hES6HxmESBQspGm98Lg4tIhv1yl45P061d3B3UHZ7aIjUSsmpZWiJ7ClUnfrTQC6x9+RL2L 4ZDAebdjkiVOinAyaYTsOxCHPzzbXJZTNnOI/pTFRQMCdT3JGS+S4BbF3hljXskiTH7lXOhF7 UiLd+eQYzfESp0QXbmW+qFkqzPeuBmN9B0BR7ahtqNxlKhtubmhNA+6XOnmUld4L/ObEU/6m2 npifdI//UXsHluhFEFhg0smQP26/ojBdprRGF0V9uOWLxEAzWXvtJShP4vGHBYXW5simg3Eqe MXm6YgjWAoZl/ucAYAoRchgiZp/pboikk3riOlv+9Sf+8LKCZjJkFQ9TibEoW+b4MiqbySbJX 2OCH7gARqVucIWLMXLpKnlnhDoWNQ3U8hb1lSVgfE+4QUrv8O7TSv+8S+/Uli74QeCSMlLJor 2EIukF+im1w9ZeU3godqs9PYo9FdZeliPbm3fy74Lz8p5DvCWGxQxoHKdxWitErhNLKhiI6T X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:207785 Archived-At: Yuri Khan writes: > You=E2=80=99re right, drop-until is not a good match for this semantics. = By > the way, how would you describe the required behavior without going > operational (mirroring the implementation)? If you asking the question implies that you find the semantics not trivially clear, maybe the following simpler (even superior) approach would be much better: Add an optional integer type argument to `seq-drop-while' and `seq-take-while' that allows to shift the index by the specified amount (as far as possible): #+begin_src emacs-lisp (cl-defgeneric seq-drop-while (pred sequence &optional less) (seq-drop sequence (- (seq--count-successive pred sequence) (or less 0)))) (cl-defgeneric seq-take-while (pred sequence &optional more) (seq-take sequence (+ (seq--count-successive pred sequence) (or more 0)))) #+end_src Michael.