From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70524: [PATCH] Fix `map-elt` with `setf` for subplaces Date: Sun, 28 Apr 2024 21:54:32 -0400 Message-ID: References: <87a5lji9bg.fsf@web.de> <9a68b4fc-55ee-41fc-aa2c-c69e9498aff0@protonmail.com> <878r10xqnd.fsf@web.de> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3070"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Michael Heerdegen , 70524@debbugs.gnu.org To: okamsn@protonmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 29 03:55:57 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 1s1GFJ-0000WM-5f for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Apr 2024 03:55:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s1GF7-0001Ko-70; Sun, 28 Apr 2024 21:55:45 -0400 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 1s1GF5-0001KN-9X for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2024 21:55:43 -0400 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 1s1GF5-000655-1H for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2024 21:55:43 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s1GFO-0008Kb-BZ for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2024 21:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Apr 2024 01:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70524 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 70524-submit@debbugs.gnu.org id=B70524.171435570332003 (code B ref 70524); Mon, 29 Apr 2024 01:56:02 +0000 Original-Received: (at 70524) by debbugs.gnu.org; 29 Apr 2024 01:55:03 +0000 Original-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 Original-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 Original-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== Original-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) Original-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) In-Reply-To: (okamsn@protonmail.com's message of "Mon, 29 Apr 2024 01:08:42 +0000") 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:284114 Archived-At: > 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