Re: Proposal for a collection API in glib

2008-07-24 Thread Philip Van Hoof
So, Do we have a conclusion on this proposal? On Thu, 2008-07-17 at 17:51 +0200, Philip Van Hoof wrote: > Hi there, > > I would like to propose this API to go into glib/gio: > > http://live.gnome.org/IteratorsAPI > > A working implementation of it can be found here (just replace Gee.List > w

Re: Proposal for a collection API in glib

2008-07-21 Thread Havoc Pennington
Hi, On Sun, Jul 20, 2008 at 4:21 AM, Colin Walters <[EMAIL PROTECTED]> wrote: > Again I think the point is we want to move this burden to the library > authors (supported by the authors of all language bindings), rather than > redundantly duplicating it in each binding. > Yes, in the short term t

Re: Proposal for a collection API in glib

2008-07-21 Thread Mikkel Kamstrup Erlandsen
2008/7/21 Steve Frécinaux <[EMAIL PROTECTED]>: >> On http://live.gnome.org/MikkelKamstrup/GCollection you will now find >> a sample patch against trunk (rev 5882) implementing GIterable as >> described on the page. > > I don't understand why the GType appears in the function call for > g_iter_next(

Re: Proposal for a collection API in glib

2008-07-20 Thread Steve Frécinaux
> On http://live.gnome.org/MikkelKamstrup/GCollection you will now find > a sample patch against trunk (rev 5882) implementing GIterable as > described on the page. I don't understand why the GType appears in the function call for g_iter_next(). As I understand it, a GIter will always be used to i

Re: Proposal for a collection API in glib

2008-07-20 Thread Colin Walters
On Fri, Jul 18, 2008 at 9:33 AM, Gustavo J. A. M. Carneiro < [EMAIL PROTECTED]> wrote: > > > Sure, but you are assuming a scenario where g-i already has complete and > accurate metadata about the library APIs. Assuming that scenario is not > very reallistic, I think. I believe the goal is to fi

Re: Proposal for a collection API in glib

2008-07-19 Thread Jamie McCracken
On Thu, 2008-07-17 at 13:37 -0400, Havoc Pennington wrote: > Hi, > > Why explore alternate ideas? Some downsides to GIterator-as-gobject: > > * GObject is pretty heavyweight for something like this, and moreover > right now libglib doesn't depend on libgobject > * the need to unref the iterator

Re: Proposal for a collection API in glib

2008-07-18 Thread Mikkel Kamstrup Erlandsen
2008/7/18 Mikkel Kamstrup Erlandsen <[EMAIL PROTECTED]>: > 2008/7/17 Mikkel Kamstrup Erlandsen <[EMAIL PROTECTED]>: >> 2008/7/17 Havoc Pennington <[EMAIL PROTECTED]>: >>> Hi, >>> >>> Here are some alternate ideas, just brainstorming: >>> >>> 1) have an iterator concept in gobject-introspection and

Re: Proposal for a collection API in glib

2008-07-18 Thread Philip Van Hoof
On Fri, 2008-07-18 at 14:33 +0100, Gustavo J. A. M. Carneiro wrote: > On Thu, 2008-07-17 at 14:23 -0400, Havoc Pennington wrote: > At leas Philip's iterators would shift some of the burden of making APIs > bindings friendly into the library authors themselves, and contribute > for language binding

Re: Proposal for a collection API in glib

2008-07-18 Thread Sebastian Rittau
On Thu, Jul 17, 2008 at 05:51:24PM +0200, Philip Van Hoof wrote: > I would like to propose this API to go into glib/gio: > > http://live.gnome.org/IteratorsAPI I'd like to point to my comment on that page: Please make the Iterator interface derive from the Iterable interface, where the iterator(

Re: Proposal for a collection API in glib

2008-07-18 Thread Gustavo J. A. M. Carneiro
On Thu, 2008-07-17 at 14:23 -0400, Havoc Pennington wrote: > Hi, > > On Thu, Jul 17, 2008 at 2:06 PM, Philip Van Hoof <[EMAIL PROTECTED]> wrote: > > You could make a GLib.Iterator that uses gobject-introspection, but I > > don't think you want to make gobject-introspection the one thing > > everyb

Re: Proposal for a collection API in glib

2008-07-18 Thread Jürg Billeter
Hi Havoc, On Thu, 2008-07-17 at 13:37 -0400, Havoc Pennington wrote: > 2) Another idea would be an equivalent to registering boxed types: > > g_iterator_type_register_static(const char *name, GBoxedCopyFunc > boxed_copy, GBoxedFreeFunc boxed_free, GIteratorNextFunc > iterator_next, GIteratorGetFu

Re: Proposal for a collection API in glib

2008-07-17 Thread Mikkel Kamstrup Erlandsen
2008/7/17 Mikkel Kamstrup Erlandsen <[EMAIL PROTECTED]>: > 2008/7/17 Havoc Pennington <[EMAIL PROTECTED]>: >> Hi, >> >> Here are some alternate ideas, just brainstorming: >> >> 1) have an iterator concept in gobject-introspection and map from >> GList etc. in g-i. So g-i would allow you to invoke a

