bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#7083: Why is `copy-tree's symbol-plist carrying side-effect-free err


From: MON KEY
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@linux-m68k.org> wrote:
> MON KEY <monkey@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\





reply via email to

[Prev in Thread] Current Thread [Next in Thread]