On Wed, Oct 28, 2009 at 10:22 AM, Alexandre Bergel
<alexandre@bergel.eu> wrote:
Dear List,
I was looking for a way to test whether a class is abstract or not.
One easy way, is to check whether the class sends the message
subclassResponsibility. This is not perfect, since we should also
check whether the receiver is 'self' and this is the only statement in
the method body. Looking at sender of #subclassResponsibiliy did not
reveal anything. I propose to define the following method:
Behavior>>isAbstract
� � � �^ self methods anySatisfy: [:cm | cm sendsSelector:
#subclassResponsibility ]
The only problem I see (maybe I am wrong) here is that there are already a lot of implementors of isAbstract. For example, those used in Sunit. So, if you add this method to Behavior, there will be a lot of non-intentional overrides.
�
Shall I can create an issue and add a changeset?
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel �http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project