Came across this one while trying to figure out why pnet-compiled switch 
statements using strings didn't work with mono's runtime.  It is related to 
some Qt# interoperability issues.

The following program gives -1 under Mono, even though 'a' is greater than 'A' 
from an ordinal point of view (0x0061 > 0x0041).  Pnet gives 1, and MS gives 
32 (any positive value is acceptable as an answer).

The reason why this breaks interoperability is because pnet uses 
"String.CompareOrdinal" to build a binary search tree for switch statements 
that use string arguments rather than use cascading ifs on intern'ed strings 
like csc and mcs.

I tested this with Mono 0.17.

---------------------------------------------
using System;

class Test
{
    public static void Main()
    {
        Console.WriteLine("Answer should be positive: {0}",
                          String.CompareOrdinal("a", "A"));
    }
}
---------------------------------------------

Cheers,

Rhys.



_______________________________________________
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to