From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 23 18:36:25 2017 Received: (at submit) by debbugs.gnu.org; 23 Apr 2017 22:36:25 +0000 Received: from localhost ([127.0.0.1]:36883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2Q7F-0000Ac-0u for submit@debbugs.gnu.org; Sun, 23 Apr 2017 18:36:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57511) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2Pav-0007DF-GN for submit@debbugs.gnu.org; Sun, 23 Apr 2017 18:03:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2Pap-0006EQ-1n for submit@debbugs.gnu.org; Sun, 23 Apr 2017 18:02:56 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33468) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d2Pao-0006EH-Up for submit@debbugs.gnu.org; Sun, 23 Apr 2017 18:02:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2Pan-0003Os-Fe for bug-gnu-emacs@gnu.org; Sun, 23 Apr 2017 18:02:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2Pai-0006DO-Hh for bug-gnu-emacs@gnu.org; Sun, 23 Apr 2017 18:02:53 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:56561) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d2Pai-0006Cw-6i for bug-gnu-emacs@gnu.org; Sun, 23 Apr 2017 18:02:48 -0400 Received: from elmo ([178.5.191.199]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.183]) with ESMTPSA (Nemesis) id 0M4qlR-1c3rxO1akn-00z0Cl for ; Mon, 24 Apr 2017 00:02:44 +0200 From: Tobias Zawada To: bug-gnu-emacs@gnu.org Subject: 25.1.50; Feature-request: Structure-preserving copying of sequences Date: Mon, 24 Apr 2017 00:02:25 +0200 Message-ID: <874lxepytq.fsf@smtp.1und1.de> MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:QxQVOKE53m0lYwyswgdd0VimB8KAmqkvyL8fuCu9qh0eO1vZ3mK 19M762NOd4hT5GqJZfPoixezFA8JwJzM/XEo+TzGQ+PIpnRMGlDKn4RcIpD1Qy7S038wUNF bjZ+UZv3Q75HSDTP+7IS1gfE7jevO6cYzI6+dDJ/Zq6lMLHe6ZRW/9cSF+FLk7ZidabhhNC MltdDSgYnNCJWEnSXuhEw== X-UI-Out-Filterresults: notjunk:1;V01:K0:Lh2M1vfD0hY=:fV1TRTJ2zulhvyFox81nzj VS7G7RKoZvayeN9/ZdqdY7grUSSQlQiCd2L2q9Vcuk2QQY2NR1qHwBN80W1A4jpAzLvJOPzKL a04DV3jJshsrN6Q+3zygsVlxi5/ImhdVmefgEnE2/sijPFb7Z9M6LUtv8sCywz4p/nzZyQFHF JF5F2jzwTq82o9lup3V7Mj+JoMNgMIEWKnhoJ6CMYKQNhNK2U8W3CSAefoYPnHOtJamAJtVtP +l3vEf9G2pzfJaZX579MX6QuANj8VcTzGXLtKJ/uVDXPr8uHxkCb4Mune4LbDnHCJj0ooJe3E ykbMisYIHrQ8pqDNvgpgu3bTYxyBC+Tpz7SRB89uH/sGDs7P68OXhkP6n0Wc5TlpV0DEGvGvb zN9OEtVJdS1o8qCADd5vCvGj7ph00CJAS17QuffNKEiVSiRgoPnSNCWCHchgLzk9bu3IS5WCZ P9nU/lMfODNwUB7fDrVMz69FXxNgYzk0p/yD0RcdrEsybJV7vDn0eZReT8yMK82uWE+/9b7RO 7gyWh/me0qtXcOD367AAnjRH2sEove3ZlrOESVSAyBeqWOCEnGuVfcA6nuht18jcunQxyuhul PayAYNx725hJayhzzPFZTWaqOs8O4Wj0XbyG5F3iKSUHywpeDYiqCDiUa1REbpe2YJt0ivlds HAxvpKEtst0EIK6MfM+rLnF/KEg847FGpaisgAYegXjAb1F2jv039U/8MWWKLmM8+c1lRovl5 SmBMqjQjsBorwTVN X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 23 Apr 2017 18:36:23 -0400 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: -5.0 (-----) Dear emacs maintainers, I propose to implement a structure-preserving version of copy-tree in emacs. It could be part of one of the elisp libraries (e.g., seq.el or subr.el) or it could be an internal function. An example implementation is cited at the end of this mail. The function copy-tree copies recursively but not structure preserving. If two cars or cdrs link to the same sub-list in the original data they point to two separate sub-lists in the copy. As mentioned in the Common Lisp Hyper Spec (http://clhs.lisp.se/Body/f_cp_tre.htm) this is the intended behavior of copy-tree. I needed a structure-preserving copy of a graph for the solution of the request https://emacs.stackexchange.com/questions/32194/undo-tree-history-file-without-text-properties So I wrote my own version of copy-tree* and asked at https://emacs.stackexchange.com/questions/32316/structure-preserving-copying-of-sequences whether anyone knows some built-in version for that purpose. Drew responded that he does not know about any such function and recommended to write this feature request. For making this request self-contained I cite in the following my version of copy-tree*. Feel free to use it or parts of it for emacs if you like. There are no license-restrictions on the code. About the code: Traversing of the original graph and construction of the new graph are stack-based as it is standard. There is an additional hash-map that maps the already traversed old nodes to the newly created ones. If some old node is already in the hash-map we do not create a new one in the copied graph but use the mapped one from the hash map. I chose the name `copy-tree*' because of the similarity of the function to `copy-tree'. Considering the functionality maybe the name `copy-graph' would be more appropriate. (cl-defstruct (copy-tree* (:constructor copy-tree*-mem (&optional stack stack-new (hash (make-hash-table))))) stack stack-new hash) (defmacro copy-tree*--push (el el-new mem &optional hash) "Put EL onto the stack and EL-NEW onto stack-new in the `copy-tree*' structure MEM. Add a key-value pair mapping EL to EL-NEW in the hash map of mem." (let ((my-el (make-symbol "my-el")) (my-el-new (make-symbol "my-el-new"))) ; makes sure `el' is only evaluated once (append `(let ((,my-el ,el) (,my-el-new ,el-new)) (push ,my-el (copy-tree*-stack ,mem)) (push ,my-el-new (copy-tree*-stack-new ,mem))) (and hash `((puthash ,my-el ,my-el-new (copy-tree*-hash ,mem)))) (list my-el-new)))) (defmacro copy-tree*--pop (el el-new mem) `(setq ,el (pop (copy-tree*-stack ,mem)) ,el-new (pop (copy-tree*-stack-new mem)))) (defun copy-tree*--copy-node (node mem vecp) "If NODE is not a `cons' just return it. Create a new copy of NODE if NODE is a `cons' not already contained in the hash map of mem (a `copy-tree*' structure). Register NODE and its copy as key-value pair in the hash table. If NODE is already a key of the hash map return its copy. With non-nil VECP vectors are treated analogously to conses." (if (or (consp node) (and vecp (vectorp node))) (let ((existing-node (gethash node (copy-tree*-hash mem)))) (if existing-node existing-node (copy-tree*--push node (if (consp node) (cons nil nil) (make-vector (length node) nil)) mem t))) node)) (defun copy-tree* (tree &optional vecp) "Structure preserving version of `cl-copy-tree'." (if (or (consp tree) (and vecp (vectorp tree))) (let* ((tree-new (if (consp tree) (cons nil nil) (make-vector (length tree) nil))) (mem (copy-tree*-mem)) next next-new) (copy-tree*--push tree tree-new mem t) (while (copy-tree*--pop next next-new mem) (cond ((consp next) (setcar next-new (copy-tree*--copy-node (car next) mem vecp)) (setcdr next-new (copy-tree*--copy-node (cdr next) mem vecp))) ((and vecp (vectorp next)) (cl-loop for i from 0 below (length next) do (aset next-new i (copy-tree*--copy-node (aref next i) mem vecp)))))) tree-new) tree)) Best regards, Tobias Zawada From debbugs-submit-bounces@debbugs.gnu.org Fri May 13 12:18:23 2022 Received: (at 26629) by debbugs.gnu.org; 13 May 2022 16:18:23 +0000 Received: from localhost ([127.0.0.1]:44863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npXzj-0006xy-4R for submit@debbugs.gnu.org; Fri, 13 May 2022 12:18:23 -0400 Received: from quimby.gnus.org ([95.216.78.240]:39356) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npXzg-0006xZ-NH for 26629@debbugs.gnu.org; Fri, 13 May 2022 12:18:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=jR84RYZGRyT/STcqAHgebvYkDADbtVgSXIPRat65sWM=; b=YQ/s9hEa9ShdR5FyXeN4/DIIQo fJvzgsQUBWTEb78FSjIcru+oNiToFAVrcYuvlLyJMVWiVRMgm43jep9hqsdY9ChZ0rFEnktfTd9/a Rv3TPqqQLscRSdlQMavKpHn+bl1QCYxLsPXTDUxYq+sTOjEc8c1+vmlnWFi8Cp1NLoiQ=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1npXzW-0002QB-0S; Fri, 13 May 2022 18:18:12 +0200 From: Lars Ingebrigtsen To: Tobias Zawada Subject: Re: bug#26629: 25.1.50; Feature-request: Structure-preserving copying of sequences References: <874lxepytq.fsf@smtp.1und1.de> X-Now-Playing: New Order's _Power, Corruption & Lies_: "The Village" Date: Fri, 13 May 2022 18:18:09 +0200 In-Reply-To: <874lxepytq.fsf@smtp.1und1.de> (Tobias Zawada's message of "Mon, 24 Apr 2017 00:02:25 +0200") Message-ID: <87ee0x1k5a.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Tobias Zawada writes: > The function copy-tree copies recursively but not structure preserving. > If two cars or cdrs link to the same sub-list in the original data > they point to two separate sub-lists in the copy. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 26629 Cc: Stefan Monnier , 26629@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 (---) Tobias Zawada writes: > The function copy-tree copies recursively but not structure preserving. > If two cars or cdrs link to the same sub-list in the original data > they point to two separate sub-lists in the copy. [...] > About the code: Traversing of the original graph and construction of the new graph are > stack-based as it is standard. There is an additional hash-map that maps > the already traversed old nodes to the newly created ones. If some old > node is already in the hash-map we do not create a new one in the copied > graph but use the mapped one from the hash map. (I'm going through old bug reports that unfortunately weren't resolved at the time.) I haven't looked closely at the code, but this is functionality that I vaguely remember having been requested before, and I don't think Emacs has it yet? (But I may be wrong about that.) I've added Stefan to the CCs; perhaps he has some comments. This change is large enough to require a copyright assignment of the code to the FSF -- if we decide to add the code, would you be willing to sign such paperwork? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri May 13 12:18:25 2022 Received: (at control) by debbugs.gnu.org; 13 May 2022 16:18:26 +0000 Received: from localhost ([127.0.0.1]:44866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npXzl-0006yE-Ld for submit@debbugs.gnu.org; Fri, 13 May 2022 12:18:25 -0400 Received: from quimby.gnus.org ([95.216.78.240]:39370) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npXzj-0006xm-O5 for control@debbugs.gnu.org; Fri, 13 May 2022 12:18:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=DopAHFuscD1RHcp4Tx7U0LO5Zqk+n/zEeMDbaG/Qn7Y=; b=jYJsLwsigI4wUd8QBufNrRop8F UEm1Zr+ijMSBm91kjQdaXq9oST4IyZvwU2Kf4bf6XMnBnX/c1s0FtKBbzF+MU5NsIJQ5lSEj/wy/D orpkbL/aU6q8WNubJ5Y+RJ7+TjkdB646jANFkbsxAZOkR0CDASi1dPhJQNSVmvYaGH0I=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1npXzc-0002QH-0i for control@debbugs.gnu.org; Fri, 13 May 2022 18:18:17 +0200 Date: Fri, 13 May 2022 18:18:15 +0200 Message-Id: <87czgh1k54.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #26629 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 26629 + moreinfo quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control 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 (---) tags 26629 + moreinfo quit From debbugs-submit-bounces@debbugs.gnu.org Fri May 13 13:48:04 2022 Received: (at 26629) by debbugs.gnu.org; 13 May 2022 17:48:04 +0000 Received: from localhost ([127.0.0.1]:44954 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npZOW-0003cF-DN for submit@debbugs.gnu.org; Fri, 13 May 2022 13:48:04 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:62187) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npZOU-0003b4-0q for 26629@debbugs.gnu.org; Fri, 13 May 2022 13:48:02 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 1117280390; Fri, 13 May 2022 13:47:56 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id A6B9D805CE; Fri, 13 May 2022 13:47:54 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1652464074; bh=082OFLLNqz+r+S32OCrurqZbqK0q+os57fRhVoOC+PA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=BdLfZmqioZnox9KVc5y7kP9aMCcNDxV1tkC2mpxgIXm+ysPd6gD1lWQX0hGH1emZl vyiFXiKFzZhdQ6BtHmb4LiDKuImBdmIE1GTOEkGWTgAC3Vz/IPmW1Fz6dQqeyAJoMg 3iq5RL2ich3QUUmNSpq5LdJxJ7Hzr2NQbF0N2DqjpuUZ3T0DuSUmALENXZk7zR6kvU X6ebO7OizEPZ92HZT/kmYccvg37dPPkV/T24dzPCCbLVWjJPWYX5/+J09rhY9b2BPu UfxH9k4Ech+COc6EuKkpOBy1OvxjRJO5zFdZAqG9kOi8KR37rHE5UxOW0iUw2DOfva hZomE1DlklHng== Received: from pastel (unknown [45.72.221.51]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 782FF120812; Fri, 13 May 2022 13:47:54 -0400 (EDT) From: Stefan Monnier To: Lars Ingebrigtsen Subject: Re: bug#26629: 25.1.50; Feature-request: Structure-preserving copying of sequences Message-ID: References: <874lxepytq.fsf@smtp.1und1.de> <87ee0x1k5a.fsf@gnus.org> Date: Fri, 13 May 2022 13:47:53 -0400 In-Reply-To: <87ee0x1k5a.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 13 May 2022 18:18:09 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) 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.054 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 T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 26629 Cc: 26629@debbugs.gnu.org, Tobias Zawada 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 haven't looked closely at the code, but this is functionality that I > vaguely remember having been requested before, and I don't think Emacs > has it yet? (But I may be wrong about that.) > I've added Stefan to the CCs; perhaps he has some comments. My opinion is rather negative: IMO `copy-tree` itself is a bad function in the sense that it's (almost) never really right, IOW most uses of `copy-tree` are fundamentally quick hacks which happen to work most of the time because the details of when to recurse and when not to very rarely map exactly to "recurse on `cons` and only `cons`". So rather than `copy-tree*` I'd rather see some kind of generic `deep-copy` function which takes a (or some) parameter(s) that indicates when (and potentially how) to copy/recurse each of the elements (where `deep-copy`s job would thus be mainly to take care of maintaining the hash-map and maybe using an explicit stack to avoid deep recursion). Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri May 13 22:18:50 2022 Received: (at 26629) by debbugs.gnu.org; 14 May 2022 02:18:50 +0000 Received: from localhost ([127.0.0.1]:45375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nphMo-0006sV-2e for submit@debbugs.gnu.org; Fri, 13 May 2022 22:18:50 -0400 Received: from quimby.gnus.org ([95.216.78.240]:43974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nphMm-0006s8-Gg for 26629@debbugs.gnu.org; Fri, 13 May 2022 22:18:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ah9/TDHAqlOgHzgldZ5i97KvGFJsyninWUDl0g9rvbs=; b=Eee1o7ETajaiQoJmPyhK/jMgl9 U/HdqhzSWlf5LWuBV68q6Z8DlssOL2b6tr7K8iICyHrhkbVc5OUtOBMy2cPdUTo8yVO0yDSYXVWka a+Pgbow9ciJPXx+O2RLrqa6dqBoMOMA5roehLgDBIguNgKpH+uUdKywEI+eSZGHqJpWo=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nphMc-0007E4-49; Sat, 14 May 2022 04:18:40 +0200 From: Lars Ingebrigtsen To: Stefan Monnier Subject: Re: bug#26629: 25.1.50; Feature-request: Structure-preserving copying of sequences References: <874lxepytq.fsf@smtp.1und1.de> <87ee0x1k5a.fsf@gnus.org> X-Now-Playing: Boris's _Tears e.p_: "To the Beach" Date: Sat, 14 May 2022 04:18:36 +0200 In-Reply-To: (Stefan Monnier's message of "Fri, 13 May 2022 13:47:53 -0400") Message-ID: <875ym8eu0z.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Monnier writes: > So rather than `copy-tree*` I'd rather see some kind of generic > `deep-copy` function which takes a (or some) parameter(s) that indicates > when (and potentially how) to copy/recurse each of the el [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 26629 Cc: 26629@debbugs.gnu.org, Tobias Zawada 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 (---) Stefan Monnier writes: > So rather than `copy-tree*` I'd rather see some kind of generic > `deep-copy` function which takes a (or some) parameter(s) that indicates > when (and potentially how) to copy/recurse each of the elements (where > `deep-copy`s job would thus be mainly to take care of maintaining the > hash-map and maybe using an explicit stack to avoid deep recursion). Makes sense to me. Since we're not going to include `copy-tree*' (being too niche), I'm closing this bug report, but a more general `deep-copy' function would be welcome, if somebody were to write it. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri May 13 22:18:58 2022 Received: (at control) by debbugs.gnu.org; 14 May 2022 02:18:58 +0000 Received: from localhost ([127.0.0.1]:45378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nphMw-0006sv-Ag for submit@debbugs.gnu.org; Fri, 13 May 2022 22:18:58 -0400 Received: from quimby.gnus.org ([95.216.78.240]:43990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nphMv-0006sd-0E for control@debbugs.gnu.org; Fri, 13 May 2022 22:18:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=FwnUReI1+JawFwrXOPabLZfEBE8WID9Tqu7wAxhTN1Y=; b=cPGB3N0Uzou9lSFBvLPOSFyaPw /Z+uR7vJaCUXo47f1QIWo+baD2+hOZVfd553LpEf+yHi9ukrq9Jembkearh40AqTdI6fv0c7V/a7A 2+zrz5PlYR8WiN6ph1UrXkwko+xLBtk7DOefsyKH4DK65phC1CpG0H71PNq79z5+S4Hk=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nphMm-0007EJ-Es for control@debbugs.gnu.org; Sat, 14 May 2022 04:18:51 +0200 Date: Sat, 14 May 2022 04:18:48 +0200 Message-Id: <874k1seu0n.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #26629 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 26629 wontfix close 26629 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control 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 (---) tags 26629 wontfix close 26629 quit From unknown Fri Aug 15 14:48:19 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 11 Jun 2022 11:24:05 +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