[Pharo-project] subclassResponsibility, how does it work?

Luc Fabresse luc.fabresse at gmail.com
Tue Jun 12 04:23:45 EDT 2012

Hi Gareth,

 I did not get what you want to do exactly.
 subclassResponsibility is used to through an exception which indicates
that this methods should have been redefined in a subclass.

2012/6/12 Gareth Cox <gareth.cox at pro-mis.com>

> Hi All
> I'm attempting to subclass a class (Point) and I want some instructions
> passed to Point to go to MyPoint.
> Specifically I have Point >>asMyPoint >> self subclassResponsibility.
> In MyPoint I've got asMyPoint ^x at y.
> When I execute code, I get an error that the subclass should have
> executed...

which code did you execute?

> How does this actually work? How should I do this?

By creating your subclass of Point named MyPoint, you can change any method
of Point by redefining it in MyPoint.


> Kind Regards
> Dusty
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20120612/64ea3dc1/attachment.html>

More information about the Pharo-dev mailing list