OK, so I tried Class-diff in Pharo 11. I noticed two issues. (1) I expected it to work like kdiff3, where scrolling scrolls both panes. I'm so used to flying around differences using Next/Previous/Last/First Difference buttons that I do very little scrolling in kdiff3, but when I do scroll, it does its best to keep the two panes aligned. (2) Comparing Array and String, I eventually figured out that I was being shown selectors *defined* in each class, but no selectors *inherited* by a class. For example, String canUnderstand: #asArray but inherits it, so it's not shown in the String pain, while Array defines it. This *looks* like a "one class has it and the other lacks it" case but it's *actually" a "both classes have it and it's different in each", so a difference I'd really like to see. I tracked this down to self aligner align: self sourceClass selectors sort with: self targetClass selectors sort. in updateAlignment, Changing that to self aligner align: self sourceClass allSelectors asArray sort with: self targetClass allSelectors asArray sort got me closer to what I wanted, but then accessing the source code of inherited methods didn't work because inherited methods, by definition, aren't in the class's own method dictionary. I could work around that too, but it's 1:19 AM where I am. In fact that's not quite what I want anyway. I don't want to be shown methods inherited by *both* classes from Object (although methods inherited from Object by one class and redefined or inherited from another class by the other are ones I do want to see). On Wed, 24 Jul 2024 at 14:06, Richard O'Keefe <raoknz@gmail.com> wrote:
Thanks for the advice about Spec2. I was keen to try Class-diff out, so I fired up Pharo, followed the installation instructions with no problems, and then tried the example. The example got a run-time error, and I expect that it's because the Pharo release I fired up was Pharo 9.
Which release(s) of Pharo is Class-diff intended to work with?
On Tue, 23 Jul 2024 at 23:38, Hernán Morales Durand <hernan.morales@gmail.com> wrote:
Thanks for your nice feedback Richard, I will sketch something and see how it goes.
About learning Spec2, for me, the best resource is to directly use the image examples. In the main menu, you have "Help -> Spec 2 demo" and "Help -> Spec 2 examples". And you also have the book in https://github.com/SquareBracketAssociates
Hernán
El mar, 23 jul 2024 a las 10:30, Richard O'Keefe (<raoknz@gmail.com>) escribió:
That's a very nice tool. There are two tweaks I'd like to see. Two classes having methods with the same *name* isn't the same as two classes having the same *method*. When the two classes have a method with the same name, there are at least three possibilities:
- The methods are the same method
- The methods are different, but the name is defined in some common superclass, so they had better be related methods.
- The methods are completely unrelated, like #next in ReadStream and LIFOQueue.
The third case applies to every method. Perhaps the best way therefore is to show something in the header, like
(score) diff of descendants of <nearest common superclass> <column> <column>
The first and second cases are the ones I want to tell apart so that I don't spend any time looking for differences that aren't there.
What's the best way to learn how to use Spec2?
On Mon, 22 Jul 2024 at 18:58, Hernán Morales Durand <hernan.morales@gmail.com> wrote:
Dear Pharo community,
I am happy to present a new tool designed specifically for comparing classes in Pharo. It provides a two-sided list of methods, so you can quickly understand the relationships between two classes.
The project location is on GitHub:
https://github.com/hernanmd/class-diff
Feel free to send comments and contributions via PRs. Have a great day,
Hernán