From: Michael Heerdegen <michael_heerdegen@web.de>
To: "Clément Pit--Claudel" <clement.pit@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] Elpa: Pinpoint semantics of `seq-subseq' for streams
Date: Tue, 13 Sep 2016 23:17:00 +0200 [thread overview]
Message-ID: <8737l3a4ab.fsf@web.de> (raw)
In-Reply-To: <79c6ccd6-9808-f4fd-071a-58559f72ecdc@gmail.com> ("Clément Pit--Claudel"'s message of "Tue, 13 Sep 2016 14:02:15 -0400")
Hi Clément,
> 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.
next prev parent reply other threads:[~2016-09-13 21:17 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 [this message]
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
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8737l3a4ab.fsf@web.de \
--to=michael_heerdegen@web.de \
--cc=clement.pit@gmail.com \
--cc=emacs-devel@gnu.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).