On 7/20/2010 11:20 AM, Bert Freudenberg wrote:
On 20.07.2010, at 04:47, Mariano Martinez Peck wrote:
Thanks for the answers. Maybe I should have explained why I needed that. What I had in mind, is to be able to detect subgraphs. But not any kind of subgraphs, but only those on which ALL objects are ONLY reachable from the root of the subgraph. This means, that there are no objects outside the graph, pointing to objects inside the graph. In ImageSegment word, would mean to detect subgraphs that don't have outPointers.
So why not simply use an ImageSegment? IIRC that's how Croquet islands are checked for closedness.
No, it's the other way around. Croquet can use ImageSegments because it can prove (constructively) that it tracks all the pointers into the object graph of an island. Since Mariano hasn't said what he's trying to do other than "detecting subgraphs" it's difficult to give any advice here but if the goal is to use ImageSegments for something similar to Croquet (i.e., dumping the bits of a well-defined set of objects) then the only way I know to do that is constructively, via message passing. And I'd recommend to check out [T]FarRef in Croquet and [T]IslandArgumentCopier to get an idea of how that can work. In addition, I'd recommend having a look at [T]IslandReader and [T]IslandWriter which do the actual checkpointing and instantiation for an island using ImageSegments (there are some interesting subtleties in this code :-)
Cheers, - Andreas