[MLton-commit] r4371
Matthew Fluet
MLton@mlton.org
Fri, 3 Mar 2006 14:11:00 -0800
Mostly refactored integer and text
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/build/sources.mlb
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/char-prim.sml
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/int-prim.sml
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/int-top.sml
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/intinf-prim.sml
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/intinf-top.sml
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/pointer-prim.sml
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/real-prim.sml
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/real-top.sml
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/string-prim.sml
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/word-prim.sml
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/word-top.sml
D mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind-for-choose.sml
D mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind-for-config0.sml
D mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind-for-config1.sml
D mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind-for-config2.sml
D mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind-for-config3.sml
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/c/position.sml
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/c/sys-word.sml
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/default/fixed-int.sml
U mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/general/option.sig
U mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/embed-int.sml
U mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/embed-word.sml
U mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int-inf.sig
U mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/integer.sig
D mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/cleaner.sig
D mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/cleaner.sml
D mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/unique-id.fun
D mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/unique-id.sig
U mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/prim-int.sml
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/prim-string.sml
U mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/primitive.mlb
U mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/primitive.sml
U mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/real/IEEE-real.sml
U mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/real/real.sig
U mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/byte.sml
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/char-global.sml
U mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/char.sml
U mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/char0.sml
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/string-global.sml
U mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/string.sml
U mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/string0.sml
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/substring-global.sml
U mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/substring.sml
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/util/cleaner.sig
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/util/cleaner.sml
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/util/natural.sml
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/util/string-comparisons.sml
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/util/unique-id.fun
A mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/util/unique-id.sig
----------------------------------------------------------------------
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-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/build/sources.mlb 2006-03-03 22:10:55 UTC (rev 4371)
@@ -19,14 +19,42 @@
../integer/int0.sml
../integer/word0.sml
- local ../config/bind-for-config0.sml in ann "forceUsed" in
+ local
+ ../config/bind/int-prim.sml
+ ../config/bind/pointer-prim.sml
+ ../config/bind/real-prim.sml
+ ../config/bind/word-prim.sml
+ in ann "forceUsed" in
../config/objptr/$(OBJPTR_REP)
../config/header/$(HEADER_WORD)
../config/seq/$(SEQ_INDEX)
../config/c/misc/$(CTYPES)
end end
../integer/int-inf0.sml
- local ../config/bind-for-config0.sml in ann "forceUsed" in
+ local
+ local
+ ../config/bind/int-prim.sml
+ ../config/bind/intinf-prim.sml
+ ../config/bind/word-prim.sml
+ in ann "forceUsed" in
+ ../config/default/$(DEFAULT_INT)
+ ../config/default/$(DEFAULT_WORD)
+ ../config/default/large-int.sml
+ ../config/default/large-word.sml
+ end end
+ in
+ ../integer/int1.sml
+ ../integer/word1.sml
+ end
+
+ local
+ ../config/bind/char-prim.sml
+ ../config/bind/int-prim.sml
+ ../config/bind/intinf-prim.sml
+ ../config/bind/real-prim.sml
+ ../config/bind/string-prim.sml
+ ../config/bind/word-prim.sml
+ in ann "forceUsed" in
../config/default/$(DEFAULT_CHAR)
../config/default/$(DEFAULT_INT)
../config/default/$(DEFAULT_REAL)
@@ -35,23 +63,6 @@
../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
@@ -60,6 +71,11 @@
../list/list.sml
../list/list-pair.sig
../list/list-pair.sml
+ local
+ ../config/bind/int-prim.sml
+ in ann "forceUsed" in
+ ../config/seq/$(SEQ_INDEX)
+ end end
../arrays-and-vectors/slice.sig
../arrays-and-vectors/sequence.sig
../arrays-and-vectors/sequence.fun
@@ -92,63 +108,82 @@
../integer/int.sml
../integer/word.sig
../integer/word.sml
- local ../config/bind-for-config1.sml in ann "forceUsed" in
+ local
+ ../config/bind/int-top.sml
+ ../config/bind/pointer-prim.sml
+ ../config/bind/real-prim.sml
+ ../config/bind/word-top.sml
+ in ann "forceUsed" in
../config/objptr/$(OBJPTR_REP)
../config/c/misc/$(CTYPES)
end end
../integer/int-inf.sig
../integer/int-inf.sml
- local ../config/bind-for-config2.sml in ann "forceUsed" in
+ local
+ ../config/bind/int-top.sml
+ ../config/bind/intinf-top.sml
+ ../config/bind/word-top.sml
+ in ann "forceUsed" in
../config/default/$(DEFAULT_INT)
../config/default/$(DEFAULT_WORD)
+ ../config/default/fixed-int.sml
../config/default/large-int.sml
../config/default/large-word.sml
end end
../integer/int-global.sml
../integer/word-global.sml
../top-level/arithmetic.sml
+ ../util/natural.sml
+ ../integer/embed-int.sml
+ ../integer/embed-word.sml
+ ../integer/pack-word.sig
+ (* ../integer/pack-word32.sml *)
-(*
../text/char.sig
../text/char.sml
+ ../text/string.sig
+ ../text/string.sml
../text/substring.sig
../text/substring.sml
- ../text/string.sig
- ../text/string.sml
- local ../config/bind-for-config3.sml in ann "forceUsed" in
- ../config/default/$(DEFAULT_CHAR)
- end end
+ ../text/char-global.sml
+ ../text/string-global.sml
+ ../text/substring-global.sml
+ ../text/byte.sig
+ ../text/byte.sml
+ ../text/text.sig
+ ../text/text.sml
- ../../misc/C.sig
- ../../misc/C.sml
- ../../real/IEEE-real.sig
- ../../real/IEEE-real.sml
- ../../real/math.sig
- ../../real/real.sig
- ../../real/real.fun
- ../../integer/pack-word.sig
- ../../integer/pack-word32.sml
- ../../text/byte.sig
- ../../text/byte.sml
- ../../text/text.sig
- ../../text/text.sml
- ../../real/pack-real.sig
- ../../real/pack-real.sml
- ../../real/real32.sml
- ../../real/real64.sml
- ../../integer/patch.sml
- ../../integer/embed-int.sml
- ../../integer/embed-word.sml
- ann "forceUsed" in
- ../../config/c/$(TARGET_ARCH)-$(TARGET_OS)/c-types.sml
- end
+ ../real/IEEE-real.sig
+ ../real/IEEE-real.sml
+ (* ../../misc/C.sig *)
+ (* ../../misc/C.sml *)
+ ../real/math.sig
+ ../real/real.sig
+ (* ../../real/real.fun *)
+ ../real/pack-real.sig
+ (* ../real/pack-real.sml *)
+ (* ../real/real32.sml *)
+ (* ../real/real64.sml *)
+(*
+ local
+ ../config/bind/int-top.sml
+ ../config/bind/pointer-prim.sml
+ ../config/bind/real-top.sml
+ ../config/bind/word-top.sml
+ in ann "forceUsed" in
+ ../config/c/misc/$(CTYPES)
+ ../config/c/position.sml
+ ../config/c/sys-word.sml
+ end end
+*)
- (* misc/unique-id.sig *)
- (* misc/unique-id.fun *)
- ../../misc/cleaner.sig
- ../../misc/cleaner.sml
+ ../util/unique-id.sig
+ ../util/unique-id.fun
+ ../util/cleaner.sig
+ ../util/cleaner.sml
+(*
../../system/pre-os.sml
../../system/time.sig
../../system/time.sml
Added: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/char-prim.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/char-prim.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/char-prim.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -0,0 +1,10 @@
+(* 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 Char8 = Primitive.Char8
+structure Char16 = Primitive.Char16
+structure Char32 = Primitive.Char32
Added: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/int-prim.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/int-prim.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/int-prim.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -0,0 +1,11 @@
+(* 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 Int8 = Primitive.Int8
+structure Int16 = Primitive.Int16
+structure Int32 = Primitive.Int32
+structure Int64 = Primitive.Int64
Added: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/int-top.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/int-top.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/int-top.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -0,0 +1,11 @@
+(* 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 Int8 = Int8
+structure Int16 = Int16
+structure Int32 = Int32
+structure Int64 = Int64
Added: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/intinf-prim.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/intinf-prim.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/intinf-prim.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -0,0 +1,8 @@
+(* 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 IntInf = Primitive.IntInf
Added: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/intinf-top.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/intinf-top.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/intinf-top.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -0,0 +1,8 @@
+(* 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 IntInf = IntInf
Added: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/pointer-prim.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/pointer-prim.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/pointer-prim.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -0,0 +1,8 @@
+(* 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 Pointer = Primitive.Pointer
Added: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/real-prim.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/real-prim.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/real-prim.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -0,0 +1,9 @@
+(* 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 Real32 = Primitive.Real32
+structure Real64 = Primitive.Real64
Added: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/real-top.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/real-top.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/real-top.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -0,0 +1,9 @@
+(* 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 Real32 = Real32
+structure Real64 = Real64
Added: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/string-prim.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/string-prim.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/string-prim.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -0,0 +1,10 @@
+(* 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 String8 = Primitive.String8
+structure String16 = Primitive.String16
+structure String32 = Primitive.String32
Added: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/word-prim.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/word-prim.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/word-prim.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -0,0 +1,11 @@
+(* 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 Word8 = Primitive.Word8
+structure Word16 = Primitive.Word16
+structure Word32 = Primitive.Word32
+structure Word64 = Primitive.Word64
Added: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/word-top.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/word-top.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind/word-top.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -0,0 +1,11 @@
+(* 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 Word8 = Word8
+structure Word16 = Word16
+structure Word32 = Word32
+structure Word64 = Word64
Deleted: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind-for-choose.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind-for-choose.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind-for-choose.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -1,28 +0,0 @@
-(* 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 Char8 = Primitive.Char8
-structure Char16 = Primitive.Char16
-structure Char32 = Primitive.Char32
-
-structure Int8 = Primitive.Int8
-structure Int16 = Primitive.Int16
-structure Int32 = Primitive.Int32
-structure Int64 = Primitive.Int64
-structure IntInf = Primitive.IntInf
-
-structure Real32 = Primitive.Real32
-structure Real64 = Primitive.Real64
-
-structure String8 = Primitive.String8
-structure String16 = Primitive.String16
-structure String32 = Primitive.String32
-
-structure Word8 = Primitive.Word8
-structure Word16 = Primitive.Word16
-structure Word32 = Primitive.Word32
-structure Word64 = Primitive.Word64
Deleted: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind-for-config0.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind-for-config0.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind-for-config0.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -1,30 +0,0 @@
-(* 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 Char8 = Primitive.Char8
-structure Char16 = Primitive.Char16
-structure Char32 = Primitive.Char32
-
-structure Int8 = Primitive.Int8
-structure Int16 = Primitive.Int16
-structure Int32 = Primitive.Int32
-structure Int64 = Primitive.Int64
-structure IntInf = Primitive.IntInf
-
-structure Pointer = Primitive.Pointer
-
-structure Real32 = Primitive.Real32
-structure Real64 = Primitive.Real64
-
-structure String8 = Primitive.String8
-structure String16 = Primitive.String16
-structure String32 = Primitive.String32
-
-structure Word8 = Primitive.Word8
-structure Word16 = Primitive.Word16
-structure Word32 = Primitive.Word32
-structure Word64 = Primitive.Word64
Deleted: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind-for-config1.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind-for-config1.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind-for-config1.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -1,30 +0,0 @@
-(* 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 Char8 = Primitive.Char8
-structure Char16 = Primitive.Char16
-structure Char32 = Primitive.Char32
-
-structure Int8 = Int8
-structure Int16 = Int16
-structure Int32 = Int32
-structure Int64 = Int64
-structure IntInf = Primitive.IntInf
-
-structure Pointer = Primitive.Pointer
-
-structure Real32 = Primitive.Real32
-structure Real64 = Primitive.Real64
-
-structure String8 = Primitive.String8
-structure String16 = Primitive.String16
-structure String32 = Primitive.String32
-
-structure Word8 = Word8
-structure Word16 = Word16
-structure Word32 = Word32
-structure Word64 = Word64
Deleted: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind-for-config2.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind-for-config2.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind-for-config2.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -1,30 +0,0 @@
-(* 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 Char8 = Primitive.Char8
-structure Char16 = Primitive.Char16
-structure Char32 = Primitive.Char32
-
-structure Int8 = Int8
-structure Int16 = Int16
-structure Int32 = Int32
-structure Int64 = Int64
-structure IntInf = IntInf
-
-structure Pointer = Primitive.Pointer
-
-structure Real32 = Primitive.Real32
-structure Real64 = Primitive.Real64
-
-structure String8 = Primitive.String8
-structure String16 = Primitive.String16
-structure String32 = Primitive.String32
-
-structure Word8 = Word8
-structure Word16 = Word16
-structure Word32 = Word32
-structure Word64 = Word64
Deleted: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind-for-config3.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind-for-config3.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/bind-for-config3.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -1,30 +0,0 @@
-(* 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 Char8 = Char8
-structure Char16 = Primitive.Char16
-structure Char32 = Primitive.Char32
-
-structure Int8 = Int8
-structure Int16 = Int16
-structure Int32 = Int32
-structure Int64 = Int64
-structure IntInf = IntInf
-
-structure Pointer = Primitive.Pointer
-
-structure Real32 = Primitive.Real32
-structure Real64 = Primitive.Real64
-
-structure String8 = String8
-structure String16 = Primitive.String16
-structure String32 = Primitive.String32
-
-structure Word8 = Word8
-structure Word16 = Word16
-structure Word32 = Word32
-structure Word64 = Word64
Added: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/c/position.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/c/position.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/c/position.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -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 Position = C_Off
+
+functor Position_ChooseIntN (A: CHOOSE_INT_ARG) :
+ sig val f : Position.int A.t end =
+ C_Off_ChooseIntN (A)
Added: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/c/sys-word.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/c/sys-word.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/c/sys-word.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -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 SysWord = C_UIntmax
+
+functor SysWord_ChooseWordN (A: CHOOSE_WORD_ARG) :
+ sig val f : SysWord.word A.t end =
+ C_UIntmax_ChooseWordN (A)
Copied: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/default/fixed-int.sml (from rev 4352, 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 03:21:00 UTC (rev 4352)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/config/default/fixed-int.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -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 FixedInt = Int64
+
+functor FixedInt_ChooseIntN (A: CHOOSE_INT_ARG) :
+ sig val f : FixedInt.int A.t end =
+ ChooseIntN_Int64 (A)
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/general/option.sig
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/general/option.sig 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/general/option.sig 2006-03-03 22:10:55 UTC (rev 4371)
@@ -15,8 +15,7 @@
val app: ('a -> unit) -> 'a option -> unit
val compose: ('a -> 'b) * ('c -> 'a option) -> 'c -> 'b option
- val composePartial:
- ('a -> 'b option) * ('c -> 'a option) -> 'c -> 'b option
+ val composePartial: ('a -> 'b option) * ('c -> 'a option) -> 'c -> 'b option
val filter: ('a -> bool) -> 'a -> 'a option
val join: 'a option option -> 'a option
val map: ('a -> 'b) -> 'a option -> 'b option
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/embed-int.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/embed-int.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/embed-int.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -10,7 +10,7 @@
eqtype int
type big
- val precision': Int.int
+ val precision': Int32.int
val fromBigUnsafe: big -> int
val toBig: int -> big
end
@@ -18,12 +18,18 @@
functor EmbedInt (structure Big: INTEGER_EXTRA
structure Small: EMBED_INT where type big = Big.int): INTEGER =
struct
- val () = if Int.< (Small.precision', valOf Big.precision) then ()
+ structure Small =
+ struct
+ open Small
+ val precision': Int.int = Int32.toInt precision'
+ end
+
+ val () = if Int.< (Small.precision', Big.precision') then ()
else raise Fail "EmbedWord"
open Small
- val shift = Word.fromInt (Int.- (valOf Big.precision, precision'))
+ val shift = Word.fromInt (Int.- (Big.precision', precision'))
val extend: Big.int -> Big.int =
fn i => Big.~>> (Big.<< (i, shift), shift)
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/embed-word.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/embed-word.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/embed-word.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -12,12 +12,18 @@
val fromBigUnsafe: big -> word
val toBig: word -> big
- val wordSize: Int.int
+ val wordSize: Int32.int
end
functor EmbedWord (structure Big: WORD
structure Small: EMBED_WORD where type big = Big.word): WORD =
struct
+ structure Small =
+ struct
+ open Small
+ val wordSize: Int.int = Int32.toInt wordSize
+ end
+
val () = if Int.< (Small.wordSize, Big.wordSize) then ()
else raise Fail "EmbedWord"
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int-inf.sig
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int-inf.sig 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/int-inf.sig 2006-03-03 22:10:55 UTC (rev 4371)
@@ -28,4 +28,9 @@
Big of BigWord.word Vector.vector
| Small of SmallInt.int
val rep: int -> rep
+
+ val +? : int * int -> int
+ val *? : int * int -> int
+ val -? : int * int -> int
+ val ~? : int -> int
end
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/integer.sig
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/integer.sig 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/integer/integer.sig 2006-03-03 22:10:55 UTC (rev 4371)
@@ -75,12 +75,10 @@
val fmt: StringCvt.radix -> int -> string
val toString: int -> string
-(*
val scan: (StringCvt.radix
-> (char, 'a) StringCvt.reader
-> (int, 'a) StringCvt.reader)
val fromString: string -> int option
-*)
end
signature INTEGER_EXTRA =
Deleted: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/cleaner.sig
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/cleaner.sig 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/cleaner.sig 2006-03-03 22:10:55 UTC (rev 4371)
@@ -1,18 +0,0 @@
-(* 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 CLEANER =
- sig
- type t
-
- val addNew: t * (unit -> unit) -> unit
- val atExit: t
- val atLoadWorld: t
- val clean: t -> unit
- val new: unit -> t
- end
Deleted: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/cleaner.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/cleaner.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/cleaner.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -1,24 +0,0 @@
-(* 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.
- *)
-
-structure Cleaner: CLEANER =
-struct
-
-type t = (unit -> unit) list ref
-
-fun new (): t = ref []
-
-fun addNew (cs, f) = cs := f :: (!cs)
-
-fun clean cs = app (fn c => c () handle _ => ()) (!cs)
-
-val atExit = new ()
-
-val atLoadWorld = new ()
-
-end
Deleted: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/unique-id.fun
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/unique-id.fun 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/unique-id.fun 2006-03-03 22:10:55 UTC (rev 4371)
@@ -1,14 +0,0 @@
-(* 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.
- *)
-
-functor UniqueId () :> UNIQUE_ID =
- struct
- type t = unit ref
-
- fun new (): t = ref ()
- end
Deleted: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/unique-id.sig
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/unique-id.sig 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/unique-id.sig 2006-03-03 22:10:55 UTC (rev 4371)
@@ -1,14 +0,0 @@
-(* 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 UNIQUE_ID =
- sig
- type t
-
- val new: unit -> t
- end
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-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/prim-int.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -127,6 +127,7 @@
struct
open Int3
type big = Int8.int
+ val fromBigUnsafe = _prim "WordU8_toWord3": big -> int;
val precision' : Int32.int = 3
val toBig = _prim "WordU3_toWord8": int -> big;
end
Copied: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/prim-string.sml (from rev 4348, mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/primitive.sml)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/primitive.sml 2006-02-05 15:30:17 UTC (rev 4348)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/prim-string.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -0,0 +1,25 @@
+(* 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.
+ *)
+
+(* Primitive names are special -- see atoms/prim.fun. *)
+
+structure Primitive = struct
+
+open Primitive
+
+structure String8 =
+ struct
+ open String8
+
+ val fromWord8Vector =
+ _prim "Word8Vector_toString": Word8.word vector -> string;
+ val toWord8Vector =
+ _prim "String_toWord8Vector": string -> Word8.word vector;
+ end
+
+end
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/primitive.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/primitive.mlb 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/primitive.mlb 2006-03-03 22:10:55 UTC (rev 4371)
@@ -20,13 +20,26 @@
prim1.sml
end
../util/integral-comparisons.sml
+ ../util/string-comparisons.sml
prim-char.sml
prim-word.sml
prim-int.sml
- local ../config/bind-for-choose.sml in ann "forceUsed" in
+ local
+ ../config/bind/char-prim.sml
+ ../config/bind/int-prim.sml
+ ../config/bind/intinf-prim.sml
+ ../config/bind/real-prim.sml
+ ../config/bind/string-prim.sml
+ ../config/bind/word-prim.sml
+ in ann "forceUsed" in
../config/choose.sml
end end
- local ../config/bind-for-config0.sml in ann "forceUsed" in
+ local
+ ../config/bind/int-prim.sml
+ ../config/bind/pointer-prim.sml
+ ../config/bind/real-prim.sml
+ ../config/bind/word-prim.sml
+ in ann "forceUsed" in
../config/objptr/$(OBJPTR_REP)
../config/header/$(HEADER_WORD)
../config/seq/$(SEQ_INDEX)
@@ -34,6 +47,7 @@
end end
prim-intinf.sml
prim-seq.sml
+ prim-string.sml
prim-nullstring.sml
prim-mlton.sml
basis-ffi.sml
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/primitive.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/primitive.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/primitive/primitive.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -211,15 +211,6 @@
end
end
-
- structure String =
- struct
- val fromWord8Vector =
- _prim "Word8Vector_toString": Word8.word vector -> string;
- val toWord8Vector =
- _prim "String_toWord8Vector": string -> Word8.word vector;
- end
-
structure TextIO =
struct
val bufSize = _command_line_const "TextIO.bufSize": int = 4096;
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/real/IEEE-real.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/real/IEEE-real.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/real/IEEE-real.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -43,13 +43,13 @@
(FE_TOWARDZERO, TO_ZERO)]
end
in
- val fromInt: int -> t =
+ val fromInt: C_Int.int -> t =
fn i =>
case List.find (fn (i', _) => i = i') modes of
NONE => raise Fail "IEEEReal.RoundingMode.fromInt"
| SOME (_, m) => m
- val toInt: t -> int =
+ val toInt: t -> C_Int.int =
fn m =>
let
open Prim.RoundingMode
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/real/real.sig
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/real/real.sig 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/real/real.sig 2006-03-03 22:10:55 UTC (rev 4371)
@@ -1,8 +1,3 @@
-structure LargeReal =
- struct
- type real = real
- end
-
signature PRE_REAL_GLOBAL =
sig
type real
@@ -29,7 +24,7 @@
val abs: real -> real
val class: real -> int
val frexp: real * int ref -> real
- val gdtoa: real * int * int * int ref -> Primitive.CString.t
+ val gdtoa: real * int * int * int ref -> C_String.t
val fromInt: int -> real
val fromLarge: IEEEReal.rounding_mode -> LargeReal.real -> real
val ldexp: real * int -> real
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/byte.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/byte.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/byte.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -8,25 +8,24 @@
structure Byte: BYTE =
struct
- val byteToChar = Primitive.Char.fromWord8
+ val byteToChar = Primitive.Char8.fromWord8Unsafe
- val bytesToString = Primitive.String.fromWord8Vector o Word8Vector.toPoly
+ val bytesToString = Primitive.String8.fromWord8Vector o Word8Vector.toPoly
- val charToByte = Primitive.Char.toWord8
+ val charToByte = Primitive.Char8.toWord8Unsafe
fun packString (a: Word8Array.array, i: int, s: substring): unit =
- Util.naturalForeach
+ Natural.foreach
(Substring.size s, fn j =>
- Word8Array.update (a, i +? j, charToByte (Substring.sub (s, j))))
+ Word8Array.update (a, i + j, charToByte (Substring.sub (s, j))))
- val stringToBytes = Word8Vector.fromPoly o Primitive.String.toWord8Vector
+ val stringToBytes = Word8Vector.fromPoly o Primitive.String8.toWord8Vector
local
fun make (length, sub) s =
String.tabulate (length s, fn i => byteToChar (sub (s, i)))
in
val unpackString = make (Word8ArraySlice.length, Word8ArraySlice.sub)
- val unpackStringVec =
- make (Word8VectorSlice.length, Word8VectorSlice.sub)
+ val unpackStringVec = make (Word8VectorSlice.length, Word8VectorSlice.sub)
end
end
Copied: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/char-global.sml (from rev 4358, mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/char.sml)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/char.sml 2006-02-15 03:30:28 UTC (rev 4358)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/char-global.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -0,0 +1,10 @@
+(* 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.
+ *)
+
+structure CharGlobal: CHAR_GLOBAL = Char
+open CharGlobal
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/char.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/char.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/char.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -8,7 +8,7 @@
structure Char: CHAR_EXTRA =
struct
- open Char0
+ open PreChar
fun control reader state =
case reader state of
@@ -159,10 +159,10 @@
fun padLeft (s: string, n: int): string =
let
- val m = String.size s
+ val m = PreString.size s
val diff = Int.-? (n, m)
in if Int.> (diff, 0)
- then String.concat [String.new (diff, #"0"), s]
+ then PreString.concat [PreString.new (diff, #"0"), s]
else if diff = 0
then s
else raise Fail "padLeft"
@@ -176,7 +176,7 @@
(case c of
#"\\" => "\\\\"
| #"\"" => "\\\""
- | _ => String0.str c)
+ | _ => PreString.str c)
else
case c of
#"\a" => "\\a"
@@ -188,9 +188,9 @@
| #"\r" => "\\r"
| _ =>
if c < #" "
- then (String.concat
- ["\\^", String0.str (chr (Int.+? (ord c, ord #"@")))])
- else String.concat
+ then (PreString.concat
+ ["\\^", PreString.str (chr (Int.+? (ord c, ord #"@")))])
+ else PreString.concat
["\\", padLeft (Int.fmt StringCvt.DEC (ord c), 3)])
val toCString =
@@ -203,7 +203,7 @@
| #"\"" => "\\\""
| #"?" => "\\?"
| #"'" => "\\'"
- | _ => String0.str c)
+ | _ => PreString.str c)
else
case c of
#"\a" => "\\a"
@@ -214,10 +214,6 @@
| #"\f" => "\\f"
| #"\r" => "\\r"
| _ =>
- String.concat
+ PreString.concat
["\\", padLeft (Int.fmt StringCvt.OCT (ord c), 3)])
end
-
-structure CharGlobal: CHAR_GLOBAL = Char
-open CharGlobal
-
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/char0.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/char0.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/char0.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -11,8 +11,8 @@
structure Prim = Primitive.Char8
open Primitive.Char8
- type char = char
- type string = string
+ type char = Primitive.Char8.char
+ type string = Primitive.String8.string
local
structure S =
@@ -65,15 +65,13 @@
NONE => raise Chr
| SOME c => c
- structure PreString = PreString
-
fun oneOf s =
let
val a = Array.array (numChars, false)
- val n = PreString.size s
+ val n = PreString8.size s
fun loop i =
if Int.>= (i, n) then ()
- else (Array.update (a, ord (PreString.sub (s, i)), true)
+ else (Array.update (a, ord (PreString8.sub (s, i)), true)
; loop (Int.+ (i, 1)))
in loop 0
; fn c => Array.sub (a, ord c)
Copied: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/string-global.sml (from rev 4358, mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/string.sml)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/string.sml 2006-02-15 03:30:28 UTC (rev 4358)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/string-global.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -0,0 +1,25 @@
+(* 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.
+ *)
+
+structure StringGlobal: STRING_GLOBAL = String
+open StringGlobal
+
+(* Now that concat is defined, we can add the exnMessager for Fail. *)
+val _ =
+ General.addExnMessager
+ (fn e =>
+ case e of
+ Fail s => SOME (concat ["Fail: ", s])
+ | _ => NONE)
+
+structure NullString =
+ struct
+ open Primitive.NullString8
+
+ val nullTerm = fromString o String.nullTerm
+ end
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/string.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/string.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/string.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -8,7 +8,7 @@
structure String: STRING_EXTRA =
struct
- open String0
+ open PreString
val toLower = translate (str o Char.toLower)
@@ -20,7 +20,12 @@
val isSuffix = make isSuffix
end
val compare = collate Char.compare
- val {<, <=, >, >=} = Util.makeOrder compare
+ local
+ structure S = StringComparisons (type t = string
+ val compare = compare)
+ in
+ open S
+ end
val toString = translate Char.toString
val toCString = translate Char.toCString
@@ -49,21 +54,3 @@
fun nullTerm s = s ^ "\000"
end
-
-structure StringGlobal: STRING_GLOBAL = String
-open StringGlobal
-
-(* Now that concat is defined, we can add the exnMessager for Fail. *)
-val _ =
- General.addExnMessager
- (fn e =>
- case e of
- Fail s => SOME (concat ["Fail: ", s])
- | _ => NONE)
-
-structure NullString =
- struct
- open Primitive.NullString8
-
- val nullTerm = fromString o String.nullTerm
- end
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/string0.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/string0.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/string0.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -30,4 +30,3 @@
val explode = toList
end
structure PreString = PreString8
-structure PreSubstring8 = PreString.PreSubstring
Copied: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/substring-global.sml (from rev 4347, mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/substring.sml)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/substring.sml 2006-02-05 14:22:33 UTC (rev 4347)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/substring-global.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -0,0 +1,10 @@
+(* 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.
+ *)
+
+structure SubstringGlobal: SUBSTRING_GLOBAL = Substring
+open SubstringGlobal
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/substring.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/substring.sml 2006-03-03 19:16:18 UTC (rev 4370)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/text/substring.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -9,14 +9,12 @@
(* The :> is to hide the type substring. We must add the where's to make char
* and string the same as the toplevel types.
*)
-structure Substring
- :> SUBSTRING_EXTRA
- where type char = char
- where type string = string
- where type substring = CharVectorSlice.slice
- =
+structure Substring :> SUBSTRING_EXTRA
+ where type char = char
+ where type string = string
+ where type substring = CharVectorSlice.slice =
struct
- open Substring0
+ open PreString.PreSubstring
val size = length
val extract = slice
@@ -35,6 +33,7 @@
val position = make position
end
val compare = collate Char.compare
+
(*
type cs = int
Copied: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/util/cleaner.sig (from rev 4347, mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/cleaner.sig)
Copied: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/util/cleaner.sml (from rev 4347, mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/cleaner.sml)
Copied: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/util/natural.sml (from rev 4347, mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/util.sml)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/util.sml 2006-02-05 14:22:33 UTC (rev 4347)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/util/natural.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -0,0 +1,26 @@
+(* 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.
+ *)
+
+structure Natural =
+ struct
+ fun foldStartStop (start, stop, b, f) =
+ if start > stop
+ then raise Subscript
+ else
+ let
+ fun loop (i, b) =
+ if i >= stop then b
+ else loop (i + 1, f (i, b))
+ in loop (start, b)
+ end
+
+ fun foreachStartStop (start, stop, f) =
+ foldStartStop (start, stop, (), fn (i, ()) => f i)
+
+ fun foreach (n, f) = foreachStartStop (0, n, f)
+ end
Copied: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/util/string-comparisons.sml (from rev 4347, mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/util.sml)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/util.sml 2006-02-05 14:22:33 UTC (rev 4347)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/util/string-comparisons.sml 2006-03-03 22:10:55 UTC (rev 4371)
@@ -0,0 +1,28 @@
+(* 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.
+ *)
+
+functor StringComparisons (type t
+ val compare: t * t -> order) =
+ struct
+ fun < (x, y) =
+ (case compare (x, y) of
+ LESS => true
+ | _ => false)
+ fun <= (x, y) =
+ (case compare (x, y) of
+ GREATER => false
+ | _ => true)
+ fun > (x, y) =
+ (case compare (x, y) of
+ GREATER => true
+ | _ => false)
+ fun >= (x, y) =
+ (case compare (x, y) of
+ LESS => false
+ | _ => true)
+ end
Copied: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/util/unique-id.fun (from rev 4347, mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/unique-id.fun)
Copied: mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/util/unique-id.sig (from rev 4347, mlton/branches/on-20050822-x86_64-branch/basis-library.refactor/misc/unique-id.sig)