break Statement Examples | |
Statement | Comments |
break; | raises an error: break operator «break; » : level 1 is too deep. |
break 3; | raises an error: break operator «break; » : level 3 is too deep. |
for (x := 0; ; x++) if (x == 30) break; | break the loop when x is equal to 30 |
while (true) {x++; if (!check(x)) break;} | break the loop when check(x) is not true |
while (true) {x++; if (!check(x)) break 2;} | raises an error: break operator «break; » : level 2 is too deep. |
while (true) {x++; while (x < 100) if (!check(&x)) break 2;} | break the two loop when check(&x) is not true |
return Statement Examples | |
Statement | Comments |
return; | raises an error: return operator «return; » : return must be performed in a function |
function fact(n) {return n * fact(n-1);} | ok. |
function f(x) {if (g(x)) return x+1; return x+2;} | ok. |
function f(b) {if (b) return list(1, 2, 3); return bag(1);} | ok. |
function f(b) {if (b) return list(1, 2, 3); return bag(1);} | ok. |
define as f(x) (if (x) return x) | raises an error: syntax error |
EyeDB manual