[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#7088: `copy-tree' of a vector copy sharing structure.with original
From: |
David De La Harpe Golden |
Subject: |
bug#7088: `copy-tree' of a vector copy sharing structure.with original |
Date: |
Thu, 23 Sep 2010 21:41:30 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100913 Icedove/3.0.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]