[MLton-commit] r6180

Vesa Karvonen vesak at mlton.org
Mon Nov 19 09:25:35 PST 2007


Moscow ML workarounds.
----------------------------------------------------------------------

U   mltonlib/trunk/org/mlton/vesak/use-lib/unstable/Make.sh
A   mltonlib/trunk/org/mlton/vesak/use-lib/unstable/detail/ml/mosml/
A   mltonlib/trunk/org/mlton/vesak/use-lib/unstable/detail/ml/mosml/workarounds.sml
U   mltonlib/trunk/org/mlton/vesak/use-lib/unstable/detail/use-lib.sml

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

Modified: mltonlib/trunk/org/mlton/vesak/use-lib/unstable/Make.sh
===================================================================
--- mltonlib/trunk/org/mlton/vesak/use-lib/unstable/Make.sh	2007-11-19 17:11:08 UTC (rev 6179)
+++ mltonlib/trunk/org/mlton/vesak/use-lib/unstable/Make.sh	2007-11-19 17:25:35 UTC (rev 6180)
@@ -29,7 +29,6 @@
   | sed -e "s/\\\${SML_COMPILER}/\"$1\"/g"      \
         -e "s/\\\${SILENT}/$(echo -n $2)/g"     \
         -e "s/\\\${VERBOSE}/$(echo -n $3)/g"    \
-        -e "s/\\\${PRELUDE}/$(echo -n $4)/g"    \
   >> .tmp
 
     if test ! -f $1.use ; then
@@ -43,15 +42,14 @@
     fi
 }
 
-gen alice '()' 'ignore' ''
+gen alice '()' 'ignore'
 
-gen mosml '()' 'ignore' 'val () = load "OS" ;'
+gen mosml '()' 'ignore'
 
 gen polyml                                      \
     '(PolyML.get_print_depth ()                 \
       before PolyML.print_depth 0)'             \
-    'PolyML.print_depth'                        \
-    ''
+    'PolyML.print_depth'
 
 gen smlnj                                       \
     'let                                        \
@@ -67,8 +65,7 @@
      in                                         \
         fn old => (printDepth := #depth old     \
                  ; signatures := #sigs old)     \
-     end'                                       \
-    ''
+     end'
 
 if which poly > /dev/null ; then
     echo 'PolyML.print_depth 0 ; use "polyml.use" ;' | poly -q

Added: mltonlib/trunk/org/mlton/vesak/use-lib/unstable/detail/ml/mosml/workarounds.sml
===================================================================
--- mltonlib/trunk/org/mlton/vesak/use-lib/unstable/detail/ml/mosml/workarounds.sml	2007-11-19 17:11:08 UTC (rev 6179)
+++ mltonlib/trunk/org/mlton/vesak/use-lib/unstable/detail/ml/mosml/workarounds.sml	2007-11-19 17:25:35 UTC (rev 6180)
@@ -0,0 +1,33 @@
+(* Copyright (C) 2007 Vesa Karvonen
+ *
+ * This code is released under the MLton license, a BSD-style license.
+ * See the LICENSE file or http://mlton.org/License for details.
+ *)
+
+load "OS" ;
+load "Substring" ;
+
+structure OS = struct
+   open OS
+   structure Path = struct
+      open Path
+      val mkRelative = fn {path, relativeTo} => mkRelative (path, relativeTo)
+   end
+end
+
+structure Substring = struct
+   open Substring
+   fun full s = extract (s, 0, NONE)
+end
+
+structure String = struct
+   fun isSuffix suf str = let
+      val sufSz = size suf
+      val strSz = size str
+   in
+      sufSz <= strSz andalso
+      EQUAL = Substring.compare (Substring.full suf,
+                                 Substring.substring (str, strSz-sufSz, sufSz))
+   end
+   open String
+end


Property changes on: mltonlib/trunk/org/mlton/vesak/use-lib/unstable/detail/ml/mosml/workarounds.sml
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: mltonlib/trunk/org/mlton/vesak/use-lib/unstable/detail/use-lib.sml
===================================================================
--- mltonlib/trunk/org/mlton/vesak/use-lib/unstable/detail/use-lib.sml	2007-11-19 17:11:08 UTC (rev 6179)
+++ mltonlib/trunk/org/mlton/vesak/use-lib/unstable/detail/use-lib.sml	2007-11-19 17:25:35 UTC (rev 6180)
@@ -4,8 +4,6 @@
  * See the LICENSE file or http://mlton.org/License for details.
  *)
 
-${PRELUDE}
-
 structure UseLib :> USE_LIB = struct
    fun after (th, ef) =
        ((case th () of v => fn () => (ef () ; v))




More information about the MLton-commit mailing list