Given this defun:
(defun jmh-test-func ()
(let (tv)
(setq tv '((?a) (?b)))
(push "testme" (cdr (assoc ?a tv)))
tv))
Why does the value returned keep accumulating data from previous
calls?
First time:
=> ((?a "testme") (?b))
Next time:
=> ((?a "testme" "testme") (?b))
...and so on...
=> ((?a "testme" "testme" "testme") (?b))
=> ((?a "testme" "testme" "testme" "testme")
(?b))
It's driving me crazy! I was under the impression let created a local
binding which was destroyed when the let statement went out of scope?
I tried edebugging, and before the setq the value of tv is nil, and
immediately after the setq tv has the specified value the first time,
but the *previous* value for each subsequent call.
Clearly, I must be missing something... :)
When I re-eval the defun, xemacs "forgets" the old values, and the
insanity starts all over!
Any insight?
--
Josh Huber