Reputation: 719
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)
Upvotes: 1
Views: 170
Reputation: 139251
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.
Upvotes: 3