Hierarchy (roots) of package

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

Hierarchy (roots) of package

Stephane Ducasse-3
Hi

Given a package I would like to know the classes that are roots
of hierarchy inside the package.

Do we have something like that?

Stef

Reply | Threaded
Open this post in threaded view
|

Re: Hierarchy (roots) of package

Clément Béra
I would do that:

Implementation:
rootsInsidePackage := [ :packageName |
| myPackage |
myPackage := RPackageOrganizer default packageNamed: packageName.
myPackage definedClasses select: [ :each | each superclass package ~~ myPackage ] ].

Example use-case:
rootsInsidePackage value: 'OpalCompiler-Core'

Is that what you expected ?

On Thu, Apr 19, 2018 at 7:19 AM, Stephane Ducasse <[hidden email]> wrote:
Hi

Given a package I would like to know the classes that are roots
of hierarchy inside the package.

Do we have something like that?

Stef




--
Reply | Threaded
Open this post in threaded view
|

Re: Hierarchy (roots) of package

Eliot Miranda-2
Hi Clément,


On Apr 18, 2018, at 11:45 PM, Clément Bera <[hidden email]> wrote:

I would do that:

Implementation:
rootsInsidePackage := [ :packageName |
| myPackage |
myPackage := RPackageOrganizer default packageNamed: packageName.
myPackage definedClasses select: [ :each | each superclass package ~~ myPackage ] ].

Don't forget nil superclasses (for proxy classes) so

each superclass isNil
or: [ each superclass package ~~ myPackage ] ]


Example use-case:
rootsInsidePackage value: 'OpalCompiler-Core'

Is that what you expected ?

On Thu, Apr 19, 2018 at 7:19 AM, Stephane Ducasse <[hidden email]> wrote:
Hi

Given a package I would like to know the classes that are roots
of hierarchy inside the package.

Do we have something like that?

Stef




--
Reply | Threaded
Open this post in threaded view
|

Re: Hierarchy (roots) of package

Stephane Ducasse-3
In reply to this post by Clément Béra
Thanks Clément this is a nice way to do it.
I was thinking about a more complex solution.
Tx!

On Thu, Apr 19, 2018 at 8:45 AM, Clément Bera <[hidden email]> wrote:

> I would do that:
>
> Implementation:
> rootsInsidePackage := [ :packageName |
> | myPackage |
> myPackage := RPackageOrganizer default packageNamed: packageName.
> myPackage definedClasses select: [ :each | each superclass package ~~
> myPackage ] ].
>
> Example use-case:
> rootsInsidePackage value: 'OpalCompiler-Core'
>
> Is that what you expected ?
>
> On Thu, Apr 19, 2018 at 7:19 AM, Stephane Ducasse <[hidden email]>
> wrote:
>>
>> Hi
>>
>> Given a package I would like to know the classes that are roots
>> of hierarchy inside the package.
>>
>> Do we have something like that?
>>
>> Stef
>>
>
>
>
> --
> Clément Béra
> https://clementbera.github.io/
> https://clementbera.wordpress.com/

Reply | Threaded
Open this post in threaded view
|

Re: Hierarchy (roots) of package

Stephane Ducasse-3
In reply to this post by Eliot Miranda-2
Thanks Eliot.


On Thu, Apr 19, 2018 at 3:06 PM, Eliot Miranda <[hidden email]> wrote:

> Hi Clément,
>
>
> On Apr 18, 2018, at 11:45 PM, Clément Bera <[hidden email]> wrote:
>
> I would do that:
>
> Implementation:
> rootsInsidePackage := [ :packageName |
> | myPackage |
> myPackage := RPackageOrganizer default packageNamed: packageName.
> myPackage definedClasses select: [ :each | each superclass package ~~
> myPackage ] ].
>
>
> Don't forget nil superclasses (for proxy classes) so
>
> each superclass isNil
> or: [ each superclass package ~~ myPackage ] ]
>
>
> Example use-case:
> rootsInsidePackage value: 'OpalCompiler-Core'
>
> Is that what you expected ?
>
> On Thu, Apr 19, 2018 at 7:19 AM, Stephane Ducasse <[hidden email]>
> wrote:
>>
>> Hi
>>
>> Given a package I would like to know the classes that are roots
>> of hierarchy inside the package.
>>
>> Do we have something like that?
>>
>> Stef
>>
>
>
>
> --
> Clément Béra
> https://clementbera.github.io/
> https://clementbera.wordpress.com/