Keywords
Reserved words and reserved route names in public Cambrian programs. A
reserved word can’t be used as an identifier (parameter, route, member,
let name, …): rename from → sender, record → log, deploy →
setup, and so on.
| Keyword / name | Use |
|---|---|
entity | Declare an entity |
extern | extern entity foreign surface |
routes / route | Route block / extern route stub |
view / init / private / accept | Route modifiers |
pure | Route modifier or start of pure fn |
fn | Second word of pure fn |
receive / fallback | Reserved route names on EVM (Receive and Fallback); not keywords |
where / from / throw | Preconditions / sender check / failure |
return | Return from a route |
call | Invoke a private route from an action list; also a test step |
deploy | Deploy another entity |
emit | Emit an event |
event / error | Declarations |
indexed | Event parameter indexing (EVM) |
library / using / for | Libraries, using Lib for T, expression/action for |
const / type / record / enum | Declarations |
macro | Entity macros (@name()) |
match / if / else | Control flow |
let / var | Bindings (var for capturing ~> returns) |
in | Member transforms; for x in …; fuzz ranges p in lo..hi |
as | Casts (x as u64) |
true / false | Boolean literals |
some / none | Option constructors |
array | Array literal array(a, b, c) |
identity | Identity member marker |
with | Send / deploy options; test and property initial state |
import / use | File import (import "./…" or bare import "token/core.cam") / namespace (use …) |
address_of | address_of Entity(args) — predicted CREATE2 address |
solidity_import | @solidity_import("…") on an extern entity |
test / property / fuzz / invariant | Testing (fuzz { … } is a property instance) |
expect / assume / bound / ctx / skip | Test / property vocabulary (skip from, skip if) |
track / derived / exclude / selectors / advanceTime | Invariant vocabulary |
cam_encode / effects | Reserved by the test grammar |
check, action and senders are invariant keywords but are contextual:
they can still be used as ordinary identifiers.
accept has no runtime effect on EVM or Lean (payability is inferred), so
it produces warning E05 on a regular route. accept receive() is
exempt: there accept is required (V40).
The namespace prefixes msg::, sys:: and trace:: are single tokens;
std:: and evm:: are ordinary namespace paths.
Operators such as ~>, ^, =>, &&, ||, +% are listed under
Operator Precedence.