# Keywords

This page is the "Keywords" section of the Voxlang language reference. It is generated from LANGUAGE.md in the Voxlang compiler's own repository, so it says what the specification says and nothing more.

A URL is the heading, lowercased, with punctuation dropped and spaces turned into hyphens. Each "##" section of the spec is a page under /docs/, and every heading inside it is a fragment on that page, so "File I/O" is /docs/file-io/ and "Reading a whole file" inside it is /docs/file-io/#reading-a-whole-file.

As data: https://vox-lang.dev/docs/index.json lists every section and every heading with its URL, https://vox-lang.dev/docs/search.json carries one entry per heading with its first sentence and keywords, and https://vox-lang.dev/docs/anchors.json maps every slug to the page it lives on. Search is also a JSON endpoint: https://vox-lang.dev/docs/search?q=<words> returns ranked results as JSON, no page load.

Source: LANGUAGE.md at bf2cba0, 2026-08-22. https://github.com/Vox-lang/vox/blob/bf2cba037976586c30d22a48e7b7246d347f54a1/LANGUAGE.md

[Reference](https://vox-lang.dev/docs/) > Keywords

## Articles (Context-Dependent)

| Keyword | Usage |
| --- | --- |
| `a`, `an` | Declares new variable with type |
| `the` | References existing variable |

## Statement Starters

| Keyword | Purpose |
| --- | --- |
| `Print` | Output |
| `Set`, `Create` | Variable declaration |
| `If`, `When` | Conditional |
| `While` | Loop |
| `For` | Iteration |
| `To` | Function definition |
| `Return` | Return value |
| `Increment` | Add 1 to variable |
| `Decrement` | Subtract 1 from variable |
| `Break` | Exit loop |
| `Continue` | Skip to next iteration |
| `Exit` | Terminate program with exit code |
| `Append` | Add element to list |
| `Create`, `Change`, `Remove`/`Delete` | Directories, device nodes, symlinks, chdir (see [Directories, Mounting, and Process Control](https://vox-lang.dev/docs/directories-mounting-and-process-control/)) |
| `Mount`, `Unmount`/`Umount` | Mount/unmount filesystems |
| `Pivot` | `pivot_root` - switch the root filesystem |
| `Execute` | `execve` - replace the process image |
| `Shutdown`/`Poweroff`, `Reboot`/`Restart`, `Halt` | `reboot(2)` - power off/restart/halt the machine |
| `fork`, `reap` | Process control expressions - `fork(2)`/`wait4(2)` |
| `Send signal` | `kill(2)` - send a signal to a process (`child` aliases `process`) |

## Flag Schema

| Keyword | Purpose |
| --- | --- |
| `Flag` | Declare a command-line flag schema (`a flag called ...`) |
| `Parse` | Trigger command-line flag parsing (`Parse flags.`) |
| `Required` | Mark a flag as required |
| `Default` | Supply a default value for a flag |

## Connectors

| Keyword | Purpose |
| --- | --- |
| `with` | Function parameters, function arguments |
| `called`, `named` | Variable naming |
| `of`, `to`, `on` | Function arguments |
| `and` | Multiple uses (see below) |
| `or` | Logical OR |
| `but` | Conditional chaining |
| `then` | After condition |
| `otherwise`, `else` | Alternative branch |
| `from`, `to` | Range bounds |

## The `and` Keyword

The word `and` has multiple context-dependent meanings:

| Context | Example | Meaning |
| --- | --- | --- |
| Logical operator | `if x and y then` | Boolean AND of two conditions |
| Function parameters | `with a number called x and a number called y` | Separates parameter declarations |
| Function arguments | `'add' of 3 and 5` | Separates argument values |
| Subject list terminator | `x, y, and z are true` | Final item in comma-separated list before `are` |

**Disambiguation:**

- When `and` appears after a comma and before `are`, it's a list terminator
- When `and` appears between two conditions (no comma), it's a logical operator
- When `and` follows `with`/`of`/`to`/`on`, it separates arguments

## Reserved Aliases

A few alternate spellings are also reserved because the compiler recognizes them as aliases for canonical keywords:

| Alias | Canonical keyword | Context |
| --- | --- | --- |
| `ms` | `milliseconds` | Time duration units (`Wait 500 ms.`) |
| `message` | `text` | Type name (`a message called ...` is treated as `text`) |
| `string` | `text` | Type name (already listed in the type synonyms) |

These cannot be used as variable names. The diagnostic names the spelling you wrote and notes which canonical keyword it aliases — so `a number called ms is ...` reports `'ms'` as an alternate spelling of `'milliseconds'`, not the internal canonical name.

Every keyword listed in the tables above is likewise reserved as a variable name. Two that are easy to hit by accident are worth calling out: the flag-schema keyword **`flag`** (`a flag called ...`) and the property keyword **`empty`** (`x's empty`). Writing `a number called flag is 1.` or `a number called empty is 1.` is rejected with the same "reserved keyword" diagnostic. (As with any reserved word, you can still quote the name — `'flag'`, `'empty'` — if you genuinely need it.)

## Two classes of special word

Not every word with a special meaning is reserved. Vox distinguishes:

- **Reserved keywords** — banned as bare names everywhere, because they would be ambiguous anywhere: statement starters, operators (`times`, `add`), type names, connectors.
- **Contextual keywords** — claimed only in the position where they mean something, and ordinary identifiers everywhere else: `start`/`begin`/ `stop`/`finish` for timers, `send` for signals, `waiting` in `without waiting`, `available` in `is available`, the things words, the property word `name`, and the property word `count` — claimed after a possessive marker and in the `the argument count` / `the environment variable count` phrases, so `a number called count is 0.` compiles while `arguments's count` keeps its meaning. The same treatment extends to the whole possessive/phrase family: `capacity` (also the `with capacity N` / `of capacity N` buffer phrase), `raw`, `all` (also the `all the numbers from/between …` range), `first`, `last`, `second` (also the `Wait 1 second.` unit — `Set second to 1. Wait second seconds.` compiles and waits one second), `size` and its synonym `length` (also `with size N` and `N bytes in size`), and `version` (the `Library <name> version "…"` and `see <lib> version "…"` headers). Each is a bare variable name everywhere except its one fixed grammatical position; `arguments's first` and `a number called first is 0.` both work in the same program.

The test for which class a word belongs in: if every position where the word means something is grammatically identifiable, it is contextual; only a word that would be ambiguous in ordinary positions is reserved.

## Contextual Keywords (Things)

Three words the things feature claims only inside their construct, and treats as ordinary identifiers everywhere else — the same treatment `send`/`begin`/`stop` get for timers. None of them is a reserved variable name, so `a number called thing is 1.` and `To do.` (a function named `do`) both compile.

| Word | Claimed in | Elsewhere |
| --- | --- | --- |
| `thing` | `A thing called <name> has ...` (a definition) | ordinary identifier |
| `has` | the verb of a thing definition | ordinary identifier |
| `do` | `To do the <type>'s <member>` (a member definition) | ordinary identifier |

A fourth, **`the`**, gains a second reading in this company: in `To do the point's 'placed at'` it pairs with a *known identifier* (the type), where `a point's 'placed at'` calls a maker that brings a new point into being. See the [article rule](https://vox-lang.dev/docs/things/#the-article-rule).
