SML ではelse
、言語のルールであるため、part を使用する必要があります。
その状態でどうすれば何もできませんelse
か?
fun calc(input : string ) : int =
let
val outStr = ref "someString"
val outInt = ref 0
in
outInt := (validateHelper(input) handle _ => ~1);
if (outInt <> ~1)
then
( outStr := replaceRomanDec(input); (* replace roman number with decimal *)
outInt := (calcMyRomanExpression(!outStr) handle _ => ~1);
)
else (* nada *)
!outInt
end;