[MLton-commit] r4770

Vesa Karvonen vesak at mlton.org
Tue Oct 24 16:06:11 PDT 2006


Reverted back to the previous basis library conforming implementation of
the MkWordExt functor.  Implemented workarounds for the SML/NJ basis
library deviations and the library now compiles with SML/NJ (v110.59).
The most dramatic workaround is that the fromDecimal spec of the REAL
signature of the SML/NJ basis library implementation changes and an
additional fromDecimal' spec is added (in case you really want to use the
SML/NJ basis library version of the function).

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

U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-word-ext.fun
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/basis-minus-extensions.cm
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/funs.cm
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/basis-minus-sane.cm
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/basis.cm
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/funs.cm
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/mk-real-sane.fun
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/mk-word-sane.fun
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/real.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/reals.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/sane.cm
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/word.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/words.sml

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

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-word-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-word-ext.fun	2006-10-24 21:53:12 UTC (rev 4769)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-word-ext.fun	2006-10-24 23:06:01 UTC (rev 4770)
@@ -10,17 +10,17 @@
 functor MkWordExt (W : WORD) = struct
    open W
    val bounds as (minWord, maxWord) = (fromInt 0, fromInt~1)
-   val fromWord = fromLargeWord o Word.toLargeWord
-   val fromWordX = fromLargeWord o Word.toLargeWordX
-   val toWord = Word.fromLargeWord o toLargeWord
-   val toWordX = Word.fromLargeWord o toLargeWordX
+   val fromWord = fromLarge o Word.toLarge
+   val fromWordX = fromLarge o Word.toLargeX
+   val toWord = Word.fromLarge o toLarge
+   val toWordX = Word.fromLarge o toLargeX
    val embString = (toString, fromString)
    val isoInt = (toInt, fromInt)
    val isoIntX = (toIntX, fromInt)
-   val isoLarge = (toLargeWord, fromLargeWord)
+   val isoLarge = (toLarge, fromLarge)
    val isoLargeInt = (toLargeInt, fromLargeInt)
    val isoLargeIntX = (toLargeIntX, fromLargeInt)
-   val isoLargeX = (toLargeWordX, fromLargeWord)
+   val isoLargeX = (toLargeX, fromLarge)
    val isoWord = (toWord, fromWord)
    val isoWordX = (toWordX, fromWordX)
    fun isZero w = fromInt 0 = w

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/basis-minus-extensions.cm
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/basis-minus-extensions.cm	2006-10-24 21:53:12 UTC (rev 4769)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/basis-minus-extensions.cm	2006-10-24 23:06:01 UTC (rev 4770)
@@ -5,6 +5,6 @@
  *)
 
 library
-   library($/basis.cm) - library(../../extensions.cm)
+   library(workarounds/basis.cm) - library(../../extensions.cm)
 is
-   $/basis.cm
+   workarounds/basis.cm

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/funs.cm
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/funs.cm	2006-10-24 21:53:12 UTC (rev 4769)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/funs.cm	2006-10-24 23:06:01 UTC (rev 4770)
@@ -5,7 +5,6 @@
  *)
 
 group is
-   $/basis.cm
    ../mk-int-inf-ext.fun
    ../mk-integer-ext.fun
    ../mk-mono-array-ext.fun
@@ -13,3 +12,4 @@
    ../mk-real-ext.fun
    ../mk-text-ext.fun
    ../mk-word-ext.fun
+   workarounds/basis.cm

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm	2006-10-24 21:53:12 UTC (rev 4769)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm	2006-10-24 23:06:01 UTC (rev 4770)
@@ -5,18 +5,6 @@
  *)
 
 group is
-   $/basis.cm
-   ../array.sml
-   ../emb.sml
-   ../iso.sml
-   ../smlnj/ints.sml
-   ../smlnj/mono-arrays.sml
-   ../smlnj/mono-vectors.sml
-   ../smlnj/reals.sml
-   ../smlnj/texts.sml
-   ../smlnj/words.sml
-   ../vector.sml
-   funs.cm
    ../../public/array.sig
    ../../public/char.sig
    ../../public/emb.sig
@@ -30,3 +18,15 @@
    ../../public/text.sig
    ../../public/vector.sig
    ../../public/word.sig
