Streaming on all collections
Klaus D. Witzel
klaus.witzel at cobss.com
Sun Feb 11 22:02:25 UTC 2007
Thank you Alan, good background info.
Separating #capacity from #size is very intuitive.
/Klaus
On Sun, 11 Feb 2007 22:49:29 +0100, Alan Lovejoy wrote:
> <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
|