emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Gnu Elpa: stream.el: Add some more basic stream operations


From: Michael Heerdegen
Subject: Re: [PATCH] Gnu Elpa: stream.el: Add some more basic stream operations
Date: Wed, 28 Sep 2016 20:27:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Yuri Khan <address@hidden> writes:

> > [...] be the smallest common divider of what we discussed.

Oops, "greatest" of course, this wasn't meant ironically, it was just
late, ok?


> That is a good complement to seq-position (and might be named
> seq-position-if).

> However, these are also strict in all elements up to and including the
> one being sought, and may not terminate.

I only partly understand your objection (what do you mean with "strict
in all elements"?).

IMO, termination in every case is not a requirement, else, we would not
have `while'.  Formulating algorithms to use streams is just a way to
describe loops.  So I don't see why it would be a problem when stream
primitives potentially don't terminate.

> As an example, if you want a subsequence starting at the first odd
> number or at index 1000, whichever is earlier, (seq-drop (min 1000
> (seq-position-if 'odd S)) S) will not do the right thing.

Would adding an optional argument that allows to specify an upper limit
for the indexes the function looks at cover (all of) your concerns?


Regards,

Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]