Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Appendix B: The Slices

Chapter 1 listed the twelve slices the plan divided ved into. This appendix records how they were built: which commit holds each one in ved’s history, which crate under examples/ holds it in this book, and which chapter covers it. The hashes are from the excelano/ved repository.

B.1 The twelve slices

#SliceCommitDateCrateChapter
1REPL loop, -p/--prompt08516632026-04-10ch02-repl2
2Buffer, a, ., p, ,pd7668182026-04-10ch03-buffer3
3Addresses, current line, nd7668182026-04-10ch04-addresses4
4w and q, the double qd7668182026-04-10ch05-write5
5aThe regex engine, step 1515d4b92026-04-11ch07-pike7
5aThe regex engine, steps 2 to 562c33ad2026-04-12ch08-bre8, 9
5bsdec3f542026-04-12ch10-substitute10
6d and i7f3369b2026-04-12ch11-editing11
7g and vc107e272026-04-12ch12-global12
8Long-form aliasesa4539c42026-04-12ch13-files14
9Confirmations, Qa4539c42026-04-12ch13-files14
10Ha4539c42026-04-12ch13-files14
11Files, e, ra4539c42026-04-12ch13-files13
12ld8d02cb2026-06-11ved14

Slices two to four were one commit, and so were slices eight to eleven. The crates for slices four, five, and onward match a commit file for file. The crates for slices two and three, ch03-buffer and ch04-addresses, match no commit: they were made for this book by taking the slice two-to-four commit and removing the later slices from it, so that chapters 3 and 4 each have a program that builds and runs at the point the chapter ends. Slices eight to eleven have one crate between them, because the chapters that cover them, 13 and 14, describe that commit from two directions.

Slice 12 was planned with the others and built a month after the first release, in 0.1.4, so its code is only in examples/ved.

The dates show the plan’s slices were unequal, as chapter 1 said they would be. Slices one to four took a day. The regex engine took two. Slices 5b to 11, seven slices including files and the help system, were built on one day.

B.2 After the plan

The slices ended at 0.1.0. Everything after was added in response to use:

VersionAddedChapter
0.1.1c11
0.1.2A missing file is a new file13
0.1.3Greedy *, leftmost-longest7
0.1.4l (slice 12)14
0.1.5j, m, t, octal escapes, bare s10, 11
0.2.0Encoding warnings, the overwrite refusal13
0.2.1The command-letter panic, the tenth-group panic5, 9
0.3.0Search addresses, character-aware matching19
0.4.0The fixes for this book’s findings; -s, %, write, edit, read20, 21, 22
0.4.1l escapes and folding; the harness’s last differences22

examples/ved is 0.2.1, examples/ch19-living is 0.3.0, and examples/ch21-fixed is 0.4.0.

B.3 The crates

CrateLinesTestsState of the program
ch02-repl1230A loop that can quit
ch03-buffer2520Text in and out
ch04-addresses4870Addresses and ranges
ch05-write6090Saving and the unsaved-buffer guard
ch07-pike83223Pike’s matcher, not yet connected
ch08-bre1,43469The full engine, not yet connected
ch10-substitute1,71176s
ch11-editing1,76876d and i
ch12-global1,86476g and v
ch13-files2,00676Files, aliases, help, Q
ved2,871125Release 0.2.1
ch19-living3,625185Release 0.3.0
ch21-fixed4,367225Release 0.4.0

Every crate builds and runs on its own, with cargo run -p <crate> from examples/, and cargo test there runs all of them.