Hi edouard
I will check as soon as I get some time.
I'm new on
this mailing list, this is my first mail :-)
welcome
MCSmalltalkhubRepository
owner:
'StephaneDucasse'
project:
'ObjVLispSkeleton'
user:
''
password:
''
I'm stuck at
"Method Lookup" p11. First, it seems that unit tests
"testNilWhenErrorInLookup" and
"testRaisesErrorSendWhenErrorInLookup" are not provided,
Mark if you read this mail. Did you get problem when you did it?
thus I'm not
sure that I'm working with the right image (everything was
fine until p11 though). Then, the "lookup: selector" is not
provided neither.
Not providing lookup: is ok since you have to define it. I will look
for the tests in my version.
While there
is another method named "lookup: selector from: anObjObject",
I can't figure out what I'm supposed to do with the second
parameter.
What you should see is that the second argument is is provided here
because when you raise an error, you should send a
messageNotUnderstood
and this message should be sent to the original object that received
the message and not the class where the method was found.
So lookup will use the receiver to walk through the inheritance
chain and the from: argument in case of error
Here is what
I would do:
lookup: selector
"look
for the method named <selector> starting in the
receiver.
The
lookup is done for a message sent to <anObjObject>.
self is an objClass"
^
self objMethodDict
at:
selector
ifAbsent:
[ self objSuperclassId ifNotNil: [ self objSuperclass
lookup: selector ] ]
what do you return when you do not find the class
Could someone
tell me if this implementation is correct? If it's correct,
what do you think the second parameter is for?
Moreover, do
you think I'm working with the right image?
Thanks.
-
Edouard