Re: [PATCH] GIterator



On Tue, Jun 11, 2002 at 09:05:26PM -0400, Havoc Pennington wrote:
> We would end up sort of pseudo-deprecating all the foreach()
> functions, all functions that return a list, list->next style
> iteration, etc., and that's just too much churn in the "recommended"
> API set, even if the old API still works.

	I don't think this is the case.  Adding a type that makes my
life easier for my code (I hate hate hate _foreach() functions) and for
the code of others is a good thing.
	In no way am I proposing "Replace all current API with GIterator
for 2.(x>2)".  This isn't feasable.  It only really makes sense for a
small set of the API (eg, gtk_container_iterate_children() returning a
GValueIterator provides more information than the GList of
gtk_container_get_children()).  Even then, I haven't included such API
in my patches because I'm not sure it would be accepted.
	However, new API can and should take advantage of such a thing.
We've discussed it already for GtkTreeSelection.  A list is a list, and
an iterator is a different beast.  Folks work with lists and iterators
in Python, Java, C++, and elsewhere without worrying.  I don't think the
complexity would really increase for the user.

Joel

-- 

Life's Little Instruction Book #30

	"Never buy a house without a fireplace."

			http://www.jlbec.org/
			jlbec evilplan org



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