Hi all,
Since a RPackage can have sub-packages (see RPackage>>systemSubPackages)
I'm wondering how to get the parent package of a package.

btw: why are subPackages computed ?
I mean it seems to me that a package can be considered as a composite, so why
not directly associate a package with its children ?
(and maybe have a two ways association between a child and a parent package).

-----
RPackage>>systemSubPackages

    "return all RPackages matching with systemCategories of this RPackage"
    |tmpPackages|
    tmpPackages := OrderedCollection new.
    self systemCategories do: [:aString |
        (aString asSymbol = self name) ifFalse: [
            |tmpPackage|
"Maybe a RPackage matching the subcategory name does not yet exist in the organizer (Because packageInfo lazily register category from system). In this case, We should also lazily register a new RPackage with the right contents inside:" tmpPackage := RPackageOrganizer default packageNamed: aString asSymbol ifAbsent: [RPackageOrganizer default importFromPackageInfo: (PackageInfo named: aString)].
            tmpPackages add: (tmpPackage).
            ].
        ].
    ^ tmpPackages
-----

Thanks
Alain


Reply via email to