Streaming on all collections

Alan Lovejoy squeak-dev.sourcery at forum-mail.net
Sun Feb 11 21:49:29 UTC 2007


<Jon Hylands>
The reason it works in VW is that #growToAtLeast: sets lastIndex to the size
the collection has grown, whereas in Squeak it keeps it at the current
position.
<Jon Hylands>

I'd explain it differently: Around the time of VW 1.0, someone at ParcPlace
put a lot of effort into rigourously making the Collection classes
intelligently distinguish between the concept of a collection's #size (its
logical size, the number of elements it contains logically) a a collection's
#capacity (its physical size, the number of slots it has allocated in which
elements could be stored.)

In VW, a Collection responds to #growToAtLeast: by increasing its logical
size.  In Squeak, a Collection responds to #growToAtLeast: by increasing its
physical size--which in some, but not all cases, also increases the
Collection's logical size.  Unfortunately, for OrderedCollections the
distinction between logical size and physical size (capacity) actually
matters.

--Alan





More information about the Squeak-dev mailing list