REPL tour
zzZZ REPL — type :help for commands, Ctrl+D to exitzz>Session basics
Section titled “Session basics”zz> x := 4242zz> x + 143zz> func add(a: int, b: int) -> int { return a + b }<func add>zz> add(3, 4)7- Bindings persist across snippets.
- Each snippet is type-checked before it runs.
- Continuation prompt is
|for open parens or trailing operators — paste multi-line closures and pipelines directly:
zz> result := " Hello World " |> str.trim() |> str.to_upper()"HELLO WORLD"Commands
Section titled “Commands”| Command | Effect |
|---|---|
:help |
Show REPL help |
:quit / Ctrl+D |
Exit the REPL |
:type expr |
Show the inferred type of an expression |
:clear |
Drop all bindings |
- Use
:typewhen inference surprises you::type [1, 2]is[int]. - The REPL is VM-backed — ideal for probing the stdlib interactively (
str.*,vec.*,json.*). - For file-level behavior (modules,
zz.tomldependencies, AOT builds) usezz run/zz test/zz buildinstead. - Every snippet runs in the same session, so a function defined earlier is available later.
Next: Language overview.