[MLton] Question about Library Calls

Ben Chambers bjchambers at gmail.com
Wed Nov 1 11:28:35 PST 2006


So... after a long period of trying to debug the Gamma-CFA code that
I've written, I've reached a point where I need to know a little bit
more about MLton.  We've gotten it to run on a variety of test cases
involving no application of the standard library (such as a factorial
program that just computes the value of factorial, but doesn't print
it).  When run on code that contains a print statement (even just
hello world) it loops forever.

I was wondering what you could tell me about how MLton implements the
library call (such as the print statement), and what operations it
performs that are not present in code that doesn't use any library
calls.

Thanks,
Ben Chambers

Code for factorial (w/o print)

fun fact (n, 0) = n
  | fact (n, a) = fact (n - 1, a * n)
val _ = fact (5, 1)



More information about the MLton mailing list