如何在mlton中使用smlnj-lib

时间:2013-05-01 05:06:50

标签: sml mlton

我正在使用MLton参考IntBinarySet编译SML源文件。代码在使用SML / NJ时运行良好,但是,当使用MLton编译时,它会抱怨Undefined structure IntBinarySet。我需要以某种方式导入smlnj-lib吗? (我可以在没有IntBinarySet的情况下直接在SML / NJ中使用use - 导入或导入任何东西)

具体来说,我的源文件intset.sml如下。

fun newSet () = IntBinarySet.empty

和MLton抱怨道:

Error: intset.sml 1.17.
  Undefined structure IntBinarySet.
compilation aborted: parseAndElaborate reported errors

1 个答案:

答案 0 :(得分:1)

MLton有一个很好的页面about smlnj-lib in MLton

根据您的有限信息,我假设您没有在.mlb文件中导入smlnj-lib?

ORD_SET is part of the utility library。因此,您的问题应该修复,参考:

$(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb