1 structure Weak
= MLton
.Weak
5 fun isAlive () = isSome (Weak
.get wx
)
6 val _
= MLton
.GC
.collect ()
7 val _
= print (Bool.toString (isAlive ()) ^
"\n")
10 fun sum (x
: int * (int list ref vector
* int * int) ref
) =
14 Vector.foldr (fn (lr
,s
) => List.foldr (op +) s (!lr
)) 0 (#
1 (! (#
2 x
)))
16 val x
= (13, ref (Vector.tabulate (10, fn n
=> ref (List.tabulate (n
, fn i
=> i
))),
20 fun isAlive () = isSome (Weak
.get wx
)
21 val _
= MLton
.GC
.collect ()
22 val _
= print (Bool.toString (isAlive ()) ^
"\n")