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

Re: bug in copy-list implementation



(COPY-LIST PROGRAM) doesn't make new copies of PROGRAM's elements,
it just gives you a brand new list pointing to the same old elements.

Thus, you're still sharing structures between (COPY-LIST PROGRAM)
and PROGRAM. Mutations to elements of PROGRAM will show up as
mutations to the copy.

If the elements of PROGRAM are lists, that's why copy-tree
does a better job, because it's making copies of the elements
as well as the outermost list.