String hierarchy (was: UTC-8 (was ...))

Lex Spoon lex at cc.gatech.edu
Fri Mar 17 11:10:50 UTC 2000


Maurice Rabb <m3rabb at stono.com> wrote:
> At 10:18 PM -0500 3/16/00, Bijan Parsia wrote:
> [snip a lot of interesting thoughts]
> 
> You know what?  My frustrations with the implementation straight 
> jacket that String and Symbol currently have us in (due to being 
> variableByteSubclasses) has me wanting to throw the baby out with the 
> bathwater.
> 
> Inheritance of protocol is an acceptable reason to inherit from a 
> supertype, provided it truly should implement the entire protocol of 
> the supertype.  Is this true of String?  Yes [blush].  I also agree 
> that it is proper for it implement the entire SequenceableCollection 
> protocol.  However, it is debatable whether or not it should share 
> the behavior of ArrayedCollection.
> 


What in ArrayedCollection does not apply to Strings?  There isn't much
in there.

I'm not so sure what is so wierd to people about a String being a
collection.  What else is a string but a sequenced collection of
characters?  It always seemed a success story of Smalltalk that you can
just stick String in the Collection hierarchy and instantly get access
to a zillion generic collection operations with no further work.

Perhaps it is the people who want Object>>do: who dislike String
is-a Collection?  Well, that's why Object>>do: is a bad idea.  :)




Lex





More information about the Squeak-dev mailing list