About method literals

Bob Arning arning at charm.net
Wed May 8 16:03:38 UTC 2002


Because the Association in each case is the same one. It is, in fact, the Association that was obtained from Smalltalk when the method was compiled. Being the same is what allows changes to global variables (like classes) to be known instantly by all methods that reference them.

Cheers,
Bob

On Wed, 08 May 2002 17:49:11 +0200 Bergel Alexandre <bergel at iam.unibe.ch> wrote:
>There is something weird with method literal associations. Let's assume I have :
>-=-=-=-=-=-=
>Test>>foo
>  ^Object
>
>Test2>>Test
>  ^Object
>-=-=-=-=-=-=
>
>In each compiled method there is a set of association #Object->Object where #Object is the symbol, and Object is the class "Object".
>
>Why this expression is true ?
>
>((foo methodDict at: #bar) literals at: 1) identityHash = ((Test2 methodDict at: #foo) literals at: 1) identityHash
>
>=> true 




More information about the Squeak-dev mailing list