pharo-project / pharo

Pharo is a dynamic reflective pure object-oriented language supporting live programming inspired by Smalltalk.
http://pharo.org
Other
1.21k stars 356 forks source link

Cleaning initialize protocol #17359

Closed Ducasse closed 1 week ago

Ducasse commented 1 week ago
| pkgPrefix newClassPrefix env model prot|
prot := #'initialize - release'.
env := RBBrowserEnvironment new 
            forClasses: (Smalltalk allClasses 
                                    select: [ :each | each protocolNames includes: prot ]).

model := (RBNamespace onEnvironment: env) name: 'MyModel'; yourself.
RBProtocolRegexTransformation new
    model: model;
    replace: prot with: 'initialization';
  execute.
((Smalltalk allClasses reject: [:each | each isMeta ]) flatCollect: [ :each | each protocolNames ]) asSet select: [ :each | 'init*' match: each ]