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] Elpa: Pinpoint semantics of `seq-subseq' for streams Date: Tue, 13 Sep 2016 23:17:00 +0200 Message-ID: <8737l3a4ab.fsf@web.de> References: <87bmzrahvg.fsf@web.de> <79c6ccd6-9808-f4fd-071a-58559f72ecdc@gmail.com> 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 1473801495 9376 195.159.176.226 (13 Sep 2016 21:18:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 13 Sep 2016 21:18:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: emacs-devel@gnu.org To: =?utf-8?Q?Cl=C3=A9ment?= Pit--Claudel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 13 23:18:11 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 1bjv5c-0000zh-55 for ged-emacs-devel@m.gmane.org; Tue, 13 Sep 2016 23:18:00 +0200 Original-Received: from localhost ([::1]:51642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjv5a-0001qR-D8 for ged-emacs-devel@m.gmane.org; Tue, 13 Sep 2016 17:17:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjv4r-0001o7-9n for emacs-devel@gnu.org; Tue, 13 Sep 2016 17:17:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjv4l-0004ET-5T for emacs-devel@gnu.org; Tue, 13 Sep 2016 17:17:12 -0400 Original-Received: from mout.web.de ([212.227.17.11]:59757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjv4k-0004Dd-RK for emacs-devel@gnu.org; Tue, 13 Sep 2016 17:17:07 -0400 Original-Received: from drachen.dragon ([90.186.2.100]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0MNLNt-1bdbYE3st7-006wgS; Tue, 13 Sep 2016 23:17:04 +0200 In-Reply-To: <79c6ccd6-9808-f4fd-071a-58559f72ecdc@gmail.com> (=?utf-8?Q?=22Cl=C3=A9ment?= Pit--Claudel"'s message of "Tue, 13 Sep 2016 14:02:15 -0400") X-Provags-ID: V03:K0:WvDWZbQYjxrOPQt8SoUeM0SVDRnHZEpOxwBFNebUgK0BTYEkodd MapRmgzfI70Uw1JeG0E5WvAJ5wWa8BcsMok9qa6JDv1TlVZyfL2e9HEvGKwPNV4wrCmnuT/ URm5/HYZgoxSJ2LRPTzpBJzaDUtvPfCJfEg6bzYFomTCYr5DIo2gqRl9/CPGYKGpg/NzOuz CFU28bpIvD/nxWmwdEDUg== X-UI-Out-Filterresults: notjunk:1;V01:K0:Fy8Q0gLAKiU=:cooJbLcrNRHDHGdTvnK68S WAaS9NlMSrUiqynz2BWLAMWy6F8UPmPD8vlTJtGf71FdpfTMhdklNkvGkFlFjl4dPlKbxI5yx A5c8X6rEMlQQFh7SA6dtwTGKgj5s91Z2GgbkiNLYV4y1bHwPeS+V+PNv8+S0CEjxFUEOT7iF2 kqGfMNT2WWiB6jaan3lNFSRYZ/O/3eBowx+Z5+WGlUvkTXWCRWc1MV7wmNJEPyxmDT1Vlp48o HT/rejf0eHPxKEGSxsCee/hjPM5nnUt9kDP+vE6VDoqmrY/FgJdy2l9Xm6K/pFZEZs0EYPb0n 7/nXATPP3jT1fwZWOJSySLHTDRS+ywnP9IiS6TQlx0ujZItDBOsWA1anL0MDgdDpY+ARDK+gg 6Iyo19dY08+9pCFTmFKutZny+VFpyUCiXPFUBbS679uUIPh46TqUSRlza0N8zDqi1bOoVS7UC HH7KPM5HGSnWMfN6+MyUk94g00fgnPsphP3ROlf/5vOIDQWnYAxzRmhjKjU0S9VfqkRUGSUks TbfpdSf7NORi4tdMScAstzP794qj4Gywg3Y814wPRDrPldzS3WQot83YoMnkkJV/IZPcm2GXq wVxQyZbDwUhUIrZPjb6AaDhKNAGifPFjXOnXQfZu7DaYtW4VJ+u6u/8ZCXg0cw8T0CWgTZxOh DMofjOMbSfyQ/dH8QjMgTwkDqiu6SDRFk4UGk+GL5mNgIb/sQ60hHhm1VFP9AXlc/qh+Qpbw2 alUD8IHaHY/c67UrCmAmyzdeXvGUbNtadcUgCQsKuKBcfL9Bipa5dY2v179kO2cLvXTTWkKH X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.11 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:207421 Archived-At: Hi Cl=C3=A9ment, > On 2016-09-13 12:23, Michael Heerdegen wrote: > > - Forbid negative index arguments. > > Do you really want to forbid negative arguments? Do we have a function > akin to `tail' for streams (something that would return the last n > elements? Thanks for your feedback! Yes, I want to forbid them, unless there are realistic use cases. No, we don't have something like `tail' for streams. If you want something like that, you are in general better done with lists (i.e. convert the stream into a list), I think. Streams are delayed. In general, you don't know how many (or if any at all) elements a stream will generate later. All functions building streams out of argument streams are not allowed to generate any elements from any input stream. Negative indexes for `seq-subseq' would still be possible without breaking these rules - but you would probably not need the result to be a stream anyway (instead of a list, for example). Streams are a mean to program in a certain way (called data flow control or something like that). Negative indexes for `seq-subseq' collide with this model. That's why I thought it's better to forbid negative indexes for now. If I see an example where it is really useful and appropriate, or good arguments against this decision, I'll change my mind. Regards, Michael.