I'm reading Practical Common Lisp, and have a question about Lisp's COPY-TREE
function.
The book gives the example of calling
(copy-tree '( '(1 2) '(3 4) '(5 6)))
After explaining it, the book makes this statement:
Where a cons cell in the original referenced an atomic value, the corresponding cons cell in the copy will reference the same value. Thus, the only objects referenced in common by the original tree and the copy produced by COPY-TREE are the numbers 5, 6, and the symbol NIL.
But that doesn't make sense to me. I thought all atoms would be shared between the original and the new. Therefore, I expected that 1, 2, 3, 4, 5, 6 and NIL would all be shared between the original and the copy, and that the only "new objects" would be all the CONS cells.
Which one is correct, and why?
Thanks.