Re: [Proposal] GRing



On Sun, Aug 19, 2001 at 11:26:29AM -0400, Havoc Pennington wrote:
> "NULL is a valid zero-length list" is sort of a minor API detail.  The
> macro-level difference in these two APIs is that GQueue is a sort of
> GList "handle" that gives you queue operations and tail caching, while
> GRing copies the GList API in its entirety and is its own native data
> structure. (Though you can call GList functions on queue->head, at
> least the functions that don't mutate the list.)
> 
> I'm actually finding it pretty hard to think of interesting reasons to
> prefer one over the other, that's why I was wondering if we had any
> relevant discussion on the list archives.

Obviously this is impractical in the short term, but GList could also
be deprecated in favor of GRing.  i believe GRing offers exactly
the same (or better) performance for the same set of operations.  So
we could conceivably merge two APIs (GList and GQueue[1]) into a single
more concise API.  Obviously this would be a very long-term change, but
it seems vaguely feasible to me given that the APIs of GList & GRing
are so similar.

[1] While GQueue offers O(1) length, GRing length is O(n).

-- 
Get self-realization at <http://sahajayoga.org> ... <http://why-compete.org> ?
  Victory to the Divine Mother!!




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