ML question

How do you include a file in ML, like #include in C? I’ve tried using open Int and load “Int” but neither seems to work.

For example, suppose I have the program



fun p5 =
    print(Int.toString 5)


I need to load the Int structure, as the compiler keeps saying that I “cannot access unit Int before it has been loaded”.

Thanks.

Anyone?

Does ML actually acknowledge that you might want to break programs up into modules? Back when I used it in school, we used something called SML (which, as I understood it, stood for “Standard” ML), and I still got the impression that it wasn’t exactly something geared toward practical usage. Stick all your code in one big file and be glad you’re not putting it on punch cards, punk. :smiley:

Yeah, I’m using SML 97 that has lots of module support. I can do open Int; in the interactive top level, yet I cannot get it to open from within a file.