문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top