freenode/#sbcl - IRC Chatlog
Search
13:31:38
stassats
that slot-definition doesn't appear in class-slots, but that's why i'm using slot-definition-using-class
13:34:14
stassats
so how the hell do i change the instance slot protocol, if i can't do anything to it
13:59:00
Xof
I think it is a generic function, but you need to have all the applicable methods defined before you make anything that those methods might be applicable to
13:59:12
stassats
"The results are undefined if the slot argument does not appear among the set of effective slots associated with the class argument."
13:59:29
stassats
it's (defun slot-value-using-class-dfun (class object slotd) (declare (ignore class)) (funcall (slot-info-reader (slot-definition-info slotd)) object))
14:03:06
stassats
basically, i can't have a virtual slot without it allocating an unused space in the slot vector
14:09:40
stassats
i just use slot-value-using-class throughout, when iterating over class slots, as going definition-name->slot-value would just start at searching for the slot definition
14:17:49
Xof
I think you can have virtual slots; you just need to override slot-definition-location so that compute-slots doesn't allocate a location for it in the slot vector
14:18:30
stassats
i'm thinking of actually using the slot vector, since i have to actually control at runtime whether it's virtual or real
14:19:55
stassats
i could generate different classes at runtime with different slot arrangements and change-class...
14:20:11
specbot
slot-definition-location: http://metamodular.com/CLOS-MOP/slot-definition-location.html