[elephant-devel] topo sort?

Alex Mizrahi alex.mizrahi at gmail.com
Mon May 9 13:17:46 UTC 2011


hi

I was inspecting code of rebuild-slot-indices and it looks like it has a 
problem with inherited indices (although it is not easy to reproduce it).

rebuild-slot-index drops index first. With inherited indices it tries to 
drop an index but fails (because it looks for index for this class 
rather than super class), so index is dropped only once (in the base 
class which has this inherited index).

But (I think) this works correctly only if base class's index is rebuild 
before subclass index. Otherwise index already populated with some 
entries will be dropped and so some instances will be lost.

E.g. if foo is base class which defines inherited slot/index bar and 
quux is subclass of foo it works correctly if foo is rebuilt before quux.

So I think we need to sort classes (topologically) in known-classes 
function to make sure that order is correct.

Or am I missing something?





More information about the elephant-devel mailing list