This is weird, I'm not seeing the problem at all! I've always thought of *#instVarNamed:* as a sibling method to *#instVarAt:*(which maybe is more obviously an instance method). So *anAddress instVarNamed: 'street'* would return a Street, just as *anAddress instVarAt: 2* could. But anAddress, being just an instance, doesn't need to know about its class definition directly, since it can always ask its class if it needs to, so for example *anAddress class instVarNames* would return the names of all the instance variables defined in the Address class. Now can someone please explain why that is confusing? -- Cheers, Peter On Sun, Sep 23, 2012 at 10:59 PM, Mariano Martinez Peck < marianopeck@gmail.com> wrote:
On Sun, Sep 23, 2012 at 6:55 PM, Stéphane Ducasse < stephane.ducasse@inria.fr> wrote:
since groups is an instance variable on the class side
Nautilus class instVarNames -> #('maxSize' 'cachedLastClasses' 'groups')
ok we get the instance variables
so it was strange that the class could not find the instance variable using instVarNamed:
Nautilus class instVarNamed: 'groups' -> error
I was confused.
Looks strange to me as well. I would like that it actually works :)
Stef
On Sep 23, 2012, at 5:42 PM, Camillo Bruni wrote:
On 2012-09-23, at 17:38, Benjamin <benjamin.vanryseghem.pharo@gmail.com>
wrote:
On a class, should answer the inst of the corresponding metaclass
Like when you ask the inst var of an instance, you get the inst var of
the corresponding class
Ben
but that works...., I don't get it :D
Nautilus instVarNamed: #maxSize Nautilus new instVarNamed: #announcer
and:
Nautilus class instVarNames includes: #maxSize. Nautilus instVarNames includes: #announcer.
everything fine and symmetrical here...
-- Mariano http://marianopeck.wordpress.com