+   ../array.sml
+   ../emb.sml
+   ../iso.sml
+   ../smlnj/ints.sml
+   ../smlnj/mono-arrays.sml
+   ../smlnj/mono-vectors.sml
+   ../smlnj/reals.sml
+   ../smlnj/texts.sml
+   ../smlnj/words.sml
+   ../vector.sml
+   funs.cm
+   workarounds/basis.cm

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/basis-minus-sane.cm
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/basis-minus-sane.cm	2006-10-24 21:53:12 UTC (rev 4769)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/basis-minus-sane.cm	2006-10-24 23:06:01 UTC (rev 4770)
@@ -0,0 +1,10 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+group
+   library($/basis.cm) - library(sane.cm)
+is
+   $/basis.cm

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/basis.cm
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/basis.cm	2006-10-24 21:53:12 UTC (rev 4769)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/basis.cm	2006-10-24 23:06:01 UTC (rev 4770)
@@ -0,0 +1,12 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+library
+   group(basis-minus-sane.cm)
+   library(sane.cm)
+is
+   basis-minus-sane.cm
+   sane.cm

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/funs.cm
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/funs.cm	2006-10-24 21:53:12 UTC (rev 4769)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/funs.cm	2006-10-24 23:06:01 UTC (rev 4770)
@@ -0,0 +1,10 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+group is
+   mk-real-sane.fun
+   mk-word-sane.fun
+   $/basis.cm

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/mk-real-sane.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/mk-real-sane.fun	2006-10-24 21:53:12 UTC (rev 4769)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/mk-real-sane.fun	2006-10-24 23:06:01 UTC (rev 4770)
@@ -0,0 +1,11 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+functor MkRealSane (R : REAL) = struct
+   open R
+   val fromDecimal' = fromDecimal
+   fun fromDecimal d = SOME (fromDecimal' d) handle _ => NONE
+end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/mk-real-sane.fun
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/mk-word-sane.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/mk-word-sane.fun	2006-10-24 21:53:12 UTC (rev 4769)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/mk-word-sane.fun	2006-10-24 23:06:01 UTC (rev 4770)
@@ -0,0 +1,12 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+functor MkWordSane (W : WORD) = struct
+   open W
+   val fromLarge = fromLargeWord
+   val toLarge = toLargeWord
+   val toLargeX = toLargeWordX
+end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/mk-word-sane.fun
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/real.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/real.sig	2006-10-24 21:53:12 UTC (rev 4769)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/real.sig	2006-10-24 23:06:01 UTC (rev 4770)
@@ -0,0 +1,76 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+signature REAL = sig
+   type real
+
+   structure Math : MATH where type real = real
+
+   val round : real -> Int.int
+   val trunc : real -> Int.int
+   val ceil : real -> Int.int
+   val floor : real -> Int.int
+
+   val != : real * real -> bool
+   val * : real * real -> real
+   val *+ : real * real * real -> real
+   val *- : real * real * real -> real
+   val + : real * real -> real
+   val - : real * real -> real
+   val / : real * real -> real
+   val <  : real * real -> bool
+   val <= : real * real -> bool
+   val == : real * real -> bool
+   val >  : real * real -> bool
+   val >= : real * real -> bool
+   val ?= : real * real -> bool
+   val ~ : real -> real
+   val abs : real -> real
+   val checkFloat : real -> real
+   val class : real -> IEEEReal.float_class
+   val compare : real * real -> order
+   val compareReal : real * real -> IEEEReal.real_order
+   val copySign : real * real -> real
+   val fmt : StringCvt.realfmt -> real -> string
+   val fromDecimal : IEEEReal.decimal_approx -> real option
+   val fromDecimal' : IEEEReal.decimal_approx -> real
+   val fromInt : int -> real
+   val fromLarge : IEEEReal.rounding_mode -> LargeReal.real -> real
+   val fromLargeInt : LargeInt.int -> real
+   val fromManExp : {man : real, exp : int} -> real
+   val fromString : string -> real option
+   val isFinite : real -> bool
+   val isNan : real -> bool
+   val isNormal : real -> bool
+   val max : real * real -> real
+   val maxFinite : real
+   val min : real * real -> real
+   val minNormalPos : real
+   val minPos : real
+   val negInf : real
+   val nextAfter : real * real -> real
+   val posInf : real
+   val precision : int
+   val radix : int
+   val realCeil : real -> real
+   val realFloor : real -> real
+   val realMod : real -> real
+   val realRound : real -> real
+   val realTrunc : real -> real
+   val rem : real * real -> real
+   val sameSign : real * real -> bool
+   val scan : (char, 'a) StringCvt.reader -> (real, 'a) StringCvt.reader
+   val sign : real -> int
+   val signBit : real -> bool
+   val split : real -> {whole : real, frac : real}
+   val toDecimal : real -> IEEEReal.decimal_approx
+   val toInt : IEEEReal.rounding_mode -> real -> int
+   val toLarge : real -> LargeReal.real
+   val toLargeInt : IEEEReal.rounding_mode -> real -> LargeInt.int
+   val toManExp : real -> {man : real, exp : int}
+   val toString : real -> string
+   val unordered : real * real -> bool
+end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/real.sig
___________________________________________________________________
Name: svn:eol-style
   + native

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/reals.sml (from rev 4769, mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/reals.sml)
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/reals.sml	2006-10-24 21:53:12 UTC (rev 4769)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/reals.sml	2006-10-24 23:06:01 UTC (rev 4770)
@@ -0,0 +1,11 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Real = MkRealSane (Real)
+
+structure LargeReal = MkRealSane (LargeReal)
+
+structure Real64 = MkRealSane (Real64)

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/sane.cm
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/sane.cm	2006-10-24 21:53:12 UTC (rev 4769)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/sane.cm	2006-10-24 23:06:01 UTC (rev 4770)
@@ -0,0 +1,18 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+library
+   source(real.sig)
+   source(reals.sml)
+   source(word.sig)
+   source(words.sml)
+is
+   $/basis.cm
+   funs.cm
+   real.sig
+   reals.sml
+   word.sig
+   words.sml

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/word.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/word.sig	2006-10-24 21:53:12 UTC (rev 4769)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/word.sig	2006-10-24 23:06:01 UTC (rev 4770)
@@ -0,0 +1,12 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+signature WORD = sig
+   include WORD
+   val fromLarge : LargeWord.word -> word
+   val toLarge : word -> LargeWord.word
+   val toLargeX : word -> LargeWord.word
+end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/word.sig
___________________________________________________________________
Name: svn:eol-style
   + native

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/words.sml (from rev 4769, mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/words.sml)
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/words.sml	2006-10-24 21:53:12 UTC (rev 4769)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/workarounds/words.sml	2006-10-24 23:06:01 UTC (rev 4770)
@@ -0,0 +1,16 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Word      = MkWordSane (Word)
+structure LargeWord = MkWordSane (LargeWord)
+structure SysWord   = MkWordSane (SysWord)
+
+structure Word8  = MkWordSane (Word8)
+
+structure Word31 = MkWordSane (Word31)
+structure Word32 = MkWordSane (Word32)
+
+structure Word64 = MkWordSane (Word64)




More information about the MLton-commit mailing list