Hi rabbit,

Am So., 13. Aug. 2023 um 14:35 Uhr schrieb rabbit <rabbit@callistohouse.org>:

I have thoughts of a generalized tree-walker with parameterization. I need another walker to walk Neighbor objects with substitutions for InMemory scoped remoting. All I need is the substitution, no encoding, I just pass the object over directly.


Squot already has facilities to walk over object graphs. It uses that to turn the live objects into snapshots, or the other way around, and to compare and merge.

So it may not do what you want out of the box, but depending on where you start from, it might have some pieces that you will want or need as well.

SquotMirror + SquotReference and their subclasses are responsible for looking at objects from the outside and for navigating from one to the next.

SquotGraphWalk carries the state for breadth-first or depth-first walks through object graphs. It neither takes the steps by itself nor does anything with the encountered objects. It needs to cooperate with others for concrete use cases and the appropriate guidance.

SquotObjectCapturer starts from an ordinary object, walks the graph, and converts it into a SquotObjectGraph, which contains snapshots of the objects. Such snapshots are made of the classes in the Squot-Shadows category, or SquotPackageShadow for Smalltalk/Monticello packages.

The way back from snapshots to regular objects mostly happens in SquotDiffBuilder and SquotPatcher because the materialization is implemented in terms of or as part of the patching of existing object graphs. The two are put together in SquotShadowMaterializer >> rematerializeGraph:into:. The actual graph walking happens in the diff builder and in the patcher.

Merging currently happens in SquotObjectGraphMerge, with the walk happening in the computeDifferences method.

In case anybody reading this wonders what this Squot is that I am writing about: it is the library underneath the Git browser that is not concerned with the Git implementation but with the tracking and treating of objects. (The pieces for packages/code wrap around Monticello's facilities, but do not use its version model.)

https://github.com/hpi-swa/Squot/

Kind regards,
Jakob