public interface Comparable<G> : Object {
	[Compare]
	public abstract int compare_to (G object);
}

public class Foo : Object, Comparable<Foo> {
	public string bar;
	public int compare_to (Foo another) {
		return this.bar.collate (another.bar);
	}
}

void main () {
	var foo1 = new Foo ();
	foo1.bar = "ab";
	var foo2 = new Foo ();
	foo2.bar = "bc";

	assert (foo1 < foo2);
	assert (foo2 > foo1);
	assert (foo1 != foo2);

	foo2.bar = "ab";
	assert (foo1 == foo2);
	assert (foo1 <= foo2);
	assert (foo1 >= foo2);
}
