Control Statements

Under Construction: Super Rough, Not Hardly Done

Fast Intro#

Adama has many control and loop structures similar to C-like languages like:

And we introduce two non-traditional ones:

Diving Into Details#

if#

if statements are straightforward ways of controling the flow of execution, and Adama's if behave like most other languages.

public int x;
@construct {
if (true) {
x = 123;
} else {
x = 42;
}
}

if-as#

Unlike most languages, Adama has a special extension to the if statement which is used for maybe. This allows safely extracting values out from the maybe.

int x;
@construct {
maybe<int> m_value = 123;
if (m_value as value) {
x = value;
}
}

while#

while statements are a straightforward way to iterate while a condition is true.

do-while#

for#

foreach#