bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#57548: Add new function `seq-positions'


From: Michael Heerdegen
Subject: bug#57548: Add new function `seq-positions'
Date: Sun, 04 Sep 2022 04:27:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Damien Cassou <damien@cassou.me> writes:

> Indeed, such a function would certainly make sense.  I would refrain
> from calling it `seq-positions` though because there is already a
> `seq-position` function that is very similar.  I guess the function you
> suggest wouldn't take an element as argument either.  In any case, I
> think the current function makes sense on its own and what you are
> asking for is a new function that seems out of scope of this current
> patch.  If you give me a name (what about `(seq-matching-positions seq
> pred)`?), I volunteer to send a new patch in a new mail thread.

No - I actually mean (and, sorry, I see that my initial response said
something slightly different): calling the function with ELT == 10 and
TESTFN == #'>= would return all positions in the SEQUENCE of elements
not less than 10.

We don't need another function.  You only need to say that TESTFN is not
necessarily an equality predicate or symmetric.  And in which order the
two arguments are passed (and have a look that your current calling order
is so that the above example works as expected).

Michael.





reply via email to

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