Hades control flow looks familiar to anyone coming from C, Java, or JavaScript — curly-brace blocks, parenthesised conditions, andDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ToberlerOhn/hades/llms.txt
Use this file to discover all available pages before exploring further.
for loop headers. The return statement uses => instead of a return keyword, and the language specification describes additional loop-control keywords that are not yet fully executed by the interpreter (see notes below).
Conditional statements
if / else if / else
Conditions are placed in parentheses and the body in curly braces. Any number ofelse if branches may follow the opening if, with an optional final else.
bool. An empty string, 0, 0.0, nothing, or an empty list are all falsy; everything else is truthy.
No semicolon is required after a closing
}. Semicolons are only needed to terminate simple expressions and declarations.Loops
While loop
Awhile loop evaluates its condition before every iteration. If the condition is falsy on the very first check, the body never runs.
Do-while loop
Ado-while loop runs the body first, then checks the condition. The body always executes at least once.
- while
- do-while
For loop
The classic C-stylefor loop has three parts in its header separated by semicolons: an initialiser, a test expression, and an update statement.
For-in loop
The for-in variant iterates over each element of alist or each character of a str. The loop variable is typed; the interpreter checks each element against that type at runtime.
Loop control keywords
next — skip to the next iteration (planned)
next — skip to the next iteration (planned)
next is intended to jump to the start of the next iteration, skipping any remaining statements in the current loop body. In a for loop, the update expression (e.g. i++) would still run.break — exit the loop (planned)
break — exit the loop (planned)
break is intended to immediately exit the enclosing loop, skipping both the remaining body statements and all future iterations.Return
Inside a function,=> followed by an expression exits the function and returns that value. To return nothing explicitly, use => nothing.
Goto labels
The planned syntax for unconditional jumps uses_goTo and named labels. A label is defined by writing LABEL_NAME: on its own line; the jump is written as _goTo LABEL_NAME.