Roelof Wobben wrote:
If I understood everything well on page 26 my initialize methods must look like this:
Cell >> initialize super initialize. self initializeActiveSegments. self initializeExitSides. self leanleft.
BlankCell >> initialize super initialize. self initializeExitSides.
MirrorCell >> initialize super initialize self leansLeft: true
Why then I see a message that #leanleft is not Understood in Blankcell. or do I misunderstood that page. I find it a very confusing page.
Roelof
I've updated your example using the # and >> convention to describe methods and the classes they belong to. So the MNU (Message Not Understood) indicates that BlankCell doesn't know how to #leanLeft Now the first question you should ask yourself is "Does BlankCell or one of its superclasses define #leftLeft ?" Or the same question in another form "Which classes is #leanLeft defined on?" Note that the #leanleft is distinct from #leanLeft. ------------------------complete above before continuing Your next question is "what is causing #leanLeft" to be called on a BlankCell?" Now to simply things I presume evaluating the following in Workspace creates the same error... BlankCell new <doIt> So what you want to do is BlankCell new <debugIt> and trace through until you find where #leanLeft is about to be executed. Pay attention in the call stack to when BlankCell>>initialize transitions to Cell>initialize. ------------------------complete above before continuing Now when debugging "BlankCell new" traces into Cell >> initialize, note that "self leanLeft" refers send the message #leanLeft to the BlankCell object, which then checks to see if BlankCell>>leanLeft is defined, and then looks in the superclass to see if Cell>>leanLeft is defined, and the looks in the next superclass to see if Object>>leanLeft is defined - and if a definition is not found then BlankCell has a MNU. So... I think your Cell>>initialize is incorrect. It would be useful to know in more detail what makes you think it should look like that - to deconstruct your confusion. Cell was only introduced on page 35, and its initialize method looked like this Cell>>initialize super initialize. self initializeActiveSegments. I see nothing else on page 25 or 26 that indicates any further change to Cell>>initialize. The only thing I can guess at it that you've confused the bottom right snapshot as applying to Cell when I guess it applies only to MirrorCell. cheers -ben