Skip to content

Commit a2e4784

Browse files
committed
docs: rename xi-query to Query, drop AI-agent framing and em-dashes
- rename the query feature to "Query" in the docs (query.md title, index, stdlib, skill). - reword the "AI agent" framing: `xi skill` prints a "language guide", not an "AI agent skill" (cli.md, getting-started.md, skill.md). - replace every em-dash across the docs with a hyphen/comma/colon (401 occurrences) so the prose reads plainly.
1 parent b0b8d9e commit a2e4784

24 files changed

Lines changed: 394 additions & 394 deletions

docs/atoms.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Atoms (active-state stores)
22

33
An **`atom`** holds a single **immutable `state` value** and lets you change it
4-
only through **`transition`s** pure reducers `(currentState, payload?) →
4+
only through **`transition`s** - pure reducers `(currentState, payload?) →
55
newState`. Dispatching a transition computes the next value and swaps the held
66
one (the old value is dropped). This is the Redux store / Clojure atom model.
77

@@ -30,7 +30,7 @@ let n = cart.current.items // read the current immutable snapshot
3030
- **`atom name { initial <value> transition* }`** declares one holder seeded
3131
with `initial`.
3232
- A **`transition f(s: T, p: P) -> T`** is a reducer. Calling `name.f(p)` passes
33-
the *current* state as `s` automatically you supply only the payload then
33+
the *current* state as `s` automatically - you supply only the payload - then
3434
stores the returned value. A transition with no payload is just `f(s: T) -> T`.
3535
- **`name.current`** reads the current value.
3636
- **Time-travel:** every transition records the prior state, so **`name.undo()`**
@@ -46,7 +46,7 @@ let n = cart.current.items // read the current immutable snapshot
4646
arrays (`Integer[]`) aren't supported yet (a general limitation).
4747

4848
A higher-level **state machine** layer (named states, a legal-transition graph,
49-
machine-wide `data`, and `where` guards) is also available see
49+
machine-wide `data`, and `where` guards) is also available - see
5050
[Machines](machines.md).
5151

5252
See `examples/state/atom_demo.xi`.

docs/cli.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ own manifest + `module` (`Compile`, `Xi`, `Test`, `LoadTest`):
1414
[Getting started](getting-started.md)); `xt` and `loadtest` are built into
1515
`./bin` by bootstrap.
1616

17-
## `xc` the compiler
17+
## `xc` - the compiler
1818

1919
```console
2020
$ xc <source.xi>
@@ -25,7 +25,7 @@ Pipeline: resolve `import`s → lex → parse → generate C → invoke `cc` →
2525
(default `build/`). It's named after the source file, unless the program's
2626
`module` declares an `id` (see [module metadata](dependency-injection.md#module-metadata)),
2727
in which case `id` is used. The intermediate generated C is deleted after a successful
28-
build set `XC_KEEP_C=1` to keep it for inspection.
28+
build - set `XC_KEEP_C=1` to keep it for inspection.
2929

3030
```console
3131
$ xc greeting.xi # -> build/greeting
@@ -49,7 +49,7 @@ xc --all: built 2 module(s), 0 failed
4949
A C compiler (`cc`) must be on your `PATH`, since `xc` builds the native binary by
5050
compiling generated C. `xc version` prints the toolchain version.
5151

52-
### WebAssembly `xc --target wasm`
52+
### WebAssembly - `xc --target wasm`
5353

5454
Because `xc` compiles through portable C99, the same program can target the web.
5555
`xc --target wasm <source.xi>` routes the generated C + runtime through
@@ -68,7 +68,7 @@ console), or run the `.js` under Node. Requires `emcc` on your `PATH`
6868
`--target native` to be explicit. See [WebAssembly](wasm.md) for what runs in
6969
the browser sandbox and what doesn't.
7070

71-
### Dependencies `xi install`
71+
### Dependencies - `xi install`
7272

7373
A module can list third-party libraries as `dependencies` (URLs to `.tar.gz` /
7474
`.zip` source archives). `xi install [file]` downloads and extracts them into a
@@ -95,7 +95,7 @@ Needs `curl` (and `unzip` for `.zip`). See
9595
> The installed `xc`/`xi` wrappers set `XC_RUNTIME` and `XC_STD` for you, so you
9696
> normally only touch `XC_OUT`.
9797
98-
## `xi` run tool & REPL
98+
## `xi` - run tool & REPL
9999

100100
`xi` compiles and runs a file, hosts the REPL, and provides `test` / `skill` /
101101
`update` / `version` subcommands.
@@ -119,7 +119,7 @@ xi 0.0.50
119119
### Self-update
120120

121121
`xi update` downloads the latest release bundle for your platform from GitHub and
122-
replaces the installed `xc`/`xi` binaries, `runtime/`, and `std/` **in place**
122+
replaces the installed `xc`/`xi` binaries, `runtime/`, and `std/` **in place** -
123123
no reinstall needed.
124124

125125
```console
@@ -134,7 +134,7 @@ It no-ops with "already up to date" when you're on the latest version. Notes:
134134

135135
- Works on an **installed release bundle** (the `bin/` + `libexec/` layout); run
136136
it from a source checkout and it reports that it can't find an install root.
137-
- Needs write access to the install directory use `sudo xi update` if you
137+
- Needs write access to the install directory - use `sudo xi update` if you
138138
installed under a system path.
139139
- Requires `curl` and `tar` on `PATH`. Override the source repo with
140140
`XI_UPDATE_REPO=owner/name`.
@@ -153,15 +153,15 @@ ok - addition
153153
3 tests, 3 passed, 0 failed
154154
```
155155

156-
### AI agent skill
156+
### Language guide skill
157157

158-
`xi skill` fetches the latest **[Xi agent guide](skill.md)** (a single markdown
159-
file that teaches an AI how to write Xi) and **prints it to stdout** — pipe it to
160-
a file or straight to your coding agent:
158+
`xi skill` fetches the latest **[Xi language guide](skill.md)** (a single markdown
159+
file documenting how to write Xi) and **prints it to stdout**. Pipe it to
160+
a file or straight to your coding tool:
161161

162162
```console
163163
$ xi skill > SKILL.md # save it
164-
$ xi skill | pbcopy # or copy it to hand to an agent
164+
$ xi skill | pbcopy # or copy it to your clipboard
165165
```
166166

167167
Status/errors go to stderr, so stdout is clean markdown. Requires `curl`;
@@ -171,7 +171,7 @@ override the source with `XI_SKILL_URL` (or `XI_SKILL_REPO` / `XI_SKILL_REF`).
171171

172172
```console
173173
$ xi
174-
Xi REPL :help for commands, :quit to exit
174+
Xi REPL - :help for commands, :quit to exit
175175
x> let n = 21
176176
x> print("n = " + n)
177177
n = 21
@@ -204,11 +204,11 @@ The REPL is a **compile-and-run loop**:
204204
| Command | Effect |
205205
|---------|--------|
206206
| `xi test <file.xi>` / `xi test --all` | run a file's `test`s, or every `*_test.xi` in the project ([Testing](testing.md)) |
207-
| `xi skill` | print the AI-agent language guide ([skill](skill.md)) |
207+
| `xi skill` | print the single-file language guide ([skill](skill.md)) |
208208
| `xi update` | self-update the toolchain to the latest release |
209209
| `xi version` | print the toolchain version |
210210

211-
## `xt` test runner
211+
## `xt` - test runner
212212

213213
A standalone test runner (`module Test`), the same compile-in-test-mode-and-run
214214
engine as `xi test`, as its own binary:
@@ -222,7 +222,7 @@ $ xt --all # every *_test.xi under the cwd
222222

223223
Reads `XC` (compiler path) and `XC_RUNTIME` from the environment, like `xi`.
224224

225-
## `loadtest` load / perf tester
225+
## `loadtest` - load / perf tester
226226

227227
A load/performance tester for Xi projects (`module LoadTest`), built on the std
228228
library (`std/time`, `std/http`). Three modes:

docs/collections.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ with no elements).
1818

1919
## `List<T>`
2020

21-
`List<T>` is a growable, mutable, typed list a **built-in generic**, the same
21+
`List<T>` is a growable, mutable, typed list - a **built-in generic**, the same
2222
way `T[]` arrays are. There's nothing to import; the compiler specializes it per
2323
element type and the runtime stores elements contiguously, so it's a thin,
2424
allocation-light layer (no boxing).
@@ -79,14 +79,14 @@ loop, so chains are zero-overhead (no intermediate closures).
7979
```x
8080
let nums = listOf(1, 2, 3, 4, 5)
8181
82-
nums.map { it * 2 } // List<U> transform (U is the body's type)
83-
nums.filter { it % 2 == 0 } // List<T> keep matching
84-
nums.filterNot { it > 3 } // List<T> drop matching
82+
nums.map { it * 2 } // List<U> - transform (U is the body's type)
83+
nums.filter { it % 2 == 0 } // List<T> - keep matching
84+
nums.filterNot { it > 3 } // List<T> - drop matching
8585
nums.forEach { print(it) } // run a side effect per element
8686
nums.fold(0) { acc, x => acc + x } // reduce with a seed
8787
nums.reduce { a, b => a + b } // reduce, seed = first element
8888
nums.sumOf { it } // sum of a projection (Integer/Number)
89-
nums.count { it > 2 } // Integer how many match
89+
nums.count { it > 2 } // Integer - how many match
9090
nums.any { it > 4 } // Bool
9191
nums.all { it > 0 } // Bool
9292
nums.none { it > 9 } // Bool
@@ -103,7 +103,7 @@ nums.first() / nums.last() // ends (bounds-checked)
103103
nums.toSet() // Set<T> of the elements
104104
nums.toList() // a shallow copy
105105
nums.onEach { print(it) } // side effect per element, returns the list
106-
nums.withIndex() // List<Pair<Integer, T>> index/value pairs
106+
nums.withIndex() // List<Pair<Integer, T>> - index/value pairs
107107
nested.flatten() // List<List<T>> -> List<T>
108108
nums.scan(0) { acc, x => acc + x } // running accumulations, incl. the seed
109109
nums.runningFold(0) { acc, x => acc + x } // alias for scan
@@ -115,8 +115,8 @@ Whole-list reductions over the elements (numeric or `String`):
115115
nums.sum() // numeric total (0 if empty)
116116
nums.min() / nums.max() // natural extreme (aborts if empty)
117117
nums.maxOf { it.score } / nums.minOf { it.score } // extreme of a projection
118-
nums.contains(3) // Bool membership
119-
nums.indexOf(3) // Integer first index, or -1
118+
nums.contains(3) // Bool - membership
119+
nums.indexOf(3) // Integer - first index, or -1
120120
nums.single { it > 4 } // the one match (aborts if 0 or many)
121121
```
122122

@@ -144,19 +144,19 @@ people.sortedByDescending { it.name }
144144
Grouping and slicing into sublists:
145145

146146
```x
147-
people.groupBy { it.team } // Map<K, List<T>> bucket by a key
148-
people.associateBy { it.id } // Map<K, T> index by a key
149-
items.associateWith { it.price } // Map<T, V> element -> value (T is primitive/String)
150-
nums.chunked(3) // List<List<T>> consecutive groups
151-
nums.windowed(3) // List<List<T>> sliding windows
147+
people.groupBy { it.team } // Map<K, List<T>> - bucket by a key
148+
people.associateBy { it.id } // Map<K, T> - index by a key
149+
items.associateWith { it.price } // Map<T, V> - element -> value (T is primitive/String)
150+
nums.chunked(3) // List<List<T>> - consecutive groups
151+
nums.windowed(3) // List<List<T>> - sliding windows
152152
```
153153

154154
`groupBy` results chain: `people.groupBy { it.team }.get("x").average { it.age }`.
155155

156156
### Lazy sequences
157157

158158
`asSequence()` makes the pipeline **lazy**: the chain of lazy operators plus the
159-
terminal compile into a **single fused loop** no intermediate lists are built,
159+
terminal compile into a **single fused loop** - no intermediate lists are built,
160160
and `take` short-circuits.
161161

162162
```x
@@ -173,10 +173,10 @@ nums.asSequence().take(3).sum() // visits only the first 3 elements
173173
- **Terminals:** `toList()`, `toSet()`, `forEach`, `fold(seed)`, `sum()`,
174174
`count()`, `any`, `all`, `first()`, `firstOrNone()`.
175175

176-
They chain naturally `orders.filter { it.paid }.map { it.qty }.fold(0) { a, b => a + b }`.
176+
They chain naturally - `orders.filter { it.paid }.map { it.qty }.fold(0) { a, b => a + b }`.
177177
See `examples/collections/functional_demo.xi`.
178178

179-
## Pairs `Pair<A, B>`
179+
## Pairs - `Pair<A, B>`
180180

181181
A two-value tuple. Build one with the `to` infix; read the members with `.first`
182182
and `.second`. `A` and `B` can be any types (including lists or other pairs).
@@ -192,7 +192,7 @@ Three `List` operations produce or consume pairs:
192192
```x
193193
names.zip(ages) // List<Pair<String, Integer>> (truncated to the shorter)
194194
nums.partition { it > 0 } // Pair<List<Integer> matching, List<Integer> not>
195-
pairs.unzip // Pair<List<A>, List<B>> splits a list of pairs back
195+
pairs.unzip // Pair<List<A>, List<B>> - splits a list of pairs back
196196
```
197197

198198
```x
@@ -212,7 +212,7 @@ See `examples/collections/pairs_demo.xi`.
212212

213213
## `Set<T>`
214214

215-
`Set<T>` is a hash set of **unique** elements also a built-in generic, created
215+
`Set<T>` is a hash set of **unique** elements - also a built-in generic, created
216216
with `empty`. Element-type-erased like `List`, with `String` elements compared by
217217
content (not by reference).
218218

@@ -250,7 +250,7 @@ for x in ids { ... }
250250

251251
## `Map<K, V>`
252252

253-
`Map<K, V>` is a hash map a built-in generic, created with `empty`. Keys are
253+
`Map<K, V>` is a hash map - a built-in generic, created with `empty`. Keys are
254254
primitives or `String` (compared by value, `String` by content); values can be
255255
any type.
256256

@@ -266,7 +266,7 @@ let byId = empty Map<String, Item> // value can be a compound
266266

267267
```x
268268
ages.put("ada", 37) // insert or overwrite
269-
ages.get("ada") // value (aborts if the key is absent guard with has)
269+
ages.get("ada") // value (aborts if the key is absent - guard with has)
270270
ages.getOr("zz", 0) // value, or the fallback if absent
271271
ages.has("ada") // Bool
272272
ages.remove("ada") // delete (no-op if absent)
@@ -277,7 +277,7 @@ ages.keys() // a List<K> of the keys
277277
ages.values() // a List<V> of the values
278278
```
279279

280-
Since lookups can miss, iterate over the keys (no `null` in Ξ a missing key
280+
Since lookups can miss, iterate over the keys (no `null` in Ξ - a missing key
281281
is simply not in `keys()`):
282282

283283
```x
@@ -289,19 +289,19 @@ for k in ages.keys() {
289289

290290
### Notes
291291

292-
- `get` aborts if the key is absent use `has` to check first, or `getOr` for a
292+
- `get` aborts if the key is absent - use `has` to check first, or `getOr` for a
293293
default. (A `V?`-returning lookup will follow once optionals are wired into the
294294
collection API.)
295295
- Keys are restricted to primitives and `String`; values may be any type.
296296
- A `Map<K, V>` is a mutable handle (reference semantics). Iteration order is
297297
unspecified.
298298

299-
## `Vec<T>` dynamic array
299+
## `Vec<T>` - dynamic array
300300

301301
`Vec<T>` is a growable, index-addressable array. It is the **same type as
302-
`List<T>`** under a familiar name, so it has the entire `List` surface indexing
302+
`List<T>`** under a familiar name, so it has the entire `List` surface - indexing
303303
(`get`/`set`), `push`/`removeAt`, the whole [functional API](#functional-operations-on-listt),
304-
and lazy sequences plus two array conveniences:
304+
and lazy sequences - plus two array conveniences:
305305

306306
```x
307307
let v = vecOf(1, 2, 4) // or: empty Vec<Integer>
@@ -314,7 +314,7 @@ v.map { it * 2 }.filter { it > 4 } // the functional pipeline, as on List
314314
Because `Vec<T>` and `List<T>` are interchangeable, a value built with `vecOf`
315315
can be passed wherever a `List<T>` is expected, and vice versa.
316316

317-
## `Stack<T>` LIFO
317+
## `Stack<T>` - LIFO
318318

319319
```x
320320
let s = empty Stack<Integer> // or: stackOf(1, 2, 3)
@@ -324,7 +324,7 @@ s.pop() // remove & return the top (aborts if empty)
324324
s.len() s.isEmpty() s.clear()
325325
```
326326

327-
## `Queue<T>` FIFO
327+
## `Queue<T>` - FIFO
328328

329329
```x
330330
let q = empty Queue<String> // or: queueOf("a", "b")
@@ -336,7 +336,7 @@ q.len() q.isEmpty() q.clear()
336336

337337
Dequeue is amortised O(1) (an internal head index, no per-element shifting).
338338

339-
## `SortedQueue<T>` priority queue
339+
## `SortedQueue<T>` - priority queue
340340

341341
A binary **min-heap**: `pop`/`peek` always return the **smallest** element by
342342
natural order. Element types are the comparable primitives (`Integer`, `Number`,
@@ -345,7 +345,7 @@ natural order. Element types are the comparable primitives (`Integer`, `Number`,
345345
```x
346346
let pq = sortedQueueOf(5, 1, 9, 3) // or: empty SortedQueue<Integer>
347347
pq.push(2)
348-
pq.peek() // 1 the minimum (aborts if empty)
348+
pq.peek() // 1 - the minimum (aborts if empty)
349349
pq.pop() // 1, then 2, then 3, ... (ascending)
350350
pq.len() pq.isEmpty() pq.clear()
351351
```
@@ -354,11 +354,11 @@ pq.len() pq.isEmpty() pq.clear()
354354
> guard with `isEmpty()`/`len()`. These containers are mutable handles (reference
355355
> semantics), like `List`. See `examples/collections/containers_demo.xi`.
356356
357-
## Lazy infinite sources `generateSequence`
357+
## Lazy infinite sources - `generateSequence`
358358

359359
`generateSequence(seed) { next }` is a lazy source whose value starts at `seed`
360360
and advances through the generator each step. It fuses into the sequence loop like
361-
any other source, so it's only as long as the bounded terminal asks for **always
361+
any other source, so it's only as long as the bounded terminal asks for - **always
362362
bound it** with `take`, `takeWhile`, or `first`:
363363

364364
```x

docs/config.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ tax:
3737
rate: 3
3838
```
3939
40-
## `readConfig<T>` read any file into a value
40+
## `readConfig<T>` - read any file into a value
4141

4242
Beyond binding a whole interface, you can read a single file into a value with the
43-
generic `readConfig<T>` form. The format is chosen by extension **JSON, YAML,
43+
generic `readConfig<T>` form. The format is chosen by extension - **JSON, YAML,
4444
and XML** are all supported:
4545

4646
```x
@@ -64,14 +64,14 @@ missing key is the zero value.
6464
- The file is read **once** (a singleton) on first use.
6565
- **YAML and JSON** are both supported, chosen by the file extension.
6666
- A **missing key yields the type's zero value** (empty string, `0`, `false`,
67-
all-zero compound) it never crashes.
67+
all-zero compound) - it never crashes.
6868

