Thursday 15 January 2015

smalltalk - subclassResponsibility sender selector stuck -


subclassResponsibility The sender selector is still stuck when the subclasses method is applied.

I think logic may be the reason but what is this?

And nobody can tell us why?

In the abstract class, we get it from

  string: string "inst string with" ^ self subclassResponsibility   

and I run it I'm having:

  unit: = (a new unit by string: aString)   

Then the error occurs.

The current approach of Travis Griggs can still remove the error

Is there bilateral example creation method?

There shy on details, but it seems that it is doing precisely what you have Told.

Expression Units new returned a new unit and then you sent the string from to: . Which you have implemented to return the result of sending subclassResponsibility .

If the units is actually a abstract element class, I will not expect to instantiate it (unless you have new < / Code> are not messed up with you until you send new to abstract classes).

That is why I would expect you to do something like this:

  unit: = (string with your realshobs new: aString)   

And that is a real implementation of YourRealSubclass from to string:

No comments:

Post a Comment