> You can chain find_h / find_b with select_h / select_b like this
> to refine an outline search::
>
> pl =
> c.find_h('@thin.*py').select_h('class.*').select_b('import (.*)')
>
> So I tried a few simple tests using select_b() and select_h(). I
> found that select_b() works just as I would expect, but select_h()
> surprised me. Puzzled I looked at the definition of select_h() and
> found "Find immediate child nodes of nodes in poslist with regex."
>
> Wouldn't it be better for select_h() to be consistent with
> select_b()? Wouldn't it be better for them both to search the nodes
> in poslist?
How would you chain select_h's if they merely pruned down the current poslist?
--
Ville M. Vainio @@ Forum Nokia
> 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.
You can see that I agreed in march 2009:
http://www.mail-archive.com/leo-e...@googlegroups.com/msg05704.html
And, I still do.
I don't know why I never got it done. Probably ended up being too busy.
If you feel like implementing the feature in trunk now, go ahead with
my permission ;-).