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

Locatives and Class slots

    Date: Tue, 22 May 90 13:13 EDT
    From: barmar@Think.COM (Barry Margolin)

	Date: Tue, 22 May 90 08:41 PDT
	From: snicoud@atc.boeing.com (Stephen L. Nicoud)

	I'm converting an application using New Flavors to use PCL on a
	Symbolics 3650 (7.2).  I have several cases where the code uses a flavor
	instance variable as an argument to SCL:LOCF.  The resulting locative is

	I can't seem to get the same functionality with class slots.

	Would anyone care to make suggestions about how to proceed?  Is there a
	way to get a locative to a PCL class slot?

    Wait for Genera 8.0 before doing the conversion.  Symbolics CLOS allows
    LOCF to be used with slots.

    With PCL you probably need to use internal functions to get at the
    representation, and then use LOCF with that.


In Victoria Day PCL this used to work.  I haven't tested it in any other PCL.

(defun locate-in-instance (instance slot)
  (let* ((static-slots (sys:eval-in-instance instance 'static-slots))
	 (wrapper (sys:eval-in-instance instance 'wrapper))
	 (slots (elt wrapper 1))
	 (slot-position (position slot slots)))
    (sys:locf (aref static-slots slot-position))))