1
votes

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);
2
Are you doing use "c:\work.sml"; or use "c:\\work.sml";. And is that the actual error message you get? Because the message first calls the file "work5.sml", but then goes on talking about "work.sml". Also it misspells "compiler". Please copy and paste your actual use command and the actual error message (if you typed use "c:\\work5.sml"; and the file is called "work.sml" without the 5, that's the error).sepp2k

2 Answers

2
votes

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.

1
votes

I suddenly started experiencing this problem as well after I pinned the shortcut to SML New Jersey to my task bar. If I ran SML from this shortcut and tried to "use" a .sml file it would give this error.

So basically make sure your SML.exe is in the same folder as your .sml programs and this should work fine again.