2009/10/29 Stéphane Ducasse <[email protected]>:
> Hi
>
> just to share a ugly design point with MethodReference
>
> MethodReference are created using
>
> MethodReference class: aClass symbol: aSymbol
>
> however they store the class ***name***
>
> and after when you query the class using either actualClass or
> methodClass
> you get the class that is in Smalltalk.
>
> So if like me you copied the class then you will get another version
> of your class
> even if this is the right one you use to create the MethodReference....
>
> One of these days we will have to check that
>

Yes, i wondering myself, what is the point to reference the methods in
such style.
The way, how actual class & its method get resolved makes it
impossible to reference a method in
arbitrary class object, especially one which is not installed into
system dictionary.

I think its lacking additional form of indirection, which should be an
environment object who is responsible for
delivering the method's source code along with resolving the class by
its name. Without such indirection, i see no point in having a
MethodReference per se,
because you can always do the same thing by yourself , i.e. (Smalltalk
at: #SomeClass) methodDict at: #someSelector.
Without that, i see no point why i would want to use it, because it
always points to same thing, no matter where i using the
MethodReference.

> Stef
>
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



-- 
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to