Control Flow

Conditional Statements

if a < b {
  a
} else {
  b
}

Syntactically, a conditional statement requires the following elements:

  1. if keyword

  2. In braces, code block of first option

  3. else keyword

  4. In braces, code block of second option

  5. Terminating ;

(Note further that ifand else are always paired—there is no standalone if.)

Branching Statements

Besides simple conditional statements, Jock supplies a type-based dispatch statement, match, and a value-based dispatch statement, switch.

Last updated