Use of semicolons seems workable with IF as well <br>(but look closely at the final IF expression, where<br>there is a semicolon already).<br><br>From: doc/getting_started/seq_prog.html<br><br>% original<br>test_if(A, B) ->
<br> if <br> A == 5 -><br> io:format("A = 5~n", []),<br> a_equals_5;<br> B == 6 -><br> io:format("B = 6~n", []),<br> b_equals_6;<br> A == 2, B == 3 -> %i.e. A equals 2 and B equals 3
<br> io:format("A == 2, B == 3~n", []),<br> a_equals_2_b_equals_3;<br> A == 1 ; B == 7 -> %i.e. A equals 1 or B equals 7<br> io:format("A == 1 ; B == 7~n", []),
<br> a_equals_1_or_b_equals_7<br> end.<br><br><br><br>%With a semicolon before expressions, this becomes<br><br>test_if(A, B) -><br> if <br> ; A == 5 -><br> io:format("A = 5~n", []),
<br> a_equals_5<br> ; B == 6 -><br> io:format("B = 6~n", []),<br> b_equals_6<br> ; A == 2, B == 3 -> %i.e. A equals 2 and B equals 3<br> io:format("A == 2, B == 3~n", []),
<br> a_equals_2_b_equals_3<br> ; A == 1 ; B == 7 -> %i.e. A equals 1 or B equals 7<br> io:format("A == 1 ; B == 7~n", []),<br> a_equals_1_or_b_equals_7
<br> end.<br><br>