Subject: Re: newbie problem with updating lists? From: Erik Naggum <erik@naggum.net> Date: 2000/11/20 Newsgroups: comp.lang.lisp Message-ID: <3183712229165050@naggum.net> * "Jeremy Rowlings" <xegean@hotmail.com> | Everytime after updating list1,2,3 I also update biglist to have a | history of changes. my problem is biglist also updates itself, in | other words in contains the last values of list1,2,3 repeated many | times instead of having the history of values. How can I prevent | biglist from changing itself? How do you "update" list1..3? This kind of thing would happen if you retain the first cons of each of those lists and destructively modify its car or cdr. It is not biglist which modifies itself, but the _identity_ of the list elements that reflects the current value, since you have not copied the list structure or contents, only the list identity, which is the first cons. If you really want to keep a history of changes when you make destructive modifications to the list, use copy-list or copy-tree, but then that probably means you will waste all the effort that went into prematurely optimizing your code with destructive list operations. #:Erik -- ALGORITHM: a procedure for solving a mathematical problem in a finite number of steps that frequently involves repetition of an operation. ALGOREISM: a procedure for solving an electoral problem in a finite number of steps that frequently involves repetition of an operation.