On 11-11-15 10:36, Peter Uhnák wrote:
> How does autocategorizing decides what to put where?
>
> For example I have (on class-side) three methods
> #example
> #example2
> #exampleClusters
>
> after autocategorizing they end up being
>
> #example in 'example' protocol
> #example2 in 'examples' protocol
> #exampleClusters in 'as yet unclassified' protocol
>
> That seems really odd, shouldn't all of them be in the same protocol?
Depends on superclass, your use of pragmas (and extension methods):
MethodClassifier>>classify:
(self classifyAccessor: aMethod)
ifTrue: [ ^ aMethod category ].
(self classifyInSuperclassProtocol: aMethod)
ifTrue: [ ^ aMethod category ].
(self classifyByKnownPrefix: aMethod)
ifTrue: [ ^ aMethod category ].
(self classifyByOtherImplementors: aMethod)
ifTrue: [ ^ aMethod category ].
(self classifyByKnownPragma: aMethod)
ifTrue: [ ^ aMethod category ].
> Also is 'example' or 'examples' the normative protocol?
examples
https://pharo.fogbugz.com/f/cases/16841/MethodClassifier-should-classify-on-pragmahttps://pharo.fogbugz.com/f/cases/16842/Recategorize-example-examplesMethodClassifier>>buildPragmaDictionary
pragmaMapping := Dictionary new.
pragmaMapping
at: 'example' put: 'examples'.
'example' is currently not in the list of known prefixes.
Stephan