[Gtk-sharp-list] Design for Indexer for GLib.List to allow []based addressing.

Todd Berman tberman@gentoo.org
Fri, 24 Oct 2003 20:13:14 -0400


Better that we have unnecessary noise than a bad commit!

> -----Original Message-----
> From: gtk-sharp-list-admin@lists.ximian.com [mailto:gtk-sharp-list-
> admin@lists.ximian.com] On Behalf Of Daniel Kornhauser
> Sent: October 24, 2003 6:38 PM
> To: Joe Shaw; gtk-sharp-list@lists.ximian.com
> Subject: Re: [Gtk-sharp-list] Design for Indexer for GLib.List to allow
> []based addressing.
> 
> The change is only four miserable lines in ListBase.cs:
> 
> 		internal ListBase (System.Type element_type)
> 		{
> 			list_ptr = (IntPtr) 0;
> 			this.element_type = element_type;
> 		}
> 
> 
> one line in SList.cs :
> 
> 	public SList (System.Type element_type) : base (element_type)
> 		{
> 		}
> 
> 
> and one line in List.cs:
> 
> 	public List (System.Type element_type) : base (element_type)
> 		{
> 		}
> 
> I tested it and it works alright should I commit this too ?
> (When/If I get miguel's cvs account)
> 
> Sorry for the stupid question, but should I even be asking if I have to
> make the commit, since mkenster didn't make a negative comment on Joe's
> suggestion ?
> 
> I want to avoid making unnecessary noise on the list.
> 
> 				Daniel
> 
> 
> On Thu, 2003-10-23 at 17:39, Joe Shaw wrote:
> > This isn't really related to your patch directly, but since you're in
> > that code... :)
> >
> > > GLib.List l = new GLib.List ((IntPtr) 0, typeof (Gtk.Widget));
> > > GLib.SList sl = new GLib.SList ((IntPtr) 0, typeof (Gtk.Widget));
> >
> > This is a pretty nasty API.  Maybe we should add another constructor
> > which just takes the type?
> >
> > Ie, add a:
> >
> >         internal ListBase (System.Type element_type)
> >         {
> >                 this.element_type = element_type;
> >         }
> >
> > to ListBase.cs and then suitable ctors to List.cs and SList.cs.
> >
> > Then you could do:
> >
> >         GList.List l = new GLib.List (typeof (Gtk.Widget));
> >
> > which offends my delicate sensibilities less.
> >
> > Joe
> 
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list