The VFS layer is a bit messy. Different node types are hardcoded all over the place, and <code>traverse-vault-node</code> always does a <code>fold-vault-node</code>, even when it's blatantly inefficient to do so, as we can find things direct from the path component. For instance, top-level tags. Also, it would be nice to allow references to objects that we can't enumerate, such as object hashes or "hash plus arbitrary extension" (making parts of the pathname irrelevant).
Therefore, it would be good to create a registry of node types, each of which has a nice record full of closures for fold and traverse; if the traversal routine is <code>#f</code>, then a default implementation (that folds until it finds the sub-node) is used.
|