Skip to the content.

Control flow

Argon has the control flow constructs you’d expect from a C-family / scripting language:

All of these use do blocks instead of curly braces. A condition is always wrapped in parentheses:

if (x > 0) do
    term.log("positive")

A single-statement body doesn’t strictly need do in every case (see factorial.ar, where if (n) return x*factorial(n) has no do), but using do for multi-statement bodies is required.