On 24 September 2012 17:57, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
On Mon, Sep 24, 2012 at 12:14 PM, Camillo Bruni <camillobruni@gmail.com> wrote:
I still don't see the problem....
everything is symmetrical, everything works...
Nautilus class instVarNames -> #('maxSize' 'cachedLastClasses' 'groups')
ok we get the instance variables
Nautilus class instVarNamed: 'groups' -> error
For me that is wrong. I should not get an error, I should get the actual variable. I mean, why #instVarNames workds but #instVarNamed: doesn't? That is inconsistent.
because you sending a message to wrong recepient. Should be: Nautilus instVarNamed: 'groups'
Cheers,
On 2012-09-24, at 11:18, Fernando Olivero <fernando.olivero@usi.ch> wrote:
...makes me envy the simplicity of SELF!
Fernando
On Mon, Sep 24, 2012 at 10:38 AM, Igor Stasenko <siguctua@gmail.com> wrote:
On 24 September 2012 08:53, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
On Sep 24, 2012, at 1:56 AM, Igor Stasenko wrote:
okay, i found what is wrong with first post (didn't read carefully).
The instVarNames is a class-side protocol i.e. part of a class behavior, while instVarNamed: is an instance-side protocol i.e. "hackishly access to instance variable with given name"
Yes this is exactly my point. I think that there is a protocol missing for class to be consistent.
err, what is missing? class is an object, and using #instVarNamed: on them is perfectly fine.
So, this is ok: Nautilus class instVarNames -> #('maxSize' 'cachedLastClasses' 'groups')
And this is ok too:
Nautilus instVarNamed: 'groups' worked
because Nautilus is an instance of its metaclass.
But this is wrong, since 'Nautilus class' is an instance of Metaclass, and metaclass doesn't have 'groups' variable.
Nautilus class instVarNamed: 'groups' -> error
-- Best regards, Igor Stasenko.
-- Best regards, Igor Stasenko.
-- Mariano http://marianopeck.wordpress.com
-- Best regards, Igor Stasenko.