Subject: | Patch to add add_child_node() method or make add_child() work with Node objects |
I've patched Tree::MultiNode 1.0.10 to add a method I'm currently calling add_child_node(). It works just like add_child() except it takes either a Tree::MultiNode::Node or a Tree::MultiNode object instead. I found this extremely useful when using recursion to populate a tree. It could also be used to subsume any tree into another tree, so this touches on the topic of the other bug item here asking for methods to copy/move trees/nodes.
Alternatively, instead of adding a new method (add_child_node), I could extend the capability of the add_child() method by inspecting the first argument to the method. If the first argument is of type Tree::MultiNode or Tree::MultiNode::Node, then act accordingly. If it's any other type, it would perform exactly as the current implementation of the add_child() method.
I think I actually prefer the second option (extending add_child), but I thought I'd check with you first. I can provide a patch for either implementation. *Please* contact me. I hope you are interested in incorporating this feature into Tree::MultiNode. I really need this capability. Thanks.