Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uwm.edu!psuvax1!rutgers!bellcore!pc@flash.bellcore.com From: pc@flash.bellcore.com Newsgroups: comp.lang.lisp Subject: updating random slots in (say) defstruct Message-ID: <18837@bellcore.bellcore.com> Date: 12 Jan 90 22:54:28 GMT Sender: news@bellcore.bellcore.com Reply-To: pc@flash.bellcore.com Organization: Bellcore - Wierd Ideas Factory Lines: 32 Given something like: (defstruct test (one) (two) (three)) one can do something like (setq access-function 'test-one) (setq instance (make-test :one 1 :two 2 :three 3)) (funcall access-function instance) => 1 There appears to be no Common LISP way to similarly update a random slot. The best one can do seems to be: (defun update-slot (object slot value) (case slot (one (setf (test-one object) value) .... )) Must i explicitly define my structure as say a list, to be able to replace an arbitrary component? Symbolics documentation on LOCFs is a little sketchy, but perhaps i can use them? Ideas? Peter Clitherow