[Newbies] Collection subclasses

stephane ducasse stephane.ducasse at free.fr
Mon Apr 7 17:26:03 UTC 2008


normally initialize instance side method is automatically invoked when  
you send  the message new.
Now for some collections this behavior has been optimized because it  
was not doing what it should do (unnnecessary initialization).

Stef

On Apr 3, 2008, at 4:31 AM, Rob Rothwell wrote:

> If I create a simple object subclassed from Collection,  
> SequenceableCollection, or ArrayedCollection called  
> CollectionObject, with
>
> CollectionObject>>#initialize
>      self halt.
>
> and execute:
>
> CollectionObject new.
>
> the halt is executed.
>
> Whereas, if I subclass CollectionObject from:
>
> Set
> Dictionary
> OrderedCollection
> Array
>
> It does not.
>
> Is one not supposed to make subclasses of these classes, and if so,  
> why not?
>
> I have an object that is most naturally a Dictionary-like object  
> with various subclasses, but I can not initialize it...
>
> Thank you; I feel I am missing something very basic in my  
> understanding!
>
> Rob Rothwell
>
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners



More information about the Beginners mailing list