[MLton] space safety for structures

Stephen Weeks MLton@mlton.org
Fri, 2 Jul 2004 15:12:21 -0700


> Perhaps, I'm missing something, but this is my model of how seperate 
> compilation works.
...
> fun main () =
>   val {x=Sl,l=Sx} = S ()
>   val _ = T ()
>   val _ = U Sx
> in ()
> end
> 
> Here its clear that l is dead at runtime after we execute the effects 
> associated with S. Anyway, this is my model about how it should work.

That makes perfect sense.  Is that what SML/NJ does?  For some reason
I always had the idea that it was passing around records for
structures and that the destructuring occured within each module, not
in some global main module like you have above.