Today I commited System.Collections.Generic.Collection class, which is part of the generics support for Parametric Polymorphism in Mono. So, I can say that after sending some small patches, and now this class, I'm a Mono hacker. Now, it's time to go beyond and work on the left classes and then work at the Generational garbage collection support.
Little sample:
using System;
using System.Collections.Generic;
public class Test {
public static void Main ()
{
Collection <int> c = new Collection <int> ();
c.Add (3);
c.Add (5);
c.Add (11);
// Note that unboxing is not neccessary
int sum = 0;
for (int i = 0; i < c.Count; i++)
sum += c [i];
Console.WriteLine (sum);
}
}
Compile with
gmcs. Enjoy.
2 comentarios:
Publicar un comentario