[Pharo-project] subclassResponsibility, how does it work?
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@y. When I execute code, I get an error that the subclass should have executed... How does this actually work? How should I do this? Kind Regards Dusty
this question is more appropriate on the user mailinglist or on even better on stackoverflow (tag #pharo) please repost on pharo-users@lists.gforge.inria.fr On 2012-06-12, at 10:11, Gareth Cox wrote:
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@y.
When I execute code, I get an error that the subclass should have executed... How does this actually work? How should I do this?
Kind Regards Dusty
Camillo Bruni-3 wrote
this question is more appropriate on the user mailinglist or on even better on stackoverflow (tag #pharo) please repost on pharo-users@.inria
+1 -- View this message in context: http://forum.world.st/subclassResponsibility-how-does-it-work-tp4634436p4634... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
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@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@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. Luc
Kind Regards Dusty
participants (4)
-
Camillo Bruni -
Gareth Cox -
Luc Fabresse -
Sean P. DeNigris