Searching senders of a method

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Searching senders of a method

deejay220989
Hi,

May I know the difference between:

SystemNavigation default allCallsOn: #subclassResponsibility
and
ProtoObject allCallsOn: #subclassResponsibility

It seems that "ProtoObject allCallsOn: #subclassResponsibility" returns 3 results lesser than "SystemNavigation default allCallsOn: #subclassResponsibility"

Shouldn't they return the same result since ProtoObject is the superclass of all classes?

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Searching senders of a method

Bert Freudenberg

On 03.03.2012, at 13:44, deejay220989 wrote:

> Hi,
>
> May I know the difference between:
>
> SystemNavigation default allCallsOn: #subclassResponsibility
> and
> ProtoObject allCallsOn: #subclassResponsibility
>
> It seems that "ProtoObject allCallsOn: #subclassResponsibility" returns 3
> results lesser than "SystemNavigation default allCallsOn:
> #subclassResponsibility"
>
> Shouldn't they return the same result since ProtoObject is the superclass of
> all classes?


In my image, this returns an empty collection:

        ProtoObject allCallsOn: #subclassResponsibility

Which is unsurprising, since ProtoObject has no methods that send #subclassResponsibility.

- Bert -


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Searching senders of a method

deejay220989
I see..I thought it will search for the method in the subclasses of ProtoObject too. As for me, it returns a SortedCollection (349 entries).

Which version of Squeak are you using?

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Searching senders of a method

Bert Freudenberg

On 03.03.2012, at 14:00, deejay220989 wrote:

> I see..I thought it will search for the method in the subclasses of
> ProtoObject too. As for me, it returns a SortedCollection (349 entries).
>
> Which version of Squeak are you using?


The latest (4.4 alpha trunk). How about you?

- Bert -


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Searching senders of a method

deejay220989
I'm using 4.2..now downloading 4.3 and will try to download 4.4 alpha..will let you know later.

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Searching senders of a method

Bert Freudenberg
On 03.03.2012, at 14:07, deejay220989 wrote:

> I'm using 4.2..now downloading 4.3 and will try to download 4.4 alpha..will
> let you know later.


It looks like the behavior was changed in 4.3. It now excludes subclasses. Not sure why. Levente?

To get the "old" behavior you now would need to do

        SystemNavigation default allCallsOn: #subclassResponsibility localTo: ProtoObject

The size difference comes from duplicates - if you convert the result of this to a Set and compare sizes, they do match.

        (SystemNavigation default allCallsOn: #subclassResponsibility localTo: ProtoObject) size
        ==> 391

        (SystemNavigation default allCallsOn: #subclassResponsibility localTo: ProtoObject) asSet size
        ==> 358

This may be considered a bug, I guess.

- Bert -


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Searching senders of a method

Levente Uzonyi-2
On Sat, 3 Mar 2012, Bert Freudenberg wrote:

> On 03.03.2012, at 14:07, deejay220989 wrote:
>
>> I'm using 4.2..now downloading 4.3 and will try to download 4.4 alpha..will
>> let you know later.
>
>
> It looks like the behavior was changed in 4.3. It now excludes subclasses. Not sure why. Levente?

I guess it's the lack of tests and me not being careful enough. I'll check
it out soon. Should we keep the old behavior?


Levente

>
> To get the "old" behavior you now would need to do
>
> SystemNavigation default allCallsOn: #subclassResponsibility localTo: ProtoObject
>
> The size difference comes from duplicates - if you convert the result of this to a Set and compare sizes, they do match.
>
> (SystemNavigation default allCallsOn: #subclassResponsibility localTo: ProtoObject) size
> ==> 391
>
> (SystemNavigation default allCallsOn: #subclassResponsibility localTo: ProtoObject) asSet size
> ==> 358
>
> This may be considered a bug, I guess.
>
> - Bert -
>
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Searching senders of a method

Levente Uzonyi-2
In reply to this post by deejay220989
On Sat, 3 Mar 2012, deejay220989 wrote:

> Hi,
>
> May I know the difference between:
>
> SystemNavigation default allCallsOn: #subclassResponsibility
> and
> ProtoObject allCallsOn: #subclassResponsibility
>
> It seems that "ProtoObject allCallsOn: #subclassResponsibility" returns 3
> results lesser than "SystemNavigation default allCallsOn:
> #subclassResponsibility"
>
> Shouldn't they return the same result since ProtoObject is the superclass of
> all classes?

The cause of the difference in Squeak <4.3 is that Behavior >>
#allCallsOn: ignores the #thoroughSenders preference, while
SystemNavigation >> #allCallsOn: doesn't and the default value is true.
This was unified in Squeak 4.3, but due to a mistake on my part, only the
given class' methods are included in the result.


Levente

>
> Thanks!
>
> --
> View this message in context: http://forum.world.st/Searching-senders-of-a-method-tp4441275p4441275.html
> Sent from the Squeak - Beginners mailing list archive at Nabble.com.
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners