Domanda

In my SML code this line is not running

if check(e1) == Num and check(e2) == Num then Num else raise TypeError "ill-typed"

I get a compile error Error: syntax error: replacing AND with ANDALSO

Does anyone know why this is not compiling?

È stato utile?

Soluzione

and is a very different keyword in SML from what you think. and is used for defining mutually recursive functions, while andalso is the keyword used for boolean and.

Also, note that == is not equality checking in SML. = is.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top