From: John Williams
Subject: Re: Please help with copy-list.
Date: 
Message-ID: <3jk6tb$3bu@infa.central.susx.ac.uk>
>I have functions to move "the blank" NORTH,SOUTH, EAST and WEST.  These
>functions use "fill" to replace items in the given list.  But no
>matter how I try, I can't get it to work on a COPY of the given list.
>
>Here's an example:
>
>>test-state
>((1 2 3) (8 NIL 4) (7 6 5) (2 2))
>
>You see?  BOTH get changed, and I can't see why ... it's driving me


COPY-LIST only copies the top-level structure of a list. So, in this case,
it doesn't make copies of the sub-lists (1 2 3) (8 NIL 4) etc.

I think the function you want is COPY-TREE, which recursively copies a
list and any nested sub-lists.


John Williams.