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

From: Michael Heerdegen <[email-masked]>
Date: Sun, 04 Sep 2022 04:27:17 +0200

Damien Cassou <[email-masked]> 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.