RE: [gtk-list] Re: Benchmarking glib (atleast GList) (was: how c




On 24-Mar-99 john@giorgio.hart.bbk.ac.uk wrote:
> I think the cool thing about the current implementation, which you
> loose with
> this sort of encapsulation, is that empty-list is just NULL. This
> makes a lot
> of init code much simpler. It also makes recursion down lists
> possible (no
> list-info block to update). 

You don't have to loose the simplicity of having NULL as the empty
list. I've implemented a list elsewhere that does this and keeps a
pointer to the end. You can also keep the recursion by using unions.

> 
> A datastructure with fast addition at either end isn't really a
> list, it's
> more like a LIFO queue or something. Build it on top of GSList and
> call it
> something else (GQueue?).
> 

I don't agree. It's still a list, only with a bit of a shortcut for
appending.

-tony


---
E-Mail: trog@gtk.org
You are fighting for survival in your own sweet and gentle way.

Go Bezerk! http://www.gtk.org/~trog



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