From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 22 22:11:25 2024 Received: (at submit) by debbugs.gnu.org; 23 Apr 2024 02:11:25 +0000 Received: from localhost ([127.0.0.1]:49121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rz5cw-0002g6-Fo for submit@debbugs.gnu.org; Mon, 22 Apr 2024 22:11:25 -0400 Received: from lists.gnu.org ([2001:470:142::17]:41416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rz5cq-0002fA-Qj for submit@debbugs.gnu.org; Mon, 22 Apr 2024 22:11:20 -0400 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 1rz5cV-0000T6-04 for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2024 22:10:55 -0400 Received: from mail-4322.protonmail.ch ([185.70.43.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rz5cS-0000bG-UD for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2024 22:10:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1713838249; x=1714097449; bh=g2HmWwIGdW3dgPgQGM9e93WbhSBaRBJU5uHsv6fslms=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=PF8Zi4AmbzsLp9cSxhBMErqzovey50uy6/d/3DbeDJOrrvOdqFEL1HQ4IkaCz9g7h +PkYpqBRSCtc9zBMfHuAxbow0qzESgizMgUAHTKOjDXY4+RXJJwbmPSvyuaEz2J9SA qzJAjyrG+ek+pypyh2m4CSrIeAUrDYAQ3PzoVKmu6wVnd0VdFB3Gdnh9rMiwtIDRQ2 SqOJw6emuVmzHVoMdCO9wwz4ECfb25O5dhf93psJH8VANp9ATn1LL1tT+ClmZ3tQUu 0/T73+BJ3oHg1WcesLabzZKnhiKRVaGIuvA8D41xlyYQsloarjBQMtD/HqprAxd9NC rq+qcZ7ESf54w== Date: Tue, 23 Apr 2024 02:10:42 +0000 To: bug-gnu-emacs@gnu.org From: Okamsn Subject: [PATCH] Fix `map-elt` with `setf` for subplaces Message-ID: Feedback-ID: 25935600:user:proton X-Pm-Message-ID: ffd85a7cf8bcef56506f39471b78cb88e56e3cca MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_mEdZrw8tdZDEdt6hXfg7OSynWeQY3nEXp0RPG4GR9c" Received-SPF: pass client-ip=185.70.43.22; envelope-from=okamsn@protonmail.com; helo=mail-4322.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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) This is a multi-part message in MIME format. --b1_mEdZrw8tdZDEdt6hXfg7OSynWeQY3nEXp0RPG4GR9c Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, Currently, the use (let ((arr (vector 0 1 2 3 4 5 6))) (setf (map-elt (cl-subseq arr 3) 0) 27) arr) expands to (let ((arr (vector 0 1 2 3 4 5 6))) (let* ((v arr)) (condition-case nil (with-no-warnings (map-put! (cl-subseq v 3) 0 27 nil)) (map-not-inplace (let* ((new (map-insert (cl-subseq v 3) 0 27))) (progn (cl-replace v new :start1 3 :end1 nil) new)) 27))) arr) which does not modify the original variable `arr` due to how `map-put!`=20 is being used. With the attached patch, it would expand to (let ((arr (vector 0 1 2 3 4 5 6))) (let* ((v arr)) (condition-case nil (with-no-warnings (let* ((m (cl-subseq v 3))) (progn (map-put! m 0 27 nil) (let* ((new m)) (progn (cl-replace v new :start1 3 :end1 nil) new)) 27))) (map-not-inplace (let* ((new (map-insert (cl-subseq v 3) 0 27))) (progn (cl-replace v new :start1 3 :end1 nil) new)) 27))) arr) which correctly sets the value using `cl-replace` as the setter for=20 `cl-subseq`. Thank you. --b1_mEdZrw8tdZDEdt6hXfg7OSynWeQY3nEXp0RPG4GR9c Content-Type: text/x-patch; charset=UTF-8; name=0001-Make-setf-with-map-elt-work-with-subplaces.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=0001-Make-setf-with-map-elt-work-with-subplaces.patch RnJvbSAxYWM2NTg1OGRjMmYyNDE5NzVkZjg2MjBhYzc5Yzk3M2ZjYzZkYWQ0IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBFYXJsIEh5YXR0IDxva2Ftc25AcHJvdG9ubWFpbC5jb20+CkRh dGU6IE1vbiwgMjIgQXByIDIwMjQgMjE6NDU6MDMgLTA0MDAKU3ViamVjdDogW1BBVENIXSBNYWtl IHNldGYgd2l0aCBtYXAtZWx0IHdvcmsgd2l0aCBzdWJwbGFjZXMuCgoqIGxpc3AvZW1hY3MtbGlz cC9tYXAuZWwgKG1hcC1lbHQpOiBVc2luZyB0aGUgc2V0dGluZyBmdW5jdGlvbiBkZWZpbmVkCmJ5 ICdndi1sZXRwbGFjZScgdG8gbWFrZSBzdXJlIHRoYXQgd2UgY2FwdHVyZSB0aGUgbW9kaWZpY2F0 aW9uLCBldmVuCndoZW4gdXNpbmcgJ21hcC1wdXQhJy4gIE90aGVyd2lzZSwgdGhlIHN1Yi1wbGFj ZSBtaWdodCBiZSB1bmRlcnN0b29kIGFzCmEgbm9ybWFsIGZ1bmN0aW9uIGNhbGwgdGhhdCB3aWxs IGNyZWF0ZSB0aGUgdmFsdWUgdG8gbW9kaWZ5IGluc3RlYWQuCgoqIHRlc3QvbGlzcC9lbWFjcy1s aXNwL21hcC10ZXN0cy5lbCAodGVzdC1zZXRmLW1hcC13aXRoLWZ1bmN0aW9uKTogVGVzdAp0aGF0 IHN1Yi1wbGFjZXMgd29yayB3aXRoICdtYXAtZWx0JyBhcyBleHBlY3RlZC4gIEZvciBleGFtcGxl LCB0aGUgdXNlCm9mICdzdWJzdHJpbmcnIHNob3VsZCBiZSB1bmRlcnN0b29kIGFzIHdhbnRpbmcg dG8gbW9kaWZ5IGFuIGV4aXN0aW5nCnN0cmluZywgbm90IHdhbnRpbmcgdG8gbW9kaWZ5IHRoZSBu ZXcgc3RyaW5nIHRoYXQgd291bGQgYmUgY3JlYXRlZCBieSBhCmNhbGwgdG8gJ3N1YnN0cmluZycu Ci0tLQogbGlzcC9lbWFjcy1saXNwL21hcC5lbCAgICAgICAgICAgIHwgNiArKysrKy0KIHRlc3Qv bGlzcC9lbWFjcy1saXNwL21hcC10ZXN0cy5lbCB8IDUgKysrKysKIDIgZmlsZXMgY2hhbmdlZCwg MTAgaW5zZXJ0aW9ucygrKSwgMSBkZWxldGlvbigtKQoKZGlmZiAtLWdpdCBhL2xpc3AvZW1hY3Mt bGlzcC9tYXAuZWwgYi9saXNwL2VtYWNzLWxpc3AvbWFwLmVsCmluZGV4IGQzZDcxYTM2ZWU0Li5m YWNmZGQ4ZGU3YiAxMDA2NDQKLS0tIGEvbGlzcC9lbWFjcy1saXNwL21hcC5lbAorKysgYi9saXNw L2VtYWNzLWxpc3AvbWFwLmVsCkBAIC0xNjcsNyArMTY3LDExIEBAIG1hcC1lbHQKICAgICAgICAg ICAgICAgICAgICAgICAgYChjb25kaXRpb24tY2FzZSBuaWwKICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA7OyBTaWxlbmNlIHdhcm5pbmdzIGFib3V0IHRoZSBoaWRkZW4gNHRoIGFyZy4KICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAod2l0aC1uby13YXJuaW5ncwotICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKG1hcC1wdXQhICxtZ2V0dGVyICxrZXkgLHYgLHRlc3RmbikpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAsKG1hY3JvZXhwLWxldDIgbmlsIG0gbWdldHRl cgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYChwcm9nbgorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgKG1hcC1wdXQhICxtICxrZXkgLHYgLHRlc3RmbikKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICwoZnVuY2FsbCBtc2V0dGVyIG0pCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAsdikpKQogICAgICAgICAgICAgICAg ICAgICAgICAgICAobWFwLW5vdC1pbnBsYWNlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAs KGZ1bmNhbGwgbXNldHRlcgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGAo bWFwLWluc2VydCAsbWdldHRlciAsa2V5ICx2KSkKZGlmZiAtLWdpdCBhL3Rlc3QvbGlzcC9lbWFj cy1saXNwL21hcC10ZXN0cy5lbCBiL3Rlc3QvbGlzcC9lbWFjcy1saXNwL21hcC10ZXN0cy5lbApp bmRleCBkYzgxMjFiMDU4Mi4uYzc5YmFjNTRjYjMgMTAwNjQ0Ci0tLSBhL3Rlc3QvbGlzcC9lbWFj cy1saXNwL21hcC10ZXN0cy5lbAorKysgYi90ZXN0L2xpc3AvZW1hY3MtbGlzcC9tYXAtdGVzdHMu ZWwKQEAgLTcyMyw2ICs3MjMsMTEgQEAgdGVzdC1zZXRmLW1hcC13aXRoLWZ1bmN0aW9uCiAgICAg OzsgQ2hlY2sgdGhhdCB0aGUgZnVuY3Rpb24gaXMgb25seSBjYWxsZWQgb25jZS4KICAgICAoc2hv dWxkICg9IG51bSAxKSkpKQogCisoZXJ0LWRlZnRlc3QgdGVzdC1zZXRmLW1hcC13aXRoLXN1YnBs YWNlICgpCisgIChsZXQgKChhcnIgKHN0cmluZyA/MCA/MSA/MiA/MyA/NCA/NSA/NikpKQorICAg IChzZXRmIChtYXAtZWx0IChzdWJzdHJpbmcgYXJyIDMpIDApID94KQorICAgIChzaG91bGQgKGVx dWFsIGFyciAoc3RyaW5nID8wID8xID8yID94ID80ID81ID82KSkpKSkKKwogKGVydC1kZWZ0ZXN0 IHRlc3QtbWFwLXBsaXN0LW1lbWJlciAoKQogICAiVGVzdCBgbWFwLS1wbGlzdC1tZW1iZXInIGFu ZCBgbWFwLS1wbGlzdC1tZW1iZXItMScuIgogICAoZG9saXN0IChtZW0gJyhtYXAtLXBsaXN0LW1l bWJlciBtYXAtLXBsaXN0LW1lbWJlci0xKSkKLS0gCjIuMzQuMQoK --b1_mEdZrw8tdZDEdt6hXfg7OSynWeQY3nEXp0RPG4GR9c-- From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 24 02:06:13 2024 Received: (at 70524) by debbugs.gnu.org; 24 Apr 2024 06:06:15 +0000 Received: from localhost ([127.0.0.1]:56619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzVlg-0004fj-89 for submit@debbugs.gnu.org; Wed, 24 Apr 2024 02:06:13 -0400 Received: from mout.web.de ([212.227.17.12]:55701) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzVlV-0004d5-5d for 70524@debbugs.gnu.org; Wed, 24 Apr 2024 02:06:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1713938732; x=1714543532; i=michael_heerdegen@web.de; bh=S2fmGG7Yjxya7Nh2FYJlmaCziFwhBtkGYlQolngkbb8=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=Uw+ZIPSi5W7asrfedalC3m5bB//Q1bMFfI7oizpF7tqY2b0A/+KDxzpuLv6h03ex YkMgM4EC56oNpNJsynn6i+oTueDTK9XsFvmYyaQCVDcZJOisOd0PyLikOxL9T9/d8 sQMjPAHMSA8EeY4MKlZR4S3AR5WSfm1AB61Cs4RjRkjm15By3ziM9ZVAl75GUDhpg Pwv/C303xzkrGP4iS8fsJN8Pd1BGic5/zqLeOj/Pil77g4iiii1f7eZbyPSV876LU PtoYQO8efhROjBF9JMO1M+kNuzSoYOmhOV940Qu+NyxAvhvmkPlgt0IirnNPccxQl Rs3mmE+6drYEbFg/8A== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([84.57.248.23]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1M2PdU-1ryyag168E-002FHm; Wed, 24 Apr 2024 08:05:32 +0200 From: Michael Heerdegen To: Okamsn via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Subject: Re: bug#70524: [PATCH] Fix `map-elt` with `setf` for subplaces In-Reply-To: (Okamsn via's message of "Tue, 23 Apr 2024 02:10:42 +0000") References: X-Debbugs-Cc: Stefan Monnier Date: Wed, 24 Apr 2024 08:06:11 +0200 Message-ID: <87a5lji9bg.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:yt94WHa47iCOv5QvRXzeHh3rUJUZdv84R/tHLRjRmUO778NoPYc Uukdpkrd5IJNsSSC7uFjfCtBp+5gxtAdjbifr7O9d1gygby6bSLvVVSpdjh+r5JUTtrq8ra j66en3P3nFCjWlfAzaak4q46fqkyVVojEbZpDSGARXwRgJrUoUHuJnXMaivoNjazX6y8jqC iVqLVDKjn8rEKcVaye/PA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:NCQwoI8XnHI=;oqv2dkSlihf+r43bGvqyYjuxjhb +Ghi58y28GzEEOwQkClM9BBtxWDHgpzQIHhs05ls1BfanTi1UetV8xl2Cnl0sIa7GSBJipMmr 8coIBBrxRgxs+G7tATi26RC+pLc8vnWrJWm7BdUYUU41gNjPT5b7CFggo7NFe0bsQamzBt0dw +TQTGL3vSZLE8VlAcp91j2/0kzYzGBKp05JYR8yPADlkal2KFgWUg1PLm0n/w1YBaOhOxCVjW lhOKKg7b86fe8hmh3VLjF3EaIWLX2nUtUD7DqyEWWBT3aMjQ1O3rtonAyEdYwxC7hZF/d8iEz XnZyrsA3lCL1e/VXvdJ6g2Rq1xtbqdChzMK+5VFPj+Sx9C5/r/O5vim4xPrVdwDsbeVeowN/e hijN+/RJzNVqHZUnIgQluAnUJrCirexG4p9hP6jksmjREtj7ZR0x4f01SsHgm3wg1ntaYVTqm olXPsmZLpt58mCWLtW8tVtXmXFuNt25hm5W5QReCzeqTjfcYMv0wm9lZZg4waM14zzsU0XY90 +3R4rKtB7SOf8E3tWjpIFQy7OU24Rq+t3viDkFThSvfBi6ZQjSh+FcEC25uSxXXlhWCkwp+VY bl3rVCnOVn57mJTepA6mJ3X/r+N5SrkoqC984o0l2GJwvZmTGGoXwcKgeP9Qwt68cJKdBEOkd jyOxkU9DCDvHQYrI9E7fhBWbN0BsBmg/COjo+ebXUChkBz5IMQdhLGRlZSjjNIZGFKotSpIv7 gJF8r71lDvgslEnBusmrI5kIpf7VBXvsrFhncnjyOHYJM5WvTMNkmYdQH5cxRtADSYYfTTy88 ivLjMNtO2jKfCQ9z4kKlmoFbomOEFB9NRMzYBvQrmDkmA= X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 70524 Cc: Okamsn , 70524@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Okamsn, let's CC Stefan. Nice to see you are working on this stuff. > Hello, > > Currently, the use > > (let ((arr (vector 0 1 2 3 4 5 6))) > (setf (map-elt (cl-subseq arr 3) 0) > 27) > arr) > > expands to [...] But... I must admit I'm not really convinced that this has to be changed. First, it is not crystal clear what the semantics should be in this case, because `cl-subseq' as a function creates a new sequence. But it's also a gv so it's debatable, ok. But second - doesn't your patch lead to very inefficient code in this example, where nearly all elements of the original sequence get replaced by themselves in a loop (through the setter of `cl-subseq')? Maybe there are other examples. But cases where the first argument given to `map-elt' returns a part of the original structure (like e.g. a `car' call) work (and there the semantics is also clearer). So I wonder if this change is really an improvement. But if we install it, --- lisp/emacs-lisp/map.el | 6 +++++- test/lisp/emacs-lisp/map-tests.el | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/map.el b/lisp/emacs-lisp/map.el index d3d71a36ee4..facfdd8de7b 100644 --- a/lisp/emacs-lisp/map.el +++ b/lisp/emacs-lisp/map.el @@ -167,7 +167,11 @@ map-elt `(condition-case nil ;; Silence warnings about the hidden 4th arg. (with-no-warnings - (map-put! ,mgetter ,key ,v ,testfn)) + ,(macroexp-let2 nil m mgetter + `(progn + (map-put! ,m ,key ,v ,testfn) + ,(funcall msetter m) + ,v))) (map-not-inplace I guess you should move the `with-no-warnings' wrapper along with the comment to the inside, around the `map-put!' it is intended for. Michael. From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 24 16:18:20 2024 Received: (at 70524) by debbugs.gnu.org; 24 Apr 2024 20:18:20 +0000 Received: from localhost ([127.0.0.1]:60143 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzj4O-00045h-AS for submit@debbugs.gnu.org; Wed, 24 Apr 2024 16:18:20 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:15274) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzj4I-00043m-LE for 70524@debbugs.gnu.org; Wed, 24 Apr 2024 16:18:18 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 011FF442879; Wed, 24 Apr 2024 16:17:51 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1713989865; bh=l1hjl9lCHjAxQyuomi/XiqBRi+DU6AiNf8hO56xVlFQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=LhhxmzXMJ9NE/gMsZNdDPy8DpHrrx1WGmJFVDJg7eBzSZsFUhIsDovMbELVYc0UJV EYgNnt2BZqUfOVB7yAPHZur9ZVTVZrdSOTJ7fKTmOn2xWZPTyv4/SixGWsVUN8rO5/ cW1Ov3KZrJyAKHqnoVRdgVbgx0YDGcHyENVziUhcC0SOA2CxCfkc769dA1fMeHy/Qg 0S2QuDwNK8IaCYhwkqVlNAlM5Be7L0T+tCArki1/gjpC7UnpOus6EdujsQ+VjIasb7 MePVOdxRvlvpOM9studBaPbd28Xx1ylpmvVgxRy6dk1ZOlPMPa0h6VuCnHMhtdHNtJ y1TRwFBA9TWRQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5F63744287E; Wed, 24 Apr 2024 16:17:45 -0400 (EDT) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4FAA5120287; Wed, 24 Apr 2024 16:17:45 -0400 (EDT) From: Stefan Monnier To: Michael Heerdegen Subject: Re: bug#70524: [PATCH] Fix `map-elt` with `setf` for subplaces In-Reply-To: <87a5lji9bg.fsf@web.de> (Michael Heerdegen's message of "Wed, 24 Apr 2024 08:06:11 +0200") Message-ID: References: <87a5lji9bg.fsf@web.de> Date: Wed, 24 Apr 2024 16:14:51 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.130 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70524 Cc: okamsn@protonmail.com, 70524@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> Currently, the use >> >> (let ((arr (vector 0 1 2 3 4 5 6))) >> (setf (map-elt (cl-subseq arr 3) 0) >> 27) >> arr) >> >> expands to [...] > > But... I must admit I'm not really convinced that this has to be > changed. I'm also unconvinced. AFAICT the same problem occurs with (setf (aref (cl-subseq arr 3) 0) 27) and I can't think of a good reason why `map-elt` should behave differently. Furthermore, the change would also fundamentally change the way `map-elt` can be used as a gv-place, in the sense that (setf (map-elt (funcall foo bar) 0) 27) would signal an error during macroexpansion because (funcall foo bar) is not a valid gv-place. > But second - doesn't your patch lead to very inefficient code in this > example, where nearly all elements of the original sequence get replaced > by themselves in a loop (through the setter of `cl-subseq')? Yes, that's another issue. I think if we want to support such `setf` in a way that is good enough to that we can recommend its use, we'd need to turn it into something that behaves more or less like: (map-set! arr (+ 3 0) 27) But I must admit that I don't know how to get there. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 24 22:00:16 2024 Received: (at 70524) by debbugs.gnu.org; 25 Apr 2024 02:00:17 +0000 Received: from localhost ([127.0.0.1]:60273 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzoPE-0003HP-RL for submit@debbugs.gnu.org; Wed, 24 Apr 2024 22:00:15 -0400 Received: from mail-4322.protonmail.ch ([185.70.43.22]:29915) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzoP8-0003FL-Tf for 70524@debbugs.gnu.org; Wed, 24 Apr 2024 22:00:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1714010383; x=1714269583; bh=gpq0tZejurU5VBZIRPl5y1aXynrFEDaOfQxOsAWDEx0=; 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=r8gLVJNbd12hgWHNOYVTLol/44MSleSbI05U4+vNhAoHrWAucklNVX/dXeT1ASOpn xA7JWTTlMWUDmPZ6jJUBFYWUDbHAmoSQCpU9HGk8NXraq1XkHOsDiugYnq5VQBs0VY il88RShyb2HyLM7aQBNM85sKTPs2+F5AsSiVGkrIMij+x+h1QYCEnjRjpgCDisCgUy xngsbS7oTE2GEox9lSmD2dNlevXSq5ksm91AJFUNEnu6/7wthE6CLe5iyDWTxBDq0J AxiP47JHNaJxhbcdcB7GUh1ZTdW/V6ycIuMbDdvjNnAyDc6ChHEPuP7OvTPsaaSiyb T34wZ81UiYMTQ== Date: Thu, 25 Apr 2024 01:59:36 +0000 To: Stefan Monnier , Michael Heerdegen From: okamsn@protonmail.com Subject: Re: bug#70524: [PATCH] Fix `map-elt` with `setf` for subplaces Message-ID: <9a68b4fc-55ee-41fc-aa2c-c69e9498aff0@protonmail.com> In-Reply-To: References: <87a5lji9bg.fsf@web.de> Feedback-ID: 25935600:user:proton X-Pm-Message-ID: b2656217444eb7f8c8302f163620b21840e35230 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 70524 Cc: 70524@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier wrote: >>> Currently, the use >>> >>> (let ((arr (vector 0 1 2 3 4 5 6))) >>> (setf (map-elt (cl-subseq arr 3) 0) >>> 27) >>> arr) >>> >>> expands to [...] >> >> But... I must admit I'm not really convinced that this has to be >> changed. >=20 > I'm also unconvinced. AFAICT the same problem occurs with >=20 > (setf (aref (cl-subseq arr 3) 0) 27) >=20 > and I can't think of a good reason why `map-elt` should behave differentl= y. I would have assumed that `aref` would work with subplaces. I am still=20 thinking of `setf` like a more flexible version of Python allowing=20 things like `my_list[0][0] =3D 27`. > Furthermore, the change would also fundamentally change the way > `map-elt` can be used as a gv-place, in the sense that >=20 > (setf (map-elt (funcall foo bar) 0) 27) >=20 > would signal an error during macroexpansion because (funcall foo bar) > is not a valid gv-place. I am trying to come up with an example that triggers the second path=20 using `map-insert` in the examples that I sent. In the second path, the=20 current version of the `map-elt` setter will already correctly set the=20 subplace using `cl-replace`. I am trying to find an example where the=20 inconsistency makes a difference. My purpose with this patch and for bug#68863 regarding `seq-subseq`=20 (which does not currently support `setf`, and I think should allow=20 subplaces like `substring` claims to) was for destructuring as=20 `setf`-able places, like in cl-loop's `for VAR in-ref LIST`. I have=20 implemented that for my Emacs Lisp package=20 (https://github.com/okamsn/loopy), but not all of the `setf`-able=20 destructuring constructs support sub-places in the expected way, due to=20 how some of the GV expansions are defined. I did not consider calling=20 `setf` on a function's output. For example, with the two patches, one can do ;; =3D> (1 2 [29 99] 29) (let ((arr (vector 1 2 88 99))) (loopy-ref (([a b &rest [&whole c &map (0 map-idx-0)]] arr)) (setf map-idx-0 29) (list a b c map-idx-0))) and have the `setf`-able destructuring work as expected. >> But second - doesn't your patch lead to very inefficient code in this >> example, where nearly all elements of the original sequence get replace= d >> by themselves in a loop (through the setter of `cl-subseq')? > > Yes, that's another issue. I think if wvale want to support such=20 `setf` in > a way that is good enough to that we can recommend its use, we'd need to > turn it into something that behaves more or less like: > val > (map-set! arr (+ 3 0) 27) > > But I must admit that I don't know how to get there. This is true. I could have used `setf (map-elt (cl-subseq arr 3 4) 0)=20 27)` to be more efficient. Thank you. From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 25 08:04:26 2024 Received: (at 70524) by debbugs.gnu.org; 25 Apr 2024 12:04:28 +0000 Received: from localhost ([127.0.0.1]:60637 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzxps-0000T9-AA for submit@debbugs.gnu.org; Thu, 25 Apr 2024 08:04:25 -0400 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]:54544) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzxpl-0000Qp-2a for 70524@debbugs.gnu.org; Thu, 25 Apr 2024 08:04:16 -0400 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a56d7d457a1so108248466b.1 for <70524@debbugs.gnu.org>; Thu, 25 Apr 2024 05:03:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714046629; x=1714651429; 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=s5lG/WpL0z+StFLSaPe2qYnYk6zZZ351ui9nsadtJds=; b=H5YI7d1hjgyQnKPESlBiHaTbiJvtMW9aX16YEArluLgJYJIwYQepU8jNGX6IfDZC/l Q8p71SZWADBZ6zPhjQ7Wii6qk8WA06skSemo5579WHFGyuM8mO9hLb0JQQIUGD6y1u4q TZgoGy50SFfXfppaLTnIPWdywuRpF7ofFRa9P5y1PRyanTtKf/j1Raq2/RrWJxAroHei cYhREMhgRSuyqL16NUoIrcnvNH7TXZuhNffL0IJRDtks0pZmVGYZpWU0FIMESahtWTzy OjlltMOf2AZWSRM/h4+A7Gf7jDXKGyIrOJkkm7YnVN377Osmd2b9tLPGtYkBkiWN9qNx /JfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714046629; x=1714651429; 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=s5lG/WpL0z+StFLSaPe2qYnYk6zZZ351ui9nsadtJds=; b=kpiSTMb4rdoQ5CWDyTSlcII0tnctq4kLbJqHhenkeqXih5hjME8inc9TTJIE9YVg8/ Z3UupZDmxGORTKaAWHuiJE5ltGVRkxsYAOzeTpqZwk2BncXt3Ugs/RMqpTSQ5Fuq+wBK FRTo2DfmhQ7qbP3Rwh+yg7KLbfJcMVynS27IHyKLotMYuTsCN8IePUWtJUBFO4MhiEpV BWyfzchzv1F/jdccnGpj68zxek9nPl33WdkJ3BD3q5uNxmCdzwCCR/hFhSZtlBqPNz7K gdEz2e1UaJu+UYGhcwukfsrghKjCt+UBGMob88tBaiV/K7WP5T5j0MMeOA1shP76qJb8 /gTw== X-Forwarded-Encrypted: i=1; AJvYcCVfck6Nit1a+W/hIqKB9ua4GZi+64DQiT2OaGcGCACreWG/H7dG5uE/8mgDmujQO5Ocnpeo2KQbRXtLv5cVsJ+Q40E/zsU= X-Gm-Message-State: AOJu0YwBWlyDbnVIf/nvtzVvCteG3hp3td3XNilarqy8neYL2bkgRyb5 +l6leVtSY3GYWiiL7ua/Y2+fxl9k7xDcfVQ2dKVPB0ZoudS2VCvEXdcpz9oD X-Google-Smtp-Source: AGHT+IFpzE7fubzJ5SKp5BlphRT2MYUfpCt8tRp8d2u/bbbZ+wcEADxiJMSmlNzw372kALNKi//gNg== X-Received: by 2002:a17:907:97c7:b0:a55:3707:781d with SMTP id js7-20020a17090797c700b00a553707781dmr4691228ejc.73.1714046628566; Thu, 25 Apr 2024 05:03:48 -0700 (PDT) Received: from ars3 ([2a02:8109:8a87:ff00::6223]) by smtp.gmail.com with ESMTPSA id 18-20020a170906309200b00a523b03a1edsm9390924ejv.20.2024.04.25.05.03.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 05:03:48 -0700 (PDT) From: Augusto Stoffel To: Okamsn via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Subject: Re: bug#70524: [PATCH] Fix `map-elt` with `setf` for subplaces In-Reply-To: (Okamsn via's message of "Tue, 23 Apr 2024 02:10:42 +0000") References: Date: Thu, 25 Apr 2024 14:03:47 +0200 Message-ID: <87frv9odi4.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70524 Cc: Michael Heerdegen , okamsn@protonmail.com, Stefan Monnier , 70524@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Tue, 23 Apr 2024 at 02:10, Okamsn via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote: > Hello, > > Currently, the use > > (let ((arr (vector 0 1 2 3 4 5 6))) > (setf (map-elt (cl-subseq arr 3) 0) > 27) > arr) > > expands to > > (let ((arr (vector 0 1 2 3 4 5 6))) > (let* ((v arr)) > (condition-case nil > (with-no-warnings > (map-put! (cl-subseq v 3) 0 27 nil)) > (map-not-inplace > (let* ((new (map-insert (cl-subseq v 3) 0 27))) > (progn > (cl-replace v new :start1 3 :end1 nil) > new)) > 27))) > arr) Since map-put! may raise a not-in-place signal, and I doubt the macro expansion checks for whatever condition it is that leads to that, I would say this use-case is essentially broken. From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 25 08:42:50 2024 Received: (at 70524) by debbugs.gnu.org; 25 Apr 2024 12:42:51 +0000 Received: from localhost ([127.0.0.1]:60656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzyR7-00072z-W9 for submit@debbugs.gnu.org; Thu, 25 Apr 2024 08:42:50 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:44362) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzyR3-000713-Uc for 70524@debbugs.gnu.org; Thu, 25 Apr 2024 08:42:47 -0400 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-56e6a1edecfso1379532a12.1 for <70524@debbugs.gnu.org>; Thu, 25 Apr 2024 05:42:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714048942; x=1714653742; 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=H6BjOxLbx4FN7NEAy39wAaS6/PSC4K0XYTB+t8dDUL8=; b=ZNpYU0Zf0VQYJUcjNLC/kVyfioZdwT9TKGBqp1Qb+EjJcyUy4Vshmk8a2kqbzegTiu TOjE9X6CACeRqGf+EWb8tkFz8EP/I08rHfrRbWAb3of7sQpTGECUwQdUkkZG1WqusgHk HIYN14k7jvIlEI7Lzh5X224KeSzb02edQrbGxUu7JwYJfoIBq/TX1f9CzO4VhKtkiEzC PZQpR8rSbJWNDgZ3NX5Gn3QBMau24RXD7sd4ztKw0yXk0A85lozYvhr8hExWPlWaPeYm MQTelTRZeGWadMLIppkWJ/jAsvFjOgD7QgsXmZc0I1C2JR7zHsDopIgFl3bVnETiC/yy kaMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714048942; x=1714653742; 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=H6BjOxLbx4FN7NEAy39wAaS6/PSC4K0XYTB+t8dDUL8=; b=XcATa25R9ah4EcypItzitWfXEPUVGqeG++Gj2T8NI4+gR4ytLOl34NJZUwdJQmWGkq jx8/GVFhB9S9nvR3OQ9lfbi3ar+ucPTtuKvh8EtGNYKF4JtaN4Ize5RvTlfDLE4yr7/x RX4ZQ1UUv9yubXGswGK2nVFgUPBY+7VBYtWRJW4Wr6eA2qsj9BDxnyiZJdtEF3/ybhIt rpmuVUJMHJArVCFm1O1z34S0qDAzxbuII1KKUBZ2Fwk76MtQWjnLoUPixFa49iJXZTBG D8fvO4qnca9ra10+xp2p1gS9RFcCNP+W1lFGNq6pj/BZnPZqgJKcK3ZEk7mYEA205lFE Oegg== X-Gm-Message-State: AOJu0YzF849Epdy17F44qzfHFG14vgcEAmIYLS9pjkigKkLLrp/5IPfq Zkf3vXZjj0S27nXqTN8Zj2I5SRUkY68QTNs9yijeLevnV0bZdv48 X-Google-Smtp-Source: AGHT+IF4/HMoUEiCPrSTsnCiOikDBMbwDqNP8MB1Gq0mgLM6zwGJEp9gF66N7gEauyMf8hxmxFow3g== X-Received: by 2002:a17:906:68c:b0:a58:afe1:9be3 with SMTP id u12-20020a170906068c00b00a58afe19be3mr1422333ejb.46.1714048941673; Thu, 25 Apr 2024 05:42:21 -0700 (PDT) Received: from ars3 ([2a02:8109:8a87:ff00::6223]) by smtp.gmail.com with ESMTPSA id lk19-20020a170906cb1300b00a526418d0ebsm9498468ejb.74.2024.04.25.05.42.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 05:42:20 -0700 (PDT) From: Augusto Stoffel To: 70524@debbugs.gnu.org Subject: Re: bug#70524: [PATCH] Fix `map-elt` with `setf` for subplaces In-Reply-To: <87frv9odi4.fsf@gmail.com> (Augusto Stoffel's message of "Thu, 25 Apr 2024 14:03:47 +0200") References: <87frv9odi4.fsf@gmail.com> Date: Thu, 25 Apr 2024 14:42:19 +0200 Message-ID: <878r11obpw.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70524 Cc: michael_heerdegen@web.de, okamsn@protonmail.com, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Thu, 25 Apr 2024 at 14:03, Augusto Stoffel wrote: > On Tue, 23 Apr 2024 at 02:10, Okamsn via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote: > >> Hello, >> >> Currently, the use >> >> (let ((arr (vector 0 1 2 3 4 5 6))) >> (setf (map-elt (cl-subseq arr 3) 0) >> 27) >> arr) >> >> expands to >> >> (let ((arr (vector 0 1 2 3 4 5 6))) >> (let* ((v arr)) >> (condition-case nil >> (with-no-warnings >> (map-put! (cl-subseq v 3) 0 27 nil)) >> (map-not-inplace >> (let* ((new (map-insert (cl-subseq v 3) 0 27))) >> (progn >> (cl-replace v new :start1 3 :end1 nil) >> new)) >> 27))) >> arr) > > Since map-put! may raise a not-in-place signal, and I doubt the macro > expansion checks for whatever condition it is that leads to that, I > would say this use-case is essentially broken. Sorry, just ignore that :-). What I actually wanted to say is that IMO there's a general conceptual problem to consider map-like values as places. There's no reasonable way (cl-subseq arr 3) can be seen as a place AFAICT. But even in a language like Python (where map-like things can be seen as places, since there are no liked lists to ruin the party), I don't understand what the above code is supposed to do. This code arr = [0, 1, 2, 3, 4, 5, 6] arr[3:][0] = 27 arr will just copy a portion of arr as new list, mutate its first element, then throw array that copy. From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 25 08:50:03 2024 Received: (at 70524) by debbugs.gnu.org; 25 Apr 2024 12:50:05 +0000 Received: from localhost ([127.0.0.1]:60661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzyY1-0008Ar-Bd for submit@debbugs.gnu.org; Thu, 25 Apr 2024 08:50:02 -0400 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]:52498) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzyXt-00089E-1u for 70524@debbugs.gnu.org; Thu, 25 Apr 2024 08:49:53 -0400 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-51abd9fcbf6so1576143e87.1 for <70524@debbugs.gnu.org>; Thu, 25 Apr 2024 05:49:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714049365; x=1714654165; 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=6NlRdo9ZIoK+UQc2VonLNHt+oZ24xI56y+3sIDFZ5Nc=; b=ho3jiOOl1rGDTQCE/aGSqUmKHXrrWq2baTAvrJSEXOjBJsiK+wV8qujsk7nSHSJj5J Ky3oV6AAEXVn+f4Z0Kl4zmT0l96fCgcoUXh2isZEPPS/E1iCC6sOXHcBF3dW96QwS99Z ZDaRoAUwj7fYgKutsQrcTOd3Bg4QYLZwwC+0qilsPnRvMNg2C2Jdv0s3utyfzPX67RbH GqT2v4WaS9uM0fs2BwyqmI0XywFGREpBVAxEIH/uQLKUCBaAG1lI+NK+c2vfdGG3HeR4 JDRT9f/REynRBKWH04oQwOKxeltNG1KcpiQIxgLPF5VlQH/y63wQ6TDFjLJG7u8DU+6M Hj7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714049365; x=1714654165; 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=6NlRdo9ZIoK+UQc2VonLNHt+oZ24xI56y+3sIDFZ5Nc=; b=Vn7jCJKVsq8/4+R6QBns6196tUctYsx1BXjrWUPEXsaQqAW9PDSAhJDEu3oyk4Ulq6 sjXmSJN0rRURESH1XW4q3UezhQ5AE5mpvoAbEppYaha+angUJ/pPk7BdkgDDnKcIwhCf IIL9+8asxJUbktmOOBBkxnzEBR0pgJzLm6ydE2UEsItO6+/g1iVLrzaxD0SZ/AJrYrr7 Acl9DJYNe18QbatbYfBZZFLpTH0eO2ZkrZT7xsU/BbXvVMpPwSyQXp4LkqGyvNqSyY2D nGRyJBa18AJF5XMzevSSVRsD94AnL1vlqEesT1sOTLn+6yWGRSh7isJ/k5rIKf5lAp0S dTEQ== X-Forwarded-Encrypted: i=1; AJvYcCUDQJtVQs0TkhpAkaS3J4DNy+Vz0ja8iKLLndlzgKpC0NBzy4xaHMQVyBrQAzc3CiaYbZeZh5J16J4BLXTkNsj2KmUJ/wY= X-Gm-Message-State: AOJu0Ywo/0KmlkZa9p7lJyNmli0A0r+Exx17C2O7CCxb3xHtFjWPKJB4 VJtZdFFc23R7RT1PugQfGF22rxRi06kfYPygOoeDttcBSMExaixqWqBKug== X-Google-Smtp-Source: AGHT+IE9qblZs8P3ES+kBq+u6HUavsuaY5RNe2w8sSWhhN6qmfOcD1ei+jLMEpwHV0pyxpQqX+j8Sw== X-Received: by 2002:a05:6512:6cd:b0:51c:5570:f570 with SMTP id u13-20020a05651206cd00b0051c5570f570mr2014496lff.59.1714049364474; Thu, 25 Apr 2024 05:49:24 -0700 (PDT) Received: from ars3 ([2a02:8109:8a87:ff00::6223]) by smtp.gmail.com with ESMTPSA id d18-20020a1709061f5200b00a587831c09fsm3521449ejk.186.2024.04.25.05.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 05:49:23 -0700 (PDT) From: Augusto Stoffel To: okamsn@protonmail.com Subject: Re: bug#70524: [PATCH] Fix `map-elt` with `setf` for subplaces In-Reply-To: <9a68b4fc-55ee-41fc-aa2c-c69e9498aff0@protonmail.com> (okamsn@protonmail.com's message of "Thu, 25 Apr 2024 01:59:36 +0000") References: <87a5lji9bg.fsf@web.de> <9a68b4fc-55ee-41fc-aa2c-c69e9498aff0@protonmail.com> Date: Thu, 25 Apr 2024 14:49:22 +0200 Message-ID: <871q6tobe5.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70524 Cc: Michael Heerdegen , Stefan Monnier , 70524@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Thu, 25 Apr 2024 at 01:59, okamsn@protonmail.com wrote: > I would have assumed that `aref` would work with subplaces. I am still > thinking of `setf` like a more flexible version of Python allowing > things like `my_list[0][0] = 27`. The right way to achieve this IMO would be the one indicated in bug#62068: (setq my-list (map-insert-in my-list '(0 0) 27)) (I believe I even had an implementation for it, but never submitted the patch.) If there's a reasonable way to make a bunch of nested setf's expand to this, I don't know. I guess it should be possible, but I'm also not sure it would be really convenient. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 26 08:19:35 2024 Received: (at 70524) by debbugs.gnu.org; 26 Apr 2024 12:19:36 +0000 Received: from localhost ([127.0.0.1]:34266 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s0KY9-00061K-Ru for submit@debbugs.gnu.org; Fri, 26 Apr 2024 08:19:35 -0400 Received: from mout.web.de ([212.227.17.11]:34007) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s0KY5-0005z9-2g for 70524@debbugs.gnu.org; Fri, 26 Apr 2024 08:19:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1714133935; x=1714738735; i=michael_heerdegen@web.de; bh=+xsANSSc8vLAIB28eMxzvCRP9S9Qm+KjzEOnbAPfcso=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=oVUm2aa9DWb0cy6/C+Pu/ZhMLn1qwV2y9m9MAOUKG5UfzU9WCADCVHOCS0gzbVey VG+4iSD4WxtDI2BwcJNWvf68bVBYC/no+Iyxye3Vz5pc4CLsRidHWljwFOgqmHVWk jGjInrfGWf1/2ENob9CO3RLOhqJvDhdLQ+7c3JDyhOGwTpqqiKTiOm8INfZxI7pel px2jI+6HethYCd4q5rU6kjpEaVhmMLwN8UeZZIx2l0pqDVer3qUT0uxqwjrPQn+jR 02k5da1ePVpB5hWJajvGFr7lfOyxuh8aWqLjpkxa7oUCuqB0VI1bulmGDceVbyAPy nIqYfP635J/tWQ6CsQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([84.57.248.23]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MRk0W-1s6TLh2BUA-00Tm6c; Fri, 26 Apr 2024 14:18:55 +0200 From: Michael Heerdegen To: okamsn@protonmail.com Subject: Re: bug#70524: [PATCH] Fix `map-elt` with `setf` for subplaces In-Reply-To: <9a68b4fc-55ee-41fc-aa2c-c69e9498aff0@protonmail.com> (okamsn@protonmail.com's message of "Thu, 25 Apr 2024 01:59:36 +0000") References: <87a5lji9bg.fsf@web.de> <9a68b4fc-55ee-41fc-aa2c-c69e9498aff0@protonmail.com> Date: Fri, 26 Apr 2024 14:19:34 +0200 Message-ID: <878r10xqnd.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:6CtdO+IujH10XJQmcBsFVFtH3/lb3Q8Cm+pCiS2snrHHdCCtzIY PJnH+KJwIOekrOnYFEUeMbUrL5QPNjF6HWakQ9a8+cZrqZhddzeTGogenhXnzzA8r7oA9Xv z1/04NAHq5aCxOwJ6Bqj92O0bdzpWEbrRbw2W152NnG9jhttvonJRdoJRkTG2wmMM5bvHCs EzsUUUoXXes/Th+MuJaDA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:1jsgRfWCfjw=;0Cvotpyo57BjsY1KdZ2Mz9Qbz8g UnXxf57Uhzyk91pxGQWlcY4uuOCE/0kAn+smVgK9D+tyKrmg8mkYQDv4keynU1IDUReDZZ+Xu Odb65z+35wFhmGz48Sq8cipjSCLwLECCk+IEAUG9GAzVBcYDcc/4jAjAjBKSYHwKaMTqGeZCl mG8dx2iykSrpHc1X2dkdEj8whDC6/WvR1s53HG6XPN2FaCTZXRrH5SZdP62dV1GI9om354Lpg +LCEkrZTWjoEiTY6SDcEYWY76zrr6lPRw7tDi5d+s1O7r6M80IMoG/7j2UV4YHGds85exd4H2 SnIS0zoPoltwhZUpmxccfEzHuR/r2rIGTvouJWCzTq+XR5ypFW6r884/4NYYU3XJjXf8iunyd C3aDb102PcrARz5S3j//JXkLfIScdSfeZsGdRKio9ktAL86wtzl3EoehjZsjeVv1bja2RZU1q viInZ+MBFhj4/D+HnUuAy2UMSmWxiNOspY4GC77IAbaJhsP8qcCFNjMBKPg06d/3pasXnJo7M JAlWJsNdS8FHe6NThUSi4NHrTCWxjBhABJ+2HehwwgypOhdEmLr63baG/ml7+gvjwuiSK/yhb q6JPysXsdOvsCrbT3YFrrd/L7Ei9APARjYTXg962a/DHa6oLh1Izfq0M1Q5EYuGLcPzryNunM JqZPnJDU2v7uV4RIr+b61fcm5sFfZH1/sZHkyUYDwsQH12JCmjEAEX197nLNUw2215pGAxsbT Xq7Acp7b2Z9ohGYzfhKPGM8S4YJBw6kUGbxR82K6hGrVzv//+jbrjXvxJMSOmQtzRIa4ndgcm quyaGM3JuvXJqIBM1P3Ni4GIiiNLwV0+viJn3K2UwD4XQ= Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 70524 Cc: Stefan Monnier , 70524@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) okamsn@protonmail.com writes: > My purpose with this patch and for bug#68863 regarding `seq-subseq` > (which does not currently support `setf`, and I think should allow > subplaces like `substring` claims to) The `substring' gv-setter doesn't need a loop however, it creates a new string using `concat'. Your patch would probably "work" ok in this case, but I'm not convinced that this would be an improvement, still for the same reasons. > was for destructuring as `setf`-able places, like in cl-loop's `for > VAR in-ref LIST`. I have implemented that for my Emacs Lisp package > (https://github.com/okamsn/loopy), but not all of the `setf`-able > destructuring constructs support sub-places in the expected way, due > to how some of the GV expansions are defined. But if loopy would base on an inefficient implementations this would not be useful. Are there examples where your patch is really a clear improvement? Michael. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 28 21:09:16 2024 Received: (at 70524) by debbugs.gnu.org; 29 Apr 2024 01:09:16 +0000 Received: from localhost ([127.0.0.1]:53920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1FW7-0007ow-RL for submit@debbugs.gnu.org; Sun, 28 Apr 2024 21:09:16 -0400 Received: from mail-4316.protonmail.ch ([185.70.43.16]:59203) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1FW5-0007oo-EF for 70524@debbugs.gnu.org; Sun, 28 Apr 2024 21:09:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1714352927; x=1714612127; bh=hMzC//1Jlzmr2HkPfTVQEr5fkeZzWBe+om6KZuYtEJ8=; 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=g6Crhbwh247K/otAxX5U1FesbWmYVx/RaextFFQ26Wxvl8fmg+QGvwgGYz/yotNUg jLfT2sofpfLHGadn7S45S4BAy1QYN5kEVVq5bYqmyO3+PucGNgYnIrsT4UgfG9gL0e LBCu2Yhm+N2s88q1a48mGrY/LHUJmwGRCkecjQLCLb4OxPaPD9xRBQEEIGiGQ5QJOG aPFKQd27BAjqUULog7NkYgIa4m8kATpY7VYetsuXYwV0Gecclr0bZD555d/4jMLyPt KFncVIcoVOoJJaGpDXzTOfBrJBm64h1KMJ6YsdcDDu/X4wR7pD/UsRjl0rSOReDSsR 0dspHMFVlQcjg== Date: Mon, 29 Apr 2024 01:08:42 +0000 To: Michael Heerdegen From: okamsn@protonmail.com Subject: Re: bug#70524: [PATCH] Fix `map-elt` with `setf` for subplaces Message-ID: In-Reply-To: <878r10xqnd.fsf@web.de> References: <87a5lji9bg.fsf@web.de> <9a68b4fc-55ee-41fc-aa2c-c69e9498aff0@protonmail.com> <878r10xqnd.fsf@web.de> Feedback-ID: 25935600:user:proton X-Pm-Message-ID: 7ec704f7e374ef270ec13c51fbc94d8ac9b4c341 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70524 Cc: Stefan Monnier , 70524@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Michael Heerdegen wrote: > okamsn@protonmail.com writes: >=20 >> My purpose with this patch and for bug#68863 regarding `seq-subseq` >> (which does not currently support `setf`, and I think should allow >> subplaces like `substring` claims to) >=20 > The `substring' gv-setter doesn't need a loop however, it creates a new > string using `concat'. Your patch would probably "work" ok in this > case, but I'm not convinced that this would be an improvement, still for > the same reasons. >=20 >> was for destructuring as `setf`-able places, like in cl-loop's `for >> VAR in-ref LIST`. I have implemented that for my Emacs Lisp package >> (https://github.com/okamsn/loopy), but not all of the `setf`-able >> destructuring constructs support sub-places in the expected way, due >> to how some of the GV expansions are defined. >=20 > But if loopy would base on an inefficient implementations this would not > be useful. >=20 > Are there examples where your patch is really a clear improvement? Hello, I have found cases in Loopy where I am using `(setf (map-elt (map-elt=20 ...))` and similar. From what you and others have said, it sounds like=20 this luckily happened to work but should not have been relied upon. I=20 have now seen the thread bug#62068 about `map-nested-elt` mentioned by=20 Augusto Stoffel, and I agree with the thoughts there that an improvement=20 can be made for that use case. That could be having `map-elt` support=20 sub-places in general, or it could be having `map-nested-elt` be a=20 generalized variable to support the one case. On efficiency and maybe outside of the sub-place question, I used=20 `seq-map` because I thought that it would be a good way to make sure=20 that the generic sequence was only moved through once. For a=20 hypothetical `seq-replace`, do you think it would be better to use a=20 combination `seq-concat`, `seq-take`, and `seq-subseq` and to assume=20 that they are efficient implementations for the generic version? Do you=20 think that it would be better if there were different implementations=20 for each combination of the built-in sequence types, like the checks=20 `cl-replace` has for lists and arrays? Thank you. >=20 > Michael. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 28 21:55:03 2024 Received: (at 70524) by debbugs.gnu.org; 29 Apr 2024 01:55:03 +0000 Received: from localhost ([127.0.0.1]:54117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1GEQ-0008K7-Um for submit@debbugs.gnu.org; Sun, 28 Apr 2024 21:55:03 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:32152) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1GEO-0008Jd-KR for 70524@debbugs.gnu.org; Sun, 28 Apr 2024 21:55:01 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5718A4424FD; Sun, 28 Apr 2024 21:54:34 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1714355673; bh=4IwKBPxJbTXpV9L5W36fwMloUqxmUzvih1m3AiVg5Pg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=QhXHaIvo4pv6CJupXLpdLr2qVMG+Jda2Y6Vv3wBbkYyMd5Dn2lF/jarHYE9yBk2Hm /yzqS/l1V2gFHeqETspwnQhlGEmaW402qjNwR3/TnQCXSJPPCsMImMmCVFOno+hK5s 9VFe7cwKLr7lwx43Aaq6y08F4/qQvqfjS10e25I/h9pF8A8uheWCzl/lIeIlFqvCL4 sVMD0trJ5Bkd4rfQ1mGkmYetS5hj8sFQgF1TwwRF6Y2VfvlQA164AzM/aVdHQggttZ ik+1Sdnlqz+doQQyhzZ+wOxCZtwehf4D56zyha8WJF1PR7Jjsde2klBY4oSb/zr2cj d8+UA/DmoukvQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 0D8BC4424E7; Sun, 28 Apr 2024 21:54:33 -0400 (EDT) Received: from pastel (unknown [45.72.201.215]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id CAC8F1202AB; Sun, 28 Apr 2024 21:54:32 -0400 (EDT) From: Stefan Monnier To: okamsn@protonmail.com Subject: Re: bug#70524: [PATCH] Fix `map-elt` with `setf` for subplaces In-Reply-To: (okamsn@protonmail.com's message of "Mon, 29 Apr 2024 01:08:42 +0000") Message-ID: References: <87a5lji9bg.fsf@web.de> <9a68b4fc-55ee-41fc-aa2c-c69e9498aff0@protonmail.com> <878r10xqnd.fsf@web.de> Date: Sun, 28 Apr 2024 21:54:32 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.007 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70524 Cc: Michael Heerdegen , 70524@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > I have found cases in Loopy where I am using `(setf (map-elt (map-elt > ...))` and similar. From what you and others have said, it sounds like > this luckily happened to work but should not have been relied upon. No: `map-elt` is supposed to return a pre-existing object from the map, so the side-effecting on it should work just fine, without needing any luck (assuming side-effecting the map can be done, of course). The problem is when you do (setf (map-elt (SOMETHING) ..) ..) and (SOMETHING) is an operation which (builds and) returns a fresh new value, such as `cl-subseq`. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 30 12:17:15 2024 Received: (at 70524) by debbugs.gnu.org; 30 Apr 2024 16:17:15 +0000 Received: from localhost ([127.0.0.1]:60191 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1qAN-0005b9-12 for submit@debbugs.gnu.org; Tue, 30 Apr 2024 12:17:15 -0400 Received: from mout.web.de ([212.227.15.3]:39179) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1qAK-0005b2-Hi for 70524@debbugs.gnu.org; Tue, 30 Apr 2024 12:17:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1714493799; x=1715098599; i=michael_heerdegen@web.de; bh=wBgXNh496PkitxzuLpOhzRbP5Ed6AuU9lUpvrOqVi4Q=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=gFylMvkufFpRHxgM6JxXx7vhvecRP2liMOsqY3jXJlsxN0VqKAx57eE+Ztw7EGOr GArK1EB2lZB1o7jW7Nplg+CJVqOkqZ9iYv7U0UXS5JiZfVhu3P/JextMJmKVlTD/T 3728GKzAcQEkG2iUVYSh2FIXRFMZX6LL++6SIh9d0Sf4yJpe7nNMqrbG4dCfTuxgE xzgHsWF+8UNRNvDUkkzPO7Ebl60aSEr0rChICrF0a7DV9/PgI8pdJxoNo8gfO/ovx I3fc2CWImih1ViFAbtHjRx5hy6KFra3ThEvUtAWMu4ulQBsrOUSJ5wo1DQpMp3FD3 aKCAHu2U4a1Gnks68A== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([84.57.248.23]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MidHP-1sY8hs10dj-00i43X; Tue, 30 Apr 2024 18:16:39 +0200 From: Michael Heerdegen To: okamsn@protonmail.com Subject: Re: bug#70524: [PATCH] Fix `map-elt` with `setf` for subplaces In-Reply-To: (okamsn@protonmail.com's message of "Mon, 29 Apr 2024 01:08:42 +0000") References: <87a5lji9bg.fsf@web.de> <9a68b4fc-55ee-41fc-aa2c-c69e9498aff0@protonmail.com> <878r10xqnd.fsf@web.de> Date: Tue, 30 Apr 2024 18:17:19 +0200 Message-ID: <87r0emddv4.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:gtYupkKRp42wQIF8BuO7ccZlAuWyYjqnHVY3WvxndfrTHQPnpf4 Rqnh4SqinBZMlyyFrRTFhfqcNjYCvlU0kWfUwB3F1tMCFez4M7kybrghZ5IKFlQIUwF6H+o FLkuCKSjm3AY3K9PMP9dhEVlOvf2PmZS2RSt73DVG445sFtf/FoqteyQ/jtONW3jGjWdMYW SWwR50nazA6IXC0cgR+Rw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:qsTz9ZO8xxk=;L0xgfvARZhtIqyoXP9uC9hOln8v sAMXZxeCE+leYGT2C8SDOFiIg0/E6SJzuY+v+BuoByrATTTfYoDjmNAZ/MXU+dmPF12joMgMk U94khKGyEnusYBUy+SetpxPEICPalaHu836avQygZS6kEqtaoJlLC0BsFkZ8FPzvOH+D2ekbb bdcSzEPxxGWY1Om3INYIAaDj1iUaGyLTbGGxHn2dSKPLwef3+2039f6aQbcuVLM68/Nf+73aH PJpC1PMaa2nMf6iiP5B4uCYO1ZurSylj+Lk+mib23s8B0M7SIXuJde759VwblZPbTQOm8/alU Tfgies3idaHhLBiZuhKQbpWeRxGrktrtA6G53X9+ugQqPJZd95enpT83jSPllCzzXiAF++BNB CCrGoDZEBLQ+2/zi4WAQkxIFfrKfEjoWk/RaOe9mqCqlQ5AkEg7ikGt5R//vAOoEescs001Ip 40nSh4TNmSBr/QORv5DOygkRzzXPCghnOylG8N6PW0HhtUKolxXvW/jczmq01aMSVkteZ2rOK EAlwbU3zQlq6wO0pi7ZQC8LnxaeIO9SvELiBDNEOYRUq3JUfqsClbxxmfHWO/Mtk/JukOUmkh n1u8p9I7MOJVHpZeyyRDg/VcbA+FRLTSBslVmFWYg1eq/ZLHYlWwh1xqcm9P5wm5x0P26n0sM EiPNAGhSaJuE7W4Oh8l7ae8fGnJaiO03xE0G3Hxq3fEltW7D3FJG6CDURa8wUKH5gD50aIPTC iSkw3GrWBV8Ed3MMSabULpF1GOzGpWA4n9AliZvzfORtK6FzlA0XPYdBPThwGg1wWmRv5UdZe sxzWncRfHCAnU0PdLu25YJlFsSr8xFQJwmItJmxF8TMMI= Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 70524 Cc: Stefan Monnier , 70524@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) okamsn@protonmail.com writes: > On efficiency and maybe outside of the sub-place question, I used > `seq-map` because I thought that it would be a good way to make sure > that the generic sequence was only moved through once. For a > hypothetical `seq-replace`, do you think it would be better to use a > combination `seq-concat`, `seq-take`, and `seq-subseq` and to assume > that they are efficient implementations for the generic version? Do you > think that it would be better if there were different implementations > for each combination of the built-in sequence types, like the checks > `cl-replace` has for lists and arrays? Probably yes, that would be the consequence. Haven't thought about whether `seq-replace' is something we want, though. Michael. From debbugs-submit-bounces@debbugs.gnu.org Mon May 06 10:01:53 2024 Received: (at 70524-done) by debbugs.gnu.org; 6 May 2024 14:01:53 +0000 Received: from localhost ([127.0.0.1]:38262 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3yuf-0004qr-Aa for submit@debbugs.gnu.org; Mon, 06 May 2024 10:01:53 -0400 Received: from mout.web.de ([217.72.192.78]:41133) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3yub-0004qh-Cd for 70524-done@debbugs.gnu.org; Mon, 06 May 2024 10:01:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1715004078; x=1715608878; i=michael_heerdegen@web.de; bh=VovYL9/fD/S7n93CDAt04Zo1Me9rrMwuiXlEy5fHdX0=; h=X-UI-Sender-Class:From:To:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=avkzbzqsizqy8wZpnUQ78pXtIlZ4LryTcEN5yghd2SVy2X5hdiy5Agd/h8egAj3B qa9lw4WkamWeeYOmHai4el1aVfunYIl/mgNjxYkWgecr12qzwuTH0SjU0cFQIZkGY OZZCe3/HknNxBsv7SspSkclpMzPN8SfM7eAxCuKELxVD+ek0Vc/KLNhXekq3LiF+c uvTN687fMmLmQ4C+MM7aflk5+B04yVcrI2DXjrKJ64plSCmTJdBWLPDvENAKUvp8z aNmFphLx0VsgUuYYs+TWXCGMde7HVIRv4/3czcRzeStscMMNq+uDYlYH3DUVQotdc rd/GIGjiR0DEJ2b/1w== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([84.57.248.23]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MHVet-1rr2bP2IKX-00F8yz for <70524-done@debbugs.gnu.org>; Mon, 06 May 2024 16:01:18 +0200 From: Michael Heerdegen To: 70524-done@debbugs.gnu.org Subject: Re: bug#70524: [PATCH] Fix `map-elt` with `setf` for subplaces In-Reply-To: (okamsn@protonmail.com's message of "Tue, 23 Apr 2024 02:10:42 +0000") References: Date: Mon, 06 May 2024 16:02:01 +0200 Message-ID: <87le4nght2.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:MSA+QWne1IucDaopQch4DqSvhSVR0xp83fDvFdX6aA1cjx/2xpp TCWRX7B0hsAwdT8OPB4TQloPKuXrprpXpyCla/7L6rNXdQ5E720hjQnDRCcjR88MdGtpzAa 12OPC/IGaziexqf4AwpFXLTrWBMAE+btCRElE11gQBANiKH0JB1ncANjmFQWA9garqps4pR TEqAbWMkjNaUkrfIYJHNw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:N7gBwAapU7o=;uQ8mGGGfTFCYMBwk3FifSv9Du01 yTvjV20U3vQ3uVGCZK4SxsILIAxr46yx0YZiI0Sl6/94SehTrApybkH9N46sz6f4LjMlEgr9n bKmZqDiYGiNbt7T3hnlZi/hWC1JEKosX7k7j0fiODHD8G0IqeHFvmXDjQsTTGbgrzFLqUWbYq YgbY8cPfxz/a/Ml7bZE87YYjWiVK7IMcQTJWJckqWwC+t0AkSkqMHix4QWOPloYEb1G/imCq4 I/h9bKCEeYVQb8eIULCQQsx6unA4aXeM23aYefiuqQyDFHZYx3x7vS5253OVwCyOLD7++Prfz oyUm1gPKSj2ASX1MfcSJrlvwu0NHRvfww2QDgIirfRdyE7mU7UBimGlc2IhhwtjfffS6WQSEq ghyg7/7/oWfqmjbcH+qmPge9Fvtbdpuj8k9b6yqhL+2J2dszMpstE0kDCUacZBlyBqPiBuOCz xzPQIE5Ihw5jROYgWnxv5q5IZwql5NzPpzgW+5QWC1d0q4Axjuol76TuqhVPjdJM173wZF1Pc V5TxxgYD+zuhg8D7eVM3f3W5igY424lN3mivIpwvc0271hyDImkmGTWesia2DEgYDHm9Rb5q6 BZWM3QRoU6uBWe9rNDrfnHvlcPsXbPcwQNZ4awChJs0Mjx8IT1nX04fXZK9uXwf2mXiLZEfzR TkOHFgStUYngIgVxeUSqVqZZhpF1MBT7/7XKnr3stFkfGNOcTtvxtdMWpkH4OjTTMOWfyXP1g xyUa/09awNLkTIFFIUhT24ZBRawqysQMpvDQwD6CdstZpWVACWSV201rfKiqSmXlJbHWXlLGl ZYpypwKV6hVu52KmkF0kt47zd523iebbrsSGvvGNhgwtY= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 70524-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello, It seems the discussion has come to an end, and we have not decided to do anything, so I'm closing this report for now. Feel free to reopen when there is something new, or to continue discussing other aspects in this or other/new bug reports. Thank you, Michael. From unknown Sat Jun 21 10:39:02 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 04 Jun 2024 11:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator