[Newbies] tutorial: "doesNotUnderstand" instance variable

Cédrick Béler cdrick65 at gmail.com
Wed Nov 14 08:16:36 UTC 2007


Karl a écrit :
> Andrew n marshall wrote:
>> I'm trying to go through the pipsqueak tutorial, but it throws a 
>> doesNotUnderstand error when I try to initialize the exitSides 
>> instance variable the first time.  The browser shows the exitSides 
>> variable (with nil value), so the VM knows its there.
>>
>> This is my class declaration:
>> Object subclass: #BlankCell
>>    instanceVariableNames: 'activeSegments exitSides'
>>    classVariableNames: ''
>>    poolDictionaries: ''
>>    category: 'Laser-Game-Model'
>>
>> This is my init function:
>> initializeExitSides
>>    self exitSides: Dictionary new. 
The error message says that #existSides: doesn't exist. So either you 
create it (the accessor) or you directly affect the instance variable.

BlankCell>>existSide: aDictionary
        existSide := aDictionary

or you replace in you initialize method "self exitSides: Dictionary" new by:
existSide := Dictionary new
>
>>    self exitSides at: #north put: #south.
>>    self exitSides at: #east put: #west.
>>    self exitSides at: #south put: #north.
>>    self exitSides at: #west put: #east.
>>
>> And a screen shot of my error stack trace is here:
>>  http://www.isi.edu/~amarshal/transfers/squeak_error.png
>> (How do I copy it as text anyway?)
>>
>>
>> Anm
>> _______________________________________________
>> Beginners mailing list
>> Beginners at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>>
>
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>



More information about the Beginners mailing list