SML 文件:“test.sml”
(* here is a comment *)
val x = 123;
我从这里安装了 SMLNJ 110.76:http ://www.smlnj.org/dist/working/110.76/,从这里安装了Emacs 24.3.1:http: //ftp.gnu.org/gnu/emacs/windows/emacs -24.3-bin-i386.zip和 Emacs 的 SML 模式,通过 Emacs GUI。
Emacs 堆栈跟踪是这样的:
test.sml:1.2 Error: illegal token
test.sml:1.3 Error: illegal token
test.sml:1.5 Error: illegal token
test.sml:1.7 Error: illegal token
test.sml:1.9 Error: illegal token
依此类推,以:
uncaught exception Compile [Compile: "syntax error"]
raised at: ../compiler/Parse/main/smlfile.sml:15.24-15.46
../compiler/TopLevel/interact/evalloop.sml:44.55
../compiler/TopLevel/interact/evalloop.sml:296.17-296.20
我还通过 Sublime Text 3 使用 SML 和 sublimeREPL 包尝试了相同的程序,如下所示:http: //developerinmotion.wordpress.com/2013/02/07/sublime-text-2-and-sml/。但是我遇到了同样的问题:一长串非法令牌语法错误,然后是:
C:\Program Files (x86)\SMLNJ\\bin\.run\run.x86-win32.exe: Fatal error -- Uncaught exception Compile with "syntax error" raised at ../compiler/Parse/main/smlfile.sml:15.24-15.46
有什么问题?我是否错误地安装了 SMLNJ?