From: Pierre Mai
Subject: Direct accessing of shared slots revisited (for CLISP)
Date: 
Message-ID: <m3emwt1aa2.fsf@torus.cs.tu-berlin.de>
Hi!

The 'problem' of accessing shared slots of classes without going
through a dummy instance has been raised on this newsgroup a couple
of times, and solutions have been given for CLOS implementations
which implement enough parts of the MOP, like the one below:

(defun class-slot-value (classname name)
  "Access the slot-value of a slot with :allocation :class."
  (let ((class (find-class classname)))
    (unless (clos::class-finalized-p class)
      (clos::finalize-inheritance class))
    (slot-value (clos::class-prototype class) name)))

(defsetf class-slot-value (classname name) (newval)
  (let ((cls (gensym)))
    `(let ((,cls (find-class ,classname)))
      (unless (clos::class-finalized-p ,cls)
	(clos::finalize-inheritance ,cls))
      (setf (slot-value (clos::class-prototype ,cls) ,name) ,newval))))

But it seems CLISP doesn't implement this part of the MOP, and now I'm 
looking for a somewhat elegant/efficient solution for CLISP...

Any help would be apperciated...

Regs, Pierre.

-- 
Pierre Mai <ยทยทยทยท@cs.tu-berlin.de>	http://home.pages.de/~trillian/
  "Such is life." -- Fiona in "Four Weddings and a Funeral" (UK/1994)