Make PackageOrganizer>>packageOfClass:ifNone: and PackageOrganizer>>packageOfMethod:ifNone: return the most specific package it can find

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

Make PackageOrganizer>>packageOfClass:ifNone: and PackageOrganizer>>packageOfMethod:ifNone: return the most specific package it can find

Stéphane Ducasse
Hi

I like the suggestion of daniel in

Make PackageOrganizer>>packageOfClass:ifNone: and PackageOrganizer>>packageOfMethod:ifNone: return the most specific package it can find

http://code.google.com/p/pharo/issues/detail?id=1752
Now I would like to have another pair of eyes on it.
This is related to my idea of non overlapping package.
Stef


Fixed in: http://www.squeaksource.com/PharoInbox/PackageInfo-DanieRoux.35.mcz


Took the fix from, and deprecated #mostSpecificPackageOfMethod:ifNone: and
#mostSpecificPackageOfClass:ifNone:

Background of problem:

In theory it should not be possible for packages to overlap. Every class,
and every method should belong to only one Category. In reality packaging
bugs and other actions does cause packages to be created that overlap.

An example in PharoCore, 10505 is this:

(PackageOrganizer default packageNamed:  'Collections' ifAbsent: [ self
error: 'hmm']) includesClass: Text. " true "
(PackageOrganizer default packageNamed:  'Collections-Text' ifAbsent: [
self error: 'hmm']) includesClass: Text. " also true! "

In the old implementation, #packageOfClass: would have returned the first
category that matches. It will now return the more specific 'Collections-Text'.

I suggest that #mostSpecificPackageOfClass* and
#mostSpecificPackageOfMethod* methods be removed?
_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project