[Pharo-project] subclassResponsibility, how does it work?
luc.fabresse at gmail.com
Tue Jun 12 04:23:45 EDT 2012
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
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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-dev