When I try to use the function List.nth
, the sml shell returns this error message:
- List.nth([1,2,3],0);
[autoloading]
unexpected exception (bug?) in SML/NJ: Io [Io: openIn failed on "/Users/jhr/Work/smlnj/osx-dist/smlnj.dst/sml.boot.x86-unix/smlnj/basis/.cm/x86-unix/basis.cm", No such file or directory]
raised at: Basis/Implementation/IO/bin-io-fn.sml:617.25-617.71
../cm/util/safeio.sml:30.11
../compiler/TopLevel/interact/evalloop.sml:42.54
It returns same error message if I use nth
without List.
as well.
So I can guess that there is something problem with 'autoloading' the library.
But there are some strange things more.
If I use another basis library function length
, it works fine. Like this:
- length ([1,2,3]);
val it = 3 : int
But what if I use List.length
? It goes to error. Like this:
- List.length([1,2,3]);
[autoloading]
unexpected exception (bug?) in SML/NJ: Io [Io: openIn failed on "/Users/jhr/Work/smlnj/osx-dist/smlnj.dst/sml.boot.x86-unix/smlnj/basis/.cm/x86-unix/basis.cm", No such file or directory]
raised at: Basis/Implementation/IO/bin-io-fn.sml:617.25-617.71
../cm/util/safeio.sml:30.11
../compiler/TopLevel/interact/evalloop.sml:42.54
So it seems there is definitely something wrong with 'autoloading' stuff, but I can't figure out how to fix it. Please help me finding the problem and fixing it!
Note:
ps. Maybe there is something problem with directory structure of complier itself between previous version and this(v110.81)?
How did you install SML/NJ on your Mac?
It seems that the compiler resides in a user-owned directory; I would recommend that you try and install SML/NJ via Homebrew as this blog post instructs:
$ ruby <(curl -fsSk https://raw.github.com/mxcl/homebrew/go)
$ brew update
$ brew install smlnj
Since you're not asking how to install SML/NJ, this isn't a duplicate of the following questions:
But perhaps you should be asking that question instead and not this one. :)
Otherwise, try and set the current username to 'Cadenzah' instead of 'cadenzah' so it matches the capitalisation of your user directory. Unix filesystems tend to be case sensitive. Even though MacOS is not, by default, this may cause some conflicts in software that don't respect local filesystem laws.