> How would you chain select_h's if they merely pruned down the current poslist?
I missed the intention of your definition of select_h(). I agree that
descending the tree is usually (and perhaps always) more useful than
pruning the current level.
I suggest making the functions simpler and the facility more flexible
by adding a method children() to the poslist class. This method would
correspond to method p.children(), which returns only the "immediate
children" of position p. And, of course, change select_h() to prune
the positions in the poslist, instead of the children of these
positions. This would make descending the tree explicit, less
surprising, and more flexible.
If you think conciseness is more important than simplicity, you could
add two new methods to the poslist class: children_h('pattern')
(equivalent to the current select_h()) and children_b('pattern').
And, of course, change select_h() to prune the positions in the
poslist, instead of the children of these positions.
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.