[MLton-commit] r4352

Matthew Fluet MLton@mlton.org
Thu, 9 Feb 2006 19:21:04 -0800


Fairly complete set of exposed primitive arithmetic.
----------------------------------------------------------------------

U   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/Makefile
U   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/arrays-and-vectors/array-slice.sig
U   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/arrays-and-vectors/sequence.fun
U   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/arrays-and-vectors/sequence.sig
U   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/arrays-and-vectors/slice.sig
U   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/build/sources.mlb
U   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/default/default-real64.sml
A   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/default/large-int.sml
A   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/default/large-real.sml
A   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/default/large-word.sml
U   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/general/general.sml
U   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int-inf0.sml
A   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int-inf1.sml
U   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int0.sml
A   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int1.sml
U   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/word0.sml
A   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/word1.sml
U   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/list/list.sml
A   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/maps/default-real64.map
U   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/prim-int.sml
U   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/prim-word.sml
U   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/prim1.sml
U   mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/test/Makefile

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

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/Makefile	2006-02-10 01:28:43 UTC (rev 4351)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/Makefile	2006-02-10 03:21:00 UTC (rev 4352)
@@ -26,6 +26,7 @@
 CTYPES_MAPS = c-types.m32.map c-types.m64.map c-types.weird.map
 DEFAULT_CHAR_MAPS = default-char8.map
 DEFAULT_INT_MAPS = default-int32.map default-int64.map default-intinf.map 
+DEFAULT_REAL_MAPS = default-real64.map
 DEFAULT_WORD_MAPS = default-word32.map default-word64.map
 
 .PHONY: type-check
@@ -36,8 +37,9 @@
 	for ctypes in $(CTYPES_MAPS); do \
 	for defchar in $(DEFAULT_CHAR_MAPS); do \
 	for defint in $(DEFAULT_INT_MAPS); do \
+	for defreal in $(DEFAULT_REAL_MAPS); do \
 	for defword in $(DEFAULT_WORD_MAPS); do \
-	echo "Type checking: $$objptrrep $$header $$seqindex $$ctypes $$defchar $$defint $$defword"; \
+	echo "Type checking: $$objptrrep $$header $$seqindex $$ctypes $$defchar $$defint $$defreal $$defword"; \
 	$(MLTON) -disable-ann deadCode -stop tc -show-types true \
 		-mlb-path-map "maps/$$objptrrep" \
 		-mlb-path-map "maps/$$header" \
@@ -45,6 +47,7 @@
 		-mlb-path-map "maps/$$ctypes" \
 		-mlb-path-map "maps/$$defchar" \
 		-mlb-path-map "maps/$$defint" \
+		-mlb-path-map "maps/$$defreal" \
 		-mlb-path-map "maps/$$defword" \
 		build/sources.mlb; \
-	done; done; done; done; done; done; done
+	done; done; done; done; done; done; done; done

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/arrays-and-vectors/array-slice.sig
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/arrays-and-vectors/array-slice.sig	2006-02-10 01:28:43 UTC (rev 4351)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/arrays-and-vectors/array-slice.sig	2006-02-10 03:21:00 UTC (rev 4352)
@@ -1,3 +1,8 @@
+structure Array =
+   struct
+      type 'a array = 'a array
+   end
+
 signature ARRAY_SLICE_GLOBAL =
    sig
    end

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/arrays-and-vectors/sequence.fun
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/arrays-and-vectors/sequence.fun	2006-02-10 01:28:43 UTC (rev 4351)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/arrays-and-vectors/sequence.fun	2006-02-10 03:21:00 UTC (rev 4352)
@@ -21,7 +21,7 @@
 
       structure Array = Primitive.Array
 
-      open Primitive.Int
+      open Int
 
       val maxLen = Array.maxLen
 
@@ -104,13 +104,13 @@
             fun unsafeSub (T {seq, start, ...}, i) =
                S.sub (seq, start +? i)
             fun sub (sl as T {len, ...}, i) =
-               if Primitive.safe andalso Primitive.Int.geu (i, len)
+               if Primitive.Controls.safe andalso Int.geu (i, len)
                   then raise Subscript
                else unsafeSub (sl, i)
             fun unsafeUpdate' update (T {seq, start, ...}, i, x) =
                update (seq, start +? i, x)
             fun update' update (sl as T {len, ...}, i, x) =
