freenode/#sbcl - IRC Chatlog
Search
4:47:54
akater
A slot accessor is a generic function that used to be overloaded for some cases, in an involved manner, but not anymore. I already got rid of some behaviour like this by fmakunbound'ing it but not all.
4:50:01
akater
Another value in the same plist is printed in inspector as #<broken weak pointer> --- maybe that could mean something relevant.
4:52:07
akater
Essentially, it looks like initform is pulled directly from this SB-PCL::CLASS-SLOT-CELLS alist of slots/initforms.
8:44:46
akater
@Krystof I don't think it's easily reproducible; this is a long-lived sbcl instance, a lot had happened. It's still running, and I could poll it for its state but that's it. The program is quite involved, classes are generated by custom macros, there's attempt to inherit initforms... I guess I'll just stick with :default-initargs as it should be easier.
8:50:59
akater
* attepmt to inherit initforms -> ...while combining initforms from other classes. I better not attempted it in the first place, it seems.
8:52:57
akater
Still, the image is there so if anyone's in the mood for awkward remote inspection, I'll respond. It is always a bummer when one has to restart the whole thing.
9:00:53
akater
Also, I finalized several classes manually. Tried to be careful of course but this certainlyis not very safe.
9:06:19
Krystof
I mean, I'd like to be *sure* that it was your fault rather than mine... but possibly not enough to go digging rather than the other things I need to do today
9:23:21
akater
It boils down to passing (descent-classes :allocation :class :initform ',descent-classes) to a defclass, with descent-classes precomputed. This particular initform persisted in CLASS-SLOT-CELLS no matter what.
9:40:13
Krystof
after (slot-makunbound (make-instance 'foo) 'x), (make-instance 'foo), the class-slot-cell is properly updated with the new initform
9:42:35
akater
@Krystof one has to slot-makunbound for each instance? BTW, my whole detour actually started because I wanted slot values for :allocation :class without allocating new instances.
9:44:54
Krystof
:default-initargs sort-of works; you don't get a defaulted initialization argument list for update-instance-for-redefined-class, but if you make a new instance the new value will appear
9:45:55
Krystof
simplest might be (reinitialize-instance (class-prototype (find-class 'foo)) :descent-classes <new-value>)
9:46:20
Krystof
or (setf (slot-value (class-prototype (find-class 'foo)) 'descent-classes) <new-value>) if you don't have an initarg
9:47:07
scymtym
redefining the class with the slot removed and then with the new definition added seems to work as well
9:47:51
Krystof
scymtym: you need to be sure to access an instance so that u-i-f-r-c gets called at least once between the redefintions
9:48:54
scymtym
at least the cell in the metaobject reflects the change immediately on removal and re-addition
14:21:41
guicho
Is there already a function that takes a function designator, environment, and a list of arguments (or a list of types) and returns the expected return type of the function using all of the defoptimizer knowledges?