[MLton-commit] r5359
Vesa Karvonen
vesak at mlton.org
Wed Feb 28 01:55:54 PST 2007
Oops, too hasty. The space safety thing works and the problem is
somewhere else.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/misc-util/unstable/queue.sml
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/misc-util/unstable/queue.sml
===================================================================
--- mltonlib/trunk/com/ssh/misc-util/unstable/queue.sml 2007-02-28 09:44:59 UTC (rev 5358)
+++ mltonlib/trunk/com/ssh/misc-util/unstable/queue.sml 2007-02-28 09:55:47 UTC (rev 5359)
@@ -7,7 +7,9 @@
(*
* An implementation of an extended version of the {QUEUE} signature. The
* extensions aren't part of the {QUEUE} signature, because they don't
- * make sense for all possible implementations of the signature.
+ * make sense for all possible implementations of the signature. This
+ * implementation is based on a space safe implementation by Stephen Weeks
+ * posted on the MLton developers mailing list.
*)
structure Queue :> sig
include QUEUE
@@ -33,13 +35,14 @@
fun length (IN {front, ...}) =
N.length (!front)
- fun enque (IN {back, ...}) a = let
- val r = !back
- val n = N.new ()
- in
- N.<- (r, SOME (a, n))
+ fun enque (IN {back, ...}) =
+ fn a => let
+ val r = !back
+ val n = N.new ()
+ in
+ N.<- (r, SOME (a, n))
; back := n
- end
+ end
fun deque (IN {front, ...}) =
case N.get (!front) of
More information about the MLton-commit
mailing list