【问题标题】:An error occurred when I used "CM.make();" in SML,Ubuntu使用“CM.make();”时出错在 SML,Ubuntu
【发布时间】:2016-07-09 11:21:02
【问题描述】:

这是我第一次使用 ubuntu 和 SML/NJ。当我使用表达式CM.make()时,我想到了这个问题:

Standard ML of New Jersey v110.76 [built: Tue Oct 22 14:04:11 2013]
- CM.make() ;

[autoloading]

[library $smlnj/cm/cm.cm is stable]

[library $smlnj/internal/cm-sig-lib.cm is stable]

[library $/pgraph.cm is stable]

[library $smlnj/internal/srcpath-lib.cm is stable]

[library $SMLNJ-BASIS/basis.cm is stable]

[autoloading done]

stdIn:1.2-1.11 Error: operator and operand don't agree [tycon mismatch]

  operator domain: string

  operand:         unit

   in expression:

    CM.make ()

我不知道为什么以及哪里错了。
有人可以帮助我吗?

【问题讨论】:

    标签: sml smlnj cm


    【解决方案1】:
    stdIn:1.2-1.11 Error: operator and operand don't agree [tycon mismatch]
      operator domain: string
      operand:         unit
      in expression:
        CM.make ()
    

    上面的错误说明CM.make是一个接受字符串参数(“operand domain: string”)的函数,但是你给了它一个单元()参数(“operand: unit”)。

    CM.make 需要一个 .cm 文件的路径,您可以在其中列出源文件:

    group is
      file-1.sml
      file-2.sml
    

    将以上内容保存在名为sources.cm 的文件中,然后使用CM.make "sources.cm" 加载它。不要忘记列出您的实际源文件,而不是 file-1.smlfile-2.sml

    您还可以使用 .cm 文件执行其他操作,这些内容已在 CM manual 中介绍,但以上内容应该足以让您入门。

    【讨论】:

      猜你喜欢
      • 2017-01-27
      • 2011-10-06
      • 2013-04-16
      • 2017-09-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-22
      • 1970-01-01
      相关资源
      最近更新 更多