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: Yuri Khan
Subject: Re: [PATCH] Gnu Elpa: stream.el: Add some more basic stream operations
Date: Wed, 28 Sep 2016 10:13:33 +0600

On Wed, Sep 28, 2016 at 8:07 AM, Michael Heerdegen
<address@hidden> wrote:

> Hmm, what would you think of a function that returns the index of the
> first element of a sequence that fulfills a certain predicate (actually,
> there is already something similar, `seq-position', but that is meant to
> find the index of an element equal to a given one)?  That would, in some
> sense, be the smallest common divider of what we discussed.

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. 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.



reply via email to

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