An interesting effect between improvements: #isObsolete
Hi, #isObsolete is interesting⦠it used to be that there were two definitions âname of class starts with âAnObsoleteâ. (these checks where inlined everywhere). And #isObsolete was checking âmy environment knows my name and the result is meâ. -> we refactored the system to use #isObsolete everywhere (one of those unimportant cleanups aka ârandom refactoringsâ) Then Yuriy wanted to annotate classes like we can already annotate the AST and Methods. So he added a property API (careful to now use space by storing in a ClassVar). Then Andrei realized that our definition of #isObsolte does not work for anonymous behaviors⦠so should we go back to âself name beginsWith:â? No! The property interface now allows us to solve this how you think it works: we tag obsolte classes. isObsolete "Return true if the receiver is obsolete." ^self propertyValueAt: #obsolete ifAbsent: false This works, even for anonymous classes. And it is *fast*: [Smalltalk allClasses do: #isObsolete] bench Pharo 3: '147 per second.â Pharo 4: '95.562 per secondâ Marcus
participants (1)
-
Marcus Denker