From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 22 02:29:22 2010 Received: (at submit) by debbugs.gnu.org; 22 Sep 2010 06:29:22 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyIpW-0006D5-MG for submit@debbugs.gnu.org; Wed, 22 Sep 2010 02:29:22 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyIpV-0006D0-2M for submit@debbugs.gnu.org; Wed, 22 Sep 2010 02:29:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OyIry-0000N4-PP for submit@debbugs.gnu.org; Wed, 22 Sep 2010 02:31:55 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:34146) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyIrx-0000Mg-6V for submit@debbugs.gnu.org; Wed, 22 Sep 2010 02:31:54 -0400 Received: from [140.186.70.92] (port=53974 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OyIrq-0001ib-A8 for bug-gnu-emacs@gnu.org; Wed, 22 Sep 2010 02:31:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OyIrn-0000Le-1B for bug-gnu-emacs@gnu.org; Wed, 22 Sep 2010 02:31:44 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:49716) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyIrm-0000LW-S8 for bug-gnu-emacs@gnu.org; Wed, 22 Sep 2010 02:31:42 -0400 Received: by wwb24 with SMTP id 24so158638wwb.30 for ; Tue, 21 Sep 2010 23:31:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.35.77 with SMTP id t55mr6571765wea.0.1285137101533; Tue, 21 Sep 2010 23:31:41 -0700 (PDT) Received: by 10.216.67.195 with HTTP; Tue, 21 Sep 2010 23:31:41 -0700 (PDT) Date: Wed, 22 Sep 2010 02:31:41 -0400 X-Google-Sender-Auth: gxq8U_XDlw41dqB-Vsw8RSu8DeA Message-ID: Subject: Why is `copy-tree's symbol-plist carrying side-effect-free error-free? From: MON KEY To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=UTF-8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.1 (-----) Why is `copy-tree' side-effect-free error-free? (symbol-plist 'copy-tree) => (side-effect-free error-free) It (potentially) `nconc's `nreverse's and `aset's the TREE arg recursively. At revno: 45675 `copy-tree' was moved into subr.el from cl.el ,---- | | committer: Colin Walters | timestamp: Sat 2002-06-08 20:48:15 +0000 | message: | (copy-list): Moved here from cl.el. | (copy-tree): Renamed here from `cl-copy-tree' in cl.el. | `---- -- /s_P\ From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 22 17:33:25 2010 Received: (at 7083-done) by debbugs.gnu.org; 22 Sep 2010 21:33:25 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyWwO-0004gK-VW for submit@debbugs.gnu.org; Wed, 22 Sep 2010 17:33:25 -0400 Received: from mail-out.m-online.net ([212.18.0.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyWwN-0004gF-0O for 7083-done@debbugs.gnu.org; Wed, 22 Sep 2010 17:33:23 -0400 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id C2BB61C00203; Wed, 22 Sep 2010 23:35:57 +0200 (CEST) Received: from igel.home (ppp-88-217-104-177.dynamic.mnet-online.de [88.217.104.177]) by mail.mnet-online.de (Postfix) with ESMTP id 8B7941C001CE; Wed, 22 Sep 2010 23:35:57 +0200 (CEST) Received: by igel.home (Postfix, from userid 501) id 1A096CA2A0; Wed, 22 Sep 2010 23:35:56 +0200 (CEST) From: Andreas Schwab To: MON KEY Subject: Re: bug#7083: Why is `copy-tree's symbol-plist carrying side-effect-free error-free? References: X-Yow: "THE LITTLE PINK FLESH SISTERS," I saw them at th' FLUORESCENT BULB MAKERS CONVENTION... Date: Wed, 22 Sep 2010 23:35:56 +0200 In-Reply-To: (MON KEY's message of "Wed, 22 Sep 2010 02:31:41 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 7083-done Cc: 7083-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) MON KEY writes: > It (potentially) `nconc's `nreverse's and `aset's the TREE arg recursively. Only the copy. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 23 01:21:11 2010 Received: (at 7083) by debbugs.gnu.org; 23 Sep 2010 05:21:11 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyeF4-0007vf-L4 for submit@debbugs.gnu.org; Thu, 23 Sep 2010 01:21:11 -0400 Received: from mail-ww0-f46.google.com ([74.125.82.46]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyeF3-0007va-06 for 7083@debbugs.gnu.org; Thu, 23 Sep 2010 01:21:09 -0400 Received: by wwj40 with SMTP id 40so828176wwj.15 for <7083@debbugs.gnu.org>; Wed, 22 Sep 2010 22:23:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.187.143 with SMTP id y15mr996226wem.74.1285219424773; Wed, 22 Sep 2010 22:23:44 -0700 (PDT) Received: by 10.216.67.195 with HTTP; Wed, 22 Sep 2010 22:23:44 -0700 (PDT) In-Reply-To: References: Date: Thu, 23 Sep 2010 01:23:44 -0400 X-Google-Sender-Auth: jWK_EZpGN4bxIzol9c2LsHDLagg Message-ID: Subject: Re: bug#7083: Why is `copy-tree's symbol-plist carrying side-effect-free error-free? From: MON KEY To: Andreas Schwab Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -3.1 (---) X-Debbugs-Envelope-To: 7083 Cc: 7083@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.1 (---) On Wed, Sep 22, 2010 at 5:35 PM, Andreas Schwab wrote: > MON KEY writes: > >> It (potentially) `nconc's `nreverse's and `aset's the TREE arg recursively. > > Only the copy. > Only for the copy of a list. Why has this bug been marked done? When copy-tree copies vectors they share structure. (let ((orig '((a b) (c d) (e f) (g h))) new-cp) (setq new-cp (copy-tree orig)) (equal (elt (prog1 orig (setf (car new-cp) "bubba")) 0) '(a b))) ;=> t (let ((orig [[a b] [c d] [e f] [g h]]) new-cp) (setq new-cp (copy-tree orig)) (string-equal (aref (prog1 orig (aset new-cp 0 "bubba")) 0) "bubba")) ;=> t Shouldn't idx 0 of the orig tree still be [a b]? If not, it should be documented that when copy-tree copies vectors the "copy" will share structure just as with `copy-sequence'. Regardless, simply marking the bug report as done with only a terse 3 word reply is obnoxious and not the least bit helpful for anyone else referencing this report in the future, esp. as there does appear to be a bug. > Andreas. -- /s_P\ From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 23 01:25:59 2010 Received: (at 7083) by debbugs.gnu.org; 23 Sep 2010 05:25:59 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyeJj-0007xK-2L for submit@debbugs.gnu.org; Thu, 23 Sep 2010 01:25:59 -0400 Received: from mail-wy0-f172.google.com ([74.125.82.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyeJh-0007xD-IO for 7083@debbugs.gnu.org; Thu, 23 Sep 2010 01:25:57 -0400 Received: by wyi11 with SMTP id 11so1200227wyi.3 for <7083@debbugs.gnu.org>; Wed, 22 Sep 2010 22:28:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.93.73 with SMTP id k51mr1044542wef.8.1285219713822; Wed, 22 Sep 2010 22:28:33 -0700 (PDT) Received: by 10.216.67.195 with HTTP; Wed, 22 Sep 2010 22:28:33 -0700 (PDT) Date: Thu, 23 Sep 2010 01:28:33 -0400 X-Google-Sender-Auth: cWrqkx0fa1Me52Wbs8an2Y2NH0E Message-ID: Subject: `copy-tree' of a vector copy sharing structure.with original From: MON KEY To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -3.1 (---) X-Debbugs-Envelope-To: 7083 Cc: 7083@debbugs.gnu.org, Andreas Schwab X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.1 (---) When copy-tree copies vectors the copy shares structure with the original. This is unlike the behavior of copy-tree on a list of lists: (let ((orig '((a b) (c d) (e f) (g h))) new-cp) (setq new-cp (copy-tree orig)) (equal (elt (prog1 orig (setf (car new-cp) "bubba")) 0) '(a b))) ;=> t (let ((orig [[a b] [c d] [e f] [g h]]) new-cp) (setq new-cp (copy-tree orig)) (string-equal (aref (prog1 orig (aset new-cp 0 "bubba")) 0) "bubba")) ;=> t Shouldn't idx 0 of the orig tree still be [a b]? Note This bug _should_ prob. have stayed with Bug7083 but that bug report was prematurely closed. -- /s_P\ From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 23 04:45:05 2010 Received: (at 7083) by debbugs.gnu.org; 23 Sep 2010 08:45:05 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyhQN-00016K-RD for submit@debbugs.gnu.org; Thu, 23 Sep 2010 04:45:04 -0400 Received: from mail-out.m-online.net ([212.18.0.9]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyhQL-00015j-0S; Thu, 23 Sep 2010 04:45:01 -0400 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 4E3881C159E1; Thu, 23 Sep 2010 10:47:37 +0200 (CEST) Received: from hase.home (ppp-88-217-115-11.dynamic.mnet-online.de [88.217.115.11]) by mail.mnet-online.de (Postfix) with ESMTP id CA8521C00314; Thu, 23 Sep 2010 10:47:36 +0200 (CEST) From: Andreas Schwab To: MON KEY Subject: Re: bug#7088: `copy-tree' of a vector copy sharing structure.with original References: X-Yow: Go on, EMOTE! I was RAISED on thought balloons!! Date: Thu, 23 Sep 2010 10:47:36 +0200 In-Reply-To: (MON KEY's message of "Thu, 23 Sep 2010 01:28:33 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 7083 Cc: 7083@debbugs.gnu.org, 7088-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) MON KEY writes: > When copy-tree copies vectors the copy shares structure with the original. Works as documented. A vector is not a cons cell. If TREE is a cons cell, this recursively copies both its car and its cdr. ^^^^^^^^^ Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 23 16:38:57 2010 Received: (at 7083) by debbugs.gnu.org; 23 Sep 2010 20:38:58 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OysZE-0006at-PF for submit@debbugs.gnu.org; Thu, 23 Sep 2010 16:38:56 -0400 Received: from harpegolden.net ([65.99.215.13]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OysZC-0006ak-B6; Thu, 23 Sep 2010 16:38:54 -0400 Received: from [87.198.54.160] (87-198-54-160.ptr.magnet.ie [87.198.54.160]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "David De La Harpe Golden", Issuer "David De La Harpe Golden Personal CA rev 3" (verified OK)) by harpegolden.net (Postfix) with ESMTPSA id 8F5CA684DE; Thu, 23 Sep 2010 21:41:27 +0100 (IST) Message-ID: <4C9BBB7A.2060004@harpegolden.net> Date: Thu, 23 Sep 2010 21:41:30 +0100 From: David De La Harpe Golden User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100913 Icedove/3.0.7 MIME-Version: 1.0 To: MON KEY Subject: Re: bug#7088: `copy-tree' of a vector copy sharing structure.with original References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 7083 Cc: 7083@debbugs.gnu.org, 7088@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) On 23/09/10 06:28, MON KEY wrote: > (let ((orig [[a b] [c d] [e f] [g h]]) > new-cp) > (setq new-cp (copy-tree orig)) Some people would have at least considered a quick C-h f copy-tree before filing a bug? You're missing the VECP arg to emacs lisp copy-tree. Without that, emacs lisp copy-tree is, much like common lisp copy-tree, documented to copy trees of _conses_. Conses do of course look pretty like 2 element vectors, but they are a separate datatype in emacs lisp. ELISP> (let ((orig [[a b] [c d] [e f] [g h]]) new-cp) (setq new-cp (copy-tree orig t)) (string-equal (aref (prog1 orig (aset new-cp 0 "bubba")) 0) "bubba")) *** Eval error *** Wrong type argument: stringp, [a b] From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 23 18:17:12 2010 Received: (at 7083) by debbugs.gnu.org; 23 Sep 2010 22:17:12 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oyu6K-0007D6-F7 for submit@debbugs.gnu.org; Thu, 23 Sep 2010 18:17:12 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oyu6J-0007Cz-22 for 7083@debbugs.gnu.org; Thu, 23 Sep 2010 18:17:11 -0400 Received: from dyn.144-85-172-119.dsl.vtx.ch ([144.85.172.119]:12067 helo=fmsmemgm.homelinux.net) by fencepost.gnu.org with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1Oyu8q-000077-De; Thu, 23 Sep 2010 18:19:48 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 7F1666611D; Fri, 24 Sep 2010 00:19:47 +0200 (CEST) From: Stefan Monnier To: MON KEY Subject: Re: bug#7083: Why is `copy-tree's symbol-plist carrying side-effect-free error-free? Message-ID: References: Date: Fri, 24 Sep 2010 00:19:47 +0200 In-Reply-To: (MON KEY's message of "Thu, 23 Sep 2010 01:23:44 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -4.4 (----) X-Debbugs-Envelope-To: 7083 Cc: 7083@debbugs.gnu.org, Andreas Schwab X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.5 (----) > Why has this bug been marked done? > When copy-tree copies vectors they share structure. C-h f copy-tree RET documents the second (optional) argument which affects this behavior. So it looks perfectly correct, and documented. Stefan From unknown Fri Aug 15 15:37:03 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 22 Oct 2010 11:24:03 +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