69-
## Live reload `ApplicationConfig`
69+
## Live reload - `ApplicationConfig`
7070

7171
`std/config` ships an `ApplicationConfig` service (default impl
7272
`FileApplicationConfig`). Inject it and call `watch(file, topic)`; a background
7373
watcher polls the file's mtime and publishes a `ConfigChanged { file }` event
74-
(via [std/events](events.md)) whenever it's edited re-read the config in a
74+
(via [std/events](events.md)) whenever it's edited - re-read the config in a
7575
`listener` to hot-reload:
7676

7777
```x
@@ -93,7 +93,7 @@ async entry (cfg: ApplicationConfig) main(args: String[]) -> Integer {
9393
```
9494

9595
Bind your own `ApplicationConfig` (an OS-native watcher, or a no-op in tests) to
96-
change the watching strategy callers don't change.
96+
change the watching strategy - callers don't change.
9797

9898
## Test configuration
9999

@@ -107,5 +107,5 @@ module Test { bind AppConfig -> readConfig("application-test.yaml") }
107107

108108
See `examples/serialization/config_demo.xi`.
109109

110-
> `readConfig` is recognized by the compiler only as a `bind` target it is not
110+
> `readConfig` is recognized by the compiler only as a `bind` target - it is not
111111
> a callable function.

0 commit comments

Comments
 (0)