700resu
700resu

Reputation: 259

Multiple Statements in If Else in SML

I want to use if (condition) then Statement 1 , statement 2, ... else statement 1, statement 2,... ; in SML Programming Language. I could not use and, simple space or ,. Any suggestions if this is possible at all? note: I do not mean nested if else. It is pretty clear though.

Upvotes: 3

Views: 7072

Answers (1)

sepp2k
sepp2k

Reputation: 370162

You can use the construct (expr1; expr2; ... ; exprn) to execute multiple expressions sequentially. So:

if condition then (
  expression1;
  expression2
) else (
  expression1;
  expression2
)

Upvotes: 9

Related Questions