Calling Class allocated slot on class-names in Common Lisp

161 Views Asked by At

Is there any way to call a :class allocated slot on the name of a class instead of an instance? Something like: (class-alloc-slot 'name-of-the-class)

1

There are 1 best solutions below

0
On

LispWorks:

CL-USER 6 > (defclass foo () ((bar :allocation :class :initform :baz)))
#<STANDARD-CLASS FOO 402005B3CB>

CL-USER 7 > (make-instance 'foo)
#<FOO 4020240C33>

CL-USER 8 > (class-prototype (find-class 'foo))
#<FOO 402005EB73>

CL-USER 9 > (slot-value * 'bar)
:BAZ

use CLOSER-MOP for portable MOP features.