all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Wiegley <jwiegley@gmail.com>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: "Clément Pit--Claudel" <clement.pit@gmail.com>, emacs-devel@gnu.org
Subject: Re: [PATCH] Elpa: Pinpoint semantics of `seq-subseq' for streams
Date: Tue, 13 Sep 2016 18:28:22 -0700	[thread overview]
Message-ID: <m2k2efl16x.fsf@newartisans.com> (raw)
In-Reply-To: <8737l3a4ab.fsf@web.de> (Michael Heerdegen's message of "Tue, 13 Sep 2016 23:17:00 +0200")

>>>>> "MH" == Michael Heerdegen <michael_heerdegen@web.de> 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



  parent reply	other threads:[~2016-09-14  1:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13 16:23 [PATCH] Elpa: Pinpoint semantics of `seq-subseq' for streams Michael Heerdegen
2016-09-13 18:02 ` Clément Pit--Claudel
2016-09-13 21:17   ` Michael Heerdegen
2016-09-14  1:24     ` Clément Pit--Claudel
2016-09-14 15:05       ` Michael Heerdegen
2016-09-14 23:26         ` Clément Pit--Claudel
2016-09-15  0:51           ` John Mastro
2016-09-15  2:00             ` Clément Pit--Claudel
2016-09-15 17:01               ` John Mastro
2016-09-15 21:07               ` Michael Heerdegen
2016-09-15 22:18                 ` Clément Pit--Claudel
2016-09-15 22:28                   ` Michael Heerdegen
2016-09-15 22:52                     ` Clément Pit--Claudel
2016-09-15  0:58           ` Michael Heerdegen
2016-09-15  3:47             ` Clément Pit--Claudel
2016-09-15  8:42               ` Nicolas Petton
2016-09-15 22:30                 ` Michael Heerdegen
2016-09-15 23:08                   ` Nicolas Petton
2016-09-15 21:29               ` Michael Heerdegen
2016-09-14  1:28     ` John Wiegley [this message]
2016-09-14 15:15       ` Michael Heerdegen
2016-09-13 22:20 ` Nicolas Petton
2016-09-13 22:40   ` Michael Heerdegen
2016-09-14  8:25     ` Nicolas Petton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2k2efl16x.fsf@newartisans.com \
    --to=jwiegley@gmail.com \
    --cc=clement.pit@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.