1

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)

Rainer Joswig
  • 136,269
  • 10
  • 221
  • 346
Student
  • 708
  • 4
  • 11

1 Answers1

3

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.

Rainer Joswig
  • 136,269
  • 10
  • 221
  • 346