2 public class Cons
<T
> : list
<T
> { }
3 public class Nil
<T
> : list
<T
> { }
7 public static void Rev
<T
> (list
<T
> y
) {
8 if (y
is list
<object>.Cons
<T
>)
9 System
.Console
.WriteLine ("Cons");
10 if (y
is list
<object>.Nil
<T
>)
11 System
.Console
.WriteLine ("Nil");
17 C
.Rev (new list
<object>.Cons
<string> ());
18 C
.Rev (new list
<object>.Nil
<string> ());