public static long compare(object self, object x)
{
if (self is FanObj)
{
return(((FanObj)self).compare(x));
}
else if (self is string)
{
return(FanStr.compare((string)self, x));
}
else if (self is IComparable)
{
return(((IComparable)self).CompareTo(x));
}
else
{
return(FanStr.compare(toStr(self), toStr(x)));
}
}