Accessible Objects
AccessibleObject methods for: instance variable access
variableAt: name
"Return the named value..."
| index |
index := self variableIndex: name.
index = 0 ifTrue: [self error: 'Bad instance variable name...'].
^self instVarAt: index
variableAt: name put: value
"Set the named instance variable to the indicated value..."
| index |
index := self variableIndex: name.
index = 0 ifTrue: [self error: 'Bad instance variable name...'].
^self instVarAt: index put: value
variableIndex: name
"Return the instance variable index for this name, or zero..."
^self class allInstVarNames indexOf: name asString.