do
''. Each instruction of the sequence, except the last one,
ends with a semicolon. The sequence is terminated by the keyword
``return
'' followed by the last intruction:
Ocaml | Revised |
---|---|
e1; e2; e3; e4 | do e1; e2; e3; return e4 |
for
'' and ``while
'' loops, all
instructions end with a semicolon, the last one included:
Ocaml | Revised |
---|---|
while e1 do | while e1 do |
e2; e3; e4 | e2; e3; e4; |
done | done |
while
'' loop and a ``for
''
loop with an empty body, equivalent to a loop where the body is
``()
'':
do return e while e do done for i = e1 to e2 do done