On Mon, Aug 16, 2010 at 9:35 PM, Stéphane Ducasse <stephane.ducasse@inria.fr
wrote:
did you check is there is a safe guard when the category start with *?
This is not up to AutomaticMethodCategorizer. I mean, by code, the only defined rules are the ones that are in #defaultCategorizationRules If you want you can add more rules. For a rule you can say something like this: add: (MethodCategorizationRule whenSelectorMatches: 'is*' categorizeIn: #testing); if you do something like this for example: add: (MethodCategorizationRule whenSelectorMatches: 'is*' categorizeIn: #*Something); There will be no error in AutomaticMethodCategorizer and Something will be recognized as it were a package. More or less could happen the same with a selector that doesn't apply to any rule. For example, suppose #aFunnySelector doesn't match any rule, but there are 10 implementors in the image and the 80% of them has category *Something. Then. it will apply *Something also to that selector. That's what I understood. However, I don't think it is a big deal and we can live with that.
?Stef
Hi folks...while browsing AutomaticMethodCategorizer I found the place where the rules are defined. It is cool becuase we can add the rules we want. I am all ears.
yes I would really like to have consistent categories. Now we should pay attention that the automaticmethodcategory does not do anythin when the category is * something.
Stef
For now, it is doing this:
defaultCategorizationRules
"The order is relevant, the categorizer uses the first rule
matching - DF"
^OrderedCollection new add: MethodCategorizationRule forAccessors; add: (MethodCategorizationRule whenSelectorMatches:
'initialize*' categorizeIn: #initialization);
#initialize
add: (MethodCategorizationRule whenSelectorMatches: 'is*'
categorizeIn: #testing);
add: (MethodCategorizationRule whenSelectorMatches: 'has*'
categorizeIn: #testing);
add: (MethodCategorizationRule whenSelectorMatches: '='
categorizeIn: #comparing);
add: (MethodCategorizationRule whenSelectorMatches: 'hash'
categorizeIn: #comparing);
add: (MethodCategorizationRule whenSelectorMatches: 'default*'
categorizeIn: #defaults);
add: (MethodCategorizationRule whenSelectorMatches: 'printOn:'
categorizeIn: #printing);
add: (MethodCategorizationRule whenSelectorMatches: 'accept:'
categorizeIn: #'visitor accepting');
add: (MethodCategorizationRule whenSelectorMatches: 'visit*:'
categorizeIn: #visiting);
add: (MethodCategorizationRule whenSelectorMatches: 'value'
categorizeIn: #evaluating);
add: (MethodCategorizationRule whenSelectorMatches: 'test*' andClassInheritsFrom: TestCase categorizeIn: #tests); add: MethodCategorizationRule
usingMostUsedCategoryInSuperClasses;
add: MethodCategorizationRule usingMostUsedCategoryInImage; yourself
One important thing I forgot to say is that the order is important here. Notice that the pattern rules are first and then the rules for the most used categories...this means that for example printOn: will be always in 'printing'. However, in the system most printOn: could be in 'print' category...
So it is important what you want more...if specific patterns or maintain consistency with what you have in the system...
cheers
mariano
We should improve this guy.... ideas to add/change?
Cheers
Mariano _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project