How can I get all the methods in a Protocol?
问题 How can I get a collection of all the (class) methods in a given protocol in smalltalk/squeak/pharo? I'm trying to collect the values returned by a group of methods. I don't want to have to store the methods in an instance or class variable. So I though I could add them to a protocol and in this way to "mark" them. Thanks. 回答1: In Pharo, the method you're looking for is ClassDescription>>allMethodsInCategory: : | selectors | selectors := MyClass allMethodsInCategory: #'protocol name'. To find