freenode/lisp - IRC Chatlog
Search
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?
16:55:29
pjb
srandon111: the rune that you can move only a single disk at a time is implemented by the fact that the computer only executes one instruction at a time!
16:56:05
pjb
srandon111: the systems knows that it cannot put larger disks above smaller disks from the algorithm. This property can be proven mathematically from the algorithm.
16:57:55
pjb
srandon111: to implement those rules explicitely in a system, you would have to make it possible to break them. For example, by implementing operations such as take tore from pile 1 in left hand, take tore from pile 2 in right hand, etc… and then you can write the rule, and ensure that such a sequence doesn't occur.