
Lists >
Statements
Local Declarations
Str s Str s := "hello" s := "hello" list := [0, 1, 2]
See docLang for details.
If/Else
if (cond) doIt if (cond) doIt else dontDoIt if (cond1) do1 else if (cond2) do2 else do3
See docLang for details.
While
while (cond) doSomething while (x) { if (y) continue if (z) break doSomething }
See docLang for details.
For
for (i:=0; i<3; ++i) echo(i) for (;;) { if (y) continue if (z) break doSomething }
See docLang for details.
Switch
switch (method) { case "head": case "get": serviceGet case "post": servicePost default: serviceBadMethod }
See docLang for details.
Throw
throw ArgErr.make throw Err.make("something bad happened")
See docLang for details.
Try/Catch
try { doSomething } catch { echo("any err thrown") } try { doSomething } catch (IOErr e) { e.trace } try { doSomething } catch (IOErr e) { handleIOErr(e) } catch (ArgErr e) { throw e // rethrow } catch { e.trace // anything else }
See docLang for details.
Try/Finally
try { doSomething } finally { cleanup } try { doSomething } catch (Err e) { e.trace } finally { cleanup }
See docLang for details.
Lists >