Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gtest-261.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 43ba6b8f2544cc6a356cd3a6b45fb762a63c5eab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;

class Cons<T,U>
{
	public T car;
	public U cdr;

	public Cons (T x, U y)
	{
		car = x; cdr = y;
	}

	public override String ToString ()
	{
		return "(" + car + '.' + cdr + ')';
	}
}

class List<A> : Cons<A, List<A>>
{
	public List (A value)
		: base(value, null)
	{ }

	public List (A value, List<A> next)
		: base(value, next)
	{ }

	public void zip<B> (List<B> other)
	{
		cdr.zip (other.cdr);
	}
}

abstract class Test
{
	public static void Main (String[] args)
	{
		List<int> list = new List<Int32> (3);
		Console.WriteLine (list);
	}
}