Re: Proposal for a collection API in glib

2008-07-17 Thread Mathias Hasselmann
Am Donnerstag, den 17.07.2008, 14:23 -0400 schrieb Havoc Pennington: > Hi, > > On Thu, Jul 17, 2008 at 2:06 PM, Philip Van Hoof <[EMAIL PROTECTED]> wrote: > > You could make a GLib.Iterator that uses gobject-introspection, but I > > don't think you want to make gobject-introspection the one thing

Re: Proposal for a collection API in glib

2008-07-17 Thread Felipe Contreras
On Thu, Jul 17, 2008 at 9:06 PM, Philip Van Hoof <[EMAIL PROTECTED]> wrote: > On Thu, 2008-07-17 at 13:37 -0400, Havoc Pennington wrote: >> Why explore alternate ideas? Some downsides to GIterator-as-gobject: >> >> * GObject is pretty heavyweight for something like this, and moreover >> right now l

Re: Proposal for a collection API in glib

2008-07-17 Thread Mikkel Kamstrup Erlandsen
2008/7/17 Havoc Pennington <[EMAIL PROTECTED]>: > Hi, > > Here are some alternate ideas, just brainstorming: > > 1) have an iterator concept in gobject-introspection and map from > GList etc. in g-i. So g-i would allow you to invoke a method that > returns a list, and get an iterator back. > > If I

Re: Proposal for a collection API in glib

2008-07-17 Thread Yu Feng
On Thu, 2008-07-17 at 14:23 -0400, Havoc Pennington wrote: > Hi, > > On Thu, Jul 17, 2008 at 2:06 PM, Philip Van Hoof <[EMAIL PROTECTED]> wrote: > > You could make a GLib.Iterator that uses gobject-introspection, but I > > don't think you want to make gobject-introspection the one thing > > everyb

Re: Proposal for a collection API in glib

2008-07-17 Thread Philip Van Hoof
On Thu, 2008-07-17 at 14:22 -0400, Jamie McCracken wrote: > On Thu, 2008-07-17 at 13:37 -0400, Havoc Pennington wrote: > As philip's proposal centres around easier bindings this would only > affect public API dealing with licts/collections so all of the above > will probably have negligible impact

Re: Proposal for a collection API in glib

2008-07-17 Thread Havoc Pennington
Hi, On Thu, Jul 17, 2008 at 2:06 PM, Philip Van Hoof <[EMAIL PROTECTED]> wrote: > You could make a GLib.Iterator that uses gobject-introspection, but I > don't think you want to make gobject-introspection the one thing > everybody who wants to expose collections in his API has to use and > learn.

Re: Proposal for a collection API in glib

2008-07-17 Thread Philip Van Hoof
On Thu, 2008-07-17 at 20:06 +0200, Philip Van Hoof wrote: > Vala is an excellent example of how community people who are true black > art masters and experts in GLib/GObject can provide excellent language > bindings. I meant "who are not true black art masters and ..." of course. -- Philip Va

Re: Proposal for a collection API in glib

2008-07-17 Thread Philip Van Hoof
On Thu, 2008-07-17 at 13:37 -0400, Havoc Pennington wrote: Hey Havoc, > Here are some alternate ideas, just brainstorming: > > 1) have an iterator concept in gobject-introspection and map from > GList etc. in g-i. So g-i would allow you to invoke a method that > returns a list, and get an iterat

Re: Proposal for a collection API in glib

2008-07-17 Thread Havoc Pennington
Hi, Here are some alternate ideas, just brainstorming: 1) have an iterator concept in gobject-introspection and map from GList etc. in g-i. So g-i would allow you to invoke a method that returns a list, and get an iterator back. If I were doing this in gobject-introspection I'd tend to make the

Re: Proposal for a collection API in glib

2008-07-17 Thread Philip Van Hoof
On Thu, 2008-07-17 at 12:46 -0400, Yu Feng wrote: > > > > We are working on adding convenience functions for C to make things as > > type safe as possible (the #1 problem with glib's current collection > > types): > > > > gchar* g_iterator_get_as_string (GIterator *iter); > > gdouble g_iterator

Re: Proposal for a collection API in glib

2008-07-17 Thread Yu Feng
Hi Tim, On Thu, 2008-07-17 at 17:51 +0200, Philip Van Hoof wrote: > Hi there, > > I would like to propose this API to go into glib/gio: > > http://live.gnome.org/IteratorsAPI > > A working implementation of it can be found here (just replace Gee.List > with GLib.Seq, as that is the name that we

Proposal for a collection API in glib

2008-07-17 Thread Philip Van Hoof
Hi there, I would like to propose this API to go into glib/gio: http://live.gnome.org/IteratorsAPI A working implementation of it can be found here (just replace Gee.List with GLib.Seq, as that is the name that we have for it in mind): http://svn.gnome.org/viewvc/libgee/trunk/gee/ To see users