[MLton-commit] r6346

Matthew Fluet fluet at mlton.org
Mon Jan 21 09:35:52 PST 2008


Share code
----------------------------------------------------------------------

U   mlton/trunk/basis-library/integer/int-inf0.sml

----------------------------------------------------------------------

Modified: mlton/trunk/basis-library/integer/int-inf0.sml
===================================================================
--- mlton/trunk/basis-library/integer/int-inf0.sml	2008-01-18 23:28:35 UTC (rev 6345)
+++ mlton/trunk/basis-library/integer/int-inf0.sml	2008-01-21 17:35:51 UTC (rev 6346)
@@ -1068,20 +1068,16 @@
                     (lhs, rhs, reserve (S.max (numLimbs lhs, numLimbs rhs), 0))
       end
 
-      fun bigCompare (lhs: bigInt, rhs: bigInt): order =
-         if areSmall (lhs, rhs)
-            then I.compare (W.idToObjptrInt (Prim.toWord lhs),
-                            W.idToObjptrInt (Prim.toWord rhs))
-            else Int32.compare (Prim.compare (lhs, rhs), 0)
-
       local
-         fun make (smallTest, int32Test)
-                  (lhs: bigInt, rhs: bigInt): bool =
+         fun make (smallTest: I.int * I.int -> 'a, 
+                   int32Test: Int32.int * Int32.int -> 'a)
+                  (lhs: bigInt, rhs: bigInt): 'a =
             if areSmall (lhs, rhs)
                then smallTest (W.idToObjptrInt (Prim.toWord lhs),
                                W.idToObjptrInt (Prim.toWord rhs))
                else int32Test (Prim.compare (lhs, rhs), 0)
       in
+         val bigCompare = make (I.compare, Int32.compare)
          val bigLT = make (I.<, Int32.<)
          val bigLE = make (I.<=, Int32.<=)
          val bigGT = make (I.>, Int32.>)




More information about the MLton-commit mailing list