On Sun, Sep 23, 2012 at 3:16 AM, Stéphane Ducasse <stephane.ducasse@inria.fr
wrote:
may be this is too early but I wanted to change the value of a class instance variable
Nautilus class instVarNames -> #('maxSize' 'cachedLastClasses' 'groups')
Nautilus class instVarNamed: 'groups' -> error
Nautilus instVarNamed: 'groups' worked
I found that strange and inconsistent. I'am wrong?
Read Peter Hugosson Miller's message. instVarNamed: is like instVarAt:, in fact instVarNamed: instVarName ^self instVarAt: (self class allInstVarNames indexOf: instVarName) but that's slot and better is instVarNamed: instVarName ^self instVarAt: (self class instVarIndexFor: aString asString ifAbsent: [self error: 'no such inst var']) any clearer? i.e. instVarNamed: is sent to instances to access their inst vars, not to classes to access meta data about their inst vars.
Stef
-- best, Eliot