freenode/#lisp - IRC Chatlog
Search
7:17:05
PuercoPope
Is there any reason why compute-effective-slot-definition-class wouldn't receive the custom initargs provided. They are present in compute-direct-slot-definition afaict
7:31:41
beach
I am unable to make such corrections. I prefer to have the correct names in the question.
7:32:10
no-defun-allowed
However, the former should be given the initargs of the slot. "The initargs argument is the set of initialization arguments and values that will be passed to make-instance when the effective slot definition metaobject is created."
7:33:45
beach
Perhaps the names are correct, but specific to a particular Common Lisp implementation.
7:37:01
beach
PuercoPope: So can you rephrase the question, and could you state whether you are referring to observed behavior in some Common Lisp implementation, or to some perceived problem in the AMOP?
7:45:05
PuercoPope
I'll share the code although it is a little bit long. I am talking about observed behaviour using SBCL and sb-mop. The problem is with initializing xcb-list-slot with the correct class https://gist.github.com/PuercoPop/d13d5d663e28cd66ccb7701e50268133
7:54:18
beach
Did you create a method on compute-effective-slot-definition specialized to your new metaclass?
7:56:52
beach
I would think the default method is the one that calls effective-slot-definition-class using the initargs for standard-class then.
7:57:33
PuercoPope
No, I would expect it to call it with all the initargs. And it does so in the other cases. For example in for the padding slot
7:59:13
beach
How would the default method on compute-effective-slot-definition know what initargs your slot definition class takes?
8:00:28
PuercoPope
Why would it need to 'know' what are the initargs? Wouldn't it just pass all the options passed to the slot?
8:00:57
PuercoPope
from what I have seen, compute-effective-slot-definition is used to set the values using the direct slots, but the slot itself is always initialized using the default method, ie. (call-next-method). Although in most cases code tends to ignore initargs and just return their custom slot because they only have one
8:03:10
beach
The effective slot definition is not initialized with the same initargs as the direct slot definition. It takes initargs such as :location where the slot is stored in the instance, etc.
8:05:02
PuercoPope
And because allocation is a 'default' one it works. Makes sense. Too bad compute-effective-slot-definition-initargs doesn't seem to be exported by sb-mop
8:08:00
PuercoPope
I can use the direct-slots to chose the correct class for the effective slot instead. But I'm unsure of how to 'instanciate' the slot intself, do I just class (make-instance 'xcb-list-effective-slot-definition?)
8:09:01
PuercoPope
It is times like this that I wish the MOP would have been more fleshed out. compute-effective-slot-definition-initargs certainly seems like something that should be exposed
10:24:20
_death
I also wondered about that omission at times.. unfortunately with memcpy there's the size_t issue again.. in my code I usually went with the naive mem-aref loop
15:37:24
srandon111
guys ii am having an hard time understanding this twoer of hanoi thing from SICP... https://www.youtube.com/watch?list=PLZHQObOWTQDMRtm8h9bG9P06WINNoBnCR&v=2SUvWfNJSsM can somebody help me? where is the rule about you can move only a single disk at a time in? and how does the system know that he cannot put laarger disks above smaller disks?