Re: [PATCH] Additional functions for gtree (fwd)

Actually, I do have a issue with this patch, though its not really new
with this patch.

The issue is the GTraverseType argument to g_tree_traverse. I don't
think the pre-order and post-order traversal makes any sense for an
opaque binary tree: from the perspective of the user, GTree presents
an ordered list with log(n) insertions; the tree structure is hidden.

Traversing in pre-order or post-order doesn't give any sort of
predictable order, and you can't make insertions/deletions while
traversing in any case.

In my comments on, I
suggested g_tree_foreach() g_tree_foreach_range(), where
g_tree_foreach_range() is the same idea as the

Also, I'm wondering about the use case for g_tree_before() and
g_tree_after(); they seem generally reasonable, but I can't think of
when I'd actually use them.


Tim Janik <timj gtk org> writes:

> thanks rebecka,
> i hope you don't mind me forwarding it back to
> gtk-devel-list again ;)
> i just have minor quirks with your patch:
> - please clean up the test-case indentation and use g_print() instead
>   of printf()
> - please supply inlined API docs for the new functions
> oes anyone else have comments on this patch? otherwise
> it's scheduled for inclusion.
> ---
> ciaoTJ
> ---------- Forwarded message ----------
> Date: lö, 17 mar 2001 19:03:50 +0100 (GMT+01:00)
> From: rebecka svanberg hushmail com
> To: timj gtk org
> Subject: [PATCH] Additional functions for gtree
> Hello!
> I really hope that you don't mind, that I am sending this patch directly 
> to you, but I have tried to get these additions into gtree for about half 
> a year, but whithout response from the gtk-devel list.
> I guess that they have drowned among all gtk-patches...
> Cheers!
> // Rebecka
> ps. Please tell me if you don't like me to send diffs directly to you, or 
> if I have done anything wrong.
> Free, encrypted, secure Web-based email at

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]