Hi guys I started to be fed up about protocol inconsistencies. So I will propose a set of rules (and a tool - I'm working on it) to automatically categorize methods. The first on the list was printOn: in printing and I clean many methods already with a kind of happy smile on my face. Now we discussed today with esteban for initialize* we will use 'initialization' I hope that this is ok for you because I'm fed up to have the following: {269->'initialization'. 248->'initialize-release'. 48->'as yet unclassified'. 15->'accessing'. 14->'private'. 12->'initializing'. 2->'instance creation'. 2->'testing'. 2->'initalize-release'. 2->'protocol'. 2->'display'. 1->'cleaning'. 1->'intializing'. 1->'like fullCopy'. 1->'keymapping'. 1->'ui-building'. 1->'initialize - release'. 1->'initialization-release'. 1->'intialize'. 1->'styling'. 1->'scrolling'. 1->'morphic ui'. 1->'world state'. 1->#'parts bin'} Please enjoy this gift from life, I love so much 'like fullCopy' as a category for initialize that I'm a bit sad to clean this kind of poem (minimal haiku) so we will keep it for us :) Yes there is no little steps to get a bright system, every little clean is stop. No broken window! No dirt on the floor in Pharo. Stef
I can add a rule for that, and check in the releaseTest if all the classes are respecting it (as i did checking repeated code) 2013/8/12 Stéphane Ducasse <stephane.ducasse@inria.fr>
Hi guys
I started to be fed up about protocol inconsistencies. So I will propose a set of rules (and a tool - I'm working on it) to automatically categorize methods. The first on the list was printOn: in printing and I clean many methods already with a kind of happy smile on my face.
Now we discussed today with esteban for initialize* we will use 'initialization' I hope that this is ok for you because I'm fed up to have the following:
{269->'initialization'. 248->'initialize-release'. 48->'as yet unclassified'. 15->'accessing'. 14->'private'. 12->'initializing'. 2->'instance creation'. 2->'testing'. 2->'initalize-release'. 2->'protocol'. 2->'display'. 1->'cleaning'. 1->'intializing'. 1->'like fullCopy'. 1->'keymapping'. 1->'ui-building'. 1->'initialize - release'. 1->'initialization-release'. 1->'intialize'. 1->'styling'. 1->'scrolling'. 1->'morphic ui'. 1->'world state'. 1->#'parts bin'}
Please enjoy this gift from life, I love so much 'like fullCopy' as a category for initialize that I'm a bit sad to clean this kind of poem (minimal haiku) so we will keep it for us :)
Yes there is no little steps to get a bright system, every little clean is stop.
No broken window! No dirt on the floor in Pharo.
Stef
On Aug 12, 2013, at 10:21 PM, Sebastian Tleye <stleye@gmail.com> wrote:
I can add a rule for that, and check in the releaseTest if all the classes are respecting it (as i did checking repeated code)
We will do it together. Now first I want to release the tool to autocategorize the methods when you edit a method.
2013/8/12 Stéphane Ducasse <stephane.ducasse@inria.fr> Hi guys
I started to be fed up about protocol inconsistencies. So I will propose a set of rules (and a tool - I'm working on it) to automatically categorize methods. The first on the list was printOn: in printing and I clean many methods already with a kind of happy smile on my face.
Now we discussed today with esteban for initialize* we will use 'initialization' I hope that this is ok for you because I'm fed up to have the following:
{269->'initialization'. 248->'initialize-release'. 48->'as yet unclassified'. 15->'accessing'. 14->'private'. 12->'initializing'. 2->'instance creation'. 2->'testing'. 2->'initalize-release'. 2->'protocol'. 2->'display'. 1->'cleaning'. 1->'intializing'. 1->'like fullCopy'. 1->'keymapping'. 1->'ui-building'. 1->'initialize - release'. 1->'initialization-release'. 1->'intialize'. 1->'styling'. 1->'scrolling'. 1->'morphic ui'. 1->'world state'. 1->#'parts bin'}
Please enjoy this gift from life, I love so much 'like fullCopy' as a category for initialize that I'm a bit sad to clean this kind of poem (minimal haiku) so we will keep it for us :)
Yes there is no little steps to get a bright system, every little clean is stop.
No broken window! No dirt on the floor in Pharo.
Stef
yes please! :) On 2013-08-12, at 17:08, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Hi guys
I started to be fed up about protocol inconsistencies. So I will propose a set of rules (and a tool - I'm working on it) to automatically categorize methods. The first on the list was printOn: in printing and I clean many methods already with a kind of happy smile on my face.
Now we discussed today with esteban for initialize* we will use 'initialization' I hope that this is ok for you because I'm fed up to have the following:
{269->'initialization'. 248->'initialize-release'. 48->'as yet unclassified'. 15->'accessing'. 14->'private'. 12->'initializing'. 2->'instance creation'. 2->'testing'. 2->'initalize-release'. 2->'protocol'. 2->'display'. 1->'cleaning'. 1->'intializing'. 1->'like fullCopy'. 1->'keymapping'. 1->'ui-building'. 1->'initialize - release'. 1->'initialization-release'. 1->'intialize'. 1->'styling'. 1->'scrolling'. 1->'morphic ui'. 1->'world state'. 1->#'parts bin'}
Please enjoy this gift from life, I love so much 'like fullCopy' as a category for initialize that I'm a bit sad to clean this kind of poem (minimal haiku) so we will keep it for us :)
Yes there is no little steps to get a bright system, every little clean is stop.
No broken window! No dirt on the floor in Pharo.
Stef
Stéphane Ducasse wrote
I started to be fed up about protocol inconsistencies
Amen Stéphane Ducasse wrote
So I will propose a set of rules (and a tool - I'm working on it) to automatically categorize methods. ... Now we discussed today with esteban for initialize* we will use 'initialization'
Yay! ----- Cheers, Sean -- View this message in context: http://forum.world.st/Uniformizing-Pharo-tp4703357p4703577.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
i wonder, if we can modify the compiler, so that when it sees that method's selector has well known name, it categorizing method automatically under right category :) (dunno however, what to do about existing code, when you recompiling it) On 14 August 2013 04:32, Sean P. DeNigris <sean@clipperadams.com> wrote:
Stéphane Ducasse wrote
I started to be fed up about protocol inconsistencies
Amen
Stéphane Ducasse wrote
So I will propose a set of rules (and a tool - I'm working on it) to automatically categorize methods. ... Now we discussed today with esteban for initialize* we will use 'initialization'
Yay!
----- Cheers, Sean -- View this message in context: http://forum.world.st/Uniformizing-Pharo-tp4703357p4703577.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
-- Best regards, Igor Stasenko.
2013/8/14 Igor Stasenko <siguctua@gmail.com>
i wonder, if we can modify the compiler, so that when it sees that method's selector has well known name, it categorizing method automatically under right category :) (dunno however, what to do about existing code, when you recompiling it)
This is possible but I don't think it belongs to the compiler to do that. I would rather modify Behavior so when it adds a method with no protocol it categorize it efficiently according to its superclasses / subclasses selectors and protocols..
On 14 August 2013 04:32, Sean P. DeNigris <sean@clipperadams.com> wrote:
Stéphane Ducasse wrote
I started to be fed up about protocol inconsistencies
Amen
Stéphane Ducasse wrote
So I will propose a set of rules (and a tool - I'm working on it) to automatically categorize methods. ... Now we discussed today with esteban for initialize* we will use 'initialization'
Yay!
----- Cheers, Sean -- View this message in context: http://forum.world.st/Uniformizing-Pharo-tp4703357p4703577.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
-- Best regards, Igor Stasenko.
On Aug 14, 2013, at 4:38 AM, Igor Stasenko <siguctua@gmail.com> wrote:
i wonder, if we can modify the compiler, so that when it sees that method's selector has well known name, it categorizing method automatically under right category :) (dunno however, what to do about existing code, when you recompiling it)
we will integrate the categorizer close to the code browser and may be later the compiler
On 14 August 2013 04:32, Sean P. DeNigris <sean@clipperadams.com> wrote:
Stéphane Ducasse wrote
I started to be fed up about protocol inconsistencies
Amen
Stéphane Ducasse wrote
So I will propose a set of rules (and a tool - I'm working on it) to automatically categorize methods. ... Now we discussed today with esteban for initialize* we will use 'initialization'
Yay!
----- Cheers, Sean -- View this message in context: http://forum.world.st/Uniformizing-Pharo-tp4703357p4703577.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
-- Best regards, Igor Stasenko.
Did you use the method categorizer that is already in the image? => MethodClassifier it implements already a lot of rules, so you should plug in your tool there or remove MethodClassifier and make it work with nautilus. otherwise we have a lot of duplicated functionality. On 2013-08-14, at 02:44, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
On Aug 14, 2013, at 4:38 AM, Igor Stasenko <siguctua@gmail.com> wrote:
i wonder, if we can modify the compiler, so that when it sees that method's selector has well known name, it categorizing method automatically under right category :) (dunno however, what to do about existing code, when you recompiling it)
we will integrate the categorizer close to the code browser and may be later the compiler
On 14 August 2013 04:32, Sean P. DeNigris <sean@clipperadams.com> wrote:
Stéphane Ducasse wrote
I started to be fed up about protocol inconsistencies
Amen
Stéphane Ducasse wrote
So I will propose a set of rules (and a tool - I'm working on it) to automatically categorize methods. ... Now we discussed today with esteban for initialize* we will use 'initialization'
Yay!
----- Cheers, Sean -- View this message in context: http://forum.world.st/Uniformizing-Pharo-tp4703357p4703577.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
-- Best regards, Igor Stasenko.
Did you use the method categorizer that is already in the image?
=> MethodClassifier
it implements already a lot of rules, so you should plug in your tool there or remove MethodClassifier and make it work with nautilus. otherwise we have a lot of duplicated functionality.
I was not aware of it I will look at it. In fact there was a method categorizer in a nice package with tests and I took this one and adapted it. I will check the rules. Stef
Ok I checked and I prefer the one I used because you can express nice rules :) My next step will be to check the tests again, hack/replace the methodClassifier and code with the hacked version for a while and push everything in the system. Now I will look to see how to make them polymorphic because the classifier is simpler Here is the default rules list (I added bench from the other list). What is nice is that - we can express that the superclass should be used in last resort - I filtered the extensions for now. defaultCategorizationRules "The order is relevant, the categorizer uses the first rule matching - DF" ^OrderedCollection new add: MethodCategorizationRule forAccessors; "initialize" add: (MethodCategorizationRule whenSelectorMatches: 'initialize*' categorizeIn: #initialization); add: (MethodCategorizationRule whenSelectorMatches: 'init*' categorizeIn: #initialization); add: (MethodCategorizationRule whenSelectorMatches: 'default*' categorizeIn: #defaults); add: (MethodCategorizationRule whenSelectorMatches: 'as*' categorizeIn: #converting); add: (MethodCategorizationRule whenSelectorMatches: 'hash' categorizeIn: #comparing); "order is important" "testing" add: (MethodCategorizationRule whenSelectorMatches: 'is*' categorizeIn: #testing); add: (MethodCategorizationRule whenSelectorMatches: 'has*' categorizeIn: #testing); add: (MethodCategorizationRule whenSelectorMatches: '=' categorizeIn: #comparing); add: (MethodCategorizationRule whenSelectorMatches: 'new' categorizeIn: #'instance creation'); add: (MethodCategorizationRule whenSelectorMatches: 'setting' categorizeIn: #'settings'); add: (MethodCategorizationRule whenSelectorMatches: 'printOn:' categorizeIn: #printing); add: (MethodCategorizationRule whenSelectorMatches: 'storeOn:' categorizeIn: #printing); add: (MethodCategorizationRule whenSelectorMatches: '*copy*' categorizeIn: #copying); add: (MethodCategorizationRule whenSelectorMatches: 'draw*' categorizeIn: #drawing); add: (MethodCategorizationRule whenSelectorMatches: 'bench*' categorizeIn: #benchmarking); add: (MethodCategorizationRule whenSelectorMatches: 'signal*' categorizeIn: #signalling); add: (MethodCategorizationRule whenSelectorMatches: 'add*' categorizeIn: #adding); add: (MethodCategorizationRule whenSelectorMatches: 'remove*' categorizeIn: #adding); add: (MethodCategorizationRule whenSelectorMatches: 'open*' categorizeIn: #opening); add: (MethodCategorizationRule whenSelectorMatches: 'update*' categorizeIn: #updating); add: (MethodCategorizationRule whenSelectorMatches: 'change*' categorizeIn: #updating); add: (MethodCategorizationRule whenSelectorMatches: 'accept*' categorizeIn: #'visitor accepting'); add: (MethodCategorizationRule whenSelectorMatches: 'visit*' categorizeIn: #visiting); add: (MethodCategorizationRule whenSelectorMatches: 'menu*' categorizeIn: #menus); add: (MethodCategorizationRule whenSelectorMatches: 'value' categorizeIn: #value); "test cases" add: (MethodCategorizationRule whenSelectorMatches: 'test*' andClassInheritsFrom: TestCase categorizeIn: #tests); add: (MethodCategorizationRule whenSelectorMatches: 'setUp' andClassInheritsFrom: TestCase categorizeIn: #'setup'); add: (MethodCategorizationRule whenSelectorMatches: 'tearDown' andClassInheritsFrom: TestCase categorizeIn: #'setup'); "baselines, versions..." add: (MethodCategorizationRule whenSelectorMatches: 'version*' andClassMatches: 'ConfigurationOf*' categorizeIn: #'versions'); add: (MethodCategorizationRule whenSelectorMatches: 'baseline*' andClassMatches: 'ConfigurationOf*' categorizeIn: #'baselines'); add: (MethodCategorizationRule whenSelectorMatches: 'development*' andClassMatches: 'ConfigurationOf*' categorizeIn: #'symbolic'); add: (MethodCategorizationRule whenSelectorMatches: 'stable*' andClassMatches: 'ConfigurationOf*' categorizeIn: #'symbolic'); add: MethodCategorizationRule usingMostUsedCategoryInSuperClasses; add: MethodCategorizationRule usingMostUsedCategoryInImage; yourself
Did you use the method categorizer that is already in the image?
=> MethodClassifier
it implements already a lot of rules, so you should plug in your tool there or remove MethodClassifier and make it work with nautilus. otherwise we have a lot of duplicated functionality.
I was not aware of it I will look at it. In fact there was a method categorizer in a nice package with tests and I took this one and adapted it. I will check the rules.
Stef
ah looks very nice, indeed much more powerful than my hack. If you have time, switch to real regular expressions, because things like
add: (MethodCategorizationRule whenSelectorMatches: 'as*' categorizeIn: #converting); will easily produce false positives. For instance #assert: will end up in converting, which is not what you want ;) => /as[A-Z][a-zA-Z]*/ for instance does a much better job
On 2013-08-14, at 15:24, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Ok I checked and I prefer the one I used because you can express nice rules :) My next step will be to check the tests again, hack/replace the methodClassifier and code with the hacked version for a while and push everything in the system. Now I will look to see how to make them polymorphic because the classifier is simpler
Here is the default rules list (I added bench from the other list).
What is nice is that - we can express that the superclass should be used in last resort - I filtered the extensions for now.
defaultCategorizationRules
"The order is relevant, the categorizer uses the first rule matching - DF"
^OrderedCollection new add: MethodCategorizationRule forAccessors;
"initialize" add: (MethodCategorizationRule whenSelectorMatches: 'initialize*' categorizeIn: #initialization); add: (MethodCategorizationRule whenSelectorMatches: 'init*' categorizeIn: #initialization); add: (MethodCategorizationRule whenSelectorMatches: 'default*' categorizeIn: #defaults);
add: (MethodCategorizationRule whenSelectorMatches: 'as*' categorizeIn: #converting); add: (MethodCategorizationRule whenSelectorMatches: 'hash' categorizeIn: #comparing); "order is important"
"testing" add: (MethodCategorizationRule whenSelectorMatches: 'is*' categorizeIn: #testing); add: (MethodCategorizationRule whenSelectorMatches: 'has*' categorizeIn: #testing);
add: (MethodCategorizationRule whenSelectorMatches: '=' categorizeIn: #comparing);
add: (MethodCategorizationRule whenSelectorMatches: 'new' categorizeIn: #'instance creation'); add: (MethodCategorizationRule whenSelectorMatches: 'setting' categorizeIn: #'settings');
add: (MethodCategorizationRule whenSelectorMatches: 'printOn:' categorizeIn: #printing); add: (MethodCategorizationRule whenSelectorMatches: 'storeOn:' categorizeIn: #printing);
add: (MethodCategorizationRule whenSelectorMatches: '*copy*' categorizeIn: #copying);
add: (MethodCategorizationRule whenSelectorMatches: 'draw*' categorizeIn: #drawing); add: (MethodCategorizationRule whenSelectorMatches: 'bench*' categorizeIn: #benchmarking); add: (MethodCategorizationRule whenSelectorMatches: 'signal*' categorizeIn: #signalling); add: (MethodCategorizationRule whenSelectorMatches: 'add*' categorizeIn: #adding); add: (MethodCategorizationRule whenSelectorMatches: 'remove*' categorizeIn: #adding);
add: (MethodCategorizationRule whenSelectorMatches: 'open*' categorizeIn: #opening); add: (MethodCategorizationRule whenSelectorMatches: 'update*' categorizeIn: #updating); add: (MethodCategorizationRule whenSelectorMatches: 'change*' categorizeIn: #updating);
add: (MethodCategorizationRule whenSelectorMatches: 'accept*' categorizeIn: #'visitor accepting'); add: (MethodCategorizationRule whenSelectorMatches: 'visit*' categorizeIn: #visiting);
add: (MethodCategorizationRule whenSelectorMatches: 'menu*' categorizeIn: #menus);
add: (MethodCategorizationRule whenSelectorMatches: 'value' categorizeIn: #value);
"test cases" add: (MethodCategorizationRule whenSelectorMatches: 'test*' andClassInheritsFrom: TestCase categorizeIn: #tests);
add: (MethodCategorizationRule whenSelectorMatches: 'setUp' andClassInheritsFrom: TestCase categorizeIn: #'setup'); add: (MethodCategorizationRule whenSelectorMatches: 'tearDown' andClassInheritsFrom: TestCase categorizeIn: #'setup');
"baselines, versions..." add: (MethodCategorizationRule whenSelectorMatches: 'version*' andClassMatches: 'ConfigurationOf*' categorizeIn: #'versions'); add: (MethodCategorizationRule whenSelectorMatches: 'baseline*' andClassMatches: 'ConfigurationOf*' categorizeIn: #'baselines'); add: (MethodCategorizationRule whenSelectorMatches: 'development*' andClassMatches: 'ConfigurationOf*' categorizeIn: #'symbolic'); add: (MethodCategorizationRule whenSelectorMatches: 'stable*' andClassMatches: 'ConfigurationOf*' categorizeIn: #'symbolic');
add: MethodCategorizationRule usingMostUsedCategoryInSuperClasses; add: MethodCategorizationRule usingMostUsedCategoryInImage; yourself
Did you use the method categorizer that is already in the image?
=> MethodClassifier
it implements already a lot of rules, so you should plug in your tool there or remove MethodClassifier and make it work with nautilus. otherwise we have a lot of duplicated functionality.
I was not aware of it I will look at it. In fact there was a method categorizer in a nice package with tests and I took this one and adapted it. I will check the rules.
Stef
On Aug 14, 2013, at 9:26 PM, Camillo Bruni <camillobruni@gmail.com> wrote:
ah looks very nice, indeed much more powerful than my hack. If you have time, switch to real regular expressions, because things like
add: (MethodCategorizationRule whenSelectorMatches: 'as*' categorizeIn: #converting); will easily produce false positives. For instance #assert: will end up in converting, which is not what you want ;) => /as[A-Z][a-zA-Z]*/ for instance does a much better job
Ok thanks for the idea. I will.
Also, to prevent explosion of the number of protocol names in the image, we could agree on some naming convention. For example, there are protocols ending with -ing and others ending with -ion: which form one should prefer? ex: conversion vs converting, composing vs composition. Then, when a protocol name is made of several word, should we use space or - to separate them? ex: instance creation vs instance-creation On 15 août 2013, at 09:35, Stéphane Ducasse wrote:
On Aug 14, 2013, at 9:26 PM, Camillo Bruni <camillobruni@gmail.com> wrote:
ah looks very nice, indeed much more powerful than my hack. If you have time, switch to real regular expressions, because things like
add: (MethodCategorizationRule whenSelectorMatches: 'as*' categorizeIn: #converting); will easily produce false positives. For instance #assert: will end up in converting, which is not what you want ;) => /as[A-Z][a-zA-Z]*/ for instance does a much better job
Ok thanks for the idea. I will.
On Aug 16, 2013, at 3:59 PM, Camille Teruel <camille.teruel@gmail.com> wrote:
Also, to prevent explosion of the number of protocol names in the image, we could agree on some naming convention.
For example, there are protocols ending with -ing and others ending with -ion: which form one should prefer? ex: conversion vs converting, composing vs composition.
Yes this is the idea so let us define them. Here is what I have Stef ^OrderedCollection new add: MethodCategorizationRule forAccessors; "initialize" add: (MethodCategorizationRule whenSelectorMatches: 'initialize*' categorizeIn: #initialization); add: (MethodCategorizationRule whenSelectorMatches: 'init*' categorizeIn: #initialization); add: (MethodCategorizationRule whenSelectorMatches: 'default*' categorizeIn: #defaults); add: (MethodCategorizationRule whenSelectorMatches: 'as*' categorizeIn: #converting); add: (MethodCategorizationRule whenSelectorMatches: 'hash' categorizeIn: #comparing); "order is important" "testing" add: (MethodCategorizationRule whenSelectorMatches: 'is*' categorizeIn: #testing); add: (MethodCategorizationRule whenSelectorMatches: 'has*' categorizeIn: #testing); add: (MethodCategorizationRule whenSelectorMatches: '=' categorizeIn: #comparing); add: (MethodCategorizationRule whenSelectorMatches: 'new' categorizeIn: #'instance creation'); add: (MethodCategorizationRule whenSelectorMatches: 'setting' categorizeIn: #'settings'); add: (MethodCategorizationRule whenSelectorMatches: 'printOn:' categorizeIn: #printing); add: (MethodCategorizationRule whenSelectorMatches: 'storeOn:' categorizeIn: #printing); add: (MethodCategorizationRule whenSelectorMatches: '*copy*' categorizeIn: #copying); add: (MethodCategorizationRule whenSelectorMatches: 'draw*' categorizeIn: #drawing); add: (MethodCategorizationRule whenSelectorMatches: 'bench*' categorizeIn: #benchmarking); add: (MethodCategorizationRule whenSelectorMatches: 'signal*' categorizeIn: #signalling); add: (MethodCategorizationRule whenSelectorMatches: 'add*' categorizeIn: #adding); add: (MethodCategorizationRule whenSelectorMatches: 'remove*' categorizeIn: #adding); add: (MethodCategorizationRule whenSelectorMatches: 'open*' categorizeIn: #opening); add: (MethodCategorizationRule whenSelectorMatches: 'update*' categorizeIn: #updating); add: (MethodCategorizationRule whenSelectorMatches: 'change*' categorizeIn: #updating); add: (MethodCategorizationRule whenSelectorMatches: 'accept*' categorizeIn: #'visitor accepting'); add: (MethodCategorizationRule whenSelectorMatches: 'visit*' categorizeIn: #visiting); add: (MethodCategorizationRule whenSelectorMatches: 'menu*' categorizeIn: #menus); add: (MethodCategorizationRule whenSelectorMatches: 'value' categorizeIn: #value); "test cases" add: (MethodCategorizationRule whenSelectorMatches: 'test*' andClassInheritsFrom: TestCase categorizeIn: #tests); add: (MethodCategorizationRule whenSelectorMatches: 'setUp' andClassInheritsFrom: TestCase categorizeIn: #'setup'); add: (MethodCategorizationRule whenSelectorMatches: 'tearDown' andClassInheritsFrom: TestCase categorizeIn: #'setup'); "baselines, versions..." add: (MethodCategorizationRule whenSelectorMatches: 'version*' andClassMatches: 'ConfigurationOf*' categorizeIn: #'versions'); add: (MethodCategorizationRule whenSelectorMatches: 'baseline*' andClassMatches: 'ConfigurationOf*' categorizeIn: #'baselines'); add: (MethodCategorizationRule whenSelectorMatches: 'development*' andClassMatches: 'ConfigurationOf*' categorizeIn: #'symbolic'); add: (MethodCategorizationRule whenSelectorMatches: 'stable*' andClassMatches: 'ConfigurationOf*' categorizeIn: #'symbolic'); add: MethodCategorizationRule usingMostUsedCategoryInSuperClasses; add: MethodCategorizationRule usingMostUsedCategoryInImage; yourself
On 16 août 2013, at 21:57, Stéphane Ducasse wrote:
On Aug 16, 2013, at 3:59 PM, Camille Teruel <camille.teruel@gmail.com> wrote:
Also, to prevent explosion of the number of protocol names in the image, we could agree on some naming convention.
For example, there are protocols ending with -ing and others ending with -ion: which form one should prefer? ex: conversion vs converting, composing vs composition.
Yes this is the idea so let us define them. Here is what I have
So from your list, it seems that the convention is to use the -ing forms and to use spaces to separate words. Personally I prefer protocol names to be nouns instead of present participle: conversion, deletion, addition, comparison... But it's just a matter of taste and I understand it would involves too much changes. So do we stick to -ing everywhere? If we do, you have exceptions in your list: 'instance creation', 'initialization' and 'value' instead of 'instantiating', 'initializing' and 'evaluating' (or something equivalent). Also does it worth having both 'visiting' and 'visitor accepting' since it's the same concern and accept* and visit* methods are in different classes? Do you really want to have remove* methods in adding protocol? What is this one: (MethodCategorizationRule whenSelectorMatches: 'setting' categorizeIn: #'settings') ? Because setting has no implementors.
Stef
^OrderedCollection new add: MethodCategorizationRule forAccessors;
"initialize" add: (MethodCategorizationRule whenSelectorMatches: 'initialize*' categorizeIn: #initialization); add: (MethodCategorizationRule whenSelectorMatches: 'init*' categorizeIn: #initialization); add: (MethodCategorizationRule whenSelectorMatches: 'default*' categorizeIn: #defaults);
add: (MethodCategorizationRule whenSelectorMatches: 'as*' categorizeIn: #converting); add: (MethodCategorizationRule whenSelectorMatches: 'hash' categorizeIn: #comparing); "order is important"
"testing" add: (MethodCategorizationRule whenSelectorMatches: 'is*' categorizeIn: #testing); add: (MethodCategorizationRule whenSelectorMatches: 'has*' categorizeIn: #testing);
add: (MethodCategorizationRule whenSelectorMatches: '=' categorizeIn: #comparing);
add: (MethodCategorizationRule whenSelectorMatches: 'new' categorizeIn: #'instance creation'); add: (MethodCategorizationRule whenSelectorMatches: 'setting' categorizeIn: #'settings');
add: (MethodCategorizationRule whenSelectorMatches: 'printOn:' categorizeIn: #printing); add: (MethodCategorizationRule whenSelectorMatches: 'storeOn:' categorizeIn: #printing);
add: (MethodCategorizationRule whenSelectorMatches: '*copy*' categorizeIn: #copying);
add: (MethodCategorizationRule whenSelectorMatches: 'draw*' categorizeIn: #drawing); add: (MethodCategorizationRule whenSelectorMatches: 'bench*' categorizeIn: #benchmarking); add: (MethodCategorizationRule whenSelectorMatches: 'signal*' categorizeIn: #signalling); add: (MethodCategorizationRule whenSelectorMatches: 'add*' categorizeIn: #adding); add: (MethodCategorizationRule whenSelectorMatches: 'remove*' categorizeIn: #adding);
add: (MethodCategorizationRule whenSelectorMatches: 'open*' categorizeIn: #opening); add: (MethodCategorizationRule whenSelectorMatches: 'update*' categorizeIn: #updating); add: (MethodCategorizationRule whenSelectorMatches: 'change*' categorizeIn: #updating);
add: (MethodCategorizationRule whenSelectorMatches: 'accept*' categorizeIn: #'visitor accepting'); add: (MethodCategorizationRule whenSelectorMatches: 'visit*' categorizeIn: #visiting);
add: (MethodCategorizationRule whenSelectorMatches: 'menu*' categorizeIn: #menus);
add: (MethodCategorizationRule whenSelectorMatches: 'value' categorizeIn: #value);
"test cases" add: (MethodCategorizationRule whenSelectorMatches: 'test*' andClassInheritsFrom: TestCase categorizeIn: #tests);
add: (MethodCategorizationRule whenSelectorMatches: 'setUp' andClassInheritsFrom: TestCase categorizeIn: #'setup'); add: (MethodCategorizationRule whenSelectorMatches: 'tearDown' andClassInheritsFrom: TestCase categorizeIn: #'setup');
"baselines, versions..." add: (MethodCategorizationRule whenSelectorMatches: 'version*' andClassMatches: 'ConfigurationOf*' categorizeIn: #'versions'); add: (MethodCategorizationRule whenSelectorMatches: 'baseline*' andClassMatches: 'ConfigurationOf*' categorizeIn: #'baselines'); add: (MethodCategorizationRule whenSelectorMatches: 'development*' andClassMatches: 'ConfigurationOf*' categorizeIn: #'symbolic'); add: (MethodCategorizationRule whenSelectorMatches: 'stable*' andClassMatches: 'ConfigurationOf*' categorizeIn: #'symbolic');
add: MethodCategorizationRule usingMostUsedCategoryInSuperClasses; add: MethodCategorizationRule usingMostUsedCategoryInImage; yourself
participants (7)
-
Camille Teruel -
Camillo Bruni -
Clément Bera -
Igor Stasenko -
Sean P. DeNigris -
Sebastian Tleye -
Stéphane Ducasse