pharo-ide / Calypso

Pharo system browser
http://dionisiydk.blogspot.com/2017/07/calypso-update-many-improvements-and.html
MIT License
38 stars 21 forks source link

Remove odd isAbstract implementation with "^self subclasses notEmpty". #462

Closed dionisiydk closed 5 years ago

dionisiydk commented 5 years ago

Remove odd isAbstract implementation with "^self subclasses notEmpty". It should be always explicit pattern "^self = MyClassName".

I checked number of abstract classes before and after change. It's same

astares commented 5 years ago

@dionisiydk

Usually the pattern is to compare the class name and not the class itself:

 isAbstract
     ^self name = #ClassNameAsSymbol

This is also more flexible than a hardcoded reference (for mocks or others)

dionisiydk commented 5 years ago

I think it was related to old tools issues in old Squeak versions. Like load or remove class with such self references. Why we can't use simple comparison here? In fact most of implementors do this way. (I don't see how any mocks can be used here because it is internal method of concrete class)