polaris
polaris

Reputation: 1

An error occurred when I used "CM.make();" in SML,Ubuntu

This is my first time that I used ubuntu and SML/NJ. And this question occurred to me when i used the expression 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 ()

I don't know why and where I'm wrong.
Could anybody help me?

Upvotes: 0

Views: 358

Answers (1)

Ionuț G. Stan
Ionuț G. Stan

Reputation: 179179

stdIn:1.2-1.11 Error: operator and operand don't agree [tycon mismatch]
  operator domain: string
  operand:         unit
  in expression:
    CM.make ()

What the above error says is that CM.make is a function that accepts a string argument ("operator domain: string"), but you gave it a unit () argument ("operand: unit").

CM.make expects a path to a .cm file where you list your source files:

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

Save the above in a file called sources.cm and then load it using CM.make "sources.cm". Don't forget to list your actual source files, not file-1.sml and file-2.sml.

There are other things that you can do with .cm files, which are covered in the CM manual, but the above should be enough to get you started.

Upvotes: 4

Related Questions