[Pharo-dev] Uniformizing Pharo

Stéphane Ducasse stephane.ducasse at inria.fr
Fri Aug 16 15:57:45 EDT 2013


On Aug 16, 2013, at 3:59 PM, Camille Teruel <camille.teruel at 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



More information about the Pharo-dev mailing list