Question #3:
Shouldn't the following (from the paper):
slots: {
#staff => ManySlot opposite: #boss class: Clerk.
}
Be:
slots: {
#staff => (ManySlot opposite: #boss class: Clerk).
}
Also, what is that code actually doing? Is #opposite:class: a class-side
method of ManySlot? If so, what does it return? Ah, I see now - #=>> does
some magic to accept either a Slot class or instance.
Question #4:
Given:
Object subclass: #MyClass
slots: { #var1 => MySlot }
classVariables: { }
category: ''
and
MyClass >>#var1: anObject
var1 := anObject
MySlot>#write:to: doesn't seem to be sent when I `myClassInstance var1: 2`.
I tried to insert a halt, 1 inspect, etc. I am able to intercept #read: on
the other hand
Question #5:
I tried:
Object subclass: #MyClass
slots: { #var1 => MySlot adjustment: 10 } "with and without () around
`MySlot adjustment: 10`"
classVariables: { }
category: ''
where:
InstanceVariableSlot subclass: #MySlot
slots: { #adjustment }
and:
adjustment
^ adjustment ifNil: [ 0 ]
but when I open a new browser on the class definition of MyClass, the slots
are truncated to:
slots: { #var1 => MySlot }
-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html