Reimplement Node.transform(operation: (Node) -> Node, inPlace: Boolean): Node
There's a TODO there.
Here's what I think right now: mapTree -> should be named mapChildren transformTree -> should be named transformChildren transform -> transforms the whole tree. Can become the new transformTree and mapTree by calling transformChildren and mapChildren recursively.
That would also solve #32
what do we mean by children and what by tree? Does "children" refers only to the direct children, while "tree" refers to the whole sub tree? So for example:
A -> B -> D
C -> E
-> F
Where A contains B and C, D contains B, and C contains E and F.
In this scenario mapChildren/transformChildren, when called on A will touch only B and C, but not D, E, F. Transform instead will operate on a tree and therefore when called on "A" will touch A, B,C,D,E, and F. When called on C, it will touch C, E, and F.
Is that correct? If this is the case I would call transform "transformTree", to avoid ambiguity
Yes, what you say is correct.
So we can have:
mapChildren and transformChildren.
mapTree and transformTree.
The bottom two will use the top two (if I can get that to work)
Is that okay?
It sounds great to me. Thank you for working with me on this one!