Search code examples
smlsmlnj

Opening SML file - use fail


I opened a file in "SML of New Jersey" with the following command: use "c:\\work.sml", and it gives me the next problem:

[openning c:\\work5.sml]
[use failed: Io: openln failed on "c:\\work.sml", Win32TextPrimIO:openRd: failed]
uncaught Exception error
raised at:../complier/TopLevel/interact.sml:24.14-24.28

In work.sml, I have just this one line:

- datatype ’a seq = Nil | Cons of ’a * (unit -> ’a seq);

Solution

  • Your file contains two errors:

    1. The - at the beginning of the line needs to be removed.
    2. The s should be 's.

    However these should cause a syntax error and a bunch of "illegal token" errors respectively, not an IO error.

    The only reason I can think of that you get the error you do is that you mistyped the file name.