Interesting concept. What is your use case for this? Also, you say you have "spreadsheet formulas", but is it possible to apply a formula to a range of nodes, like you can in an actual spreadsheet?
> Also, you say you have "spreadsheet formulas", but is it possible to apply a formula to a range of nodes, like you can in an actual spreadsheet?
You can apply to all children of a node like len(`foo). In a different version, if you wanted to do that for an entire subtree, you could have something like len(list((`foo).dfs()))