[MLton-commit] r6187

Vesa Karvonen vesak at mlton.org
Tue Nov 20 00:47:48 PST 2007


O(n) queue management.
----------------------------------------------------------------------

U   mltonlib/trunk/org/mlton/vesak/use-lib/unstable/detail/use-lib.sml

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

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-20 08:22:32 UTC (rev 6186)
+++ mltonlib/trunk/org/mlton/vesak/use-lib/unstable/detail/use-lib.sml	2007-11-20 08:47:48 UTC (rev 6187)
@@ -42,13 +42,13 @@
       val libStack : entry list list ref = ref []
       val useQueue : entry list ref = ref []
    in
-      fun pushUse e = useQueue := !useQueue @ [e]
+      fun pushUse e = useQueue := e :: !useQueue
       fun popUse () =
           case !useQueue
            of [] => error ["Each lib must be used as a unique .use file"]
             | e::es => (useQueue := es ; e)
       fun pushLib () =
-          (libStack := !useQueue :: !libStack
+          (libStack := rev (!useQueue) :: !libStack
          ; useQueue := [])
       fun popLib () =
           case !libStack




More information about the MLton-commit mailing list