X-Loop: help-debbugs@HIDDEN Subject: bug#67456: [PATCH] seq.el: Add functions for mapping over subsequences Resent-From: Okamsn <okamsn@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 26 Nov 2023 17:19:01 +0000 Resent-Message-ID: <handler.67456.B.170101909221556 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 67456 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 67456 <at> debbugs.gnu.org, nicolas@HIDDEN X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN, Nicolas Petton <nicolas@HIDDEN> Received: via spool by submit <at> debbugs.gnu.org id=B.170101909221556 (code B ref -1); Sun, 26 Nov 2023 17:19:01 +0000 Received: (at submit) by debbugs.gnu.org; 26 Nov 2023 17:18:12 +0000 Received: from localhost ([127.0.0.1]:42644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r7Ilo-0005bb-4E for submit <at> debbugs.gnu.org; Sun, 26 Nov 2023 12:18:12 -0500 Received: from lists.gnu.org ([2001:470:142::17]:58564) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <okamsn@HIDDEN>) id 1r7Ill-0005b2-9q for submit <at> debbugs.gnu.org; Sun, 26 Nov 2023 12:18:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <okamsn@HIDDEN>) id 1r7IlV-0005wq-Ok for bug-gnu-emacs@HIDDEN; Sun, 26 Nov 2023 12:17:54 -0500 Received: from mail-4316.protonmail.ch ([185.70.43.16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <okamsn@HIDDEN>) id 1r7IlR-0007x0-Vj for bug-gnu-emacs@HIDDEN; Sun, 26 Nov 2023 12:17:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1701019060; x=1701278260; bh=qMR6dNmiXYpIViCtjvC8X2oQiHpeGgP0pGjFrcWSCCI=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=J0d9/D+RB4WMaMpbkuxZG7afB7ceciE+i/53sUm+jIk0f5CZtAxwlq3e7ADlXyruV AGzpvEhnj5guOSjfJNl4P/6DL+ygPcFqhMVuX5VPoyIODTWUNu5Z/Mv1PAS4qY8ZJh 7qjW3oad2S+unM+qyuduTgvxO4rrEjdlq1t7RNmheW8LYGBetbzPcMtGCmEIn2AvLn wCGWGuEAvj9jBxMlPx1Jx8X91WdkL5elS7FwA4jnT5P9Fih0ZfU5fXUx5YRTKrxw76 ThZm5rb3kUGzMlmnZlFpDW8ksVdCQrDixgo83yWCnRs+adVQ+XMWpn0oUrzZxKM3MY pxC64NKA6g3sQ== Date: Sun, 26 Nov 2023 17:17:35 +0000 From: Okamsn <okamsn@HIDDEN> Message-ID: <6f6d9f2d-fee9-4d1d-a1e4-8c6ce57a0627@HIDDEN> Feedback-ID: 25935600:user:proton MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_0UHc1bd4Q0BgDpqpjszXE04CheHhJcGSYrxJNXBMFw4" Received-SPF: pass client-ip=185.70.43.16; envelope-from=okamsn@HIDDEN; helo=mail-4316.protonmail.ch X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.0 (/) This is a multi-part message in MIME format. --b1_0UHc1bd4Q0BgDpqpjszXE04CheHhJcGSYrxJNXBMFw4 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, The attached features work like `cl-maplist` and `cl-mapl`, applying=20 functions to a sequence and to the remaining parts of a sequence. For=20 example, `(seq-mapsub #'identity [1 2 3])` returns `([1 2 3] [2 3] [3])`. The patch adds a `seq-mapsub`, `seq-dosub`, and a `seq-doseqsub`,=20 similar to `seq-map`, `seq-do`, and `seq-doseq`, respectively. I was looking for an equivalent for vectors of `cl-maplist`, `cl-mapl`,=20 and `cl-loop`'s `for VAR on LIST`, and think that these would be useful=20 additions. To get the sub-sequences, the code uses `seq-rest` and stops when the=20 returned sub-sequence is empty according to `seq-empty-p`. This is=20 similar to how I would do it for a list, using `cdr` and `null`, but is=20 that a good way to do it for arrays and other sequences? Thank you. --b1_0UHc1bd4Q0BgDpqpjszXE04CheHhJcGSYrxJNXBMFw4 Content-Type: text/x-patch; charset=UTF-8; name=0001-Create-seq-functions-for-mapping-over-subsequences.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=0001-Create-seq-functions-for-mapping-over-subsequences.patch RnJvbSAyZjA3MzgzNDcwYjkwMDA5Yzc4YjA0NTllZTA5ZmNjNTEzZTBlMTJmIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBFYXJsIEh5YXR0IDxva2Ftc25AcHJvdG9ubWFpbC5jb20+CkRh dGU6IFN1biwgMjYgTm92IDIwMjMgMTE6MjA6MjggLTA1MDAKU3ViamVjdDogW1BBVENIXSBDcmVh dGUgc2VxIGZ1bmN0aW9ucyBmb3IgbWFwcGluZyBvdmVyIHN1YnNlcXVlbmNlcy4KClRoZXNlIGZ1 bmN0aW9ucyBhcmUgc2ltaWxhciB0byAnY2wtbWFwbGlzdCcgYW5kICdjbC1tYXBsJy4KCiogbGlz cC9lbWFjcy1saXNwL3NlcS5lbCAoc2VxLW1hcHN1Yiwgc2VxLWRvc3ViLCBzZXEtZG9zZXFzdWIp OgpBZGQgZnVuY3Rpb25zIGZvciBtYXBwaW5nIG92ZXIgc3ViLXNlcXVlbmNlcywgbGlrZSBpbiAn Y2wtbWFwbGlzdCcsCnNpbWlsYXIgdG8gdGhlIGV4aXN0aW5nICdzZXEtbWFwJywgJ3NlcS1kbycs IGFuZCAnc2VxLWRvc2VxJy4KCiogdGVzdC9saXNwL2VtYWNzLWxpc3Avc2VxLXRlc3RzLmVsICh0 ZXN0LXNlcS1tYXBzdWIsIHRlc3Qtc2VxLWRvc3ViKQoodGVzdC1zZXEtZG9zZXFzdWIpOiBBZGQg dGVzdHMgZm9yIHRoZSBhYm92ZSBmdW5jdGlvbnMuCgoqIGRvYy9saXNwcmVmL3NlcXVlbmNlcy50 ZXhpIChTZXF1ZW5jZSBGdW5jdGlvbnMpOiBEZXNjcmliZSB0aGUKZnVuY3Rpb25zLgotLS0KIGRv Yy9saXNwcmVmL3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aCB4IHJlcykpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBbMSAyIDNdKQorICAgICAgICAgICAgICAgICAgIChucmV2ZXJzZSByZXMpKQorICAgICAg ICAgICAgICAgICAnKFsxIDIgM10gWzIgM10gWzNdKSkpCisgIChzaG91bGQgKGVxdWFsIChsZXQg KChyZXMgKGxpc3QpKSkKKyAgICAgICAgICAgICAgICAgICAoc2VxLWRvc3ViIChsYW1iZGEgKHgp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwdXNoIHggcmVzKSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcoMSAyIDMpKQorICAgICAgICAgICAgICAgICAgIChucmV2 ZXJzZSByZXMpKQorICAgICAgICAgICAgICAgICAnKCgxIDIgMykgKDIgMykgKDMpKSkpKQorCiso ZXJ0LWRlZnRlc3QgdGVzdC1zZXEtZG9zZXFzdWIgKCkKKyAgKHNob3VsZCAoZXF1YWwgKGxldCAo KHJlcyAobGlzdCkpKQorICAgICAgICAgICAgICAgICAgIChzZXEtZG9zZXFzdWIgKHggWzEgMiAz XSkKKyAgICAgICAgICAgICAgICAgICAgIChwdXNoIHggcmVzKSkKKyAgICAgICAgICAgICAgICAg ICAobnJldmVyc2UgcmVzKSkKKyAgICAgICAgICAgICAgICAgJyhbMSAyIDNdIFsyIDNdIFszXSkp KQorICAoc2hvdWxkIChlcXVhbCAobGV0ICgocmVzIChsaXN0KSkpCisgICAgICAgICAgICAgICAg ICAgKHNlcS1kb3NlcXN1YiAoeCAnKDEgMiAzKSkKKyAgICAgICAgICAgICAgICAgICAgIChwdXNo IHggcmVzKSkKKyAgICAgICAgICAgICAgICAgICAobnJldmVyc2UgcmVzKSkKKyAgICAgICAgICAg ICAgICAgJygoMSAyIDMpICgyIDMpICgzKSkpKSkKKwogKGVydC1kZWZ0ZXN0IHRlc3Qtc2VxLWZp bHRlciAoKQogICAod2l0aC10ZXN0LXNlcXVlbmNlcyAoc2VxICcoNiA3IDggOSAxMCkpCiAgICAg KHNob3VsZCAoZXF1YWwgKHNlcS1maWx0ZXIgIyd0ZXN0LXNlcXVlbmNlcy1ldmVucCBzZXEpICco NiA4IDEwKSkpCi0tIAoyLjM0LjEKCg== --b1_0UHc1bd4Q0BgDpqpjszXE04CheHhJcGSYrxJNXBMFw4--
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Okamsn <okamsn@HIDDEN> Subject: bug#67456: Acknowledgement ([PATCH] seq.el: Add functions for mapping over subsequences) Message-ID: <handler.67456.B.170101909221556.ack <at> debbugs.gnu.org> References: <6f6d9f2d-fee9-4d1d-a1e4-8c6ce57a0627@HIDDEN> X-Gnu-PR-Message: ack 67456 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 67456 <at> debbugs.gnu.org Date: Sun, 26 Nov 2023 17:19:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-gnu-emacs@HIDDEN If you wish to submit further information on this problem, please send it to 67456 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 67456: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D67456 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN Subject: bug#67456: [PATCH] seq.el: Add functions for mapping over subsequences Resent-From: Okamsn <okamsn@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Tue, 28 Nov 2023 01:30:02 +0000 Resent-Message-ID: <handler.67456.B.170113498426940 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 67456 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 67456 <at> debbugs.gnu.org, nicolas@HIDDEN X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN, Nicolas Petton <nicolas@HIDDEN> Received: via spool by submit <at> debbugs.gnu.org id=B.170113498426940 (code B ref -1); Tue, 28 Nov 2023 01:30:02 +0000 Received: (at submit) by debbugs.gnu.org; 28 Nov 2023 01:29:44 +0000 Received: from localhost ([127.0.0.1]:45103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r7mv1-00070S-J6 for submit <at> debbugs.gnu.org; Mon, 27 Nov 2023 20:29:44 -0500 Received: from lists.gnu.org ([2001:470:142::17]:58580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <okamsn@HIDDEN>) id 1r7muz-00070B-7B for submit <at> debbugs.gnu.org; Mon, 27 Nov 2023 20:29:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <okamsn@HIDDEN>) id 1r7mum-0005oq-0D for bug-gnu-emacs@HIDDEN; Mon, 27 Nov 2023 20:29:28 -0500 Received: from mail-40131.protonmail.ch ([185.70.40.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <okamsn@HIDDEN>) id 1r7muj-0003FE-L2 for bug-gnu-emacs@HIDDEN; Mon, 27 Nov 2023 20:29:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1701134961; x=1701394161; bh=kDHHh21xjkyu/QplJuQHzMDo4+j4MUWslzDY6eTF6F0=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=FEe0tJKop5jAptXAsV+GM5K1fBWGog/3CzbBKNzZ++kkTaTI1rWNRb1aJ1bT3/rUg 6mhJuP1tGkjv8dUdi3dxp0uVxmFy9PUY4jyJeQCyFHoQC+Dxs+/hS74fnpC6nQ0SXP BWNtRvuLwI4SVCEyRF7w70E3S7bYxl68XrXu0fk6PdnBavaDtbigwUMWTAFZHj3tZS DtIMOOLnAkCxo0TwgfkWY94K8Zx7UbpK5IIvSRMLEHJL0z/DiOWWjRYOmDjajYVdOf m2zPeUsW7UyPmwbAARm7oj7agXE90pMMxsItyY2gFqDgONNwEKvTR96WQyU64vW9Xw L5nT8uHQtcWCA== Date: Tue, 28 Nov 2023 01:29:14 +0000 From: Okamsn <okamsn@HIDDEN> Message-ID: <3f57efba-4258-4c81-8c57-e6bedd19888f@HIDDEN> In-Reply-To: <6f6d9f2d-fee9-4d1d-a1e4-8c6ce57a0627@HIDDEN> References: <6f6d9f2d-fee9-4d1d-a1e4-8c6ce57a0627@HIDDEN> Feedback-ID: 25935600:user:proton MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_x5XJONrxbozzHL5DRQPmyW32AcFP2YgDqVVmGSbqHZM" Received-SPF: pass client-ip=185.70.40.131; envelope-from=okamsn@HIDDEN; helo=mail-40131.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.0 (/) This is a multi-part message in MIME format. --b1_x5XJONrxbozzHL5DRQPmyW32AcFP2YgDqVVmGSbqHZM Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Okamsn wrote: > Hello, >=20 > The attached features work like `cl-maplist` and `cl-mapl`, applying > functions to a sequence and to the remaining parts of a sequence. For > example, `(seq-mapsub #'identity [1 2 3])` returns `([1 2 3] [2 3] [3])`. >=20 > The patch adds a `seq-mapsub`, `seq-dosub`, and a `seq-doseqsub`, > similar to `seq-map`, `seq-do`, and `seq-doseq`, respectively. >=20 > I was looking for an equivalent for vectors of `cl-maplist`, `cl-mapl`, > and `cl-loop`'s `for VAR on LIST`, and think that these would be useful > additions. >=20 > To get the sub-sequences, the code uses `seq-rest` and stops when the > returned sub-sequence is empty according to `seq-empty-p`. This is > similar to how I would do it for a list, using `cdr` and `null`, but is > that a good way to do it for arrays and other sequences? >=20 > Thank you. I've updated the patch to only add the one `seq-mapsub` function, to be=20 more like `seq-mapn` and `seq-mapcat`, and to add an optimized version=20 for lists. Would you like anything changed? Thank you. --b1_x5XJONrxbozzHL5DRQPmyW32AcFP2YgDqVVmGSbqHZM Content-Type: text/x-patch; charset=UTF-8; name=v2-0001-Create-function-seq-mapsub-for-mapping-over-subse.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=v2-0001-Create-function-seq-mapsub-for-mapping-over-subse.patch RnJvbSBlYThlZTUxOTc3YzBhNTgzYmMzNzQ4NTZhZjYzMzk0NTE0NGJjN2RkIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBFYXJsIEh5YXR0IDxva2Ftc25AcHJvdG9ubWFpbC5jb20+CkRh dGU6IFN1biwgMjYgTm92IDIwMjMgMTE6MjA6MjggLTA1MDAKU3ViamVjdDogW1BBVENIIHYyXSBD cmVhdGUgZnVuY3Rpb24gJ3NlcS1tYXBzdWInIGZvciBtYXBwaW5nIG92ZXIKIHN1YnNlcXVlbmNl cy4KClRoaXMgZnVuY3Rpb24gaXMgc2ltaWxhciB0byAnY2wtbWFwbGlzdCcuCgoqIGxpc3AvZW1h Y3MtbGlzcC9zZXEuZWwgKHNlcS1tYXBzdWIpOiBBZGQgZ2VuZXJpYyBmdW5jdGlvbiBmb3IKbWFw cGluZyBvdmVyIHN1Yi1zZXF1ZW5jZXMsIGxpa2UgaW4gJ2NsLW1hcGxpc3QnLiAgQWRkIG9wdGlt aXplZAppbXBsZW1lbnRhdGlvbiBmb3IgbGlzdHMuCgoqIHRlc3QvbGlzcC9lbWFjcy1saXNwL3Nl cS10ZXN0cy5lbCAodGVzdC1zZXEtbWFwc3ViKTogQWRkIHRlc3RzIGZvcgp0aGUgYWJvdmUgZnVu Y3Rpb25zLgoKKiBkb2MvbGlzcHJlZi9zZXF1ZW5jZXMudGV4aSAoU2VxdWVuY2UgRnVuY3Rpb25z KTogRGVzY3JpYmUgdGhlCmZ1bmN0aW9uLgotLS0KIGRvYy9saXNwcmVmL3NlcXVlbmNlcy50ZXhp ICAgICAgICB8IDIwICsrKysrKysrKysrKysrKysrKysrCiBsaXNwL2VtYWNzLWxpc3Avc2VxLmVs ICAgICAgICAgICAgfCAyNSArKysrKysrKysrKysrKysrKysrKysrKysrCiB0ZXN0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N1YiAjJ2lk ZW50aXR5IFtdKQorICAgICAgICAgICAgICAgICBuaWwpKSkKKwogKGVydC1kZWZ0ZXN0IHRlc3Qt c2VxLWZpbHRlciAoKQogICAod2l0aC10ZXN0LXNlcXVlbmNlcyAoc2VxICcoNiA3IDggOSAxMCkp CiAgICAgKHNob3VsZCAoZXF1YWwgKHNlcS1maWx0ZXIgIyd0ZXN0LXNlcXVlbmNlcy1ldmVucCBz ZXEpICcoNiA4IDEwKSkpCi0tIAoyLjM0LjEKCg== --b1_x5XJONrxbozzHL5DRQPmyW32AcFP2YgDqVVmGSbqHZM--
X-Loop: help-debbugs@HIDDEN Subject: bug#67456: [PATCH] seq.el: Add functions for mapping over subsequences Resent-From: Augusto Stoffel <arstoffel@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 01 Dec 2023 20:15:02 +0000 Resent-Message-ID: <handler.67456.B.17014616811402 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 67456 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 67456 <at> debbugs.gnu.org Cc: okamsn@HIDDEN, nicolas@HIDDEN X-Debbugs-Original-To: Okamsn via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> X-Debbugs-Original-Cc: Okamsn <okamsn@HIDDEN>, nicolas@HIDDEN, 67456 <at> debbugs.gnu.org Received: via spool by submit <at> debbugs.gnu.org id=B.17014616811402 (code B ref -1); Fri, 01 Dec 2023 20:15:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Dec 2023 20:14:41 +0000 Received: from localhost ([127.0.0.1]:56133 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r99uK-0000MY-RC for submit <at> debbugs.gnu.org; Fri, 01 Dec 2023 15:14:41 -0500 Received: from lists.gnu.org ([2001:470:142::17]:45272) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <arstoffel@HIDDEN>) id 1r99uH-0000M5-Pc for submit <at> debbugs.gnu.org; Fri, 01 Dec 2023 15:14:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <arstoffel@HIDDEN>) id 1r99tz-0003Ff-KC for bug-gnu-emacs@HIDDEN; Fri, 01 Dec 2023 15:14:21 -0500 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <arstoffel@HIDDEN>) id 1r99ty-0003vl-4D for bug-gnu-emacs@HIDDEN; Fri, 01 Dec 2023 15:14:19 -0500 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a195e0145acso235404166b.2 for <bug-gnu-emacs@HIDDEN>; Fri, 01 Dec 2023 12:14:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701461656; x=1702066456; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=hEMADib7T0f+UZQ3+DtdZ9UY6OllWFXrR7FVSUQSVAo=; b=kgrgRKibtORA+qHk5DJUD/JF4zGsZNhvax8g5I7vLOvwIeEemI9p9ufvgk2/doTVo1 o3RghaGNiIQFeJoLYcXMGY3nurDe2cNCPDrBTC32EU48mHL+xmJSth8dnSOJ700ZbXHV gXHl4eT4p+D0Ux0uPtprMM4PDmxIbJs7V0cuUfEP1XA+GnRZrqDkyIXPSgyb/Qmkfg+j 2nmfUVmWHVBk9c8FugJkjlNyegvBz/YL4dytVzsuwUhj33pqXUlrm0y52gU24Jo4zvJa 53GPx7P21htAYFDjgkMqBOI3UW6P/KA/aNosqLFkPdwGX3Mu28jgUsP/74MX++d1L45I l05w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701461656; x=1702066456; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hEMADib7T0f+UZQ3+DtdZ9UY6OllWFXrR7FVSUQSVAo=; b=xK/eLVWyJIZ2q9k8AB3RcSU7K0GHlyEuBCSYHVSMo25fs4FiGfcUSen9epJYRI2Zdn DohaTQ+hs7IXa1WjEjYUnrfZ3C7bV1iD/iJBezMtgd6kRBbIKEJtU5x1ymSoNOf13NuZ ujDprgNMwg94dCuKTJifUQu6Xt1y2nIptHpPRsj2c2CRBGE73YgZtdhAAaqyBbLYAUkz f82tuoR1jOSOMtT1Qzp0/FDOso767NlJAZHdwM332oMSm4j9F7d0YLPdarNxATHuISxG VLUc7aSwL2Ev+oFvNmkPRTtDBBfKZ8VNXm0nAsD2CDd2LmZ44rURsK772Ulhz/Ot12YU a3CA== X-Gm-Message-State: AOJu0YzDK0zIc59a0CT5cm8ynmWEKYt/tSOB8YRwXXl/fEqY2ijyAAo5 xbtlS8Miw2Up10172/zO8vMdub9EgwY= X-Google-Smtp-Source: AGHT+IGRGrv2cnXcGohPSxBHIm8hDFE9vbyL2FRT4hQOnLtGZXy2zckg7KnyNnvNmLVd80oVqfpbCw== X-Received: by 2002:a17:907:511:b0:a19:a19b:4268 with SMTP id wj17-20020a170907051100b00a19a19b4268mr747824ejb.211.1701461655766; Fri, 01 Dec 2023 12:14:15 -0800 (PST) Received: from ars3 ([2a02:8109:8a87:ff00::1fd7]) by smtp.gmail.com with ESMTPSA id f20-20020a1709067f9400b00a121e5d002bsm2280793ejr.174.2023.12.01.12.14.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 12:14:14 -0800 (PST) From: Augusto Stoffel <arstoffel@HIDDEN> In-Reply-To: <3f57efba-4258-4c81-8c57-e6bedd19888f@HIDDEN> (Okamsn via's message of "Tue, 28 Nov 2023 01:29:14 +0000") References: <6f6d9f2d-fee9-4d1d-a1e4-8c6ce57a0627@HIDDEN> <3f57efba-4258-4c81-8c57-e6bedd19888f@HIDDEN> Date: Fri, 01 Dec 2023 21:14:13 +0100 Message-ID: <87bkb9y92i.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=arstoffel@HIDDEN; helo=mail-ej1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.0 (/) On Tue, 28 Nov 2023 at 01:29, Okamsn via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote: > Okamsn wrote: >> Hello, >> >> The attached features work like `cl-maplist` and `cl-mapl`, applying >> functions to a sequence and to the remaining parts of a sequence. For >> example, `(seq-mapsub #'identity [1 2 3])` returns `([1 2 3] [2 3] [3])`. >> >> The patch adds a `seq-mapsub`, `seq-dosub`, and a `seq-doseqsub`, >> similar to `seq-map`, `seq-do`, and `seq-doseq`, respectively. >> >> I was looking for an equivalent for vectors of `cl-maplist`, `cl-mapl`, >> and `cl-loop`'s `for VAR on LIST`, and think that these would be useful >> additions. >> >> To get the sub-sequences, the code uses `seq-rest` and stops when the >> returned sub-sequence is empty according to `seq-empty-p`. This is >> similar to how I would do it for a list, using `cdr` and `null`, but is >> that a good way to do it for arrays and other sequences? >> >> Thank you. > > I've updated the patch to only add the one `seq-mapsub` function, to be > more like `seq-mapn` and `seq-mapcat`, and to add an optimized version > for lists. > > Would you like anything changed? > > Thank you. This operation has quadratic complexity for anything other than regular linked lists. I'm not sure it's a good idea to add it to a generic sequence library...
X-Loop: help-debbugs@HIDDEN Subject: bug#67456: [PATCH] seq.el: Add functions for mapping over subsequences Resent-From: Augusto Stoffel <arstoffel@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 01 Dec 2023 20:15:02 +0000 Resent-Message-ID: <handler.67456.B67456.17014616761383 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 67456 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 67456 <at> debbugs.gnu.org Cc: okamsn@HIDDEN, nicolas@HIDDEN X-Debbugs-Original-To: Okamsn via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> X-Debbugs-Original-Cc: Okamsn <okamsn@HIDDEN>, nicolas@HIDDEN, 67456 <at> debbugs.gnu.org Received: via spool by 67456-submit <at> debbugs.gnu.org id=B67456.17014616761383 (code B ref 67456); Fri, 01 Dec 2023 20:15:02 +0000 Received: (at 67456) by debbugs.gnu.org; 1 Dec 2023 20:14:36 +0000 Received: from localhost ([127.0.0.1]:56130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r99uG-0000MF-Gm for submit <at> debbugs.gnu.org; Fri, 01 Dec 2023 15:14:36 -0500 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]:47597) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <arstoffel@HIDDEN>) id 1r99uA-0000Ly-S9 for 67456 <at> debbugs.gnu.org; Fri, 01 Dec 2023 15:14:35 -0500 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a1a2615e909so138858166b.3 for <67456 <at> debbugs.gnu.org>; Fri, 01 Dec 2023 12:14:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701461656; x=1702066456; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=hEMADib7T0f+UZQ3+DtdZ9UY6OllWFXrR7FVSUQSVAo=; b=SBnHza2YZpaHdNZOcMSYUJpsg9VsMxc26y3wuIGA7vzvUJ2B45WOsyID2ZcF5BHqIh OT08sG3XUObT7wywPYNLAXyXEMatRkOx6xEY63tnmXTpKhlz8vEBWwoKTTULBP/SE27T jxcESxgOGPwemDX62n2566eE5NbCvS2L3vrFin+Lxay3WepPZX4xUSUqvujzH/CUZFtO iB79JmMmr8aLcF6c8/vvolwz3MdquO0qJoKgSSdo3r6plVNOP+Hwn1038C0oFAACiCeZ a+6nHmVtPPbdKlHlF+pqljuNLT8dDL/lKKNMEGFmmTl5HnFkGOKvf/PGnDKba6qFl+Ma 0aPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701461656; x=1702066456; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hEMADib7T0f+UZQ3+DtdZ9UY6OllWFXrR7FVSUQSVAo=; b=jtAXsABR/ppl8oiyjEzwaSElZLXCNN3gVs+jYwAqED+CLf3Xok64K8NEfMcM9kN1wF QKvKaNywXvGtciBznuP7G+DdeNY2i1gBaanVEZUqdHHxGp6N+zy3qXqMo0D+FAUS/XGB ApTGWIw+B6FFK/1PGNxz/m0WT9+EP4dkXC00o1x6WcK50M3fEn44H8PbC+PYXtU1gHgc Or+VtMJHvWgUzEfTKkeqf1BdyJmymaMMy0Cqz6RGmhzXEep9xkxSOisA7LrsPZxHmP23 +86NcLebqdqkbvnVdR47ppS8DMNY/mvGICo3Yy8WYKIGs4eWiKzDVt12ycOzXOimdrBg HD2g== X-Gm-Message-State: AOJu0YyTNqhtB3dG+bJLoZVa2aJy8bUjKpMqrYxDq7nTsdLmmT9LBa3e 3ttvpfh/7e37sJHWn8s6k7A= X-Google-Smtp-Source: AGHT+IGRGrv2cnXcGohPSxBHIm8hDFE9vbyL2FRT4hQOnLtGZXy2zckg7KnyNnvNmLVd80oVqfpbCw== X-Received: by 2002:a17:907:511:b0:a19:a19b:4268 with SMTP id wj17-20020a170907051100b00a19a19b4268mr747824ejb.211.1701461655766; Fri, 01 Dec 2023 12:14:15 -0800 (PST) Received: from ars3 ([2a02:8109:8a87:ff00::1fd7]) by smtp.gmail.com with ESMTPSA id f20-20020a1709067f9400b00a121e5d002bsm2280793ejr.174.2023.12.01.12.14.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 12:14:14 -0800 (PST) From: Augusto Stoffel <arstoffel@HIDDEN> In-Reply-To: <3f57efba-4258-4c81-8c57-e6bedd19888f@HIDDEN> (Okamsn via's message of "Tue, 28 Nov 2023 01:29:14 +0000") References: <6f6d9f2d-fee9-4d1d-a1e4-8c6ce57a0627@HIDDEN> <3f57efba-4258-4c81-8c57-e6bedd19888f@HIDDEN> Date: Fri, 01 Dec 2023 21:14:13 +0100 Message-ID: <87bkb9y92i.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On Tue, 28 Nov 2023 at 01:29, Okamsn via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote: > Okamsn wrote: >> Hello, >> >> The attached features work like `cl-maplist` and `cl-mapl`, applying >> functions to a sequence and to the remaining parts of a sequence. For >> example, `(seq-mapsub #'identity [1 2 3])` returns `([1 2 3] [2 3] [3])`. >> >> The patch adds a `seq-mapsub`, `seq-dosub`, and a `seq-doseqsub`, >> similar to `seq-map`, `seq-do`, and `seq-doseq`, respectively. >> >> I was looking for an equivalent for vectors of `cl-maplist`, `cl-mapl`, >> and `cl-loop`'s `for VAR on LIST`, and think that these would be useful >> additions. >> >> To get the sub-sequences, the code uses `seq-rest` and stops when the >> returned sub-sequence is empty according to `seq-empty-p`. This is >> similar to how I would do it for a list, using `cdr` and `null`, but is >> that a good way to do it for arrays and other sequences? >> >> Thank you. > > I've updated the patch to only add the one `seq-mapsub` function, to be > more like `seq-mapn` and `seq-mapcat`, and to add an optimized version > for lists. > > Would you like anything changed? > > Thank you. This operation has quadratic complexity for anything other than regular linked lists. I'm not sure it's a good idea to add it to a generic sequence library...
X-Loop: help-debbugs@HIDDEN Subject: bug#67456: [PATCH] seq.el: Add functions for mapping over subsequences Resent-From: Okamsn <okamsn@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 03 Dec 2023 01:26:01 +0000 Resent-Message-ID: <handler.67456.B.170156675625303 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 67456 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: arstoffel@HIDDEN, 67456 <at> debbugs.gnu.org Cc: nicolas@HIDDEN X-Debbugs-Original-To: Augusto Stoffel <arstoffel@HIDDEN>, "Okamsn via \"Bug reports for GNU Emacs, the Swiss army knife of text editors\"" <bug-gnu-emacs@HIDDEN> X-Debbugs-Original-Cc: nicolas@HIDDEN, 67456 <at> debbugs.gnu.org Received: via spool by submit <at> debbugs.gnu.org id=B.170156675625303 (code B ref -1); Sun, 03 Dec 2023 01:26:01 +0000 Received: (at submit) by debbugs.gnu.org; 3 Dec 2023 01:25:56 +0000 Received: from localhost ([127.0.0.1]:58937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r9bF6-0006a2-0k for submit <at> debbugs.gnu.org; Sat, 02 Dec 2023 20:25:56 -0500 Received: from lists.gnu.org ([2001:470:142::17]:41178) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <okamsn@HIDDEN>) id 1r9bF4-0006ZZ-OC for submit <at> debbugs.gnu.org; Sat, 02 Dec 2023 20:25:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <okamsn@HIDDEN>) id 1r9bEp-00065s-5v for bug-gnu-emacs@HIDDEN; Sat, 02 Dec 2023 20:25:39 -0500 Received: from mail-40133.protonmail.ch ([185.70.40.133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <okamsn@HIDDEN>) id 1r9bEn-0007Kg-Bi for bug-gnu-emacs@HIDDEN; Sat, 02 Dec 2023 20:25:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1701566733; x=1701825933; bh=89mfsvPnIv9kvMRnchN/7EgPvy44DG+XEXk86gPuhAM=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=jRFxevqRgGoYNgaxQ3vdmEVFIhRoy3bHv+ZbPcOOv5BDv2H4cJHq/c7S43af9huLz AbXoXGZYY2QY0hHXgs5am4Ysp5cT3jljrfqRqFK9TnRponiBQCZAr6AdBAs2geLPaY TP2AGCh6KSIYVwUbRYnLpPWV+J18Cx5ac+ObyHHvYtImKl/+bNrv1P5kmTiyxvR469 ExgWO7doJmLQ435j0moPcK3PYdoXOOO1UQao8SaOOMLxHGEdU1inTbqu/GkULTxl2a XCbXEjhN8J4Dmn3Gx28zlNLpkHWNqxAaSEipEWwtfWiraouEZYNDH/Zt1ZpvUrViLE U/33YFsJVK6gA== Date: Sun, 03 Dec 2023 01:25:25 +0000 From: Okamsn <okamsn@HIDDEN> Message-ID: <4b435881-ee4c-42fd-88bc-fe8438567211@HIDDEN> In-Reply-To: <87bkb9y92i.fsf@HIDDEN> References: <6f6d9f2d-fee9-4d1d-a1e4-8c6ce57a0627@HIDDEN> <3f57efba-4258-4c81-8c57-e6bedd19888f@HIDDEN> <87bkb9y92i.fsf@HIDDEN> Feedback-ID: 25935600:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.133; envelope-from=okamsn@HIDDEN; helo=mail-40133.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.0 (/) Augusto Stoffel wrote: > This operation has quadratic complexity for anything other than regular > linked lists. I'm not sure it's a good idea to add it to a generic > sequence library... Thank you for the feedback. Do you know whether there is a better way to implement the idea for=20 arrays? Is there a way to apply a function to a portion of the array=20 without copying the sub-sequences, if that is what you mean?
X-Loop: help-debbugs@HIDDEN Subject: bug#67456: [PATCH] seq.el: Add functions for mapping over subsequences Resent-From: Okamsn <okamsn@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 03 Dec 2023 01:26:02 +0000 Resent-Message-ID: <handler.67456.B67456.170156675225286 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 67456 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: arstoffel@HIDDEN, 67456 <at> debbugs.gnu.org Cc: nicolas@HIDDEN X-Debbugs-Original-To: Augusto Stoffel <arstoffel@HIDDEN>, "Okamsn via \"Bug reports for GNU Emacs, the Swiss army knife of text editors\"" <bug-gnu-emacs@HIDDEN> X-Debbugs-Original-Cc: nicolas@HIDDEN, 67456 <at> debbugs.gnu.org Received: via spool by 67456-submit <at> debbugs.gnu.org id=B67456.170156675225286 (code B ref 67456); Sun, 03 Dec 2023 01:26:02 +0000 Received: (at 67456) by debbugs.gnu.org; 3 Dec 2023 01:25:52 +0000 Received: from localhost ([127.0.0.1]:58933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r9bF1-0006Zj-M7 for submit <at> debbugs.gnu.org; Sat, 02 Dec 2023 20:25:51 -0500 Received: from mail-40134.protonmail.ch ([185.70.40.134]:22479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <okamsn@HIDDEN>) id 1r9bF0-0006ZR-7Q for 67456 <at> debbugs.gnu.org; Sat, 02 Dec 2023 20:25:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1701566733; x=1701825933; bh=89mfsvPnIv9kvMRnchN/7EgPvy44DG+XEXk86gPuhAM=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=jRFxevqRgGoYNgaxQ3vdmEVFIhRoy3bHv+ZbPcOOv5BDv2H4cJHq/c7S43af9huLz AbXoXGZYY2QY0hHXgs5am4Ysp5cT3jljrfqRqFK9TnRponiBQCZAr6AdBAs2geLPaY TP2AGCh6KSIYVwUbRYnLpPWV+J18Cx5ac+ObyHHvYtImKl/+bNrv1P5kmTiyxvR469 ExgWO7doJmLQ435j0moPcK3PYdoXOOO1UQao8SaOOMLxHGEdU1inTbqu/GkULTxl2a XCbXEjhN8J4Dmn3Gx28zlNLpkHWNqxAaSEipEWwtfWiraouEZYNDH/Zt1ZpvUrViLE U/33YFsJVK6gA== Date: Sun, 03 Dec 2023 01:25:25 +0000 From: Okamsn <okamsn@HIDDEN> Message-ID: <4b435881-ee4c-42fd-88bc-fe8438567211@HIDDEN> In-Reply-To: <87bkb9y92i.fsf@HIDDEN> References: <6f6d9f2d-fee9-4d1d-a1e4-8c6ce57a0627@HIDDEN> <3f57efba-4258-4c81-8c57-e6bedd19888f@HIDDEN> <87bkb9y92i.fsf@HIDDEN> Feedback-ID: 25935600:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Augusto Stoffel wrote: > This operation has quadratic complexity for anything other than regular > linked lists. I'm not sure it's a good idea to add it to a generic > sequence library... Thank you for the feedback. Do you know whether there is a better way to implement the idea for=20 arrays? Is there a way to apply a function to a portion of the array=20 without copying the sub-sequences, if that is what you mean?
X-Loop: help-debbugs@HIDDEN Subject: bug#67456: [PATCH] seq.el: Add functions for mapping over subsequences Resent-From: Philip Kaludercic <philipk@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 25 Dec 2023 20:27:02 +0000 Resent-Message-ID: <handler.67456.B67456.170353600019481 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 67456 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Okamsn <okamsn@HIDDEN> Cc: nicolas@HIDDEN, 67456 <at> debbugs.gnu.org Received: via spool by 67456-submit <at> debbugs.gnu.org id=B67456.170353600019481 (code B ref 67456); Mon, 25 Dec 2023 20:27:02 +0000 Received: (at 67456) by debbugs.gnu.org; 25 Dec 2023 20:26:40 +0000 Received: from localhost ([127.0.0.1]:55439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rHrX5-000549-Lv for submit <at> debbugs.gnu.org; Mon, 25 Dec 2023 15:26:39 -0500 Received: from mout01.posteo.de ([185.67.36.65]:49385) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <philipk@HIDDEN>) id 1rHrWz-00053n-Tw for 67456 <at> debbugs.gnu.org; Mon, 25 Dec 2023 15:26:37 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 084A0240028 for <67456 <at> debbugs.gnu.org>; Mon, 25 Dec 2023 21:26:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1703535981; bh=vRksafUxQl4LABZIf3OC0/JemvqKMokv9Jl2yuo53jM=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: From; b=FqL5EtVM4XPvAEN16yo5coRMsX5X9goC+pxJ+uFbbCoXwSXSd6BeJ5twok1Wh/nsF 1RKm4I4oL8W5PsKAhfzEz88pioDNB6cI+Qgz6VPE5ons0aZ1WjAz2ArpuHOuc1y+3c zuGZ66D+4jRR05iVfBjkCU0OSBW2oLoo6Nd9/O55uALgBFDkn7F0KEyZ5xZUQA/b5g 9jNazwqlYgTJOCgG0fUg/i7fkwk+w77rfwaNAg7dcTl19cr4a9dKU6wbflzkqlvo0T 7MyDXmAhxJC4O+N74fMYPcxbXleG1OHA+D0x7g96sWNLWbFEoYZJ5stIvakqg8W8Dw SxFaukHT7LD+g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SzTvJ13NHz9rxB; Mon, 25 Dec 2023 21:26:20 +0100 (CET) From: Philip Kaludercic <philipk@HIDDEN> In-Reply-To: <6f6d9f2d-fee9-4d1d-a1e4-8c6ce57a0627@HIDDEN> (okamsn@HIDDEN's message of "Sun, 26 Nov 2023 17:17:35 +0000") References: <6f6d9f2d-fee9-4d1d-a1e4-8c6ce57a0627@HIDDEN> Autocrypt: addr=philipk@HIDDEN; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Mon, 25 Dec 2023 20:26:18 +0000 Message-ID: <87tto6rpud.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Okamsn <okamsn@HIDDEN> writes: > Hello, > > The attached features work like `cl-maplist` and `cl-mapl`, applying > functions to a sequence and to the remaining parts of a sequence. For > example, `(seq-mapsub #'identity [1 2 3])` returns `([1 2 3] [2 3] [3])`. > > The patch adds a `seq-mapsub`, `seq-dosub`, and a `seq-doseqsub`, > similar to `seq-map`, `seq-do`, and `seq-doseq`, respectively. How about adding a custom sequence type, that operates on sub-sequences as elements? --8<---------------cut here---------------start------------->8--- (cl-defstruct (subseq (:constructor seq-make-subseq (seq))) seq) (cl-defmethod seq-elt ((seq subseq) n) (seq-subseq (subseq-seq seq) n (seq-length seq))) (cl-defmethod seq-length ((seq subseq)) (seq-length (subseq-seq seq))) (cl-defmethod seq-do (fn (seq subseq)) (seq-do fn (subseq-seq seq))) ;; etc. --8<---------------cut here---------------end--------------->8--- It might not be that efficient either, but at least it doesn't require more functions.
Received: (at control) by debbugs.gnu.org; 10 Jan 2024 17:42:12 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 10 12:42:12 2024 Received: from localhost ([127.0.0.1]:42836 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rNcah-0008Bh-Ts for submit <at> debbugs.gnu.org; Wed, 10 Jan 2024 12:42:12 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:43099) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1rNcag-0008BQ-G7 for control <at> debbugs.gnu.org; Wed, 10 Jan 2024 12:42:10 -0500 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-557bfc7f7b4so5562201a12.0 for <control <at> debbugs.gnu.org>; Wed, 10 Jan 2024 09:42:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704908526; x=1705513326; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=B/hf+MN9sb9VvjYts8k0InOs9pdVokjgm0kYa1bsFlI=; b=X7jR6qW7s/A++6yk1lV+KNTH+gfBlVrFLbI/i9ttKcfbi8+gyoxhzjek8xByl2iWJV oeoT6BG1x+hRGgBh/4tD8zxxyxJtNF0IOxtO/t2fUPog7elMD3Grru7Cxn5p+P4ZpVew 6onTClUIcEZlPG1WqGLP+k2FYEyeMd/3FBuI6TxG/MeWuihSUEMKVaMG8lxWVEsq/oUQ z4jzS9MBhvK0hCerN1Q8+txUtzflcQQDDD5Z4/R/9uDawuP1aCi1ajh/tTBlMcVx+8iZ bmuwUKVLftWmsCFPypspWtUbtc4GLAtSgmYBKsMcUDAS2qOULpGcoW9aM8o2Xlo9oOIM 3JLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704908526; x=1705513326; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=B/hf+MN9sb9VvjYts8k0InOs9pdVokjgm0kYa1bsFlI=; b=lwA6QbYC7TOJV+hKEiR8SudNBd5+HOI9iF/t8/uvdYcDZQbumr8GmyaWD4ZSyxeoKX E8Hut6pOocIdjZ95IzMPjtXBsVccpvDiEZIFA+YXg0QtyiZ94VziqHz1cpTXNJzKEjTG VPOi4DuQ4KGu1YBnhwzJ8ThQPdKeSWg0ui6+d5K9ZDzLnetk1/SBuwV0HQ70ht+g/6MQ OuBFbYTvF/mb2mB3hVWV0sxNUXL+PZVrODbFCSJxKz0GfhY99VUbz10QbzFHeS2zZtes 65fwie/oFg74NKzPOGqk2pe34CbYXk0g05VkQ+O4F59uzC+XwY9iaAWD4GiCxbqZfRRq JmpQ== X-Gm-Message-State: AOJu0Yz/DJ1tU9qC81+bsTZ6vKJIM+e7t41F7VTDVGLezn1rWk3exRkk lV9LO6DLTYuS2QpkRe6+I8IgFWyO9eKDNd0csptGlP07els8rA== X-Google-Smtp-Source: AGHT+IHgthEm258Dcelfh5C32PciuCpyCB30UiLzqYv6jdRDGB460kuybAMgwwvx6CpR9QWGKz0dCKObvaI1xGipPK4= X-Received: by 2002:aa7:c50d:0:b0:557:3cbb:8f52 with SMTP id o13-20020aa7c50d000000b005573cbb8f52mr443906edq.19.1704908526063; Wed, 10 Jan 2024 09:42:06 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 10 Jan 2024 09:42:05 -0800 From: Stefan Kangas <stefankangas@HIDDEN> MIME-Version: 1.0 Date: Wed, 10 Jan 2024 09:42:05 -0800 Message-ID: <CADwFkmkaNKnFvhu8_0sOHR0QHUSte5qOEx0c-epq6D5y_2e3YA@HIDDEN> Subject: control message for bug #67456 To: control <at> debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) severity 67456 wishlist quit
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.