Re: [Pharo-users] Moving Class to a Package programmaticaly

2017-05-27 Thread Hilaire
Thanks Thierry Le 26/05/2017 à 19:22, Thierry Goubier a écrit : > > This should work: -- Dr. Geo http://drgeo.eu

Re: [Pharo-users] Moving Class to a Package programmaticaly

2017-05-27 Thread Denis Kudriashov
2017-05-27 15:05 GMT+02:00 Thierry Goubier : > The problem I foresee is that at a certain point in the future, not > advertised, that semantic will change to not mean 'remove existing tag'. > > If I start using that API, I'll need to add a test in my stuff that will > flag that API semantic change

Re: [Pharo-users] Moving Class to a Package programmaticaly

2017-05-27 Thread Thierry Goubier
2017-05-27 14:45 GMT+02:00 Denis Kudriashov : > > 2017-05-27 14:15 GMT+02:00 Thierry Goubier : > >> Will: >> >> #MyPackage asPackage definedClasses do: [:each | each tagWith: #MyPackage] >> >> put the classes in the #MyPackage or in the #MyPackage-MyPackage system >> category? >> > > #tagWith: not

Re: [Pharo-users] Moving Class to a Package programmaticaly

2017-05-27 Thread Denis Kudriashov
2017-05-27 14:15 GMT+02:00 Thierry Goubier : > Will: > > #MyPackage asPackage definedClasses do: [:each | each tagWith: #MyPackage] > > put the classes in the #MyPackage or in the #MyPackage-MyPackage system > category? > #tagWith: not touches package of class. It only adds receiver into package

Re: [Pharo-users] Moving Class to a Package programmaticaly

2017-05-27 Thread Thierry Goubier
2017-05-27 13:58 GMT+02:00 Denis Kudriashov : > > 2017-05-26 19:22 GMT+02:00 Thierry Goubier : > >> >> This should work: >> >> org := (RPackageOrganizer default packageNamed: 'MyPackage'). >> tag := org addClassTag: #Classes. >> org definedClasses do: [ :aClass | >> aClass category: tag ca

Re: [Pharo-users] Moving Class to a Package programmaticaly

2017-05-27 Thread Denis Kudriashov
2017-05-26 19:22 GMT+02:00 Thierry Goubier : > > This should work: > > org := (RPackageOrganizer default packageNamed: 'MyPackage'). > tag := org addClassTag: #Classes. > org definedClasses do: [ :aClass | > aClass category: tag categoryName ]. In Pharo 6 there is new tag API for class

Re: [Pharo-users] Moving Class to a Package programmaticaly

2017-05-26 Thread Thierry Goubier
Hi Hilaire, what you are describing is moving a class from a package tag to another package tag in the same package. And you are manipulating directly the RPackageOrganizer for that. As RPackage was designed, to avoid infinite recursion, some operations apply only onto the RPackageOrganizer

[Pharo-users] Moving Class to a Package programmaticaly

2017-05-26 Thread Hilaire
Hello, I want to move class from package "MyPackage-subPackage" to "MyPackage-Classes" with the code bellow: org := (RPackageOrganizer default packageNamed: 'MyPackage'). org addClassTag: #Classes. org definedClasses do: [ :aClass | |tag| tag := org classTagForClass: aClass. org addClassD