[Gtk-sharp-list] Using IList for API beauty

Miguel de Icaza miguel@ximian.com
23 Apr 2003 18:57:44 -0400


Hello,

> I would expect any .NET programmer to know exactly what an IList is
> > after very little training, but I'd also expect that most would have to
> > go hunting for docs to find out exactly what a GLib.SList does, (and as
> > it happens, they wouldn't find any yet).
> > 
> > Am I alone in thinking IList usage would be nicer? If not, could someone
> > point me in the right direction to implement this?
> 
> I think that a possible option would be making GLib.SList and GLib.List
> implement all those useful interfaces: ICollection, IList,
> IEnumerable... And then provide constructors for all of them (the 2
> types and the interfaces).

ListBase already implements ICollection.

Implementing IList would be convenient to *navigate* SList structures,
but it does not solve the problem of users providing .NET data types 

The problem with this is that the public API still requires a SList to
be passed in various places.  

Although the implicit conversions operators might be useful, they are
not obvious to someone browsing the documentation, maybe we should just
expose other the other entry points, and internally implement the
routines depending on the implicit conversion.

Miguel