Squeaking trouble

Chris Muller afunkyobject at yahoo.com
Tue Nov 15 18:27:56 UTC 2005


> However, apart from the
> comment I am at a loss to understand what makes this class abstract, there
> is no special protocol in the class definition and all the methods appear to
> have an implementation. I was expecting to find subclassResponsibility
> somewhere like it says in http://minnow.cc.gatech.edu/squeak/472. 

That page is somewhat incorrect.  An abstract class does not require a method
to say subclassResponsibility; all of the inherited behaviors may have default
implementations.  However, any class that *does* have a subclassResponsibility
is generally considered "abstract".

In Smalltalk, a class whose comment declares it abstract is sufficient
notification/warning to not to instantiate it.  Things are not as "official" as
they are in Java where you can a Class declare, "by the power vested in me,
offically declared 'abstract'...".

As Bert pointed out, you were "informed" of the inappropriateness of
instantiating it very quickly..  :)

> > I was simply trying to understand why forceTo: paddingStartWith: 
> > didn't work if the length was more than the original string.
> 
> On this point which I think got masked by the first point. I have now
> discovered that '0' is not the same as $0. Saying paddingStartWith: '0'
> gives an indexing error. Probably blindingly obvious to anyone who has
> worked with Smalltalk for a while. 

'0' is a String, $0 is a Character.  These classes of objects have different
API's.

 - Chris



More information about the Squeak-dev mailing list