# ML question

**URL:** <https://boards.straightdope.com/t/ml-question/325205>\
**Category:** Factual Questions\
**Created:** [October 7, 2005, 3:40pm UTC](https://boards.straightdope.com/t/ml-question/325205 "2005-10-07T15:40:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Capt.Ridley\_s\_Shooting\_Party](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@Capt.Ridley\_s\_Shooting\_Party](https://boards.straightdope.com/u/Capt.Ridley_s_Shooting_Party)\
**Post date:** [October 7, 2005, 3:40pm UTC](https://boards.straightdope.com/t/ml-question/325205/1 "2005-10-07T15:40:23Z")

</div>

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

```auto

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.

---

<div class="post-metadata">

**Author:** ![Capt.Ridley\_s\_Shooting\_Party](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@Capt.Ridley\_s\_Shooting\_Party](https://boards.straightdope.com/u/Capt.Ridley_s_Shooting_Party)\
**Post date:** [October 8, 2005, 5:45pm UTC](https://boards.straightdope.com/t/ml-question/325205/2 "2005-10-08T17:45:07Z")

</div>

Anyone?

---

<div class="post-metadata">

**Author:** ![spinky](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@spinky](https://boards.straightdope.com/u/spinky)\
**Post date:** [October 9, 2005, 10:45am UTC](https://boards.straightdope.com/t/ml-question/325205/3 "2005-10-09T10:45:18Z")

</div>

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. 😃

---

<div class="post-metadata">

**Author:** ![Capt.Ridley\_s\_Shooting\_Party](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@Capt.Ridley\_s\_Shooting\_Party](https://boards.straightdope.com/u/Capt.Ridley_s_Shooting_Party)\
**Post date:** [October 9, 2005, 2:43pm UTC](https://boards.straightdope.com/t/ml-question/325205/4 "2005-10-09T14:43:54Z")

</div>

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.
