pharo-users@lists.pharo.org

Any question about pharo is welcome

View all threads

Method comparison

DV
Davide Varvello
Fri, Jun 21, 2024 3:59 PM

In older Pharo versions it was possible to compare two methods selecting them via UI. 
I couldn't find this opportunity in Pharo10,  so digging into the source code I found SpDiffPresenter, if you pass to it a couple of selectors it can compare them.
Example:
SpDiffPresenter new showOptions: true; leftText: (MyObject >> #firstSelector) sourceCode; rightText: (MyObject >> #secondSelector) sourceCode; contextClass: True; open 

CheersDavide

In older Pharo versions it was possible to compare two methods selecting them via UI.  I couldn't find this opportunity in Pharo10,  so digging into the source code I found SpDiffPresenter, if you pass to it a couple of selectors it can compare them. Example: SpDiffPresenter new showOptions: true; leftText: (MyObject >> #firstSelector) sourceCode; rightText: (MyObject >> #secondSelector) sourceCode; contextClass: True; open  CheersDavide