[MLton-commit] r7190

Matthew Fluet fluet at mlton.org
Mon Jun 22 08:54:27 PDT 2009


Support bootstrap from mlton-20051202.
----------------------------------------------------------------------

U   mlton/trunk/bin/upgrade-basis
U   mlton/trunk/mlton/atoms/real-x.fun

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

Modified: mlton/trunk/bin/upgrade-basis
===================================================================
--- mlton/trunk/bin/upgrade-basis	2009-06-21 23:01:25 UTC (rev 7189)
+++ mlton/trunk/bin/upgrade-basis	2009-06-22 15:54:26 UTC (rev 7190)
@@ -95,6 +95,28 @@
 structure Word32 = Word
 structure LargeWord = Word'
 
+feature 'val _ = PackWord64Big.bytesPerElem' '
+structure PackWord64Big : PACK_WORD = struct
+   val bytesPerElem = 0
+   val isBigEndian = true
+   fun subVec _ = raise Fail "PackWord64Big.subVec"
+   fun subVecX _ = raise Fail "PackWord64Big.subVecX"
+   fun subArr _ = raise Fail "PackWord64Big.subArr"
+   fun subArrX _ = raise Fail "PackWord64Big.subArrX"
+   fun update _ = raise Fail "PackWord64Big.update"
+end'
+
+feature 'val _ = PackWord64Little.bytesPerElem' '
+structure PackWord64Little : PACK_WORD = struct
+   val bytesPerElem = 0
+   val isBigEndian = false
+   fun subVec _ = raise Fail "PackWord64Little.subVec"
+   fun subVecX _ = raise Fail "PackWord64Little.subVecX"
+   fun subArr _ = raise Fail "PackWord64Little.subArr"
+   fun subArrX _ = raise Fail "PackWord64Little.subArrX"
+   fun update _ = raise Fail "PackWord64Little.update"
+end'
+
 cat <<-EOF
 structure MLton =
    struct

Modified: mlton/trunk/mlton/atoms/real-x.fun
===================================================================
--- mlton/trunk/mlton/atoms/real-x.fun	2009-06-21 23:01:25 UTC (rev 7189)
+++ mlton/trunk/mlton/atoms/real-x.fun	2009-06-22 15:54:26 UTC (rev 7190)
@@ -255,18 +255,20 @@
 end
 
 local
-   fun doit (R {bits, toBytes, subVec, ...}) x =
-       WordX.fromIntInf
+   fun doit (R {bits, toBytes, subVec, ...}) x = let
+   in
+       (SOME o WordX.fromIntInf)
           (P.LargeWord.toLargeInt (subVec (toBytes x, 0)),
            WordX.WordSize.fromBits bits)
+   end handle _ => NONE
 in
    fun castToWord x =
        if disableCF ()
           then NONE
        else
-          SOME (case x of
-                   Real32 x => doit r32 x
-                 | Real64 x => doit r64 x)
+          (case x of
+              Real32 x => doit r32 x
+            | Real64 x => doit r64 x)
 end
 
 local
@@ -275,7 +277,7 @@
    in
       update (a, 0, P.LargeWord.fromLargeInt (WordX.toIntInf w))
     ; SOME (tag (subArr (a, 0)))
-   end
+   end handle _ => NONE
 in
    fun castFromWord w =
       if disableCF () then




More information about the MLton-commit mailing list