GNU bug report logs - #7083
Why is `copy-tree's symbol-plist carrying side-effect-free error-free?

Previous Next

Package: emacs;

Reported by: MON KEY <monkey <at> sandpframing.com>

Date: Wed, 22 Sep 2010 06:30:02 UTC

Severity: normal

Done: Andreas Schwab <schwab <at> linux-m68k.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: MON KEY <monkey <at> sandpframing.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 7083 <at> debbugs.gnu.org
Subject: bug#7083: Why is `copy-tree's symbol-plist carrying side-effect-free error-free?
Date: Thu, 23 Sep 2010 01:23:44 -0400
On Wed, Sep 22, 2010 at 5:35 PM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
> MON KEY <monkey <at> sandpframing.com> 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\




This bug report was last modified 14 years and 300 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.