Jock Documentation
  • Introduction to Jock
  • Getting Started
  • Language Basics
  • Operators and Expressions
  • Functions
  • Control Flow
  • Data Structures
  • Classes and Objects
  • Compiler
  • Hoon Interface
  • Nock Interface
  • Language Reference
    • ASCII
  • Tutorial
Powered by GitBook
On this page
  • Conditional Statements
  • Branching Statements
Export as PDF

Control Flow

Conditional Statements

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.

PreviousFunctionsNextData Structures

Last updated 28 days ago