On Sun, Aug 15, 2010 at 9:12 PM, Stéphane Ducasse <stephane.ducasse@inria.fr
wrote:
On Aug 15, 2010, at 8:55 PM, Mariano Martinez Peck wrote:
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