I have tried very hard to sort this out but now I think I need help. At lease I'm getting to know the debugger.
The relavent page is: http://squeak.preeminent.org/tut2007/html/022.html Here are two file outs: Laser-Game-Model.st Laser-Game-Tests.st I'm getting three errors with the Test Runner. It would seem that a BlankCell object doesn't understand the message exitSides: Or do I actually. It looks like it should be: initializeExitSides self exitSides := Dictionary new. not initializeExitSides self exitSides: Dictionary new. Is this another way to do assignment? Anyway it's not working and that's how the tutorial says to do it. I'm really curious to what the problem is. Can anyone enlighten me? |
On Jul 21, 2007, at 8:25 AM, gruntfuttuck wrote: > I'm getting three errors with the Test Runner. It would seem that a > BlankCell object doesn't understand the message exitSides: > Or do I actually. It looks like it should be: > > initializeExitSides > self exitSides := Dictionary new. > > not > initializeExitSides > self exitSides: Dictionary new. > > Is this another way to do assignment? Anyway it's not working and > that's how > the tutorial says to do it. > > I'm really curious to what the problem is. Can anyone enlighten me? The exitSides: message looks like an accessor, a method for setting the value of an instance variable. That method would be implemented much like the assignment you give above: exitSides: aDictionary exitSides := aDictionary The preceding "self" isn't used when referring to the name of an instance variable. Accessors let other objects set the values of variables directly, and are sometimes thought to be more helpful for possible later changes. Sometimes they do things like alerting other objects of changes. When there's no behavior above and beyond simple setting, from inside the same object, their use is largely a matter of personal style. I haven't read through the whole tutorial, but perhaps the exitSides: method is defined elsewhere. In any case, I'd guess that you are correct and it is trying to do an assignment, although it may also need to do other things. Hope this helps, Benjamin Schroeder _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
Hello Benjamin,
Thanks for your help. I have now fixed the problem. I had forgotten to add the accessors method. Do you find often when you find a solution to a problem, that you are amazed you didn't see it sooner? I always find my self thinking how did I not see that. Thanks again.
|
On Jul 21, 2007, at 10:15 AM, gruntfuttuck wrote: > Thanks for your help. I have now fixed the problem. I had forgotten > to add > the accessors method. Do you find often when you find a solution to a > problem, that you are amazed you didn't see it sooner? I always > find my self > thinking how did I not see that. Heh, yes, of course, I feel that way all the time! :) Benjamin Schroeder _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
Free forum by Nabble | Edit this page |