[Mono-list] Array Class

Gaurav Vaish gvaish@iitk.ac.in
Mon, 11 Mar 2002 12:57:48 +0530 (IST)


This mail is in response to:

>Date: Mon, 11 Mar 2002 07:15:02 -0000
>From: "Dwivedi , Ajay Kumar" <AjayKumar.Dwivedi@dresdner-bank.com>
>To: 'Nick Drochak' <ndrochak@gol.com>, Mono-List <mono-list@ximian.com>
>Subject: RE: [Mono-list] Array Class
>
>I found some bugs in the patch ;)
>
>2. All of the IList functions implemetations are Explicit. So
>	public int Add (object value)  should be infact
>	int IList.Add (object value)
>    The list of all such methods is:
>	IList.Add
>	IList.Clear
>	IList.Contains
>	IList.IndexOf
>	IList.Insert
>	IList.Remove
>	IList.RemoveAt

    No, I think this is correct. There's no need to explicitly have
the methods as IList.<something> unless you wish to change the
visibility of the final implementation of the methods. Since the
methods Add(object), Clear() etc are defined public, there's no
explicit implementation required.

    Were the visible implementations as:
     protected int Add(object)

   (and similarly for others) that you needed Explicit
implementations.


Cheers,
Gaurav Vaish
http://home.iitk.ac.in/student/gvaish
http://calendar.yahoo.com/mastergaurav
-----------------------------------------


>
>3. GetEnumerator() should no more be a MonoTODO :)
>
>
>Happy Hacking,
>Ajay
>
>> -----Original Message-----
>> From: Nick Drochak [mailto:ndrochak@gol.com]
>> Sent: 11 March 2002 11:30
>> To: Mono-List
>> Subject: Re: [Mono-list] Array Class
>>
>>
>> | > 2. Implementing the iterator for all dimensions should be
>> | very easy if
>> | > we have "internal extern object GetValueImpl (int pos);"
>> | implemented.
>> | > I suppose this would return an object based on position and not
>> | > indices.
>> |
>> | This function already exists as interncall. It takes a
>> | position and returns an object.
>> |
>>
>> I changed the Enumerator to use Ajay's version.  This should work fine
>> with both single and multi-dimensional arrays since it's based on
>> positions, not indicies.  Thanks Ajay.
>>
>> Since MS's implementation does not throw an error after a mutation, I
>> removed all the versioning stuff; much to Paolo's relief, I'm sure :)
>>
>> I also included the IList interface methods since those are needed in
>> the Nunit tests. Using Ajay's hint, I utilized GetValueImpl (int pos)
>> in order to simplify the code for Contains () and IndexOf ().
>>
>> I've attached the diff for review again.
>>
>> Thanks,
>> Nick D.
>>
>>
>>
>>
>>
>>
>
>_______________________________________________
>Mono-list maillist  -  Mono-list@ximian.com
>http://lists.ximian.com/mailman/listinfo/mono-list
>