Skip to main content

Keywords

The following identifiers are reserved keywords in Zynx and cannot be used as variable, function, or type names.

KeywordDescription
asType cast or import alias
asmInline assembly block
assertRuntime assertion
asyncDeclare or call an asynchronous function
awaitSuspend until an async value is ready
breakExit the innermost loop
caseBranch in a match arm
catchHandle an error union inline
constDeclare a compile-time constant or immutable binding
continueSkip to the next loop iteration
deferRun a statement when the current scope exits
distinctCreate a nominally distinct type alias
elseAlternative branch of an if or match
enumDeclare an enumeration
errorDeclare an error type
exportMake a declaration visible outside the current module
externDeclare a symbol defined in a foreign (C) library
fnDeclare a function
forIterate over a collection
fromSelective import (from mod import symbol)
ifConditional branch
importImport a module
inSpecify the iterable in a for loop
interfaceDeclare a structural interface
letDeclare a local variable
matchPattern-match on a value
rawRaw pointer dereference or cast
returnReturn a value from a function
structDeclare a structure
testDeclare a test block
tryPropagate an error union; unwraps the value or returns the error
typeDeclare a type alias
unionDeclare a C-compatible union
whileLoop while a condition holds

Reserved identifiers

The following identifiers have special meaning in certain positions but are not reserved keywords — they can still be used as variable names, though doing so is discouraged:

IdentifierContext
trueBoolean literal
falseBoolean literal
nullNull pointer literal
requireBuilt-in dynamic module loader
selfReceiver in struct/interface methods