azrosen92
azrosen92

Reputation: 9057

SML code and not compiling, asking for andalso

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?

Upvotes: 2

Views: 314

Answers (1)

qaphla
qaphla

Reputation: 4733

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.

Upvotes: 4

Related Questions