[MLton] space safety for structures

Stephen Weeks MLton@mlton.org
Wed, 30 Jun 2004 11:53:43 -0700


What do people think space safety requires for structures?  For
example,

  structure S =
     struct
        val l = List.tabulate (1000000, fn i => i)
        val x = 13
     end
  
  val f = fn _ => .... S.x ...

Is it OK for f to keep S.l alive?  Of course, MLton won't do this
right now, since we will evaluate away the structure S at compile
time.  But I could imagine other implementations keeping S.l alive.