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

MCL bug??



I recently came across some unusual behaviour in MCL...
I defined a function which similar to the following:

(defun test (arg)
  (let ((list1 '(nil nil)))
    (push arg (second list1))
    list1))

  The first time 'test is called, the behaviour is as expected:

(test 1)   ;=>  (nil (1))

  The second time however is unusual:

(test 2)   ;=>  (nil (2 1))

  The result grows with each sucessive call. I can't see how this happens -
I would assume the scope of list1 was within the 'let. And certainly it is
not global as is suggested by thsi result.

  Any ideas?


Mick O'Donnell
University of Sydney