-               if Primitive.safe andalso Primitive.Int.geu (i, len)
+               if Primitive.safe andalso Int.geu (i, len)
                   then raise Subscript
                else unsafeUpdate' update (sl, i, x)
             fun full (seq: 'a sequence) : 'a slice = 
@@ -373,7 +373,7 @@
                in split (sl, loop (start +? len -? 1))
                end
             fun splitAt (T {seq, start, len}, i) =
-               if Primitive.safe andalso Primitive.Int.gtu (i, len)
+               if Primitive.safe andalso Int.gtu (i, len)
                   then raise Subscript
                else (unsafeSlice (seq, start, SOME i),
                      unsafeSlice (seq, start +? i, SOME (len -? i)))

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/arrays-and-vectors/sequence.sig
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/arrays-and-vectors/sequence.sig	2006-02-10 01:28:43 UTC (rev 4351)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/arrays-and-vectors/sequence.sig	2006-02-10 03:21:00 UTC (rev 4352)
@@ -20,7 +20,8 @@
       val length: 'a sequence -> int
       val sub: 'a sequence * int -> 'a elt
       val unsafeSub: 'a sequence * int -> 'a elt
-      (* ('a sequence * int * 'a elt -> unit  should be an unsafe update. 
+      (* update':
+       * ('a sequence * int * 'a elt -> unit)  should be an unsafe update. 
        *)
       val update': ('a sequence * int * 'a elt -> unit) ->
                    ('a sequence * int * 'a elt) -> unit
@@ -53,7 +54,7 @@
       (* Extra *)
       val append: 'a sequence * 'a sequence -> 'a sequence
       (* createi,create:
-       * (int * (int -> 'b elt) -> 'c  should be a tabulate function.
+       * (int * (int -> 'b elt) -> 'c)  should be a tabulate function.
        *)
       val createi: (int * (int -> 'b elt) -> 'c) ->
                    (int * 'a elt -> 'b elt) -> 'a sequence -> 'c

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/arrays-and-vectors/slice.sig
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/arrays-and-vectors/slice.sig	2006-02-10 01:28:43 UTC (rev 4351)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/arrays-and-vectors/slice.sig	2006-02-10 03:21:00 UTC (rev 4352)
@@ -14,7 +14,8 @@
       val length: 'a slice -> int
       val sub: 'a slice * int -> 'a elt
       val unsafeSub: 'a slice * int -> 'a elt
-      (* ('a sequence * int * 'a elt -> unit  should be an unsafe update. 
+      (* update',unsafeUpdate':
+       * ('a sequence * int * 'a elt -> unit)  should be an unsafe update. 
        *)
       val update': ('a sequence * int * 'a elt -> unit) ->
                    ('a slice * int * 'a elt) -> unit
@@ -62,7 +63,7 @@
       val position: ('a elt * 'a elt -> bool) -> 
                     'a sequence -> 'a slice -> 'a slice * 'a slice
       (* span:
-       * 'a sequence * 'a sequence -> bool should be polymorphic equality
+       * ('a sequence * 'a sequence -> bool)  should be polymorphic equality
        *)
       val span: ('a sequence * 'a sequence -> bool) -> 'a slice * 'a slice -> 'a slice
       val translate: ('a elt -> 'a sequence) -> 'a slice -> 'a sequence
@@ -72,7 +73,7 @@
       (* Extra *)
       val append: 'a slice * 'a slice -> 'a sequence
       (* createi,create:
-       * (int * (int -> 'b elt) -> 'c  should be a tabulate function.
+       * (int * (int -> 'b elt) -> 'c)  should be a tabulate function.
        *)
       val createi: (int * (int -> 'b elt) -> 'c) ->
                    (int * 'a elt -> 'b elt) -> 'a slice -> 'c

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/build/sources.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/build/sources.mlb	2006-02-10 01:28:43 UTC (rev 4351)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/build/sources.mlb	2006-02-10 03:21:00 UTC (rev 4352)
@@ -29,52 +29,60 @@
    local ../config/bind-for-config0.sml in ann "forceUsed" in
       ../config/default/$(DEFAULT_CHAR)
       ../config/default/$(DEFAULT_INT)
+      ../config/default/$(DEFAULT_REAL)
       ../config/default/$(DEFAULT_WORD)
+      ../config/default/large-int.sml
+      ../config/default/large-real.sml
+      ../config/default/large-word.sml
    end end
+   ../integer/int1.sml
+   ../integer/word1.sml
    local ../config/bind-for-config0.sml in ann "forceUsed" in
+      ../config/default/$(DEFAULT_CHAR)
+      ../config/default/$(DEFAULT_INT)
+      ../config/default/$(DEFAULT_REAL)
+      ../config/default/$(DEFAULT_WORD)
+      ../config/default/large-int.sml
+      ../config/default/large-real.sml
+      ../config/default/large-word.sml
+   end end
+   local ../config/bind-for-config0.sml in ann "forceUsed" in
       ../config/objptr/$(OBJPTR_REP)
       ../config/header/$(HEADER_WORD)
       ../config/seq/$(SEQ_INDEX)
       ../config/c/misc/$(CTYPES)
    end end
-
+   ../general/general.sig
+   ../general/general.sml
+   ../general/option.sig
+   ../general/option.sml
+   ../list/list.sig
+   ../list/list.sml
+   ../list/list-pair.sig
+   ../list/list-pair.sml
+   ../arrays-and-vectors/slice.sig
+   ../arrays-and-vectors/sequence.sig
 (*
-   local
-      ../../primitive/primitive.mlb
-      (* Common basis implementation. *)
-      ../../top-level/infixes.sml
-      ../../misc/basic.sml
-      ../../misc/dynamic-wind.sig
-      ../../misc/dynamic-wind.sml
-      ../../general/general.sig
-      ../../general/general.sml
-      ../../misc/util.sml
-      ../../general/option.sig
-      ../../general/option.sml
-      ../../list/list.sig
-      ../../list/list.sml
-      ../../list/list-pair.sig
-      ../../list/list-pair.sml
-      ../../arrays-and-vectors/slice.sig
-      ../../arrays-and-vectors/sequence.sig
-      ../../arrays-and-vectors/sequence.fun
-      ../../arrays-and-vectors/vector-slice.sig
-      ../../arrays-and-vectors/vector.sig
-      ../../arrays-and-vectors/vector.sml
-      ../../arrays-and-vectors/array-slice.sig
-      ../../arrays-and-vectors/array.sig
-      ../../arrays-and-vectors/array.sml
-      ../../arrays-and-vectors/array2.sig
-      ../../arrays-and-vectors/array2.sml
-      ../../arrays-and-vectors/mono-vector-slice.sig
-      ../../arrays-and-vectors/mono-vector.sig
-      ../../arrays-and-vectors/mono-vector.fun
-      ../../arrays-and-vectors/mono-array-slice.sig
-      ../../arrays-and-vectors/mono-array.sig
-      ../../arrays-and-vectors/mono-array.fun
-      ../../arrays-and-vectors/mono-array2.sig
-      ../../arrays-and-vectors/mono-array2.fun
-      ../../arrays-and-vectors/mono.sml
+      ../arrays-and-vectors/sequence.fun
+*)
+      ../arrays-and-vectors/vector-slice.sig
+      ../arrays-and-vectors/vector.sig
+(*
+      ../arrays-and-vectors/vector.sml
+      ../arrays-and-vectors/array-slice.sig
+      ../arrays-and-vectors/array.sig
+      ../arrays-and-vectors/array.sml
+      ../arrays-and-vectors/array2.sig
+      ../arrays-and-vectors/array2.sml
+      ../arrays-and-vectors/mono-vector-slice.sig
+      ../arrays-and-vectors/mono-vector.sig
+      ../arrays-and-vectors/mono-vector.fun
+      ../arrays-and-vectors/mono-array-slice.sig
+      ../arrays-and-vectors/mono-array.sig
+      ../arrays-and-vectors/mono-array.fun
+      ../arrays-and-vectors/mono-array2.sig
+      ../arrays-and-vectors/mono-array2.fun
+      ../arrays-and-vectors/mono.sml
       ../../text/string0.sml
       ../../text/char0.sml
       ../../misc/reader.sig

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/default/default-real64.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/default/default-real64.sml	2006-02-10 01:28:43 UTC (rev 4351)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/default/default-real64.sml	2006-02-10 03:21:00 UTC (rev 4352)
@@ -7,3 +7,7 @@
 
 structure Real = Real64
 type real = Real.real
+
+functor Real_ChooseRealN (A: CHOOSE_REALN_ARG) :
+   sig val f : Real.real A.t end =
+   ChooseRealN_Real64 (A)

Added: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/default/large-int.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/default/large-int.sml	2006-02-10 01:28:43 UTC (rev 4351)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/default/large-int.sml	2006-02-10 03:21:00 UTC (rev 4352)
@@ -0,0 +1,12 @@
+(* Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
+ *    Jagannathan, and Stephen Weeks.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure LargeInt = IntInf
+
+functor LargeInt_ChooseInt (A: CHOOSE_INT_ARG) :
+   sig val f : LargeInt.int A.t end =
+   ChooseInt_IntInf (A)

Added: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/default/large-real.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/default/large-real.sml	2006-02-10 01:28:43 UTC (rev 4351)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/default/large-real.sml	2006-02-10 03:21:00 UTC (rev 4352)
@@ -0,0 +1,12 @@
+(* Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
+ *    Jagannathan, and Stephen Weeks.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure LargeReal = Real64
+
+functor LargeReal_ChooseRealN (A: CHOOSE_REALN_ARG) :
+   sig val f : Real.real A.t end =
+   ChooseRealN_Real64 (A)

Added: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/default/large-word.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/default/large-word.sml	2006-02-10 01:28:43 UTC (rev 4351)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/default/large-word.sml	2006-02-10 03:21:00 UTC (rev 4352)
@@ -0,0 +1,12 @@
+(* Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
+ *    Jagannathan, and Stephen Weeks.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure LargeWord = Word64
+
+functor LargeWord_ChooseWordN (A: CHOOSE_WORDN_ARG) :
+   sig val f : LargeWord.word A.t end =
+   ChooseWordN_Word64 (A)

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/general/general.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/general/general.sml	2006-02-10 01:28:43 UTC (rev 4351)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/general/general.sml	2006-02-10 03:21:00 UTC (rev 4352)
@@ -8,7 +8,7 @@
 
 structure General: GENERAL_EXTRA =
    struct
-      type unit = unit
+      type unit = Primitive.Unit.unit
 
       type exn = exn
       exception Bind = Bind
@@ -16,13 +16,13 @@
       exception Chr
       exception Div
       exception Domain
-      exception Fail = Fail
+      exception Fail of string
       exception Overflow = Overflow
       exception Size = Size
       exception Span
       exception Subscript
 
-      datatype order = LESS | EQUAL | GREATER
+      datatype order = datatype Primitive.Order.order
 
       val ! = Primitive.Ref.deref
       val op := = Primitive.Ref.assign
@@ -54,4 +54,3 @@
 
 structure GeneralGlobal: GENERAL_GLOBAL = General
 open GeneralGlobal
-

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int-inf0.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int-inf0.sml	2006-02-10 01:28:43 UTC (rev 4351)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int-inf0.sml	2006-02-10 03:21:00 UTC (rev 4352)
@@ -71,10 +71,10 @@
       val fromWord64: Primitive.Word64.word -> int
 
       (* Sign extend. *)
-      val fromWordX8: Primitive.Word8.word -> int
-      val fromWordX16: Primitive.Word16.word -> int
-      val fromWordX32: Primitive.Word32.word -> int
-      val fromWordX64: Primitive.Word64.word -> int
+      val fromWord8X: Primitive.Word8.word -> int
+      val fromWord16X: Primitive.Word16.word -> int
+      val fromWord32X: Primitive.Word32.word -> int
+      val fromWord64X: Primitive.Word64.word -> int
 
       (* Overflow checking. *)
       val toInt8: int -> Primitive.Int8.int
@@ -90,10 +90,10 @@
       val toWord64: int -> Primitive.Word64.word
 
       (* Lowbits. *)
-      val toWordX8: int -> Primitive.Word8.word
-      val toWordX16: int -> Primitive.Word16.word
-      val toWordX32: int -> Primitive.Word32.word
-      val toWordX64: int -> Primitive.Word64.word
+      val toWord8X: int -> Primitive.Word8.word
+      val toWord16X: int -> Primitive.Word16.word
+      val toWord32X: int -> Primitive.Word32.word
+      val toWord64X: int -> Primitive.Word64.word
    end
 
 structure Primitive = struct
@@ -136,10 +136,10 @@
                           structure S =
                              ObjptrInt_ChooseIntN
                              (type 'a t = ObjptrWord.word -> 'a
-                              val fInt8 = ObjptrWord.toIntX8
-                              val fInt16 = ObjptrWord.toIntX16
-                              val fInt32 = ObjptrWord.toIntX32
-                              val fInt64 = ObjptrWord.toIntX64)
+                              val fInt8 = ObjptrWord.toInt8X
+                              val fInt16 = ObjptrWord.toInt16X
+                              val fInt32 = ObjptrWord.toInt32X
+                              val fInt64 = ObjptrWord.toInt64X)
                        in
                           val toObjptrIntX = S.f
                        end
@@ -261,7 +261,7 @@
             if Int8.>= (i, 0)
                then fromWordAux8 (false, Word8.fromInt8 i)
                else fromWordAux8 (true, Word8.~ (Word8.fromInt8 i))
-         fun fromWordX8 w = fromInt8 (Word8.toIntX8 w)
+         fun fromWord8X w = fromInt8 (Word8.toInt8X w)
 
          val fromWordAux16 =
             make {toMPLimb = MPLimb.fromWord16,
@@ -275,7 +275,7 @@
             if Int16.>= (i, 0)
                then fromWordAux16 (false, Word16.fromInt16 i)
                else fromWordAux16 (true, Word16.~ (Word16.fromInt16 i))
-         fun fromWordX16 w = fromInt16 (Word16.toIntX16 w)
+         fun fromWord16X w = fromInt16 (Word16.toInt16X w)
 
          val fromWordAux32 =
             make {toMPLimb = MPLimb.fromWord32,
@@ -289,7 +289,7 @@
             if Int32.>= (i, 0)
                then fromWordAux32 (false, Word32.fromInt32 i)
                else fromWordAux32 (true, Word32.~ (Word32.fromInt32 i))
-         fun fromWordX32 w = fromInt32 (Word32.toIntX32 w)
+         fun fromWord32X w = fromInt32 (Word32.toInt32X w)
 
          val fromWordAux64 =
             make {toMPLimb = MPLimb.fromWord64,
@@ -303,7 +303,7 @@
             if Int64.>= (i, 0)
                then fromWordAux64 (false, Word64.fromInt64 i)
                else fromWordAux64 (true, Word64.~ (Word64.fromInt64 i))
-         fun fromWordX64 w = fromInt64 (Word64.toIntX64 w)
+         fun fromWord64X w = fromInt64 (Word64.toInt64X w)
 
          fun fromIntInf i = i
       end
@@ -385,20 +385,20 @@
                            zero = Word8.zero,
                            lshift = Word8.<<,
                            orb = Word8.orb}}
-         fun toWordX8 i =
+         fun toWord8X i =
             case toWordAux8 i of
-               Small w => ObjptrWord.toWordX8 w
+               Small w => ObjptrWord.toWord8X w
              | Big (isneg, _, ans) => if isneg then Word8.~ ans else ans
-         fun toWord8 i = toWordX8 i
+         fun toWord8 i = toWord8X i
          fun toInt8 i =
             case toWordAux8 i of
-               Small w => ObjptrWord.toIntX8 w
+               Small w => ObjptrWord.toInt8X w
              | Big (isneg, extra, ans) =>
                   if extra
                      then raise Overflow
                   else if isneg
                      then let
-                             val ans = Word8.toIntX8 (Word8.~ ans)
+                             val ans = Word8.toInt8X (Word8.~ ans)
                           in
                              if Int8.>= (ans, 0)
                                 then raise Overflow
@@ -413,20 +413,20 @@
                            zero = Word16.zero,
                            lshift = Word16.<<,
                            orb = Word16.orb}}
-         fun toWordX16 i =
+         fun toWord16X i =
             case toWordAux16 i of
-               Small w => ObjptrWord.toWordX16 w
+               Small w => ObjptrWord.toWord16X w
              | Big (isneg, _, ans) => if isneg then Word16.~ ans else ans
-         fun toWord16 i = toWordX16 i
+         fun toWord16 i = toWord16X i
          fun toInt16 i =
             case toWordAux16 i of
-               Small w => ObjptrWord.toIntX16 w
+               Small w => ObjptrWord.toInt16X w
              | Big (isneg, extra, ans) =>
                   if extra
                      then raise Overflow
                   else if isneg
                      then let
-                             val ans = Word16.toIntX16 (Word16.~ ans)
+                             val ans = Word16.toInt16X (Word16.~ ans)
                           in
                              if Int16.>= (ans, 0)
                                 then raise Overflow
@@ -441,20 +441,20 @@
                            zero = Word32.zero,
                            lshift = Word32.<<,
                            orb = Word32.orb}}
-         fun toWordX32 i =
+         fun toWord32X i =
             case toWordAux32 i of
-               Small w => ObjptrWord.toWordX32 w
+               Small w => ObjptrWord.toWord32X w
              | Big (isneg, _, ans) => if isneg then Word32.~ ans else ans
-         fun toWord32 i = toWordX32 i
+         fun toWord32 i = toWord32X i
          fun toInt32 i =
             case toWordAux32 i of
-               Small w => ObjptrWord.toIntX32 w
+               Small w => ObjptrWord.toInt32X w
              | Big (isneg, extra, ans) =>
                   if extra
                      then raise Overflow
                   else if isneg
                      then let
-                             val ans = Word32.toIntX32 (Word32.~ ans)
+                             val ans = Word32.toInt32X (Word32.~ ans)
                           in
                              if Int32.>= (ans, 0)
                                 then raise Overflow
@@ -469,20 +469,20 @@
                            zero = Word64.zero,
                            lshift = Word64.<<,
                            orb = Word64.orb}}
-         fun toWordX64 i =
+         fun toWord64X i =
             case toWordAux64 i of
-               Small w => ObjptrWord.toWordX64 w
+               Small w => ObjptrWord.toWord64X w
              | Big (isneg, _, ans) => if isneg then Word64.~ ans else ans
-         fun toWord64 i = toWordX64 i
+         fun toWord64 i = toWord64X i
          fun toInt64 i =
             case toWordAux64 i of
-               Small w => ObjptrWord.toIntX64 w
+               Small w => ObjptrWord.toInt64X w
              | Big (isneg, extra, ans) =>
                   if extra
                      then raise Overflow
                   else if isneg
                      then let
-                             val ans = Word64.toIntX64 (Word64.~ ans)
+                             val ans = Word64.toInt64X (Word64.~ ans)
                           in
                              if Int64.>= (ans, 0)
                                 then raise Overflow
@@ -890,28 +890,28 @@
       open Word8
       val fromIntInf = IntInf.toWord8
       val toIntInf = IntInf.fromWord8
-      val toIntInfX = IntInf.fromWordX8
+      val toIntInfX = IntInf.fromWord8X
    end
 structure Word16 =
    struct
       open Word16
       val fromIntInf = IntInf.toWord16
       val toIntInf = IntInf.fromWord16
-      val toIntInfX = IntInf.fromWordX16
+      val toIntInfX = IntInf.fromWord16X
    end
 structure Word32 =
    struct
       open Word32
       val fromIntInf = IntInf.toWord32
       val toIntInf = IntInf.fromWord32
-      val toIntInfX = IntInf.fromWordX32
+      val toIntInfX = IntInf.fromWord32X
    end
 structure Word64 =
    struct
       open Word64
       val fromIntInf = IntInf.toWord64
       val toIntInf = IntInf.fromWord64
-      val toIntInfX = IntInf.fromWordX64
+      val toIntInfX = IntInf.fromWord64X
    end
 
 end

Copied: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int-inf1.sml (from rev 4350, mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int-inf0.sml)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int-inf0.sml	2006-02-10 00:42:03 UTC (rev 4350)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int-inf1.sml	2006-02-10 03:21:00 UTC (rev 4352)
@@ -0,0 +1,78 @@
+(* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
+ *    Jagannathan, and Stephen Weeks.
+ * Copyright (C) 1997-2000 NEC Research Institute.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+signature INT_INF1 =
+   sig
+      include INT_INF0
+
+      val fromInt: Int.int -> int
+      val fromLarge: LargeInt.int -> int
+      val toInt: int -> Int.int
+      val toLarge: int -> LargeInt.int
+   end
+
+structure Primitive = struct
+
+open Primitive
+
+structure IntInf : INT_INF1 =
+   struct
+      structure I = Primitive.IntInf
+
+      local
+         structure S =
+            Int_ChooseInt
+            (type 'a t = 'a -> int
+             val fInt8 = I.fromInt8
+             val fInt16 = I.fromInt16
+             val fInt32 = I.fromInt32
+             val fInt64 = I.fromInt64
+             val fIntInf = I.fromIntInf)
+      in
+         val fromInt = S.f
+      end
+      local
+         structure S =
+            LargeInt_ChooseInt
+            (type 'a t = 'a -> int
+             val fInt8 = I.fromInt8
+             val fInt16 = I.fromInt16
+             val fInt32 = I.fromInt32
+             val fInt64 = I.fromInt64
+             val fIntInf = I.fromIntInf)
+      in
+         val fromLarge = S.f
+      end
+      local
+         structure S =
+            Int_ChooseInt
+            (type 'a t = int -> 'a
+             val fInt8 = I.toInt8
+             val fInt16 = I.toInt16
+             val fInt32 = I.toInt32
+             val fInt64 = I.toInt64
+             val fIntInf = I.toIntInf)
+      in
+         val toInt = S.f
+      end
+      local
+         structure S =
+            LargeInt_ChooseInt
+            (type 'a t = int -> 'a
+             val fInt8 = I.toInt8
+             val fInt16 = I.toInt16
+             val fInt32 = I.toInt32
+             val fInt64 = I.toInt64
+             val fIntInf = I.toIntInf)
+      in
+         val toLarge = S.f
+      end
+
+   end
+
+end

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int0.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int0.sml	2006-02-10 01:28:43 UTC (rev 4351)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int0.sml	2006-02-10 03:21:00 UTC (rev 4352)
@@ -26,10 +26,10 @@
       val rem: int * int -> int
 
       val << : int * Primitive.Word32.word -> int
-      val >> : int * Primitive.Word32.word -> int
       val rol : int * Primitive.Word32.word -> int
       val ror : int * Primitive.Word32.word -> int
       val ~>> : int * Primitive.Word32.word -> int
+      val >> : int * Primitive.Word32.word -> int
 
       val sign': int -> Primitive.Int32.int
       val sameSign: int * int -> bool
@@ -47,10 +47,10 @@
       val fromWord64: Primitive.Word64.word -> int
 
       (* Overflow checking, signed interp. *)
-      val fromWordX8: Primitive.Word8.word -> int
-      val fromWordX16: Primitive.Word16.word -> int
-      val fromWordX32: Primitive.Word32.word -> int
-      val fromWordX64: Primitive.Word64.word -> int
+      val fromWord8X: Primitive.Word8.word -> int
+      val fromWord16X: Primitive.Word16.word -> int
+      val fromWord32X: Primitive.Word32.word -> int
+      val fromWord64X: Primitive.Word64.word -> int
 
       (* Overflow checking. *)
       val toInt8: int -> Primitive.Int8.int
@@ -65,10 +65,10 @@
       val toWord64: int -> Primitive.Word64.word
 
       (* Lowbits or sign extend. *)
-      val toWordX8: int -> Primitive.Word8.word
-      val toWordX16: int -> Primitive.Word16.word
-      val toWordX32: int -> Primitive.Word32.word
-      val toWordX64: int -> Primitive.Word64.word
+      val toWord8X: int -> Primitive.Word8.word
+      val toWord16X: int -> Primitive.Word16.word
+      val toWord32X: int -> Primitive.Word32.word
+      val toWord64X: int -> Primitive.Word64.word
    end
 
 functor MkInt0 (I: PRIM_INTEGER): INTEGER0 =
@@ -268,35 +268,35 @@
                 toWordXUnsafe)
             end
       in
-         val (fromWord8, fromWordX8, toWord8, toWordX8) =
+         val (fromWord8, fromWord8X, toWord8, toWord8X) =
             make {fromWordUnsafe = fromWord8Unsafe, 
-                  fromWordXUnsafe = fromWordX8Unsafe,
+                  fromWordXUnsafe = fromWord8XUnsafe,
                   toWordUnsafe = toWord8Unsafe,
-                  toWordXUnsafe =toWordX8Unsafe,
+                  toWordXUnsafe =toWord8XUnsafe,
                   other = {wordSize' = Primitive.Word8.wordSize',
                            lt = Primitive.Word8.<,
                            gt = Primitive.Word8.>}}
-         val (fromWord16, fromWordX16, toWord16, toWordX16) =
+         val (fromWord16, fromWord16X, toWord16, toWord16X) =
             make {fromWordUnsafe = fromWord16Unsafe, 
-                  fromWordXUnsafe = fromWordX16Unsafe,
+                  fromWordXUnsafe = fromWord16XUnsafe,
                   toWordUnsafe = toWord16Unsafe,
-                  toWordXUnsafe =toWordX16Unsafe,
+                  toWordXUnsafe =toWord16XUnsafe,
                   other = {wordSize' = Primitive.Word16.wordSize',
                            lt = Primitive.Word16.<,
                            gt = Primitive.Word16.>}}
-         val (fromWord32, fromWordX32, toWord32, toWordX32) =
+         val (fromWord32, fromWord32X, toWord32, toWord32X) =
             make {fromWordUnsafe = fromWord32Unsafe, 
-                  fromWordXUnsafe = fromWordX32Unsafe,
+                  fromWordXUnsafe = fromWord32XUnsafe,
                   toWordUnsafe = toWord32Unsafe,
-                  toWordXUnsafe =toWordX32Unsafe,
+                  toWordXUnsafe =toWord32XUnsafe,
                   other = {wordSize' = Primitive.Word32.wordSize',
                            lt = Primitive.Word32.<,
                            gt = Primitive.Word32.>}}
-         val (fromWord64, fromWordX64, toWord64, toWordX64) =
+         val (fromWord64, fromWord64X, toWord64, toWord64X) =
             make {fromWordUnsafe = fromWord64Unsafe, 
-                  fromWordXUnsafe = fromWordX64Unsafe,
+                  fromWordXUnsafe = fromWord64XUnsafe,
                   toWordUnsafe = toWord64Unsafe,
-                  toWordXUnsafe =toWordX64Unsafe,
+                  toWordXUnsafe =toWord64XUnsafe,
                   other = {wordSize' = Primitive.Word64.wordSize',
                            lt = Primitive.Word64.<,
                            gt = Primitive.Word64.>}}

Copied: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int1.sml (from rev 4350, mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int0.sml)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int0.sml	2006-02-10 00:42:03 UTC (rev 4350)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int1.sml	2006-02-10 03:21:00 UTC (rev 4352)
@@ -0,0 +1,133 @@
+(* Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
+ *    Jagannathan, and Stephen Weeks.
+ * Copyright (C) 1997-2000 NEC Research Institute.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+signature INT_FROM_TO_ARG =
+   sig
+      type int
+      (* Overflow checking, signed interp. *)
+      val fromInt8: Primitive.Int8.int -> int
+      val fromInt16: Primitive.Int16.int -> int
+      val fromInt32: Primitive.Int32.int -> int
+      val fromInt64: Primitive.Int64.int -> int
+      val fromIntInf: Primitive.IntInf.int -> int
+      (* Overflow checking. *)
+      val toInt8: int -> Primitive.Int8.int
+      val toInt16: int -> Primitive.Int16.int
+      val toInt32: int -> Primitive.Int32.int
+      val toInt64: int -> Primitive.Int64.int
+      val toIntInf: int -> Primitive.IntInf.int
+   end
+
+signature INT_FROM_TO_RES =
+   sig
+      type int
+      val fromInt: Int.int -> int
+      val fromLarge: LargeInt.int -> int
+      val toInt: int -> Int.int
+      val toLarge: int -> LargeInt.int
+   end
+
+functor IntFromTo(I: INT_FROM_TO_ARG): INT_FROM_TO_RES where type int = I.int =
+   struct
+      open I
+         
+      local
+         structure S =
+            Int_ChooseInt
+            (type 'a t = 'a -> int
+             val fInt8 = I.fromInt8
+             val fInt16 = I.fromInt16
+             val fInt32 = I.fromInt32
+             val fInt64 = I.fromInt64
+             val fIntInf = I.fromIntInf)
+      in
+         val fromInt = S.f
+      end
+      local
+         structure S =
+            LargeInt_ChooseInt
+            (type 'a t = 'a -> int
+             val fInt8 = I.fromInt8
+             val fInt16 = I.fromInt16
+             val fInt32 = I.fromInt32
+             val fInt64 = I.fromInt64
+             val fIntInf = I.fromIntInf)
+      in
+         val fromLarge = S.f
+      end
+      local
+         structure S =
+            Int_ChooseInt
+            (type 'a t = int -> 'a
+             val fInt8 = I.toInt8
+             val fInt16 = I.toInt16
+             val fInt32 = I.toInt32
+             val fInt64 = I.toInt64
+             val fIntInf = I.toIntInf)
+      in
+         val toInt = S.f
+      end
+      local
+         structure S =
+            LargeInt_ChooseInt
+            (type 'a t = int -> 'a
+             val fInt8 = I.toInt8
+             val fInt16 = I.toInt16
+             val fInt32 = I.toInt32
+             val fInt64 = I.toInt64
+             val fIntInf = I.toIntInf)
+      in
+         val toLarge = S.f
+      end
+
+   end
+
+structure Primitive = struct
+open Primitive
+
+structure Int8 = struct 
+                    open Int8
+                    local 
+                       structure S = IntFromTo (Primitive.Int8)
+                    in
+                       open S
+                    end
+                 end
+structure Int16 = struct 
+                     open Int16
+                     local 
+                        structure S = IntFromTo (Primitive.Int16)
+                     in
+                        open S
+                     end
+                  end
+structure Int32 = struct 
+                     open Int32
+                     local 
+                        structure S = IntFromTo (Primitive.Int32)
+                     in
+                        open S
+                     end
+                  end
+structure Int64 = struct 
+                     open Int64
+                     local 
+                        structure S = IntFromTo (Primitive.Int64)
+                     in
+                        open S
+                     end
+                  end
+structure IntInf = struct 
+                      open IntInf
+                      local 
+                         structure S = IntFromTo (Primitive.IntInf)
+                      in
+                         open S
+                      end
+                   end
+end

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/word0.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/word0.sml	2006-02-10 01:28:43 UTC (rev 4351)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/word0.sml	2006-02-10 03:21:00 UTC (rev 4352)
@@ -31,10 +31,10 @@
       val fromInt64: Primitive.Int64.int -> word
 
       (* Lowbits or zero extend. *)
-      val fromIntZ8: Primitive.Int8.int -> word
-      val fromIntZ16: Primitive.Int16.int -> word
-      val fromIntZ32: Primitive.Int32.int -> word
-      val fromIntZ64: Primitive.Int64.int -> word
+      val fromInt8Z: Primitive.Int8.int -> word
+      val fromInt16Z: Primitive.Int16.int -> word
+      val fromInt32Z: Primitive.Int32.int -> word
+      val fromInt64Z: Primitive.Int64.int -> word
 
       (* Lowbits or zero extend. *)
       val fromWord8: Primitive.Word8.word -> word
@@ -43,10 +43,10 @@
       val fromWord64: Primitive.Word64.word -> word
          
       (* Lowbits or sign extend. *)
-      val fromWordX8: Primitive.Word8.word -> word
-      val fromWordX16: Primitive.Word16.word -> word
-      val fromWordX32: Primitive.Word32.word -> word
-      val fromWordX64: Primitive.Word64.word -> word
+      val fromWord8X: Primitive.Word8.word -> word
+      val fromWord16X: Primitive.Word16.word -> word
+      val fromWord32X: Primitive.Word32.word -> word
+      val fromWord64X: Primitive.Word64.word -> word
 
       (* Overflow checking, unsigned interp. *)
       val toInt8: word -> Primitive.Int8.int
@@ -55,10 +55,10 @@
       val toInt64: word -> Primitive.Int64.int
 
       (* Overflow checking, signed interp. *)
-      val toIntX8: word -> Primitive.Int8.int
-      val toIntX16: word -> Primitive.Int16.int
-      val toIntX32: word -> Primitive.Int32.int
-      val toIntX64: word -> Primitive.Int64.int   
+      val toInt8X: word -> Primitive.Int8.int
+      val toInt16X: word -> Primitive.Int16.int
+      val toInt32X: word -> Primitive.Int32.int
+      val toInt64X: word -> Primitive.Int64.int   
 
       (* Lowbits or zero extend. *)
       val toWord8: word -> Primitive.Word8.word
@@ -67,10 +67,10 @@
       val toWord64: word -> Primitive.Word64.word
 
       (* Lowbits or sign extend. *)
-      val toWordX8: word -> Primitive.Word8.word
-      val toWordX16: word -> Primitive.Word16.word
-      val toWordX32: word -> Primitive.Word32.word
-      val toWordX64: word -> Primitive.Word64.word
+      val toWord8X: word -> Primitive.Word8.word
+      val toWord16X: word -> Primitive.Word16.word
+      val toWord32X: word -> Primitive.Word32.word
+      val toWord64X: word -> Primitive.Word64.word
    end
 
 functor MkWord0 (W: PRIM_WORD): WORD0 =
@@ -152,48 +152,48 @@
                 toIntX)
             end
       in
-         val (fromInt8, fromIntZ8, toInt8, toIntX8) = 
+         val (fromInt8, fromInt8Z, toInt8, toInt8X) = 
             make {fromIntUnsafe = fromInt8Unsafe,
-                  fromIntZUnsafe = fromIntZ8Unsafe,
+                  fromIntZUnsafe = fromInt8ZUnsafe,
                   toIntUnsafe = toInt8Unsafe,
-                  toIntXUnsafe = toIntX8Unsafe,
+                  toIntXUnsafe = toInt8XUnsafe,
                   other = {precision' = Primitive.Int8.precision',
                            maxInt' = Primitive.Int8.maxInt',
                            minInt' = Primitive.Int8.minInt'}}
-         val (fromInt16, fromIntZ16, toInt16, toIntX16) = 
+         val (fromInt16, fromInt16Z, toInt16, toInt16X) = 
             make {fromIntUnsafe = fromInt16Unsafe,
-                  fromIntZUnsafe = fromIntZ16Unsafe,
+                  fromIntZUnsafe = fromInt16ZUnsafe,
                   toIntUnsafe = toInt16Unsafe,
-                  toIntXUnsafe = toIntX16Unsafe,
+                  toIntXUnsafe = toInt16XUnsafe,
                   other = {precision' = Primitive.Int16.precision',
                            maxInt' = Primitive.Int16.maxInt',
                            minInt' = Primitive.Int16.minInt'}}
-         val (fromInt32, fromIntZ32, toInt32, toIntX32) = 
+         val (fromInt32, fromInt32Z, toInt32, toInt32X) = 
             make {fromIntUnsafe = fromInt32Unsafe,
-                  fromIntZUnsafe = fromIntZ32Unsafe,
+                  fromIntZUnsafe = fromInt32ZUnsafe,
                   toIntUnsafe = toInt32Unsafe,
-                  toIntXUnsafe = toIntX32Unsafe,
+                  toIntXUnsafe = toInt32XUnsafe,
                   other = {precision' = Primitive.Int32.precision',
                            maxInt' = Primitive.Int32.maxInt',
                            minInt' = Primitive.Int32.minInt'}}
-         val (fromInt64, fromIntZ64, toInt64, toIntX64) = 
+         val (fromInt64, fromInt64Z, toInt64, toInt64X) = 
             make {fromIntUnsafe = fromInt64Unsafe,
-                  fromIntZUnsafe = fromIntZ64Unsafe,
+                  fromIntZUnsafe = fromInt64ZUnsafe,
                   toIntUnsafe = toInt64Unsafe,
-                  toIntXUnsafe = toIntX64Unsafe,
+                  toIntXUnsafe = toInt64XUnsafe,
                   other = {precision' = Primitive.Int64.precision',
                            maxInt' = Primitive.Int64.maxInt',
                            minInt' = Primitive.Int64.minInt'}}
       end
 
-      val (fromWord8, fromWordX8, toWord8, toWordX8) =
-         (fromWord8Unsafe, fromWordX8Unsafe, toWord8Unsafe, toWordX8Unsafe)   
-      val (fromWord16, fromWordX16, toWord16, toWordX16) =
-         (fromWord16Unsafe, fromWordX16Unsafe, toWord16Unsafe, toWordX16Unsafe)   
-      val (fromWord32, fromWordX32, toWord32, toWordX32) =
-         (fromWord32Unsafe, fromWordX32Unsafe, toWord32Unsafe, toWordX32Unsafe)   
-      val (fromWord64, fromWordX64, toWord64, toWordX64) =
-         (fromWord64Unsafe, fromWordX64Unsafe, toWord64Unsafe, toWordX64Unsafe)   
+      val (fromWord8, fromWord8X, toWord8, toWord8X) =
+         (fromWord8Unsafe, fromWord8XUnsafe, toWord8Unsafe, toWord8XUnsafe)   
+      val (fromWord16, fromWord16X, toWord16, toWord16X) =
+         (fromWord16Unsafe, fromWord16XUnsafe, toWord16Unsafe, toWord16XUnsafe)   
+      val (fromWord32, fromWord32X, toWord32, toWord32X) =
+         (fromWord32Unsafe, fromWord32XUnsafe, toWord32Unsafe, toWord32XUnsafe)   
+      val (fromWord64, fromWord64X, toWord64, toWord64X) =
+         (fromWord64Unsafe, fromWord64XUnsafe, toWord64Unsafe, toWord64XUnsafe)   
 
    end
 

Copied: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/word1.sml (from rev 4350, mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/word0.sml)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/word0.sml	2006-02-10 00:42:03 UTC (rev 4350)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/word1.sml	2006-02-10 03:21:00 UTC (rev 4352)
@@ -0,0 +1,218 @@
+(* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
+ *    Jagannathan, and Stephen Weeks.
+ * Copyright (C) 1997-2000 NEC Research Institute.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+signature WORD_FROM_TO_ARG =
+   sig
+      type word
+      (* Lowbits or sign extend. *)
+      val fromInt8: Primitive.Int8.int -> word
+      val fromInt16: Primitive.Int16.int -> word
+      val fromInt32: Primitive.Int32.int -> word
+      val fromInt64: Primitive.Int64.int -> word
+      val fromIntInf: Primitive.IntInf.int -> word
+      (* Lowbits or zero extend. *)
+      val fromWord8: Primitive.Word8.word -> word
+      val fromWord16: Primitive.Word16.word -> word
+      val fromWord32: Primitive.Word32.word -> word
+      val fromWord64: Primitive.Word64.word -> word
+      (* Overflow checking, unsigned interp. *)
+      val toInt8: word -> Primitive.Int8.int
+      val toInt16: word -> Primitive.Int16.int
+      val toInt32: word -> Primitive.Int32.int
+      val toInt64: word -> Primitive.Int64.int
+      val toIntInf: word -> Primitive.IntInf.int
+      (* Overflow checking, signed interp. *)
+      val toInt8X: word -> Primitive.Int8.int
+      val toInt16X: word -> Primitive.Int16.int
+      val toInt32X: word -> Primitive.Int32.int
+      val toInt64X: word -> Primitive.Int64.int   
+      val toIntInfX: word -> Primitive.IntInf.int   
+      (* Lowbits or zero extend. *)
+      val toWord8: word -> Primitive.Word8.word
+      val toWord16: word -> Primitive.Word16.word
+      val toWord32: word -> Primitive.Word32.word
+      val toWord64: word -> Primitive.Word64.word
+      (* Lowbits or sign extend. *)
+      val toWord8X: word -> Primitive.Word8.word
+      val toWord16X: word -> Primitive.Word16.word
+      val toWord32X: word -> Primitive.Word32.word
+      val toWord64X: word -> Primitive.Word64.word
+   end
+
+signature WORD_FROM_TO_RES =   
+   sig
+      type word
+
+      val fromInt: Int.int -> word
+      val fromLarge: LargeWord.word -> word
+      val fromLargeInt: LargeInt.int -> word
+      val fromLargeWord: LargeWord.word -> word
+
+      val toInt: word -> Int.int
+      val toIntX: word -> Int.int
+      val toLarge: word -> LargeWord.word
+      val toLargeX: word -> LargeWord.word
+      val toLargeInt: word -> LargeInt.int
+      val toLargeIntX: word -> LargeInt.int
+      val toLargeWord: word -> LargeWord.word
+      val toLargeWordX: word -> LargeWord.word
+   end
+
+functor WordFromTo (W: WORD_FROM_TO_ARG): WORD_FROM_TO_RES where type word = W.word =
+   struct
+      open W
+
+      local
+         structure S =
+            Int_ChooseInt
+            (type 'a t = 'a -> word
+             val fInt8 = W.fromInt8
+             val fInt16 = W.fromInt16
+             val fInt32 = W.fromInt32
+             val fInt64 = W.fromInt64
+             val fIntInf = W.fromIntInf)
+      in
+         val fromInt = S.f
+      end
+      local
+         structure S =
+            LargeInt_ChooseInt
+            (type 'a t = 'a -> word
+             val fInt8 = W.fromInt8
+             val fInt16 = W.fromInt16
+             val fInt32 = W.fromInt32
+             val fInt64 = W.fromInt64
+             val fIntInf = W.fromIntInf)
+      in
+         val fromLargeInt = S.f
+      end
+      local
+         structure S =
+            LargeWord_ChooseWordN
+            (type 'a t = 'a -> word
+             val fWord8 = W.fromWord8
+             val fWord16 = W.fromWord16
+             val fWord32 = W.fromWord32
+             val fWord64 = W.fromWord64)
+      in
+         val fromLarge = S.f
+         val fromLargeWord = fromLarge
+      end
+
+      local
+         structure S =
+            Int_ChooseInt
+            (type 'a t = word -> 'a
+             val fInt8 = W.toInt8
+             val fInt16 = W.toInt16
+             val fInt32 = W.toInt32
+             val fInt64 = W.toInt64
+             val fIntInf = W.toIntInf)
+      in
+         val toInt = S.f
+      end
+      local
+         structure S =
+            Int_ChooseInt
+            (type 'a t = word -> 'a
+             val fInt8 = W.toInt8X
+             val fInt16 = W.toInt16X
+             val fInt32 = W.toInt32X
+             val fInt64 = W.toInt64X
+             val fIntInf = W.toIntInfX)
+      in
+         val toIntX = S.f
+      end
+      local
+         structure S =
+            LargeInt_ChooseInt
+            (type 'a t = word -> 'a
+             val fInt8 = W.toInt8
+             val fInt16 = W.toInt16
+             val fInt32 = W.toInt32
+             val fInt64 = W.toInt64
+             val fIntInf = W.toIntInf)
+      in
+         val toLargeInt = S.f
+      end
+      local
+         structure S =
+            LargeInt_ChooseInt
+            (type 'a t = word -> 'a
+             val fInt8 = W.toInt8X
+             val fInt16 = W.toInt16X
+             val fInt32 = W.toInt32X
+             val fInt64 = W.toInt64X
+             val fIntInf = W.toIntInfX)
+      in
+         val toLargeIntX = S.f
+      end
+      local
+         structure S =
+            LargeWord_ChooseWordN
+            (type 'a t = word -> 'a
+             val fWord8 = W.toWord8
+             val fWord16 = W.toWord16
+             val fWord32 = W.toWord32
+             val fWord64 = W.toWord64)
+      in
+         val toLarge = S.f
+         val toLargeWord = toLarge
+      end
+      local
+         structure S =
+            LargeWord_ChooseWordN
+            (type 'a t = word -> 'a
+             val fWord8 = W.toWord8X
+             val fWord16 = W.toWord16X
+             val fWord32 = W.toWord32X
+             val fWord64 = W.toWord64X)
+      in
+         val toLargeX = S.f
+         val toLargeWordX = toLargeX
+      end
+
+
+   end
+
+structure Primitive = struct
+open Primitive
+
+structure Word8 = struct
+                     open Word8
+                     local
+                        structure S = WordFromTo (Primitive.Word8)
+                     in
+                        open S
+                     end
+                  end
+structure Word16 = struct
+                      open Word16
+                      local
+                         structure S = WordFromTo (Primitive.Word16)
+                      in
+                         open S
+                      end
+                   end
+structure Word32 = struct
+                      open Word32
+                      local
+                         structure S = WordFromTo (Primitive.Word32)
+                      in
+                         open S
+                      end
+                   end
+structure Word64 = struct
+                      open Word64
+                      local
+                         structure S = WordFromTo (Primitive.Word64)
+                      in
+                         open S
+                      end
+                   end
+end

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/list/list.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/list/list.sml	2006-02-10 01:28:43 UTC (rev 4351)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/list/list.sml	2006-02-10 03:21:00 UTC (rev 4352)
@@ -8,9 +8,9 @@
 
 structure List: LIST =
   struct
-     open Primitive.Int
+     open Int
         
-     datatype list = datatype list
+     datatype list = datatype Primitive.List.list
 
      exception Empty
 
@@ -101,7 +101,7 @@
      fun all pred = not o (exists (not o pred))
 
      fun tabulate (n, f) = 
-        if Primitive.safe andalso n < 0
+        if Primitive.Controls.safe andalso n < 0
            then raise Size
         else let
                 fun loop (i, ac) =
@@ -121,7 +121,7 @@
                        then loop (l, n - 1)
                     else x
         in
-           if Primitive.safe andalso n < 0
+           if Primitive.Controls.safe andalso n < 0
               then raise Subscript
            else loop (l, n)
         end
@@ -135,7 +135,7 @@
                         | x :: l => loop (l, n - 1, x :: ac))
               else rev ac
         in
-           if Primitive.safe andalso n < 0
+           if Primitive.Controls.safe andalso n < 0
               then raise Subscript
            else loop (l, n, [])
         end
@@ -149,7 +149,7 @@
                         | _ :: l => loop (l, n - 1))
               else l
         in
-           if Primitive.safe andalso n < 0
+           if Primitive.Controls.safe andalso n < 0
               then raise Subscript
            else loop (l, n)
         end

Copied: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/maps/default-real64.map (from rev 4348, mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/maps/default-int64.map)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/maps/default-int64.map	2006-02-05 15:30:17 UTC (rev 4348)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/maps/default-real64.map	2006-02-10 03:21:00 UTC (rev 4352)
@@ -0,0 +1 @@
+DEFAULT_REAL default-real64.sml

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/prim-int.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/prim-int.sml	2006-02-10 01:28:43 UTC (rev 4351)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/prim-int.sml	2006-02-10 03:21:00 UTC (rev 4352)
@@ -57,10 +57,10 @@
       val fromInt64Unsafe: Primitive.Int64.int -> int
 
       (* Lowbits or zero extend. *)
-      val fromIntZ8Unsafe: Primitive.Int8.int -> int
-      val fromIntZ16Unsafe: Primitive.Int16.int -> int
-      val fromIntZ32Unsafe: Primitive.Int32.int -> int
-      val fromIntZ64Unsafe: Primitive.Int64.int -> int
+      val fromInt8ZUnsafe: Primitive.Int8.int -> int
+      val fromInt16ZUnsafe: Primitive.Int16.int -> int
+      val fromInt32ZUnsafe: Primitive.Int32.int -> int
+      val fromInt64ZUnsafe: Primitive.Int64.int -> int
 
       (* Lowbits or zero extend. *)
       val fromWord8Unsafe: Primitive.Word8.word -> int
@@ -69,10 +69,10 @@
       val fromWord64Unsafe: Primitive.Word64.word -> int
 
       (* Lowbits or sign extend. *)
-      val fromWordX8Unsafe: Primitive.Word8.word -> int
-      val fromWordX16Unsafe: Primitive.Word16.word -> int
-      val fromWordX32Unsafe: Primitive.Word32.word -> int
-      val fromWordX64Unsafe: Primitive.Word64.word -> int
+      val fromWord8XUnsafe: Primitive.Word8.word -> int
+      val fromWord16XUnsafe: Primitive.Word16.word -> int
+      val fromWord32XUnsafe: Primitive.Word32.word -> int
+      val fromWord64XUnsafe: Primitive.Word64.word -> int
 
       (* Lowbits or sign extend. *)
       val toInt8Unsafe: int -> Primitive.Int8.int
@@ -81,10 +81,10 @@
       val toInt64Unsafe: int -> Primitive.Int64.int
 
       (* Lowbits or zero extend. *)
-      val toIntZ8Unsafe: int -> Primitive.Int8.int
-      val toIntZ16Unsafe: int -> Primitive.Int16.int
-      val toIntZ32Unsafe: int -> Primitive.Int32.int
-      val toIntZ64Unsafe: int -> Primitive.Int64.int
+      val toInt8ZUnsafe: int -> Primitive.Int8.int
+      val toInt16ZUnsafe: int -> Primitive.Int16.int
+      val toInt32ZUnsafe: int -> Primitive.Int32.int
+      val toInt64ZUnsafe: int -> Primitive.Int64.int
 
       (* Lowbits or zero extend. *)
       val toWord8Unsafe: int -> Primitive.Word8.word
@@ -93,10 +93,10 @@
       val toWord64Unsafe: int -> Primitive.Word64.word
 
       (* Lowbits or sign extend. *)
-      val toWordX8Unsafe: int -> Primitive.Word8.word
-      val toWordX16Unsafe: int -> Primitive.Word16.word
-      val toWordX32Unsafe: int -> Primitive.Word32.word
-      val toWordX64Unsafe: int -> Primitive.Word64.word
+      val toWord8XUnsafe: int -> Primitive.Word8.word
+      val toWord16XUnsafe: int -> Primitive.Word16.word
+      val toWord32XUnsafe: int -> Primitive.Word32.word
+      val toWord64XUnsafe: int -> Primitive.Word64.word
    end
 
 structure Primitive = struct
@@ -206,40 +206,40 @@
       val fromInt32Unsafe = _prim "WordS32_toWord8": Int32.int -> int;
       val fromInt64Unsafe = _prim "WordS64_toWord8": Int64.int -> int;
 
-      val fromIntZ8Unsafe = _prim "WordU8_toWord8": Int8.int -> int;
-      val fromIntZ16Unsafe = _prim "WordU16_toWord8": Int16.int -> int;
-      val fromIntZ32Unsafe = _prim "WordU32_toWord8": Int32.int -> int;
-      val fromIntZ64Unsafe = _prim "WordU64_toWord8": Int64.int -> int;
+      val fromInt8ZUnsafe = _prim "WordU8_toWord8": Int8.int -> int;
+      val fromInt16ZUnsafe = _prim "WordU16_toWord8": Int16.int -> int;
+      val fromInt32ZUnsafe = _prim "WordU32_toWord8": Int32.int -> int;
+      val fromInt64ZUnsafe = _prim "WordU64_toWord8": Int64.int -> int;
 
       val fromWord8Unsafe = _prim "WordU8_toWord8": Word8.word -> int;
       val fromWord16Unsafe = _prim "WordU16_toWord8": Word16.word -> int;
       val fromWord32Unsafe = _prim "WordU32_toWord8": Word32.word -> int;
       val fromWord64Unsafe = _prim "WordU64_toWord8": Word64.word -> int;
 
-      val fromWordX8Unsafe = _prim "WordS8_toWord8": Word8.word -> int;
-      val fromWordX16Unsafe = _prim "WordS16_toWord8": Word16.word -> int;
-      val fromWordX32Unsafe = _prim "WordS32_toWord8": Word32.word -> int;
-      val fromWordX64Unsafe = _prim "WordS64_toWord8": Word64.word -> int;
+      val fromWord8XUnsafe = _prim "WordS8_toWord8": Word8.word -> int;
+      val fromWord16XUnsafe = _prim "WordS16_toWord8": Word16.word -> int;
+      val fromWord32XUnsafe = _prim "WordS32_toWord8": Word32.word -> int;
+      val fromWord64XUnsafe = _prim "WordS64_toWord8": Word64.word -> int;
 
       val toInt8Unsafe = _prim "WordS8_toWord8": int -> Int8.int;
       val toInt16Unsafe = _prim "WordS8_toWord16": int -> Int16.int;
       val toInt32Unsafe = _prim "WordS8_toWord32": int -> Int32.int;
       val toInt64Unsafe = _prim "WordS8_toWord64": int -> Int64.int;
 
-      val toIntZ8Unsafe = _prim "WordU8_toWord8": int -> Int8.int;
-      val toIntZ16Unsafe = _prim "WordU8_toWord16": int -> Int16.int;
-      val toIntZ32Unsafe = _prim "WordU8_toWord32": int -> Int32.int;
-      val toIntZ64Unsafe = _prim "WordU8_toWord64": int -> Int64.int;
+      val toInt8ZUnsafe = _prim "WordU8_toWord8": int -> Int8.int;
+      val toInt16ZUnsafe = _prim "WordU8_toWord16": int -> Int16.int;
+      val toInt32ZUnsafe = _prim "WordU8_toWord32": int -> Int32.int;
+      val toInt64ZUnsafe = _prim "WordU8_toWord64": int -> Int64.int;
 
       val toWord8Unsafe = _prim "WordU8_toWord8": int -> Word8.word;
       val toWord16Unsafe = _prim "WordU8_toWord16": int -> Word16.word;
       val toWord32Unsafe = _prim "WordU8_toWord32": int -> Word32.word;
       val toWord64Unsafe = _prim "WordU8_toWord64": int -> Word64.word;
 
-      val toWordX8Unsafe = _prim "WordS8_toWord8": int -> Word8.word;
-      val toWordX16Unsafe = _prim "WordS8_toWord16": int -> Word16.word;
-      val toWordX32Unsafe = _prim "WordS8_toWord32": int -> Word32.word;
-      val toWordX64Unsafe = _prim "WordS8_toWord64": int -> Word64.word;
+      val toWord8XUnsafe = _prim "WordS8_toWord8": int -> Word8.word;
+      val toWord16XUnsafe = _prim "WordS8_toWord16": int -> Word16.word;
+      val toWord32XUnsafe = _prim "WordS8_toWord32": int -> Word32.word;
+      val toWord64XUnsafe = _prim "WordS8_toWord64": int -> Word64.word;
    end
 structure Int8 : PRIM_INTEGER =
    struct
@@ -362,40 +362,40 @@
       val fromInt32Unsafe = _prim "WordS32_toWord16": Int32.int -> int;
       val fromInt64Unsafe = _prim "WordS64_toWord16": Int64.int -> int;
 
-      val fromIntZ8Unsafe = _prim "WordU8_toWord16": Int8.int -> int;
-      val fromIntZ16Unsafe = _prim "WordU16_toWord16": Int16.int -> int;
-      val fromIntZ32Unsafe = _prim "WordU32_toWord16": Int32.int -> int;
-      val fromIntZ64Unsafe = _prim "WordU64_toWord16": Int64.int -> int;
+      val fromInt8ZUnsafe = _prim "WordU8_toWord16": Int8.int -> int;
+      val fromInt16ZUnsafe = _prim "WordU16_toWord16": Int16.int -> int;
+      val fromInt32ZUnsafe = _prim "WordU32_toWord16": Int32.int -> int;
+      val fromInt64ZUnsafe = _prim "WordU64_toWord16": Int64.int -> int;
 
       val fromWord8Unsafe = _prim "WordU8_toWord16": Word8.word -> int;
       val fromWord16Unsafe = _prim "WordU16_toWord16": Word16.word -> int;
       val fromWord32Unsafe = _prim "WordU32_toWord16": Word32.word -> int;
       val fromWord64Unsafe = _prim "WordU64_toWord16": Word64.word -> int;
 
-      val fromWordX8Unsafe = _prim "WordS8_toWord16": Word8.word -> int;
-      val fromWordX16Unsafe = _prim "WordS16_toWord16": Word16.word -> int;
-      val fromWordX32Unsafe = _prim "WordS32_toWord16": Word32.word -> int;
-      val fromWordX64Unsafe = _prim "WordS64_toWord16": Word64.word -> int;
+      val fromWord8XUnsafe = _prim "WordS8_toWord16": Word8.word -> int;
+      val fromWord16XUnsafe = _prim "WordS16_toWord16": Word16.word -> int;
+      val fromWord32XUnsafe = _prim "WordS32_toWord16": Word32.word -> int;
+      val fromWord64XUnsafe = _prim "WordS64_toWord16": Word64.word -> int;
 
       val toInt8Unsafe = _prim "WordS16_toWord8": int -> Int8.int;
       val toInt16Unsafe = _prim "WordS16_toWord16": int -> Int16.int;
       val toInt32Unsafe = _prim "WordS16_toWord32": int -> Int32.int;
       val toInt64Unsafe = _prim "WordS16_toWord64": int -> Int64.int;
 
-      val toIntZ8Unsafe = _prim "WordU16_toWord8": int -> Int8.int;
-      val toIntZ16Unsafe = _prim "WordU16_toWord16": int -> Int16.int;
-      val toIntZ32Unsafe = _prim "WordU16_toWord32": int -> Int32.int;
-      val toIntZ64Unsafe = _prim "WordU16_toWord64": int -> Int64.int;
+      val toInt8ZUnsafe = _prim "WordU16_toWord8": int -> Int8.int;
+      val toInt16ZUnsafe = _prim "WordU16_toWord16": int -> Int16.int;
+      val toInt32ZUnsafe = _prim "WordU16_toWord32": int -> Int32.int;
+      val toInt64ZUnsafe = _prim "WordU16_toWord64": int -> Int64.int;
 
       val toWord8Unsafe = _prim "WordU16_toWord8": int -> Word8.word;
       val toWord16Unsafe = _prim "WordU16_toWord16": int -> Word16.word;
       val toWord32Unsafe = _prim "WordU16_toWord32": int -> Word32.word;
       val toWord64Unsafe = _prim "WordU16_toWord64": int -> Word64.word;
 
-      val toWordX8Unsafe = _prim "WordS16_toWord8": int -> Word8.word;
-      val toWordX16Unsafe = _prim "WordS16_toWord16": int -> Word16.word;
-      val toWordX32Unsafe = _prim "WordS16_toWord32": int -> Word32.word;
-      val toWordX64Unsafe = _prim "WordS16_toWord64": int -> Word64.word;
+      val toWord8XUnsafe = _prim "WordS16_toWord8": int -> Word8.word;
+      val toWord16XUnsafe = _prim "WordS16_toWord16": int -> Word16.word;
+      val toWord32XUnsafe = _prim "WordS16_toWord32": int -> Word32.word;
+      val toWord64XUnsafe = _prim "WordS16_toWord64": int -> Word64.word;
    end
 structure Int16 : PRIM_INTEGER =
    struct
@@ -582,40 +582,40 @@
       val fromInt32Unsafe = _prim "WordS32_toWord32": Int32.int -> int;
       val fromInt64Unsafe = _prim "WordS64_toWord32": Int64.int -> int;
 
-      val fromIntZ8Unsafe = _prim "WordU8_toWord32": Int8.int -> int;
-      val fromIntZ16Unsafe = _prim "WordU16_toWord32": Int16.int -> int;
-      val fromIntZ32Unsafe = _prim "WordU32_toWord32": Int32.int -> int;
-      val fromIntZ64Unsafe = _prim "WordU64_toWord32": Int64.int -> int;
+      val fromInt8ZUnsafe = _prim "WordU8_toWord32": Int8.int -> int;
+      val fromInt16ZUnsafe = _prim "WordU16_toWord32": Int16.int -> int;
+      val fromInt32ZUnsafe = _prim "WordU32_toWord32": Int32.int -> int;
+      val fromInt64ZUnsafe = _prim "WordU64_toWord32": Int64.int -> int;
 
       val fromWord8Unsafe = _prim "WordU8_toWord32": Word8.word -> int;
       val fromWord16Unsafe = _prim "WordU16_toWord32": Word16.word -> int;
       val fromWord32Unsafe = _prim "WordU32_toWord32": Word32.word -> int;
       val fromWord64Unsafe = _prim "WordU64_toWord32": Word64.word -> int;
 
-      val fromWordX8Unsafe = _prim "WordS8_toWord32": Word8.word -> int;
-      val fromWordX16Unsafe = _prim "WordS16_toWord32": Word16.word -> int;
-      val fromWordX32Unsafe = _prim "WordS32_toWord32": Word32.word -> int;
-      val fromWordX64Unsafe = _prim "WordS64_toWord32": Word64.word -> int;
+      val fromWord8XUnsafe = _prim "WordS8_toWord32": Word8.word -> int;
+      val fromWord16XUnsafe = _prim "WordS16_toWord32": Word16.word -> int;
+      val fromWord32XUnsafe = _prim "WordS32_toWord32": Word32.word -> int;
+      val fromWord64XUnsafe = _prim "WordS64_toWord32": Word64.word -> int;
 
       val toInt8Unsafe = _prim "WordS32_toWord8": int -> Int8.int;
       val toInt16Unsafe = _prim "WordS32_toWord16": int -> Int16.int;
       val toInt32Unsafe = _prim "WordS32_toWord32": int -> Int32.int;
       val toInt64Unsafe = _prim "WordS32_toWord64": int -> Int64.int;
 
-      val toIntZ8Unsafe = _prim "WordU32_toWord8": int -> Int8.int;
-      val toIntZ16Unsafe = _prim "WordU32_toWord16": int -> Int16.int;
-      val toIntZ32Unsafe = _prim "WordU32_toWord32": int -> Int32.int;
-      val toIntZ64Unsafe = _prim "WordU32_toWord64": int -> Int64.int;
+      val toInt8ZUnsafe = _prim "WordU32_toWord8": int -> Int8.int;
+      val toInt16ZUnsafe = _prim "WordU32_toWord16": int -> Int16.int;
+      val toInt32ZUnsafe = _prim "WordU32_toWord32": int -> Int32.int;
+      val toInt64ZUnsafe = _prim "WordU32_toWord64": int -> Int64.int;
 
       val toWord8Unsafe = _prim "WordU32_toWord8": int -> Word8.word;
       val toWord16Unsafe = _prim "WordU32_toWord16": int -> Word16.word;
       val toWord32Unsafe = _prim "WordU32_toWord32": int -> Word32.word;
       val toWord64Unsafe = _prim "WordU32_toWord64": int -> Word64.word;
 
-      val toWordX8Unsafe = _prim "WordS32_toWord8": int -> Word8.word;
-      val toWordX16Unsafe = _prim "WordS32_toWord16": int -> Word16.word;
-      val toWordX32Unsafe = _prim "WordS32_toWord32": int -> Word32.word;
-      val toWordX64Unsafe = _prim "WordS32_toWord64": int -> Word64.word;
+      val toWord8XUnsafe = _prim "WordS32_toWord8": int -> Word8.word;
+      val toWord16XUnsafe = _prim "WordS32_toWord16": int -> Word16.word;
+      val toWord32XUnsafe = _prim "WordS32_toWord32": int -> Word32.word;
+      val toWord64XUnsafe = _prim "WordS32_toWord64": int -> Word64.word;
    end
 structure Int32 : PRIM_INTEGER =
    struct
@@ -682,40 +682,40 @@
       val fromInt32Unsafe = _prim "WordS32_toWord64": Int32.int -> int;
       val fromInt64Unsafe = _prim "WordS64_toWord64": Int64.int -> int;
 
-      val fromIntZ8Unsafe = _prim "WordU8_toWord64": Int8.int -> int;
-      val fromIntZ16Unsafe = _prim "WordU16_toWord64": Int16.int -> int;
-      val fromIntZ32Unsafe = _prim "WordU32_toWord64": Int32.int -> int;
-      val fromIntZ64Unsafe = _prim "WordU64_toWord64": Int64.int -> int;
+      val fromInt8ZUnsafe = _prim "WordU8_toWord64": Int8.int -> int;
+      val fromInt16ZUnsafe = _prim "WordU16_toWord64": Int16.int -> int;
+      val fromInt32ZUnsafe = _prim "WordU32_toWord64": Int32.int -> int;
+      val fromInt64ZUnsafe = _prim "WordU64_toWord64": Int64.int -> int;
 
       val fromWord8Unsafe = _prim "WordU8_toWord64": Word8.word -> int;
       val fromWord16Unsafe = _prim "WordU16_toWord64": Word16.word -> int;
       val fromWord32Unsafe = _prim "WordU32_toWord64": Word32.word -> int;
       val fromWord64Unsafe = _prim "WordU64_toWord64": Word64.word -> int;
 
-      val fromWordX8Unsafe = _prim "WordS8_toWord64": Word8.word -> int;
-      val fromWordX16Unsafe = _prim "WordS16_toWord64": Word16.word -> int;
-      val fromWordX32Unsafe = _prim "WordS32_toWord64": Word32.word -> int;
-      val fromWordX64Unsafe = _prim "WordS64_toWord64": Word64.word -> int;
+      val fromWord8XUnsafe = _prim "WordS8_toWord64": Word8.word -> int;
+      val fromWord16XUnsafe = _prim "WordS16_toWord64": Word16.word -> int;
+      val fromWord32XUnsafe = _prim "WordS32_toWord64": Word32.word -> int;
+      val fromWord64XUnsafe = _prim "WordS64_toWord64": Word64.word -> int;
 
       val toInt8Unsafe = _prim "WordS64_toWord8": int -> Int8.int;
       val toInt16Unsafe = _prim "WordS64_toWord16": int -> Int16.int;
       val toInt32Unsafe = _prim "WordS64_toWord32": int -> Int32.int;
       val toInt64Unsafe = _prim "WordS64_toWord64": int -> Int64.int;
 
-      val toIntZ8Unsafe = _prim "WordU64_toWord8": int -> Int8.int;
-      val toIntZ16Unsafe = _prim "WordU64_toWord16": int -> Int16.int;
-      val toIntZ32Unsafe = _prim "WordU64_toWord32": int -> Int32.int;
-      val toIntZ64Unsafe = _prim "WordU64_toWord64": int -> Int64.int;
+      val toInt8ZUnsafe = _prim "WordU64_toWord8": int -> Int8.int;
+      val toInt16ZUnsafe = _prim "WordU64_toWord16": int -> Int16.int;
+      val toInt32ZUnsafe = _prim "WordU64_toWord32": int -> Int32.int;
+      val toInt64ZUnsafe = _prim "WordU64_toWord64": int -> Int64.int;
 
       val toWord8Unsafe = _prim "WordU64_toWord8": int -> Word8.word;
       val toWord16Unsafe = _prim "WordU64_toWord16": int -> Word16.word;
       val toWord32Unsafe = _prim "WordU64_toWord32": int -> Word32.word;
       val toWord64Unsafe = _prim "WordU64_toWord64": int -> Word64.word;
 
-      val toWordX8Unsafe = _prim "WordS64_toWord8": int -> Word8.word;
-      val toWordX16Unsafe = _prim "WordS64_toWord16": int -> Word16.word;
-      val toWordX32Unsafe = _prim "WordS64_toWord32": int -> Word32.word;
-      val toWordX64Unsafe = _prim "WordS64_toWord64": int -> Word64.word;
+      val toWord8XUnsafe = _prim "WordS64_toWord8": int -> Word8.word;
+      val toWord16XUnsafe = _prim "WordS64_toWord16": int -> Word16.word;
+      val toWord32XUnsafe = _prim "WordS64_toWord32": int -> Word32.word;
+      val toWord64XUnsafe = _prim "WordS64_toWord64": int -> Word64.word;
    end
 structure Int64 : PRIM_INTEGER =
    struct

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/prim-word.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/prim-word.sml	2006-02-10 01:28:43 UTC (rev 4351)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/prim-word.sml	2006-02-10 03:21:00 UTC (rev 4352)
@@ -46,10 +46,10 @@
       val fromInt64Unsafe: Primitive.Int64.int -> word
 
       (* Lowbits or zero extend. *)
-      val fromIntZ8Unsafe: Primitive.Int8.int -> word
-      val fromIntZ16Unsafe: Primitive.Int16.int -> word
-      val fromIntZ32Unsafe: Primitive.Int32.int -> word
-      val fromIntZ64Unsafe: Primitive.Int64.int -> word
+      val fromInt8ZUnsafe: Primitive.Int8.int -> word
+      val fromInt16ZUnsafe: Primitive.Int16.int -> word
+      val fromInt32ZUnsafe: Primitive.Int32.int -> word
+      val fromInt64ZUnsafe: Primitive.Int64.int -> word
 
       (* Lowbits or zero extend. *)
       val fromWord8Unsafe: Primitive.Word8.word -> word
@@ -58,10 +58,10 @@
       val fromWord64Unsafe: Primitive.Word64.word -> word
 
       (* Lowbits or sign extend. *)
-      val fromWordX8Unsafe: Primitive.Word8.word -> word
-      val fromWordX16Unsafe: Primitive.Word16.word -> word
-      val fromWordX32Unsafe: Primitive.Word32.word -> word
-      val fromWordX64Unsafe: Primitive.Word64.word -> word
+      val fromWord8XUnsafe: Primitive.Word8.word -> word
+      val fromWord16XUnsafe: Primitive.Word16.word -> word
+      val fromWord32XUnsafe: Primitive.Word32.word -> word
+      val fromWord64XUnsafe: Primitive.Word64.word -> word
 
       (* Lowbits or zero extend. *)
       val toInt8Unsafe: word -> Primitive.Int8.int
@@ -70,10 +70,10 @@
       val toInt64Unsafe: word -> Primitive.Int64.int
 
       (* Lowbits or sign extend. *)
-      val toIntX8Unsafe: word -> Primitive.Int8.int
-      val toIntX16Unsafe: word -> Primitive.Int16.int
-      val toIntX32Unsafe: word -> Primitive.Int32.int
-      val toIntX64Unsafe: word -> Primitive.Int64.int
+      val toInt8XUnsafe: word -> Primitive.Int8.int
+      val toInt16XUnsafe: word -> Primitive.Int16.int
+      val toInt32XUnsafe: word -> Primitive.Int32.int
+      val toInt64XUnsafe: word -> Primitive.Int64.int
 
       (* Lowbits or zero extend. *)
       val toWord8Unsafe: word -> Primitive.Word8.word
@@ -82,10 +82,10 @@
       val toWord64Unsafe: word -> Primitive.Word64.word
 
       (* Lowbits or sign extend. *)
-      val toWordX8Unsafe: word -> Primitive.Word8.word
-      val toWordX16Unsafe: word -> Primitive.Word16.word
-      val toWordX32Unsafe: word -> Primitive.Word32.word
-      val toWordX64Unsafe: word -> Primitive.Word64.word
+      val toWord8XUnsafe: word -> Primitive.Word8.word
+      val toWord16XUnsafe: word -> Primitive.Word16.word
+      val toWord32XUnsafe: word -> Primitive.Word32.word
+      val toWord64XUnsafe: word -> Primitive.Word64.word
    end
 
 structure Primitive = struct
@@ -177,40 +177,40 @@
       val fromInt32Unsafe = _prim "WordS32_toWord8": Int32.int -> word;
       val fromInt64Unsafe = _prim "WordS64_toWord8": Int64.int -> word;
 
-      val fromIntZ8Unsafe = _prim "WordU8_toWord8": Int8.int -> word;
-      val fromIntZ16Unsafe = _prim "WordU16_toWord8": Int16.int -> word;
-      val fromIntZ32Unsafe = _prim "WordU32_toWord8": Int32.int -> word;
-      val fromIntZ64Unsafe = _prim "WordU64_toWord8": Int64.int -> word;
+      val fromInt8ZUnsafe = _prim "WordU8_toWord8": Int8.int -> word;
+      val fromInt16ZUnsafe = _prim "WordU16_toWord8": Int16.int -> word;
+      val fromInt32ZUnsafe = _prim "WordU32_toWord8": Int32.int -> word;
+      val fromInt64ZUnsafe = _prim "WordU64_toWord8": Int64.int -> word;
 
       val fromWord8Unsafe = _prim "WordU8_toWord8": Word8.word -> word;
       val fromWord16Unsafe = _prim "WordU16_toWord8": Word16.word -> word;
       val fromWord32Unsafe = _prim "WordU32_toWord8": Word32.word -> word;
       val fromWord64Unsafe = _prim "WordU64_toWord8": Word64.word -> word;
 
-      val fromWordX8Unsafe = _prim "WordS8_toWord8": Word8.word -> word;
-      val fromWordX16Unsafe = _prim "WordS16_toWord8": Word16.word -> word;
-      val fromWordX32Unsafe = _prim "WordS32_toWord8": Word32.word -> word;
-      val fromWordX64Unsafe = _prim "WordS64_toWord8": Word64.word -> word;
+      val fromWord8XUnsafe = _prim "WordS8_toWord8": Word8.word -> word;
+      val fromWord16XUnsafe = _prim "WordS16_toWord8": Word16.word -> word;
+      val fromWord32XUnsafe = _prim "WordS32_toWord8": Word32.word -> word;
+      val fromWord64XUnsafe = _prim "WordS64_toWord8": Word64.word -> word;
 
       val toInt8Unsafe = _prim "WordU8_toWord8": word -> Int8.int;
       val toInt16Unsafe = _prim "WordU8_toWord16": word -> Int16.int;
       val toInt32Unsafe = _prim "WordU8_toWord32": word -> Int32.int;
       val toInt64Unsafe = _prim "WordU8_toWord64": word -> Int64.int;
 
-      val toIntX8Unsafe = _prim "WordS8_toWord8": word -> Int8.int;
-      val toIntX16Unsafe = _prim "WordS8_toWord16": word -> Int16.int;
-      val toIntX32Unsafe = _prim "WordS8_toWord32": word -> Int32.int;
-      val toIntX64Unsafe = _prim "WordS8_toWord64": word -> Int64.int;
+      val toInt8XUnsafe = _prim "WordS8_toWord8": word -> Int8.int;
+      val toInt16XUnsafe = _prim "WordS8_toWord16": word -> Int16.int;
+      val toInt32XUnsafe = _prim "WordS8_toWord32": word -> Int32.int;
+      val toInt64XUnsafe = _prim "WordS8_toWord64": word -> Int64.int;
 
       val toWord8Unsafe = _prim "WordU8_toWord8": word -> Word8.word;
       val toWord16Unsafe = _prim "WordU8_toWord16": word -> Word16.word;
       val toWord32Unsafe = _prim "WordU8_toWord32": word -> Word32.word;
       val toWord64Unsafe = _prim "WordU8_toWord64": word -> Word64.word;
 
-      val toWordX8Unsafe = _prim "WordS8_toWord8": word -> Word8.word;
-      val toWordX16Unsafe = _prim "WordS8_toWord16": word -> Word16.word;
-      val toWordX32Unsafe = _prim "WordS8_toWord32": word -> Word32.word;
-      val toWordX64Unsafe = _prim "WordS8_toWord64": word -> Word64.word;
+      val toWord8XUnsafe = _prim "WordS8_toWord8": word -> Word8.word;
+      val toWord16XUnsafe = _prim "WordS8_toWord16": word -> Word16.word;
+      val toWord32XUnsafe = _prim "WordS8_toWord32": word -> Word32.word;
+      val toWord64XUnsafe = _prim "WordS8_toWord64": word -> Word64.word;
    end
 structure Word8 : PRIM_WORD =
    struct
@@ -306,40 +306,40 @@
       val fromInt32Unsafe = _prim "WordS32_toWord16": Int32.int -> word;
       val fromInt64Unsafe = _prim "WordS64_toWord16": Int64.int -> word;
 
-      val fromIntZ8Unsafe = _prim "WordU8_toWord16": Int8.int -> word;
-      val fromIntZ16Unsafe = _prim "WordU16_toWord16": Int16.int -> word;
-      val fromIntZ32Unsafe = _prim "WordU32_toWord16": Int32.int -> word;
-      val fromIntZ64Unsafe = _prim "WordU64_toWord16": Int64.int -> word;
+      val fromInt8ZUnsafe = _prim "WordU8_toWord16": Int8.int -> word;
+      val fromInt16ZUnsafe = _prim "WordU16_toWord16": Int16.int -> word;
+      val fromInt32ZUnsafe = _prim "WordU32_toWord16": Int32.int -> word;
+      val fromInt64ZUnsafe = _prim "WordU64_toWord16": Int64.int -> word;
 
       val fromWord8Unsafe = _prim "WordU8_toWord16": Word8.word -> word;
       val fromWord16Unsafe = _prim "WordU16_toWord16": Word16.word -> word;
       val fromWord32Unsafe = _prim "WordU32_toWord16": Word32.word -> word;
       val fromWord64Unsafe = _prim "WordU64_toWord16": Word64.word -> word;
 
-      val fromWordX8Unsafe = _prim "WordS8_toWord16": Word8.word -> word;
-      val fromWordX16Unsafe = _prim "WordS16_toWord16": Word16.word -> word;
-      val fromWordX32Unsafe = _prim "WordS32_toWord16": Word32.word -> word;
-      val fromWordX64Unsafe = _prim "WordS64_toWord16": Word64.word -> word;
+      val fromWord8XUnsafe = _prim "WordS8_toWord16": Word8.word -> word;
+      val fromWord16XUnsafe = _prim "WordS16_toWord16": Word16.word -> word;
+      val fromWord32XUnsafe = _prim "WordS32_toWord16": Word32.word -> word;
+      val fromWord64XUnsafe = _prim "WordS64_toWord16": Word64.word -> word;
 
       val toInt8Unsafe = _prim "WordU16_toWord8": word -> Int8.int;
       val toInt16Unsafe = _prim "WordU16_toWord16": word -> Int16.int;
       val toInt32Unsafe = _prim "WordU16_toWord32": word -> Int32.int;
       val toInt64Unsafe = _prim "WordU16_toWord64": word -> Int64.int;
 
-      val toIntX8Unsafe = _prim "WordS16_toWord8": word -> Int8.int;
-      val toIntX16Unsafe = _prim "WordS16_toWord16": word -> Int16.int;
-      val toIntX32Unsafe = _prim "WordS16_toWord32": word -> Int32.int;
-      val toIntX64Unsafe = _prim "WordS16_toWord64": word -> Int64.int;
+      val toInt8XUnsafe = _prim "WordS16_toWord8": word -> Int8.int;
+      val toInt16XUnsafe = _prim "WordS16_toWord16": word -> Int16.int;
+      val toInt32XUnsafe = _prim "WordS16_toWord32": word -> Int32.int;
+      val toInt64XUnsafe = _prim "WordS16_toWord64": word -> Int64.int;
 
       val toWord8Unsafe = _prim "WordU16_toWord8": word -> Word8.word;
       val toWord16Unsafe = _prim "WordU16_toWord16": word -> Word16.word;
       val toWord32Unsafe = _prim "WordU16_toWord32": word -> Word32.word;
       val toWord64Unsafe = _prim "WordU16_toWord64": word -> Word64.word;
 
-      val toWordX8Unsafe = _prim "WordS16_toWord8": word -> Word8.word;
-      val toWordX16Unsafe = _prim "WordS16_toWord16": word -> Word16.word;
-      val toWordX32Unsafe = _prim "WordS16_toWord32": word -> Word32.word;
-      val toWordX64Unsafe = _prim "WordS16_toWord64": word -> Word64.word;
+      val toWord8XUnsafe = _prim "WordS16_toWord8": word -> Word8.word;
+      val toWord16XUnsafe = _prim "WordS16_toWord16": word -> Word16.word;
+      val toWord32XUnsafe = _prim "WordS16_toWord32": word -> Word32.word;
+      val toWord64XUnsafe = _prim "WordS16_toWord64": word -> Word64.word;
    end
 structure Word16 : PRIM_WORD =
    struct
@@ -499,40 +499,40 @@
       val fromInt32Unsafe = _prim "WordS32_toWord32": Int32.int -> word;
       val fromInt64Unsafe = _prim "WordS64_toWord32": Int64.int -> word;
 
-      val fromIntZ8Unsafe = _prim "WordU8_toWord32": Int8.int -> word;
-      val fromIntZ16Unsafe = _prim "WordU16_toWord32": Int16.int -> word;
-      val fromIntZ32Unsafe = _prim "WordU32_toWord32": Int32.int -> word;
-      val fromIntZ64Unsafe = _prim "WordU64_toWord32": Int64.int -> word;
+      val fromInt8ZUnsafe = _prim "WordU8_toWord32": Int8.int -> word;
+      val fromInt16ZUnsafe = _prim "WordU16_toWord32": Int16.int -> word;
+      val fromInt32ZUnsafe = _prim "WordU32_toWord32": Int32.int -> word;
+      val fromInt64ZUnsafe = _prim "WordU64_toWord32": Int64.int -> word;
 
       val fromWord8Unsafe = _prim "WordU8_toWord32": Word8.word -> word;
       val fromWord16Unsafe = _prim "WordU16_toWord32": Word16.word -> word;
       val fromWord32Unsafe = _prim "WordU32_toWord32": Word32.word -> word;
       val fromWord64Unsafe = _prim "WordU64_toWord32": Word64.word -> word;
 
-      val fromWordX8Unsafe = _prim "WordS8_toWord32": Word8.word -> word;
-      val fromWordX16Unsafe = _prim "WordS16_toWord32": Word16.word -> word;
-      val fromWordX32Unsafe = _prim "WordS32_toWord32": Word32.word -> word;
-      val fromWordX64Unsafe = _prim "WordS64_toWord32": Word64.word -> word;
+      val fromWord8XUnsafe = _prim "WordS8_toWord32": Word8.word -> word;
+      val fromWord16XUnsafe = _prim "WordS16_toWord32": Word16.word -> word;
+      val fromWord32XUnsafe = _prim "WordS32_toWord32": Word32.word -> word;
+      val fromWord64XUnsafe = _prim "WordS64_toWord32": Word64.word -> word;
 
       val toInt8Unsafe = _prim "WordU32_toWord8": word -> Int8.int;
       val toInt16Unsafe = _prim "WordU32_toWord16": word -> Int16.int;
       val toInt32Unsafe = _prim "WordU32_toWord32": word -> Int32.int;
       val toInt64Unsafe = _prim "WordU32_toWord64": word -> Int64.int;
 
-      val toIntX8Unsafe = _prim "WordS32_toWord8": word -> Int8.int;
-      val toIntX16Unsafe = _prim "WordS32_toWord16": word -> Int16.int;
-      val toIntX32Unsafe = _prim "WordS32_toWord32": word -> Int32.int;
-      val toIntX64Unsafe = _prim "WordS32_toWord64": word -> Int64.int;
+      val toInt8XUnsafe = _prim "WordS32_toWord8": word -> Int8.int;
+      val toInt16XUnsafe = _prim "WordS32_toWord16": word -> Int16.int;
+      val toInt32XUnsafe = _prim "WordS32_toWord32": word -> Int32.int;
+      val toInt64XUnsafe = _prim "WordS32_toWord64": word -> Int64.int;
 
       val toWord8Unsafe = _prim "WordU32_toWord8": word -> Word8.word;
       val toWord16Unsafe = _prim "WordU32_toWord16": word -> Word16.word;
       val toWord32Unsafe = _prim "WordU32_toWord32": word -> Word32.word;
       val toWord64Unsafe = _prim "WordU32_toWord64": word -> Word64.word;
 
-      val toWordX8Unsafe = _prim "WordS32_toWord8": word -> Word8.word;
-      val toWordX16Unsafe = _prim "WordS32_toWord16": word -> Word16.word;
-      val toWordX32Unsafe = _prim "WordS32_toWord32": word -> Word32.word;
-      val toWordX64Unsafe = _prim "WordS32_toWord64": word -> Word64.word;
+      val toWord8XUnsafe = _prim "WordS32_toWord8": word -> Word8.word;
+      val toWord16XUnsafe = _prim "WordS32_toWord16": word -> Word16.word;
+      val toWord32XUnsafe = _prim "WordS32_toWord32": word -> Word32.word;
+      val toWord64XUnsafe = _prim "WordS32_toWord64": word -> Word64.word;
    end
 structure Word32 : PRIM_WORD =
    struct
@@ -572,40 +572,40 @@
       val fromInt32Unsafe = _prim "WordS32_toWord64": Int32.int -> word;
       val fromInt64Unsafe = _prim "WordS64_toWord64": Int64.int -> word;
 
-      val fromIntZ8Unsafe = _prim "WordU8_toWord64": Int8.int -> word;
-      val fromIntZ16Unsafe = _prim "WordU16_toWord64": Int16.int -> word;
-      val fromIntZ32Unsafe = _prim "WordU32_toWord64": Int32.int -> word;
-      val fromIntZ64Unsafe = _prim "WordU64_toWord64": Int64.int -> word;
+      val fromInt8ZUnsafe = _prim "WordU8_toWord64": Int8.int -> word;
+      val fromInt16ZUnsafe = _prim "WordU16_toWord64": Int16.int -> word;
+      val fromInt32ZUnsafe = _prim "WordU32_toWord64": Int32.int -> word;
+      val fromInt64ZUnsafe = _prim "WordU64_toWord64": Int64.int -> word;
 
       val fromWord8Unsafe = _prim "WordU8_toWord64": Word8.word -> word;
       val fromWord16Unsafe = _prim "WordU16_toWord64": Word16.word -> word;
       val fromWord32Unsafe = _prim "WordU32_toWord64": Word32.word -> word;
       val fromWord64Unsafe = _prim "WordU64_toWord64": Word64.word -> word;
 
-      val fromWordX8Unsafe = _prim "WordS8_toWord64": Word8.word -> word;
-      val fromWordX16Unsafe = _prim "WordS16_toWord64": Word16.word -> word;
-      val fromWordX32Unsafe = _prim "WordS32_toWord64": Word32.word -> word;
-      val fromWordX64Unsafe = _prim "WordS64_toWord64": Word64.word -> word;
+      val fromWord8XUnsafe = _prim "WordS8_toWord64": Word8.word -> word;
+      val fromWord16XUnsafe = _prim "WordS16_toWord64": Word16.word -> word;
+      val fromWord32XUnsafe = _prim "WordS32_toWord64": Word32.word -> word;
+      val fromWord64XUnsafe = _prim "WordS64_toWord64": Word64.word -> word;
 
       val toInt8Unsafe = _prim "WordU64_toWord8": word -> Int8.int;
       val toInt16Unsafe = _prim "WordU64_toWord16": word -> Int16.int;
       val toInt32Unsafe = _prim "WordU64_toWord32": word -> Int32.int;
       val toInt64Unsafe = _prim "WordU64_toWord64": word -> Int64.int;
 
-      val toIntX8Unsafe = _prim "WordS64_toWord8": word -> Int8.int;
-      val toIntX16Unsafe = _prim "WordS64_toWord16": word -> Int16.int;
-      val toIntX32Unsafe = _prim "WordS64_toWord32": word -> Int32.int;
-      val toIntX64Unsafe = _prim "WordS64_toWord64": word -> Int64.int;
+      val toInt8XUnsafe = _prim "WordS64_toWord8": word -> Int8.int;
+      val toInt16XUnsafe = _prim "WordS64_toWord16": word -> Int16.int;
+      val toInt32XUnsafe = _prim "WordS64_toWord32": word -> Int32.int;
+      val toInt64XUnsafe = _prim "WordS64_toWord64": word -> Int64.int;
 
       val toWord8Unsafe = _prim "WordU64_toWord8": word -> Word8.word;
       val toWord16Unsafe = _prim "WordU64_toWord16": word -> Word16.word;
       val toWord32Unsafe = _prim "WordU64_toWord32": word -> Word32.word;
       val toWord64Unsafe = _prim "WordU64_toWord64": word -> Word64.word;
 
-      val toWordX8Unsafe = _prim "WordS64_toWord8": word -> Word8.word;
-      val toWordX16Unsafe = _prim "WordS64_toWord16": word -> Word16.word;
-      val toWordX32Unsafe = _prim "WordS64_toWord32": word -> Word32.word;
-      val toWordX64Unsafe = _prim "WordS64_toWord64": word -> Word64.word;
+      val toWord8XUnsafe = _prim "WordS64_toWord8": word -> Word8.word;
+      val toWord16XUnsafe = _prim "WordS64_toWord16": word -> Word16.word;
+      val toWord32XUnsafe = _prim "WordS64_toWord32": word -> Word32.word;
+      val toWord64XUnsafe = _prim "WordS64_toWord64": word -> Word64.word;
    end
 structure Word64 : PRIM_WORD =
    struct

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/prim1.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/prim1.sml	2006-02-10 01:28:43 UTC (rev 4351)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/prim1.sml	2006-02-10 03:21:00 UTC (rev 4352)
@@ -43,7 +43,6 @@
 
       exception Div
       exception Fail8 of String8.string
-      (* exception Fail = Fail8 *)
       exception Fail16 of String16.string
       exception Fail32 of String32.string
       exception Overflow
@@ -85,7 +84,6 @@
 
 exception Bind = Primitive.Exn.Bind
 exception Div = Primitive.Exn.Div
-(* exception Fail = Primitive.Exn.Fail *)
 exception Match = Primitive.Exn.Match
 exception Overflow = Primitive.Exn.Overflow
 exception Size = Primitive.Exn.Size

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/test/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/test/Makefile	2006-02-10 01:28:43 UTC (rev 4351)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/test/Makefile	2006-02-10 03:21:00 UTC (rev 4352)
@@ -26,9 +26,10 @@
 CTYPES_MAPS = c-types.m32.map
 DEFAULT_CHAR_MAPS = default-char8.map
 DEFAULT_INT_MAPS = default-int32.map default-int64.map default-intinf.map 
+DEFAULT_REAL_MAPS = default-real64.map
 DEFAULT_WORD_MAPS = default-word32.map default-word64.map
 
-test: test.mlb print.o $(shell $(MLTON) -mlb-path-map "../maps/header-word32.map" -mlb-path-map "../maps/objptr-rep32.map" -mlb-path-map "../maps/seqindex-int32.map" -mlb-path-map "../maps/c-types.m32.map" -mlb-path-map "../maps/default-char8.map" -mlb-path-map "../maps/default-int32.map" -mlb-path-map "../maps/default-word32.map" -stop f test.mlb)
+test: test.mlb print.o $(shell $(MLTON) -mlb-path-map "../maps/header-word32.map" -mlb-path-map "../maps/objptr-rep32.map" -mlb-path-map "../maps/seqindex-int32.map" -mlb-path-map "../maps/c-types.m32.map" -mlb-path-map "../maps/default-char8.map" -mlb-path-map "../maps/default-int32.map" -mlb-path-map "../maps/default-real64.map" -mlb-path-map "../maps/default-word32.map" -stop f test.mlb)
 	$(MLTON) \
 		-mlb-path-map "../maps/header-word32.map" \
 		-mlb-path-map "../maps/objptr-rep32.map" \
@@ -36,6 +37,7 @@
 		-mlb-path-map "../maps/c-types.m32.map" \
 		-mlb-path-map "../maps/default-char8.map" \
 		-mlb-path-map "../maps/default-int32.map" \
+		-mlb-path-map "../maps/default-real64.map" \
 		-mlb-path-map "../maps/default-word32.map" \
 		test.mlb print.o