|
Re: Laser game tutorial again: msg#00114lang.smalltalk.squeak.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. Benjamin Schroeder-2 wrote: > > > 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 > Beginners@xxxxxxxxxxxxxxxxxxxxxxxxxx > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > -- View this message in context: http://www.nabble.com/Laser-game-tutorial-again-tf4121699.html#a11722632 Sent from the Squeak - Beginners mailing list archive at Nabble.com.
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Laser game tutorial again, Benjamin Schroeder |
|---|---|
| Next by Date: | Re: Laser game tutorial again, Benjamin Schroeder |
| Previous by Thread: | Re: Laser game tutorial again, Benjamin Schroeder |
| Next by Thread: | Re: Laser game tutorial again, Benjamin Schroeder |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |