From: David Sletten
Subject: Re: Confusing bug while examining function parameters
Date: 
Message-ID: <jy6Xd.2473$Mf.2090@twister.socal.rr.com>
Rich wrote:

> 
>   As you can see, the lists appear to be maintained between calls.
> Redefining the function empties the lists again. This happens in
> OpenMCL and CLISP.
> 
>   Can anyone either (a) point out what I've done wrong, or (b) point me
> towards an existing function to allow me to deconstruct an argument
> list?
> 

Try these:
(defun good (x)
   (let ((l (list 0)))
     (dotimes (i x)
       (incf (car l)))
     l))

(defun not-so-good (x)
   (let ((l '(0)))
     (dotimes (i x)
       (incf (car l)))
     l))

Then note that you are assigning literal list values to SPLITS and SUB. 
Later when you modify those literal values you are effectively modifying 
your source code. This is why you see the persistence from call to call.

David Sletten
From: Rich
Subject: Re: Confusing bug while examining function parameters
Date: 
Message-ID: <1110271029.921157.47140@o13g2000cwo.googlegroups.com>
David,
  An elementary error. I am ashamed -- thank you for your patient
reply! Fixed.