Keywords
q64 reserves the following 54 keywords. This list is generated directly from the compiler’s lexer, so it never drifts from what the parser actually recognizes.
| Keyword | Description | Token kind |
|---|---|---|
actor | Declare an actor — an isolated unit of concurrent state with message handlers. | KW_ACTOR |
as | Bind an import under a different name (import foo as bar). | KW_AS |
break | Exit the innermost loop, optionally yielding a value. | KW_BREAK |
catch | Handle an error or a failed task. | KW_CATCH |
const | A compile-time constant binding. | KW_CONST |
continue | Skip to the next iteration of the innermost loop. | KW_CONTINUE |
draw | A screen’s declarative view block; its statements are widget calls. | KW_DRAW |
dyn | Dynamic dispatch over a face used as a type (dyn Face). | KW_DYN |
effect | Declare an effect or an effect relationship (spec/effects.md). | KW_EFFECT |
else | The alternative branch of an if. | KW_ELSE |
enum | Declare an enum (sum type) with named variants. | KW_ENUM |
face | Declare a face — q64’s interface/trait for polymorphism (spec/faces.md). | KW_FACE |
false | The boolean literal false. | KW_FALSE |
fit | Implement a face for a type (fit T : Face). | KW_FIT |
fn | Declare a function. | KW_FN |
for | Iterate over a sequence (for x in xs). | KW_FOR |
forall | Universal quantifier used in laws and generic reasoning. | KW_FORALL |
from | Source clause of a re-export. | KW_FROM |
graph | A stream graph — connected dataflow stages (spec/streams.md). | KW_GRAPH |
handle | Declare an actor’s handler for a message. | KW_HANDLE |
if | A conditional. | KW_IF |
import | Bring a module or selected names into scope. | KW_IMPORT |
in | The by-value in parameter mode; also the for x in xs separator. | KW_IN |
law | State an algebraic law a fit must satisfy (property-checked). | KW_LAW |
let | An immutable local binding. | KW_LET |
loop | An unconditional loop (exit with break). | KW_LOOP |
match | Pattern-match a value against arms. | KW_MATCH |
move | The move parameter mode — transfer ownership. | KW_MOVE |
on | An event handler in a screen (on press(…) { … }). | KW_ON |
out | The out parameter mode — a write-only output parameter. | KW_OUT |
panic | Abort the current computation with an error. | KW_PANIC |
pub | Mark an item public — part of the qube’s exported surface. | KW_PUB |
ref | A reference type (ref T) or the ref parameter mode. | KW_REF |
region | A memory region — the unit of allocation lifetime (spec/memory.md). | KW_REGION |
return | Return a value from a function. | KW_RETURN |
scope | A structured-concurrency scope that bounds spawned tasks. | KW_SCOPE |
screen | The QView frontend DSL: state, a draw block, and on handlers. | KW_SCREEN |
select | Wait on multiple channel operations, taking the first ready. | KW_SELECT |
self | The receiver value of a method. | KW_SELF |
Self | The enclosing / implementing type. | KW_SELF_TYPE |
spawn | Start a concurrent task within a scope. | KW_SPAWN |
state | A reactive state binding (in a screen or actor). | KW_STATE |
struct | Declare a struct (record type). | KW_STRUCT |
tell | Send a fire-and-forget message to an actor. | KW_TELL |
trap | Raise an unrecoverable trap. | KW_TRAP |
true | The boolean literal true. | KW_TRUE |
try | Propagate an error from a Result (early-return on failure). | KW_TRY |
type | Declare a type alias (type Name = …). | KW_TYPE |
use | Re-export names from a module (pub use …). | KW_USE |
var | A mutable local binding. | KW_VAR |
where | Attach bounds to generic parameters. | KW_WHERE |
while | A loop that runs while a condition holds. | KW_WHILE |
with_capabilities | Run a block with a narrowed capability set (grant / deny). | KW_WITH_CAPABILITIES |
None | The Option None value / pattern. | KW_NONE |