asymertical behavior with where: and where:sortedBy:...

Chris Muller asqueaker at gmail.com
Tue Apr 8 02:09:15 UTC 2008


I agree with your point about it being asymetrical.  And if it were
real cheap to build an index, I would be already convinced to make it
symetrical.

>  Yes, depending on the quantity of index in a MagmaCollection, it can be
> very expensive. I will avoid it myself, I documented this aspect in
> http://wiki.squeak.org/squeak/5859

But this precisely why the "the minimum needed to satisfy the request"
was chosen.  If you want to add the additional indexes that are on the
original collection, it is easy to do so via #addIndex.

In fact, you could add your own extension if you wanted;

  MagmaCollectionReader>>#ensureIndexesOf: anotherMagmaCollection

which would add whatever indexes were needed to make your
MagmaCollectionReader have the original indexes of
anotherMagmaCollection.

Symmetry in your code would then be achieved by *always* sending this
method, which would be a no-op for optimized-Readers.

Regards,
  Chris


 - Chris


More information about the Magma mailing list