Xref: utzoo comp.lang.lisp:3371 comp.sys.ti.explorer:339 Path: utzoo!attcan!uunet!cs.utexas.edu!mailrus!ncar!boulder!!behrens From: behrens@boulder (John Behrens) Newsgroups: comp.lang.lisp,comp.sys.ti.explorer Subject: Problem with CLOS Message-ID: <22986@boulder.Colorado.EDU> Date: 2 Jul 90 00:05:54 GMT Sender: news@boulder.Colorado.EDU Reply-To: behrens@boulder (John Behrens) Distribution: na Organization: University of Colorado, Boulder Lines: 24 I spent the best part of a day chasing what turned out to be the following: (defmethod foo ((state state-class)) (with-slots (bar) state ;bar is a list (dotimes (i (length bar)) (setf (nth i bar) )))) The behavior I got was that bar in *all* instances of state was changed not just the instance passed into the method. The following works: (defmethod foo ((state state-class)) (with-slots (bar) state ;bar is a list (let ((baz (make-sequence 'list (length bar) :initial-element 0))) (dotimes (i (length bar)(setf bar baz)) (setf (nth i baz) ))))) I'm working in common LISP with CLOS on a MicroExplorer. Does anyone have any idea what the problem is? Jon