Keyword Reference
Every identifier in this table is reserved — you cannot use it as a variable,
function, or type name. The table is generated from the lexer source of truth
(crates/zolo-lexer/src/keywords.rs). Links point to the by-example chapter
that covers each keyword in depth; "—" means the keyword is reserved for a
future language feature that has no chapter yet.
| Keyword | Meaning | Chapter |
|---|---|---|
after |
Schedules a block to run once after a duration (temporal). | Temporal |
as |
Casts or renames a value in a pattern, import, or type expression. | Modules |
async |
Marks a function as asynchronous; the body returns a future. | Concurrency |
await |
Suspends the current async function until a future resolves. | Concurrency |
break |
Exits the innermost loop immediately. | Control Flow |
catch |
Handles an exception thrown inside a try block. |
Error Handling |
comptime |
Evaluates an expression at compile time. | Comptime |
const |
Declares a compile-time constant binding. | Variables |
const_assert |
Asserts a condition at compile time; fails the build if false. | Comptime |
continue |
Skips the rest of the current loop iteration. | Control Flow |
defer |
Runs a block when the enclosing scope exits (success or failure). | Control Flow |
defer_err |
Runs a block only when the enclosing scope exits with an error. | Error Handling |
defer_ok |
Runs a block only when the enclosing scope exits successfully. | Error Handling |
effect |
Declares an algebraic effect interface. | Effects |
else |
Provides an alternative branch for an if expression. |
Control Flow |
enable |
Enables an optional language or compiler feature (directive). | Directives |
enum |
Defines a sum type with named variants. | Data Structures |
every |
Schedules a block to run repeatedly on an interval (temporal). | Temporal |
false |
Boolean literal false. | Primitives and Numbers |
finally |
Runs a block unconditionally after a try/catch sequence. |
Error Handling |
fn |
Declares a function. | Functions |
for |
Iterates over an iterable value. | Control Flow |
guard |
Early-returns from a function if a condition is not met. | Control Flow |
handle |
Provides an implementation for an algebraic effect. | Effects |
if |
Introduces a conditional expression. | Control Flow |
impl |
Implements methods or a trait for a type. | OOP |
in |
Separates the loop variable from the iterable in a for loop. |
Control Flow |
is |
Tests whether a value matches a type or variant pattern. | Pattern Matching |
let |
Declares an immutable local binding. | Variables |
loop |
Introduces an infinite loop (must be exited with break). |
Control Flow |
machine |
Declares a state machine type. | State Machines |
macro |
Declares a macro definition. | Macros |
match |
Pattern-matches a value against a set of arms. | Control Flow |
mod |
Declares or references a module. | Modules |
mut |
Makes a binding or field mutable. | Variables |
newtype |
Declares a newtype wrapper around an existing type. | Data Structures |
nil |
The null / absent value literal. | Primitives and Numbers |
on |
Attaches a lifecycle hook or event handler to a scope. | Lifecycle Hooks |
override |
Overrides a compiler setting or default behavior (directive). | Directives |
perform |
Invokes an algebraic effect operation. | Effects |
pub |
Makes a declaration visible outside its module. | Modules |
requires |
Declares a compile-time requirement or dependency (directive). | Directives |
return |
Returns a value from a function early. | Functions |
schema |
Declares a data-validation schema. | Schemas |
scope |
Creates an explicit concurrent scope that waits for all tasks. | Concurrency |
select |
Waits on the first of several concurrent channels or futures. | Concurrency |
self |
Refers to the current instance inside an impl block. |
OOP |
sleep |
Pauses execution for a duration (temporal). | Temporal |
spawn |
Launches a concurrent task. | Concurrency |
struct |
Declares a product type with named fields. | Data Structures |
timeout |
Cancels an operation if it does not complete within a duration. | Temporal |
trait |
Declares a set of methods that a type must implement. | OOP |
true |
Boolean literal true. | Primitives and Numbers |
try |
Wraps a block to intercept thrown errors. | Error Handling |
type |
Declares a type alias. | Data Structures |
use |
Imports names from a module or plugin into the current scope. | Modules |
using |
Embeds the fields and methods of a struct field into the parent type. | Data Structures |
var |
Declares a mutable local binding (shorthand for let mut). |
Variables |
where |
Attaches trait bounds to a generic parameter list. | OOP |
while |
Loops while a condition holds. | Control Flow |
with |
Pairs a handle block with the effect scope it covers. |
Effects |
yield |
Produces a value from a generator function. | — |