I would like to define a common lisp slot definition metaobject in order to allow for providing new options when writing the details of a slot on a class.
For example
(defclass test3 ()
((world :my-new-option T)))
Just like :initform could be provided, I want to be able to provide a new option for that slot. Furthermore, I would then like to be able to have a function that, given class, can then return the value of the provided option.
Example:
(my-new-option-value (find-class 'test3))
=> T
I tried defining it as a subclass of c2mop:standard-direct-slot-definition, but didn't really know where to go from there to use it.
Based on additional properties to slot definition by @RainerJoswig with some modifications so that it works in SBCL and probably in all Common Lisps that support c2mop.
Now, given a slot, we can check the value of the
:foooption like this:So for example: