From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Wiegley Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Elpa: Pinpoint semantics of `seq-subseq' for streams Date: Tue, 13 Sep 2016 18:28:22 -0700 Message-ID: References: <87bmzrahvg.fsf@web.de> <79c6ccd6-9808-f4fd-071a-58559f72ecdc@gmail.com> <8737l3a4ab.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1473816620 27504 195.159.176.226 (14 Sep 2016 01:30:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Sep 2016 01:30:20 +0000 (UTC) User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1 (darwin) Cc: =?utf-8?Q?Cl=C3=A9ment?= Pit--Claudel , emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 14 03:30:16 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 1bjz1e-0005ue-AF for ged-emacs-devel@m.gmane.org; Wed, 14 Sep 2016 03:30:10 +0200 Original-Received: from localhost ([::1]:52513 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjz1c-0005d4-BU for ged-emacs-devel@m.gmane.org; Tue, 13 Sep 2016 21:30:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjz13-0005co-Jx for emacs-devel@gnu.org; Tue, 13 Sep 2016 21:29:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjz0z-0005gf-EC for emacs-devel@gnu.org; Tue, 13 Sep 2016 21:29:32 -0400 Original-Received: from mail-pf0-f169.google.com ([209.85.192.169]:36013) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjz0z-0005gM-8L for emacs-devel@gnu.org; Tue, 13 Sep 2016 21:29:29 -0400 Original-Received: by mail-pf0-f169.google.com with SMTP id 128so1100795pfb.3 for ; Tue, 13 Sep 2016 18:29:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:date:message-id:references :user-agent:mail-followup-to:mime-version; bh=nGGcRis9C2hKIK4EUQHewudxTqT3GAjl1PuXaZsTpsM=; b=frQmdwR8+VasEN4RPQvTGQi6IqWAN8q7Jl62tu/+6sXKwyXB7ExW9+ZVb3k/TfLYWN X5nCdL9t+SnQkNnT7SyVgH8heUI5cwZAjgOME1wIhJrxw4PwGrq2dvXndp/+xR0T5Ogk kZ2bRSzz50lI2c+HAlx0dgnAOWfCwRdeEu6/2tXYZ4jKylbenQv/fsiZ6iES4lx2EN4i Sxja58S/XeQcfqUP9v3ve7YGjJleraMQQ7C3C62WEydXoatrxMH/Ujci0FoflyzDXDs1 OI8WdDBKzPhkzUWs7Zlym9OAIAib7KBq5+10pcRVDCu+yEts1jy/PK163EHrMEU68t2h b3RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:in-reply-to:date:message-id :references:user-agent:mail-followup-to:mime-version; bh=nGGcRis9C2hKIK4EUQHewudxTqT3GAjl1PuXaZsTpsM=; b=fXZdDWLiNjdnYr9MPmqLfvri7Uc4ARsVB5xsdAMvRjVe00DKwjKn+5yy3UqnXpedlM LmqoaMGL7qktHrLZrrmYd5Vc6XsoZejqgl4hax2kjiXhhC45jNcSpls0DQcJBN6H0a3l dmw+75RhZhMe3tQcZDViP/CYmE5waFWRvDfFIQxif49ndZz5ho8hjcAAIuna5PQskPeh YLTv6Wq1Vl9ZrSFy/jCE1XJqlmNgG04PewhgFvXLZ7hWCqldK8rcjPxY+3hgFgwwnogM 1S6AYACVkAXVzLEqnDGRAK3aLrPtYwEnHdjtJ/Y0KAWxZI30KPtbml1WiZtx30uApBBc 1/Gg== X-Gm-Message-State: AE9vXwO1fAKjeex7ztNrfV3k6L7XWq8/lmHgLndohzJQsh/gwV1yK6Oy2tGY1KsQvO1U9g== X-Received: by 10.98.102.17 with SMTP id a17mr6572631pfc.65.1473816508517; Tue, 13 Sep 2016 18:28:28 -0700 (PDT) Original-Received: from Vulcan.local (76-234-69-149.lightspeed.frokca.sbcglobal.net. [76.234.69.149]) by smtp.gmail.com with ESMTPSA id u1sm33664834pfu.12.2016.09.13.18.28.26 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 13 Sep 2016 18:28:26 -0700 (PDT) X-Google-Original-From: "John Wiegley" Original-Received: by Vulcan.local (Postfix, from userid 501) id AF9C9250141D; Tue, 13 Sep 2016 18:28:25 -0700 (PDT) In-Reply-To: <8737l3a4ab.fsf@web.de> (Michael Heerdegen's message of "Tue, 13 Sep 2016 23:17:00 +0200") Mail-Followup-To: Michael Heerdegen , =?utf-8?Q?Cl=C3=A9ment?= Pit--Claudel , emacs-devel@gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.192.169 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:207426 Archived-At: >>>>> "MH" == Michael Heerdegen writes: HM> Yes, I want to forbid them, unless there are realistic use cases. No, we HM> don't have something like `tail' for streams. If you want something like MH> that, you are in general better done with lists (i.e. convert the stream HM> into a list), I think. You could implement tail as a stream adapter that basically implements a sliding window: Whenever an element is requested from the tail stream, it keeps requesting elements from the parent stream, filling up its window buffer and cycling out old elements, until it reaches the end of the parent stream. At that point, it knows enough to start draining the window buffer to the caller. It "forces" the parent stream, but provides the requested behavior for those who might prefer a streams interface. Also, the forcing of the parent stream can be delayed until at least one element is requested. -- John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2