remove: and GOODS -- identity problems?

Ragnar Hojland Espinosa ragnar.hojland at linalco.com
Fri Jul 9 23:06:13 UTC 2004


On Thu, Jul 08, 2004 at 11:40:16AM -0700, Avi Bryant wrote:
> The problem is this line in KKRecordCache>>commitObjects:
> 
> newObjects := IdentitySet new.
> 
> If you comment it out, the KKIdentitySet should work.

Indeed, this does fix the issue.  I did find another one tho, having
to do with select:

Start with an empty set stored at #aSet

      KKIdentitySet database: db

in GOODS.

      aSet _ (db root at: #aSet).
      aSet add: 'foo'.
      aSet select: [:each | each = each]

This will complain happily in the select:, because when we get to run
KKIdentitySet>>scanFor: , the database instval is nil.  Digging a bit
it appears that Collection>>select: instantiates a new collection via
self similarSpeciesInstance but the database instvar isn't set, so
obviously scanFor: breaks later.

I've fixed this with

KKIdentitySet>>similarSpeciesInstance
       ^ self species new instanceWithDatabase: database

Broke anything? :)
-- 
Ragnar Hojland - Project Manager
Linalco "Specialists in Linux and Free Software"
http://www.linalco.com  Tel: +34-91-4561700



More information about the Squeak-dev mailing list