methods not registered in packages?

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

methods not registered in packages?

Tudor Girba-2
Hi,

While trying to measure the size of code, I stumbled across an interesting problem: it seems that some methods have a package, but the package does not list.

packagedMethods := RPackageOrganizer default packages flatCollect: #methods.
methods := ProtoObject withAllSubclasses flatCollect: #methods.
diff := methods \ packagedMethods.
diff size.
“7249"

Looking at bit closer, it looks like the methods do have a package and that they point to the package that is in the package organizer, so that is good:

diff select: [ :each | each package isNil ]
"an OrderedCollection()".

diff select: [ :each | (RPackageOrganizer default packages includes: each package) not ].
"an OrderedCollection()”

However, when we ask the package, it does not know about the method:

diff select: [ :each | each package methods includes: each ]
"an OrderedCollection()”


Is this a known problem or should I open an issue (I did not find a bug report for it)?


Cheers,
Doru


--
feenk.com

"Presenting is storytelling."


Reply | Threaded
Open this post in threaded view
|

Re: methods not registered in packages?

tesonep@gmail.com
Hi Doru,
  thanks for checking this behavior. Those methods are not correctly
packaged because those are methods added from a trait.  Nowadays,
#methods returns all the methods in the class (the ones defined in the
class and the ones defined in the used traits) and #localMethods
returns the methods defined only in the class.

I think it is a good issue to open so we can discuss which is the best
API for it. Maybe the existing one is not good. To me, #methods should
not return all the methods from the method dictionary or we have to
encourage to use the #localMethods where #methods is used.
I am not sure about what is the answer, so the issue to discuss will be perfect.

Cheers,
Pablo

On Sun, Feb 9, 2020 at 8:16 AM Tudor Girba <[hidden email]> wrote:

>
> Hi,
>
> While trying to measure the size of code, I stumbled across an interesting problem: it seems that some methods have a package, but the package does not list.
>
> packagedMethods := RPackageOrganizer default packages flatCollect: #methods.
> methods := ProtoObject withAllSubclasses flatCollect: #methods.
> diff := methods \ packagedMethods.
> diff size.
> “7249"
>
> Looking at bit closer, it looks like the methods do have a package and that they point to the package that is in the package organizer, so that is good:
>
> diff select: [ :each | each package isNil ]
> "an OrderedCollection()".
>
> diff select: [ :each | (RPackageOrganizer default packages includes: each package) not ].
> "an OrderedCollection()”
>
> However, when we ask the package, it does not know about the method:
>
> diff select: [ :each | each package methods includes: each ]
> "an OrderedCollection()”
>
>
> Is this a known problem or should I open an issue (I did not find a bug report for it)?
>
>
> Cheers,
> Doru
>
>
> --
> feenk.com
>
> "Presenting is storytelling."
>
>


--
Pablo Tesone.
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: methods not registered in packages?

Tudor Girba-2
Excellent catch!

Ok, I will open an issue.

Cheers,
Doru



> On Feb 9, 2020, at 3:04 PM, [hidden email] wrote:
>
> Hi Doru,
>  thanks for checking this behavior. Those methods are not correctly
> packaged because those are methods added from a trait.  Nowadays,
> #methods returns all the methods in the class (the ones defined in the
> class and the ones defined in the used traits) and #localMethods
> returns the methods defined only in the class.
>
> I think it is a good issue to open so we can discuss which is the best
> API for it. Maybe the existing one is not good. To me, #methods should
> not return all the methods from the method dictionary or we have to
> encourage to use the #localMethods where #methods is used.
> I am not sure about what is the answer, so the issue to discuss will be perfect.
>
> Cheers,
> Pablo
>
> On Sun, Feb 9, 2020 at 8:16 AM Tudor Girba <[hidden email]> wrote:
>>
>> Hi,
>>
>> While trying to measure the size of code, I stumbled across an interesting problem: it seems that some methods have a package, but the package does not list.
>>
>> packagedMethods := RPackageOrganizer default packages flatCollect: #methods.
>> methods := ProtoObject withAllSubclasses flatCollect: #methods.
>> diff := methods \ packagedMethods.
>> diff size.
>> “7249"
>>
>> Looking at bit closer, it looks like the methods do have a package and that they point to the package that is in the package organizer, so that is good:
>>
>> diff select: [ :each | each package isNil ]
>> "an OrderedCollection()".
>>
>> diff select: [ :each | (RPackageOrganizer default packages includes: each package) not ].
>> "an OrderedCollection()”
>>
>> However, when we ask the package, it does not know about the method:
>>
>> diff select: [ :each | each package methods includes: each ]
>> "an OrderedCollection()”
>>
>>
>> Is this a known problem or should I open an issue (I did not find a bug report for it)?
>>
>>
>> Cheers,
>> Doru
>>
>>
>> --
>> feenk.com
>>
>> "Presenting is storytelling."
>>
>>
>
>
> --
> Pablo Tesone.
> [hidden email]
>

--
feenk.com

"If you interrupt the barber while he is cutting your hair,
you will end up with a messy haircut."