all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#7088: `copy-tree' of a vector copy sharing structure.with original
@ 2010-09-23  5:28 MON KEY
  2010-09-23  8:47 ` bug#7083: " Andreas Schwab
  2010-09-23 20:41 ` David De La Harpe Golden
  0 siblings, 2 replies; 4+ messages in thread
From: MON KEY @ 2010-09-23  5:28 UTC (permalink / raw)
  To: 7088; +Cc: 7083, Andreas Schwab

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\





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-09-24  5:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-23  5:28 bug#7088: `copy-tree' of a vector copy sharing structure.with original MON KEY
2010-09-23  8:47 ` bug#7083: " Andreas Schwab
2010-09-23 20:41 ` David De La Harpe Golden
2010-09-24  5:19   ` MON KEY

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.