From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#57548: Add new function `seq-positions' Date: Sun, 04 Sep 2022 04:27:17 +0200 Message-ID: <87bkrvq3ga.fsf@web.de> References: <87edwtty5v.fsf@cassou.me> <83sfl9ob41.fsf@gnu.org> <87a67gubs9.fsf@cassou.me> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26787"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Eli Zaretskii , 57548@debbugs.gnu.org To: Damien Cassou Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 04 04:28:11 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oUfMo-0006ll-Nu for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Sep 2022 04:28:10 +0200 Original-Received: from localhost ([::1]:59036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oUfMn-0001Fl-5i for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 03 Sep 2022 22:28:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUfMg-0001E7-Bx for bug-gnu-emacs@gnu.org; Sat, 03 Sep 2022 22:28:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54510) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oUfMg-0006Z9-1l for bug-gnu-emacs@gnu.org; Sat, 03 Sep 2022 22:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oUfMf-0002QL-L0 for bug-gnu-emacs@gnu.org; Sat, 03 Sep 2022 22:28:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Sep 2022 02:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57548 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 57548-submit@debbugs.gnu.org id=B57548.16622584489274 (code B ref 57548); Sun, 04 Sep 2022 02:28:01 +0000 Original-Received: (at 57548) by debbugs.gnu.org; 4 Sep 2022 02:27:28 +0000 Original-Received: from localhost ([127.0.0.1]:43209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUfM7-0002PW-Sh for submit@debbugs.gnu.org; Sat, 03 Sep 2022 22:27:28 -0400 Original-Received: from mout.web.de ([212.227.15.4]:43545) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUfM5-0002PI-V2 for 57548@debbugs.gnu.org; Sat, 03 Sep 2022 22:27:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1662258439; bh=xR7GSJt7okyeJB64K1NL5t9yjL9NpKYW0/bmDGiAtJM=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=asclFDIREiX5GNMAcN1Ri2tHcaY8uE2AMrynETxTV1w4y9YEeFqTNbXG7xhaPKJN7 4nIPOzp4e5fnyy2384pwfemklCb749pSVdNP2mO+9PAYo21hWlPFqR5kQ/xDXJoau3 kcBKK7RbucBoqxSLzBl7XYBquAS1uOZ1CnDoM4nw= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([84.57.248.18]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MqqTV-1p8j953nfN-00mV8V; Sun, 04 Sep 2022 04:27:18 +0200 In-Reply-To: <87a67gubs9.fsf@cassou.me> (Damien Cassou's message of "Sat, 03 Sep 2022 10:01:26 +0200") X-Provags-ID: V03:K1:OkTXx3/Bd2ppTuOCIuaYRgTLxYTGRtel8jIrJ+EimeOAGe9UBRp 8y5GNdlvE0uJEE9vjfMwr0LfXfVvB9QgxQNEir0AWl9U9gJWVqLqjYBjBUeEBatPuYY51o5 lDYOcLslnUlOabcnbfXhm8juS15/aLZcIdWqz6qe7R2JZYah+X2k22HN3m3fjOajcdyHr8/ HtMW/wMHLCS9PM4b/yHoQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:Z6pd4Fc3sls=:6JDCSOdyCUMoLnOLEx4SBw AD/oaATyPwyz351hx8XAirz+YBnf2ATW0CnbCd1H9p3jFvxTUDJwD5S/pA5aH+WYZcjUAt38v IF/s/WkZhkzPIuv2kE2HuC3d+TZtdwAwbKSKm8c5lMQMdz7cJc7QGffqa68HTZfssSqxsExHe xHUPtK9gaFtGXK9pMddBdz4m66S0M6iF0Ee6I+7vCfg7satGY0FLpBIzGZT8AZnajL17P1x/2 Iweba4JSxLHjed8+8YDgYrNRrDSodR3oB2vhilXkcIdSjBKNGgcUP4l32bTBMaQupJV9AQ8qT 0W509iPuTLAN2HDLtaUE3W9S2FsOeeSa43SssuMvCeS/aX2abee5Fu+Z4hBQqzWBgApj/IMxl yDRcZCFEj9VmDitKUj64f5urxg0VDAlLcj1XcYAItbVtC2CZRusXV8LXBGn5yDrq5B+4ih1Ly RfyK9P6LcMl7CGljgRv+lR+F1dBcugmok0sA5WayDs+Y/7uMJOH8StOqNYDYPF2f9xPHLSS/a 4tt5IQMTjpQIGiBtvcn0bvDPmblVxij/nMOtY3terncVYH3m1GcVATyWkV/ZESscLhZEol1Uj OiYGEZzI0W9pNmFUqiFhZNNWgJNnL1oZWkPOR3jSnaAPdhBZ9Xxalg/c18Xc7bQiX8gWCjley 217J2Gnf40LlRKA2NMbQXpB6oahgecbSEjKE/eZ4Az4J8px1WnEA+uVdGMQ2eu0BU6X7/2Tr6 mVu/3UxbhBewxHaXFuSnQwavjCRDKKLlyPqgDClouNUSKcFnYg/UQEKkhx/Z2J6yokGExoXN X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:241456 Archived-At: Damien Cassou 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.