From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Okamsn via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#68863: Add support for using setf with seq-subseq Date: Wed, 14 Feb 2024 02:50:29 +0000 Message-ID: <8d2a8d06-5b69-4587-9aab-36f7c792c623@protonmail.com> References: <050ba625-2372-425f-85c6-988e2ef4cf14@protonmail.com> <86y1bvw5ff.fsf@gnu.org> <2dfd9d7f-5c63-4e1d-845c-cd245a71fc34@protonmail.com> Reply-To: Okamsn Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20474"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68863@debbugs.gnu.org, Nicolas Petton To: Stefan Monnier , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 14 03:52:23 2024 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 1ra5Nn-00056N-5h for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Feb 2024 03:52:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ra5ND-00087M-Iz; Tue, 13 Feb 2024 21:51:47 -0500 Original-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 ) id 1ra5NB-00086g-GZ for bug-gnu-emacs@gnu.org; Tue, 13 Feb 2024 21:51:45 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ra5NB-00067J-8K for bug-gnu-emacs@gnu.org; Tue, 13 Feb 2024 21:51:45 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ra5NS-0005vp-Ms for bug-gnu-emacs@gnu.org; Tue, 13 Feb 2024 21:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Okamsn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Feb 2024 02:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68863 X-GNU-PR-Package: emacs Original-Received: via spool by 68863-submit@debbugs.gnu.org id=B68863.170787907222702 (code B ref 68863); Wed, 14 Feb 2024 02:52:02 +0000 Original-Received: (at 68863) by debbugs.gnu.org; 14 Feb 2024 02:51:12 +0000 Original-Received: from localhost ([127.0.0.1]:49129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ra5Me-0005u5-9F for submit@debbugs.gnu.org; Tue, 13 Feb 2024 21:51:12 -0500 Original-Received: from mail-4316.protonmail.ch ([185.70.43.16]:11033) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ra5Mc-0005tn-Jx for 68863@debbugs.gnu.org; Tue, 13 Feb 2024 21:51:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1707879046; x=1708138246; bh=4ETv0m0qZsdeZFsX4ClolRdIjLc0jsUb1zIUfcIOZlA=; 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=R72VIO/+tJeeFdohgM5A5/gllaGElQEY1bl2x8dw9qD06wdFV+QS0923cpzksNkK/ vkwyYkt6jj5Qd6r8+nseO/uYabhD48eudf/1MBbn87nVEypSBkkTVrJDM//0Bqejwv NaKMhwTLqo2t4+oCa7iaxvu6fzdzNt0tQueDHHFGraUdwV+yVnDiqOmO7YASadtAyR bA0WG9TL+FwfTqUeX/gfnWXwJ9ZM0e+zLdM5kIz4hTguDx0VEFJLK0z3zPRBKifiTc IcTNohuqmdLN6QbAOHhLyZ6iSMbBqu5Tz2pdIzmBlacUP9o1Fcwx4qoQDJLxvrXzwi zfDjntXpkptzw== In-Reply-To: <2dfd9d7f-5c63-4e1d-845c-cd245a71fc34@protonmail.com> Feedback-ID: 25935600:user:proton 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:279992 Archived-At: Okamsn wrote: > Stefan Monnier wrote: >>>> To avoid modifying more values than specified, that modifying function >>>> uses a `when` condition. I'm not sure of a good way to stop `seq-do` >>>> early when we know that it can stop calling the modifying function. >>>> Normally, I would use `cl-block` and `cl-return`. Is it OK to use thos= e >>>> features in `seq.el`? If not, is it worth adding something like a >>>> `seq-map-while` or a `seq-do-while`? >> >> `seq.el` is used by some parts of the implementation of `cl-lib`, so >> the use of `cl-lib` risks introducing a circular dependency. Maybe usin= g >> `cl-block/return` would be OK, but I wouldn't be surprised if it causes >> bootstrap trouble. You can use catch/throw, OTOH. >> >> >> Stefan >> >=20 > Attached is an updated version using `catch` and `throw`. Thank you for > pointing those out to me. The patch is also changed to signal > `args-out-of-range` for the start and end indexes to be more like > `seq-subseq`. >=20 > How does it look? Hello, After testing it more, I see that what I've written does not work as I=20 expected in the case (let ((v (vector (vector 0 1) (vector 2 3) (vector 4 5)))) (setf (seq-subseq (seq-subseq (elt v 0) 0) 0) [10]) v) in which I would expect it to replace the first element of the first=20 sub-vector with 10. I will take more time to continue working on this. Thank you for your patience.