Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!rphroy!caen!hellgate.utah.edu!dog.ee.lbl.gov!ucbvax!tut.cis.ohio-state.edu!unreplyable!garbage From: Gallagher@GILGAMESH.CS.UMASS.EDU (Kevin Gallagher) Newsgroups: comp.lang.clos Subject: SLOT-VALUE and structures Message-ID: <2880914762-3910514@Gilgamesh> Date: 17 Apr 91 22:06:02 GMT Sender: welch@tut.cis.ohio-state.edu Distribution: inet Organization: CommonLoops Lines: 33 From: Gregor Kiczales (via barmar@think.com) Date: Mon, 15 Apr 1991 09:37:22 -0700 The MOP spec does not require SLOT-VALUE to work on structures. This requirement was dropped in the final version because some people were concerned that it interfered with efficient structure implementations. I am very disappointed to see this. For several *years* the standard answer to the question ``How do I access an arbitrary slot in a structure instance?'' has been ``Use SLOT-VALUE (when CLOS is available).'' This question is asked almost monthly on the various lisp mailing lists and newsgroups. Providing this capability does not prevent efficient structure implementations. All that is required is to maintain declarative information about the implemenation of the structure. Most lisps already save this information anyway for the benefit of functions like describe and inspect. The defstruct generated slot access functions can still use whatever implementation tricks you like. In addition, it is not possible to implement this capability in Common Lisp. Many Common Lisp solutions have been proposed, however none of them are completely general. Kevin Gallagher Gallagher@cs.umass.edu P.S. I have a set of implementation specific structure slot access utilities for each lisp that I use, as I'm sure many other people do as well. I can certainly define SLOT-VALUE-USING-CLASS in terms of these, but this is less than optimal.