# Index of examples

From A Little Lisp for a Small World, the Plazmi Lisp book (https://plazmi.gg/book). Checked against Plazmi Lisp version 2, 12 November 2026. The whole book as one file: https://plazmi.gg/book.md

Every example in the book, page by page, with the section it teaches and the words of the table it uses. Each links to the example itself.

### Preface

- [preface-sum](https://plazmi.gg/book/preface#ex-preface-sum) (The two ways in; runs): `(+ 2 3)`, `+`
- [preface-key](https://plazmi.gg/book/preface#ex-preface-key) (The two ways in; runs with a key): `(+ 2 3)`, `+`
- [preface-bell](https://plazmi.gg/book/preface#ex-preface-bell) (How to read the examples; runs): `defobject`, `say`

### Forms and values

- [forms-values](https://plazmi.gg/book/forms#ex-forms-values) (Values answer themselves; runs): `(+ 2 3)`, `:k`
- [forms-collections](https://plazmi.gg/book/forms#ex-forms-collections) (Values that hold values; runs): `#"…"`, `(+ 2 3)`, `:k`, `hash-set`, `{"a" 1 :b 2}`
- [forms-calls](https://plazmi.gg/book/forms#ex-forms-calls) (Lists that work something out; runs): `(+ 2 3)`, `*`, `+`, `-`, `max`, `str`
- [forms-nested](https://plazmi.gg/book/forms#ex-forms-nested) (Inside out; runs): `(+ 2 3)`, `*`, `+`, `str`
- [forms-type](https://plazmi.gg/book/forms#ex-forms-type) (What kind of value; runs): `(+ 2 3)`, `:k`, `type`, `{:k v}`
- [forms-quote](https://plazmi.gg/book/forms#ex-forms-quote) (A list as data; runs): `(+ 2 3)`, `list`
- [forms-comment](https://plazmi.gg/book/forms#ex-forms-comment) (Notes to yourself; runs): `(+ 2 3)`, `*`
- [forms-unknown](https://plazmi.gg/book/forms#ex-forms-unknown) (A word that isn't one; is refused)

### Names

- [names-let](https://plazmi.gg/book/names#ex-names-let) (let; runs): `(+ 2 3)`, `(let [x (atom v)] …)`, `*`
- [names-several](https://plazmi.gg/book/names#ex-names-several) (let; runs): `(+ 2 3)`, `(let [x (atom v)] …)`, `*`, `str`
- [names-outside](https://plazmi.gg/book/names#ex-names-outside) (Where a name reaches; is refused): `(+ 2 3)`, `(let [x (atom v)] …)`
- [names-taken](https://plazmi.gg/book/names#ex-names-taken) (Good names; is refused)
- [names-unchanged](https://plazmi.gg/book/names#ex-names-unchanged) (Values don't change; runs): `(+ 2 3)`, `(assoc m :k v)`, `(let [x (atom v)] …)`, `{:k v}`
- [names-again](https://plazmi.gg/book/names#ex-names-again) (Values don't change; runs): `(+ 2 3)`, `(let [x (atom v)] …)`, `+`
- [names-apart](https://plazmi.gg/book/names#ex-names-apart) (Taking values apart; runs): `(+ 2 3)`, `(get m :k)`, `(let [x (atom v)] …)`, `:k`, `nth`, `str`, `{"a" 1 :b 2}`
- [names-keys](https://plazmi.gg/book/names#ex-names-keys) (Reading a key; runs): `(+ 2 3)`, `(get m :k)`, `{:k v}`
- [names-atom](https://plazmi.gg/book/names#ex-names-atom) (A name that changes, at the top of a plan; runs): `(+ 2 3)`, `(dotimes [i n] …)`, `(let [x (atom v)] …)`, `(swap! x + n)`
- [names-swaps](https://plazmi.gg/book/names#ex-names-swaps) (A name that changes, at the top of a plan; runs): `(+ 2 3)`, `(let [x (atom v)] …)`, `(reset! x v)`, `(swap! x + n)`, `(swap! x conj v)`, `(swap! x not)`, `{:k v}`

### Text, lists and maps

- [text-basics](https://plazmi.gg/book/text-lists-maps#ex-text-basics) (Text; runs): `(+ 2 3)`, `count`, `str`, `subs`
- [text-words](https://plazmi.gg/book/text-lists-maps#ex-text-words) (Text; runs): `(+ 2 3)`, `blank?`, `ends-with?`, `includes?`, `lower`, `replace-all`, `starts-with?`, `trim` …
- [text-split](https://plazmi.gg/book/text-lists-maps#ex-text-split) (Text into lists, and back; runs): `(+ 2 3)`, `(join sep l)`, `split`, `words`
- [text-format](https://plazmi.gg/book/text-lists-maps#ex-text-format) (Numbers in text; runs): `(+ 2 3)`, `format`, `parse-double`, `parse-long`
- [text-keywords](https://plazmi.gg/book/text-lists-maps#ex-text-keywords) (Keywords and text; runs): `(+ 2 3)`, `:k`, `name`
- [text-patterns](https://plazmi.gg/book/text-lists-maps#ex-text-patterns) (Patterns; runs): `#"…"`, `(+ 2 3)`, `re-find`, `re-matches`, `re-seq`
- [lists-read](https://plazmi.gg/book/text-lists-maps#ex-lists-read) (Lists; runs): `(+ 2 3)`, `count`, `empty?`, `first`, `last`, `nth`, `rest`, `second`
- [lists-make](https://plazmi.gg/book/text-lists-maps#ex-lists-make) (Lists; runs): `(+ 2 3)`, `(concat a b)`, `(reverse l)`, `(vec (range a b))`, `conj`, `cons`, `distinct`, `drop` …
- [maps-read](https://plazmi.gg/book/text-lists-maps#ex-maps-read) (Maps; runs): `(+ 2 3)`, `(get m :k)`, `:k`, `contains?`, `count`, `get-in`, `keys`, `vals` …
- [maps-make](https://plazmi.gg/book/text-lists-maps#ex-maps-make) (Maps; runs): `(+ 2 3)`, `(assoc m :k v)`, `:k`, `assoc-in`, `count`, `dissoc`, `inc`, `merge` …
- [sets](https://plazmi.gg/book/text-lists-maps#ex-sets) (Sets; runs): `(+ 2 3)`, `(reset! x v)`, `conj`, `contains?`, `disj`, `hash-set`

### Tests and choices

- [choices-tests](https://plazmi.gg/book/choices#ex-choices-tests) (Tests; runs): `(+ 2 3)`, `<`, `=`, `>=`, `empty?`, `even?`, `nil?`, `not=` …
- [choices-logic](https://plazmi.gg/book/choices#ex-choices-logic) (Tests; runs): `(+ 2 3)`, `<`, `=`, `>`, `and`, `not`, `or`
- [choices-truthy](https://plazmi.gg/book/choices#ex-choices-truthy) (What counts as true; runs): `(+ 2 3)`, `(get m :k)`, `and`, `or`, `{:k v}`
- [choices-if](https://plazmi.gg/book/choices#ex-choices-if) (if; runs): `(+ 2 3)`, `(if t … …)`, `(let [x (atom v)] …)`, `=`, `>`, `str`
- [choices-when](https://plazmi.gg/book/choices#ex-choices-when) (when; runs): `(+ 2 3)`, `(if t … …)`, `>`, `str`
- [choices-when-let](https://plazmi.gg/book/choices#ex-choices-when-let) (when; runs): `(+ 2 3)`, `(if t … …)`, `(let [x (atom v)] …)`, `=`, `first`, `not`, `str`
- [choices-cond](https://plazmi.gg/book/choices#ex-choices-cond) (cond; runs): `(+ 2 3)`, `(let [x (atom v)] …)`, `:k`, `<`, `=`, `cond`
- [choices-case](https://plazmi.gg/book/choices#ex-choices-case) (case; runs): `(+ 2 3)`, `(case x 1 "a" "b")`, `:k`, `list`
- [choices-threading](https://plazmi.gg/book/choices#ex-choices-threading) (Threading; runs): `(+ 2 3)`, `(assoc m :k v)`, `(if t … …)`, `(let [x (atom v)] …)`, `(map f l)`, `:k`, `count`, `inc` …

### Working over lists

- [lists-map](https://plazmi.gg/book/over-lists#ex-lists-map) (map; runs): `(+ 2 3)`, `(map f l)`, `count`, `count`, `inc`, `upper`
- [lists-map-fn](https://plazmi.gg/book/over-lists#ex-lists-map-fn) (map; runs): `(+ 2 3)`, `(fn [a b] …)`, `(map f l)`, `*`, `str`
- [lists-map-two](https://plazmi.gg/book/over-lists#ex-lists-map-two) (map; runs): `(+ 2 3)`, `(fn [a b] …)`, `(map f l)`, `str`
- [lists-for](https://plazmi.gg/book/over-lists#ex-lists-for) (for; runs): `(+ 2 3)`, `(fn [a b] …)`, `(map f l)`, `str`
- [lists-filter](https://plazmi.gg/book/over-lists#ex-lists-filter) (filter and remove; runs): `(+ 2 3)`, `(fn [a b] …)`, `(range a b)`, `(swap! x (fn …))`, `>`, `count`, `count`, `even?` …
- [lists-keep](https://plazmi.gg/book/over-lists#ex-lists-keep) (filter and remove; runs): `(+ 2 3)`, `(fn [a b] …)`, `(if t … …)`, `*`, `keep`, `odd?`
- [lists-reduce](https://plazmi.gg/book/over-lists#ex-lists-reduce) (reduce; runs): `(+ 2 3)`, `(fn [a b] …)`, `+`, `count`, `count`, `max`, `reduce`
- [lists-reduce-map](https://plazmi.gg/book/over-lists#ex-lists-reduce-map) (reduce; runs): `(+ 2 3)`, `(fn [a b] …)`, `count`, `fnil`, `inc`, `reduce`, `update`, `{:k v}`
- [lists-ask](https://plazmi.gg/book/over-lists#ex-lists-ask) (Asking about a whole list; runs): `(+ 2 3)`, `(fn [a b] …)`, `(if t … …)`, `=`, `count`, `even?`, `every?`, `neg?` …
- [lists-sort](https://plazmi.gg/book/over-lists#ex-lists-sort) (Sorting and grouping; runs): `(+ 2 3)`, `>`, `count`, `count`, `frequencies`, `group-by`, `max-key`, `sort` …
- [lists-more](https://plazmi.gg/book/over-lists#ex-lists-more) (More list words; runs): `(+ 2 3)`, `(fn [a b] …)`, `+`, `<`, `apply`, `count`, `inc`, `interpose` …
- [lists-dotimes](https://plazmi.gg/book/over-lists#ex-lists-dotimes) (Repeating something a number of times; runs): `(+ 2 3)`, `(dotimes [i n] …)`, `(join sep l)`, `(let [x (atom v)] …)`, `(swap! x conj v)`

### Functions

- [fn-call](https://plazmi.gg/book/functions#ex-fn-call) (fn; runs): `((fn …) x)`, `(+ 2 3)`, `(fn [a b] …)`, `*`
- [fn-map](https://plazmi.gg/book/functions#ex-fn-map) (fn; runs): `(+ 2 3)`, `(fn [a b] …)`, `(map f l)`, `*`, `filter`, `starts-with?`
- [fn-short](https://plazmi.gg/book/functions#ex-fn-short) (The short way: #( ); runs): `(+ 2 3)`, `(fn [a b] …)`, `(map f l)`, `*`, `str`
- [fn-defn](https://plazmi.gg/book/functions#ex-fn-defn) (defn; runs): `(+ 2 3)`, `(defn f [a] …)`, `(f a b)`, `(if t … …)`, `(map f l)`, `=`, `str`
- [fn-let-top](https://plazmi.gg/book/functions#ex-fn-let-top) (defn; is refused): `(+ 2 3)`, `(f a b)`, `(fn [a b] …)`, `(let [x (atom v)] …)`, `*`
- [fn-makers](https://plazmi.gg/book/functions#ex-fn-makers) (Functions that make functions; runs): `((fn …) x)`, `(+ 2 3)`, `+`, `comp`, `complement`, `constantly`, `count`, `count` …
- [fn-recursion](https://plazmi.gg/book/functions#ex-fn-recursion) (A function that calls itself; runs): `(+ 2 3)`, `(defn f [a] …)`, `(f a b)`, `(if t … …)`, `=`, `cons`, `dec`
- [fn-forever](https://plazmi.gg/book/functions#ex-fn-forever) (A function that calls itself; is refused): `(+ 2 3)`, `(defn f [a] …)`, `(f a b)`, `inc`
- [fn-loop](https://plazmi.gg/book/functions#ex-fn-loop) (loop and recur; runs): `(+ 2 3)`, `(if t … …)`, `(loop [i 0] …)`, `+`, `>`, `inc`, `recur`
- [fn-values](https://plazmi.gg/book/functions#ex-fn-values) (A function as a value; runs): `(+ 2 3)`, `(fn [a b] …)`, `(get m :k)`, `(let [x (atom v)] …)`, `(map f l)`, `str`, `{:k v}`

### Chance that repeats

- [chance-words](https://plazmi.gg/book/chance#ex-chance-words) (The words; runs): `(+ 2 3)`, `pick-one`, `rand`, `rand-int`, `rand-nth`, `shuffle`
- [chance-again-1](https://plazmi.gg/book/chance#ex-chance-again-1) (Where the chance comes from; runs): `(+ 2 3)`, `rand-int`
- [chance-again-2](https://plazmi.gg/book/chance#ex-chance-again-2) (Where the chance comes from; runs): `(+ 2 3)`, `rand-int`
- [chance-die](https://plazmi.gg/book/chance#ex-chance-die) (Chance in a toy; runs): `(defobject name {…})`, `inc`, `rand-int`, `say`, `str`
- [chance-jar](https://plazmi.gg/book/chance#ex-chance-jar) (Chance in a toy; runs): `defobject`, `say`
- [chance-in-turn](https://plazmi.gg/book/chance#ex-chance-in-turn) (Chance without repeats; runs): `(+ 2 3)`, `(fn [a b] …)`, `(let [x (atom v)] …)`, `(map f l)`, `(range a b)`, `count`, `mod`, `nth`

### Reading your own home

- [home-coins](https://plazmi.gg/book/your-home#ex-home-coins) (Your coins; runs): `(+ 2 3)`, `coins`
- [home-house](https://plazmi.gg/book/your-home#ex-home-house) (Your house; runs): `(+ 2 3)`, `(get m :k)`, `(map f l)`, `:k`, `count`, `house`, `keys`
- [home-house-deep](https://plazmi.gg/book/your-home#ex-home-house-deep) (Your house; runs): `(+ 2 3)`, `(get m :k)`, `:k`, `first`, `get-in`, `house`
- [home-storage](https://plazmi.gg/book/your-home#ex-home-storage) (What you keep; runs): `(+ 2 3)`, `(get m k)`, `materials`, `storage`
- [home-time](https://plazmi.gg/book/your-home#ex-home-time) (The time and the sky; runs): `(+ 2 3)`, `(get m :k)`, `sky`, `weather`, `world-time`
- [home-greeting](https://plazmi.gg/book/your-home#ex-home-greeting) (The time and the sky; runs): `(+ 2 3)`, `(= :night (:time (sky)))`, `(if t … …)`
- [home-plan](https://plazmi.gg/book/your-home#ex-home-plan) (What a plan is; runs): `(+ 2 3)`, `+`, `coins`, `str`
- [home-each](https://plazmi.gg/book/your-home#ex-home-each) (What a plan is; runs): `(+ 2 3)`, `(dotimes [i n] …)`, `*`

### A first toy

- [bell](https://plazmi.gg/book/first-toy#ex-bell) (The bell; runs): `(defobject name {…})`, `(get m :k)`, `:k`, `inc`, `put!`, `say`, `str`, `{:k v}`
- [bell-better](https://plazmi.gg/book/first-toy#ex-bell-better) (Better words; runs): `(defobject name {…})`, `(f a b)`, `(fn [a b] …)`, `(get m :k)`, `(if t … …)`, `(let [x (atom v)] …)`, `:k`, `=` …
- [bell-who](https://plazmi.gg/book/first-toy#ex-bell-who) (Who played; runs): `(defobject name {…})`, `(get m :k)`, `(let [x (atom v)] …)`, `:k`, `do`, `inc`, `put!`, `say` …
- [bell-two-verbs](https://plazmi.gg/book/first-toy#ex-bell-two-verbs) (More than one verb; runs): `(defobject name {…})`, `(get m :k)`, `:k`, `inc`, `put!`, `say`, `str`, `{:k v}`
- [owl-ask](https://plazmi.gg/book/first-toy#ex-owl-ask) (More than one verb; runs): `defobject`, `say`
- [bell-lines](https://plazmi.gg/book/first-toy#ex-bell-lines) (Saying more than one line; runs): `defobject`, `say`

### A toy that listens

- [parrot](https://plazmi.gg/book/listening#ex-parrot) (:on-hear; runs): `(defobject name {…})`, `(if t … …)`, `includes?`, `lower`, `say`
- [riddle-stone](https://plazmi.gg/book/listening#ex-riddle-stone) (Spoken to, or overheard; runs): `(defobject name {…})`, `(get m :k)`, `(if t … …)`, `includes?`, `lower`, `say`, `{:k v}`
- [parrot-match](https://plazmi.gg/book/listening#ex-parrot-match) (Matching words; runs): `(defobject name {…})`, `(if t … …)`, `(let [x (atom v)] …)`, `first`, `match`, `say`, `str`
- [mirror](https://plazmi.gg/book/listening#ex-mirror) (Turning words round; runs): `(defobject name {…})`, `(get m :k)`, `(if t … …)`, `reflect`, `say`, `str`
- [doorbell](https://plazmi.gg/book/listening#ex-doorbell) (Knowing who spoke; runs): `(defobject name {…})`, `(get m :k)`, `(if t … …)`, `=`, `say`, `str`

### Keeping time

- [sundial](https://plazmi.gg/book/dawn#ex-sundial) (:on-tick, at dawn; runs): `(defobject name {…})`, `(get m :k)`, `:k`, `inc`, `put!`, `say`, `str`, `{:k v}`
- [greeter-time](https://plazmi.gg/book/dawn#ex-greeter-time) (The time of day; runs): `(case x 1 "a" "b")`, `(defobject name {…})`, `(get m :k)`, `:k`, `say`, `sky`
- [mood-stone](https://plazmi.gg/book/dawn#ex-mood-stone) (Your colour; runs): `(case x 1 "a" "b")`, `(defobject name {…})`, `(get m :k)`, `(if t … …)`, `:k`, `colour`, `my-colour`, `say` …
- [welcome-sign](https://plazmi.gg/book/dawn#ex-welcome-sign) (:on-visit, on the Commons; runs): `(defobject name {…})`, `say`, `str`

### A toy with a memory

- [guest-log](https://plazmi.gg/book/memory#ex-guest-log) (A guest log; runs): `(defobject name {…})`, `(get m :k)`, `(join sep l)`, `:k`, `conj`, `put!`, `say`, `str` …
- [friend-counter](https://plazmi.gg/book/memory#ex-friend-counter) (A count for each friend; runs): `(defobject name {…})`, `(get m :k)`, `(get m k)`, `(if t … …)`, `(let [x (atom v)] …)`, `:k`, `=`, `count` …
- [wish-jar](https://plazmi.gg/book/memory#ex-wish-jar) (A wish jar; runs): `(defobject name {…})`, `(get m :k)`, `(if t … …)`, `(join sep l)`, `(let [x (atom v)] …)`, `:k`, `conj`, `do` …
- [hoarder](https://plazmi.gg/book/memory#ex-hoarder) (What a memory can hold; runs): `(defobject name {…})`, `(dotimes [i n] …)`, `(join sep l)`, `:k`, `put!`, `{:k v}`

### A small game

- [game-state](https://plazmi.gg/book/a-small-game#ex-game-state) (Each player's own game; a fragment): `(+ 2 3)`, `{"a" 1 :b 2}`, `{:k v}`
- [refuse-example](https://plazmi.gg/book/a-small-game#ex-refuse-example) (Saying no; a fragment)
- [stone-pile](https://plazmi.gg/book/a-small-game#ex-stone-pile) (The whole toy; runs): `#"…"`, `(defobject name {…})`, `(f a b)`, `(fn [a b] …)`, `(get m :k)`, `(get m k)`, `(if t … …)`, `(join sep l)` …

### Pictures and dances

- [flag](https://plazmi.gg/book/designs-and-dances#ex-flag) (A design; runs): `design`
- [heart](https://plazmi.gg/book/designs-and-dances#ex-heart) (A design; runs): `design`
- [stairs](https://plazmi.gg/book/designs-and-dances#ex-stairs) (A design worked out; runs): `(defn f [a] …)`, `(f a b)`, `(fn [a b] …)`, `(if t … …)`, `(join sep l)`, `(map f l)`, `(mapv (fn [x] …) l)`, `(range a b)` …
- [stairs-and-answer](https://plazmi.gg/book/designs-and-dances#ex-stairs-and-answer) (A design worked out; is refused): `(+ 2 3)`, `(defn f [a] …)`, `(f a b)`, `(fn [a b] …)`, `(if t … …)`, `(join sep l)`, `(map f l)`, `(mapv (fn [x] …) l)` …
- [frame](https://plazmi.gg/book/designs-and-dances#ex-frame) (A design worked out; runs): `(defn f [a] …)`, `(f a b)`, `(fn [a b] …)`, `(if t … …)`, `(join sep l)`, `(map f l)`, `(mapv (fn [x] …) l)`, `(range a b)` …
- [porch-step](https://plazmi.gg/book/designs-and-dances#ex-porch-step) (A dance; runs): `defdance`
- [garden-waltz](https://plazmi.gg/book/designs-and-dances#ex-garden-waltz) (A dance; runs): `defdance`
- [own-things](https://plazmi.gg/book/designs-and-dances#ex-own-things) (Your own things, by name; runs): `(+ 2 3)`, `(get m :k)`, `(own? :toy "name")`
- [porch-again](https://plazmi.gg/book/designs-and-dances#ex-porch-again) (Your own things, by name; runs): `(vec (concat a b))`, `defdance`

### The house as a form

- [house-roof-read](https://plazmi.gg/book/the-house#ex-house-roof-read) (Read it first; runs): `(+ 2 3)`, `(get m :k)`, `first`, `house`
- [house-roof](https://plazmi.gg/book/the-house#ex-house-roof) (The roof; runs): `(+ 2 3)`, `(get m :k)`, `first`, `house`, `roof`
- [house-finish](https://plazmi.gg/book/the-house#ex-house-finish) (Floors, window boxes and paint; runs): `floor`, `paint`, `window-box`
- [house-more](https://plazmi.gg/book/the-house#ex-house-more) (A porch, a chimney, a storey; runs): `build-up`, `chimney`, `porch`
- [house-room](https://plazmi.gg/book/the-house#ex-house-room) (A porch, a chimney, a storey; runs): `room`
- [house-place](https://plazmi.gg/book/the-house#ex-house-place) (Things in their places; runs): `defobject`, `say`
- [house-move](https://plazmi.gg/book/the-house#ex-house-move) (Things in their places; runs): `move`
- [house-place-twice](https://plazmi.gg/book/the-house#ex-house-place-twice) (Things in their places; is refused): `place`
- [house-all-or-nothing](https://plazmi.gg/book/the-house#ex-house-all-or-nothing) (When something won't do; is refused): `hang-lights`, `roof`
- [house-still](https://plazmi.gg/book/the-house#ex-house-still) (When something won't do; runs): `(+ 2 3)`, `(get m :k)`, `first`, `house`
- [house-worked-out](https://plazmi.gg/book/the-house#ex-house-worked-out) (A value worked out; runs): `(+ 2 3)`, `(get m :k)`, `(if t … …)`, `(let [x (atom v)] …)`, `:k`, `=`, `first`, `house` …
- [house-worked-out-plain](https://plazmi.gg/book/the-house#ex-house-worked-out-plain) (A value worked out; is refused): `(let [x (atom v)] …)`
- [house-worked-out-bad](https://plazmi.gg/book/the-house#ex-house-worked-out-bad) (A value worked out; is refused): `(let [x (atom v)] …)`, `*`, `roof`
- [house-shape](https://plazmi.gg/book/the-house#ex-house-shape) (The whole shape; runs): `(+ 2 3)`, `(get m :k)`, `(map f l)`, `:k`, `house`, `house`

### Living with others

- [walls-eval](https://plazmi.gg/book/living-with-others#ex-walls-eval) (The walls; is refused)
- [walls-like](https://plazmi.gg/book/living-with-others#ex-walls-like) (The walls; is refused): `paint`
- [walls-toy](https://plazmi.gg/book/living-with-others#ex-walls-toy) (What a toy can do; is refused)
- [open-bell](https://plazmi.gg/book/living-with-others#ex-open-bell) (Open toys; runs): `(defobject name {…})`, `(get m :k)`, `:k`, `inc`, `put!`, `say`, `str`, `{:k v}`
- [closed-chime](https://plazmi.gg/book/living-with-others#ex-closed-chime) (Open toys; runs): `defobject`, `say`
- [mira-kettle](https://plazmi.gg/book/living-with-others#ex-mira-kettle) (Open toys; runs with a key): `(defobject name {…})`, `(get m :k)`, `:k`, `inc`, `place`, `put!`, `say`, `str` …
- [mira-after](https://plazmi.gg/book/living-with-others#ex-mira-after) (Making one after another; runs with a key)
- [after-chat](https://plazmi.gg/book/living-with-others#ex-after-chat) (Making one after another; is refused)
- [manners](https://plazmi.gg/book/living-with-others#ex-manners) (Manners in what a toy says; runs): `defobject`, `say`

### Limits, errors and refusals

- [err-form](https://plazmi.gg/book/limits-and-errors#ex-err-form) (Before it runs; is refused)
- [err-ratio](https://plazmi.gg/book/limits-and-errors#ex-err-ratio) (Before it runs; is refused)
- [err-field](https://plazmi.gg/book/limits-and-errors#ex-err-field) (Before it runs; is refused)
- [err-times](https://plazmi.gg/book/limits-and-errors#ex-err-times) (Before it runs; is refused): `(+ 2 3)`, `(dotimes [i n] …)`, `inc`
- [err-params](https://plazmi.gg/book/limits-and-errors#ex-err-params) (Before it runs; is refused): `(defn f [a] …)`
- [err-fuel](https://plazmi.gg/book/limits-and-errors#ex-err-fuel) (While it runs; is refused): `(+ 2 3)`, `(loop [i 0] …)`, `inc`, `recur`
- [err-divide](https://plazmi.gg/book/limits-and-errors#ex-err-divide) (While it runs; is refused): `(+ 2 3)`, `(/ a b)`
- [err-index](https://plazmi.gg/book/limits-and-errors#ex-err-index) (While it runs; is refused): `(+ 2 3)`, `nth`
- [err-nil](https://plazmi.gg/book/limits-and-errors#ex-err-nil) (While it runs; is refused): `(+ 2 3)`, `(get m :k)`, `+`, `{:k v}`
- [err-case](https://plazmi.gg/book/limits-and-errors#ex-err-case) (While it runs; is refused): `(+ 2 3)`, `(case x 1 "a" "b")`, `:k`
- [err-toy](https://plazmi.gg/book/limits-and-errors#ex-err-toy) (In a toy; runs): `(defobject name {…})`, `(get m :k)`, `nth`, `say`, `str`, `{:k v}`

### Style

- [style-small](https://plazmi.gg/book/style#ex-style-small) (Small functions; runs): `(+ 2 3)`, `(defn f [a] …)`, `(f a b)`, `(if t … …)`, `(join sep l)`, `=`, `empty?`, `str`
- [style-old-state](https://plazmi.gg/book/style#ex-style-old-state) (State that lasts; runs): `(defobject name {…})`, `(get m :k)`, `:k`, `inc`, `put!`, `say`, `{:k v}`
- [style-new-state](https://plazmi.gg/book/style#ex-style-new-state) (State that lasts; runs): `(defobject name {…})`, `(get m :k)`, `(let [x (atom v)] …)`, `:k`, `count`, `count`, `do`, `fnil` …

### Other spellings

- [spelling-check](https://plazmi.gg/book/spellings#ex-spelling-check) (A worked-out step; a fragment): `+`, `roof`

### Words in brief

- [brief-fixed](https://plazmi.gg/book/words-in-brief#ex-brief-fixed) (The fixed tests and their spellings; runs): `(+ 2 3)`, `(/ (double a) b)`, `(/ a b)`, `(= :rain (:weather (sky)))`, `(contains? (set l) v)`, `(format "%.2f" (double n))`, `(vec (reverse l))`
- [brief-swaps](https://plazmi.gg/book/words-in-brief#ex-brief-swaps) (Names that change: the other two shapes; runs): `(+ 2 3)`, `(let [x (atom v)] …)`, `(reset! x (rand-nth l))`, `(swap! x - n)`, `string?`
- [brief-numbers](https://plazmi.gg/book/words-in-brief#ex-brief-numbers) (Numbers; runs): `(+ 2 3)`, `*`, `==`, `abs`, `atan2`, `ceil`, `clamp`, `compare` …
- [brief-number-kinds](https://plazmi.gg/book/words-in-brief#ex-brief-number-kinds) (Numbers of other kinds; runs): `(+ 2 3)`, `(/ a b)`, `*'`, `+'`, `-'`, `bigdec`, `bigint`, `biginteger` …
- [brief-number-tests](https://plazmi.gg/book/words-in-brief#ex-brief-number-tests) (Tests on numbers; runs): `(+ 2 3)`, `(/ a b)`, `decimal?`, `double?`, `float?`, `int?`, `integer?`, `nat-int?` …
- [brief-bits](https://plazmi.gg/book/words-in-brief#ex-brief-bits) (Bits; runs): `(+ 2 3)`, `bit-and`, `bit-and-not`, `bit-clear`, `bit-flip`, `bit-not`, `bit-or`, `bit-set` …
- [brief-truth](https://plazmi.gg/book/words-in-brief#ex-brief-truth) (True, false and nothing; runs): `(+ 2 3)`, `:k`, `any?`, `boolean`, `boolean?`, `false?`, `identical?`, `identity` …
- [brief-kinds](https://plazmi.gg/book/words-in-brief#ex-brief-kinds) (What kind of value; runs): `(+ 2 3)`, `:k`, `associative?`, `char?`, `coll?`, `count`, `counted?`, `first` …
- [brief-lists](https://plazmi.gg/book/words-in-brief#ex-brief-lists) (Lists, front and back; runs): `(+ 2 3)`, `butlast`, `count`, `drop-last`, `drop-while`, `ffirst`, `fnext`, `next` …
- [brief-making](https://plazmi.gg/book/words-in-brief#ex-brief-making) (Making lists and maps; runs): `(+ 2 3)`, `+`, `:k`, `array-map`, `bounded-count`, `count`, `empty`, `find` …
- [brief-over](https://plazmi.gg/book/words-in-brief#ex-brief-over) (Over a list; runs): `(+ 2 3)`, `(fn [a b] …)`, `(if t … …)`, `(map f l)`, `+`, `:k`, `coll?`, `count` …
- [brief-sorted](https://plazmi.gg/book/words-in-brief#ex-brief-sorted) (Sorted maps and sets; runs): `(+ 2 3)`, `:k`, `<`, `>`, `count`, `rsubseq`, `sorted-map`, `sorted-map-by` …
- [brief-fold](https://plazmi.gg/book/words-in-brief#ex-brief-fold) (Steps that fold; runs): `((fn …) x)`, `(+ 2 3)`, `(fn [a b] …)`, `(if t … …)`, `+`, `>`, `cat`, `completing` …
- [brief-functions](https://plazmi.gg/book/words-in-brief#ex-brief-functions) (Functions of functions; runs): `((fn …) x)`, `(+ 2 3)`, `(fn [a b] …)`, `count`, `even?`, `every-pred`, `inc`, `memoize` …
- [brief-text](https://plazmi.gg/book/words-in-brief#ex-brief-text) (Text, symbols and keywords; runs): `#"…"`, `(+ 2 3)`, `(let [x (atom v)] …)`, `:k`, `char`, `char-escape-string`, `char-name-string`, `ident?` …
- [brief-chance](https://plazmi.gg/book/words-in-brief#ex-brief-chance) (Chance, once more; runs): `(+ 2 3)`, `count`, `random-sample`
- [brief-toy](https://plazmi.gg/book/words-in-brief#ex-brief-toy) (A toy's other words; runs): `(defobject name {…})`, `:k`, `color`, `glow-color`, `glow-colour`, `my-color`, `my-glow`, `say` …

### Answers to the exercises

- [ans-forms-1](https://plazmi.gg/book/answers#ex-ans-forms-1) (Forms and values; runs): `(+ 2 3)`, `*`
- [ans-forms-2](https://plazmi.gg/book/answers#ex-ans-forms-2) (Forms and values; runs): `(+ 2 3)`, `+`, `str`
- [ans-forms-3](https://plazmi.gg/book/answers#ex-ans-forms-3) (Forms and values; runs): `(+ 2 3)`, `str`, `type`
- [ans-forms-4](https://plazmi.gg/book/answers#ex-ans-forms-4) (Forms and values; runs): `(+ 2 3)`, `{:k v}`
- [ans-names-1](https://plazmi.gg/book/answers#ex-ans-names-1) (Names; runs): `(+ 2 3)`, `(let [x (atom v)] …)`, `*`
- [ans-names-2](https://plazmi.gg/book/answers#ex-ans-names-2) (Names; runs): `(+ 2 3)`, `(get m :k)`, `(let [x (atom v)] …)`, `str`, `{:k v}`
- [ans-names-4](https://plazmi.gg/book/answers#ex-ans-names-4) (Names; runs): `(+ 2 3)`, `(dotimes [i n] …)`, `(let [x (atom v)] …)`, `(swap! x + n)`
- [ans-text-1](https://plazmi.gg/book/answers#ex-ans-text-1) (Text, lists and maps; runs): `(+ 2 3)`, `(join sep l)`, `(map f l)`, `count`, `upper`
- [ans-text-2](https://plazmi.gg/book/answers#ex-ans-text-2) (Text, lists and maps; runs): `(+ 2 3)`, `count`, `words`
- [ans-text-3](https://plazmi.gg/book/answers#ex-ans-text-3) (Text, lists and maps; runs): `(+ 2 3)`, `:k`, `assoc`, `{:k v}`
- [ans-text-4](https://plazmi.gg/book/answers#ex-ans-text-4) (Text, lists and maps; runs): `(+ 2 3)`, `(range a b)`, `take-last`, `vec`
- [ans-text-5](https://plazmi.gg/book/answers#ex-ans-text-5) (Text, lists and maps; runs): `(+ 2 3)`, `includes?`, `starts-with?`
- [ans-choices-1](https://plazmi.gg/book/answers#ex-ans-choices-1) (Tests and choices; runs): `(+ 2 3)`, `(let [x (atom v)] …)`, `:k`, `<`, `cond`
- [ans-choices-2](https://plazmi.gg/book/answers#ex-ans-choices-2) (Tests and choices; runs): `(+ 2 3)`, `(case x 1 "a" "b")`, `:k`
- [ans-choices-3](https://plazmi.gg/book/answers#ex-ans-choices-3) (Tests and choices; runs): `(+ 2 3)`, `and`, `or`
- [ans-choices-4](https://plazmi.gg/book/answers#ex-ans-choices-4) (Tests and choices; runs): `(+ 2 3)`, `(if t … …)`, `(let [x (atom v)] …)`, `*`, `count`, `even?`, `filter`, `first`
- [ans-lists-1](https://plazmi.gg/book/answers#ex-ans-lists-1) (Working over lists; runs): `(+ 2 3)`, `(mapv (fn [x] …) l)`, `(range a b)`, `*`
- [ans-lists-2](https://plazmi.gg/book/answers#ex-ans-lists-2) (Working over lists; runs): `(+ 2 3)`, `apply`, `count`, `frequencies`, `key`, `max-key`, `val`
- [ans-lists-3](https://plazmi.gg/book/answers#ex-ans-lists-3) (Working over lists; runs): `(+ 2 3)`, `(fn [a b] …)`, `(if t … …)`, `>`, `count`, `reduce`
- [ans-lists-4](https://plazmi.gg/book/answers#ex-ans-lists-4) (Working over lists; runs): `(+ 2 3)`, `(fn [a b] …)`, `filter`, `starts-with?`
- [ans-fn-1](https://plazmi.gg/book/answers#ex-ans-fn-1) (Functions; runs): `(+ 2 3)`, `(defn f [a] …)`, `(f a b)`, `str`, `upper`
- [ans-fn-2](https://plazmi.gg/book/answers#ex-ans-fn-2) (Functions; runs): `(+ 2 3)`, `(fn [a b] …)`, `(map f l)`, `+`
- [ans-fn-3](https://plazmi.gg/book/answers#ex-ans-fn-3) (Functions; runs): `(+ 2 3)`, `(defn f [a] …)`, `(f a b)`, `(if t … …)`, `+`, `count`, `empty?`, `first` …
- [ans-fn-4](https://plazmi.gg/book/answers#ex-ans-fn-4) (Functions; runs): `(+ 2 3)`, `(if t … …)`, `(loop [i 0] …)`, `*`, `>`, `recur`
- [ans-chance-1](https://plazmi.gg/book/answers#ex-ans-chance-1) (Chance that repeats; runs): `(+ 2 3)`, `+`, `inc`, `rand-int`
- [ans-chance-2](https://plazmi.gg/book/answers#ex-ans-chance-2) (Chance that repeats; runs): `(+ 2 3)`, `shuffle`
- [ans-chance-4](https://plazmi.gg/book/answers#ex-ans-chance-4) (Chance that repeats; runs): `defobject`, `say`
- [ans-home-1](https://plazmi.gg/book/answers#ex-ans-home-1) (Reading your own home; runs): `(+ 2 3)`, `(if t … …)`, `-`, `>=`, `coins`
- [ans-home-2](https://plazmi.gg/book/answers#ex-ans-home-2) (Reading your own home; runs): `(+ 2 3)`, `(get m :k)`, `(join sep l)`, `(map f l)`, `:k`, `house`
- [ans-home-3](https://plazmi.gg/book/answers#ex-ans-home-3) (Reading your own home; runs): `(+ 2 3)`, `(= :night (:time (sky)))`, `(if t … …)`
- [ans-home-4](https://plazmi.gg/book/answers#ex-ans-home-4) (Reading your own home; runs): `(+ 2 3)`, `(get m :k)`, `(let [x (atom v)] …)`, `-`, `first`, `parse-long`, `split`, `world-time`
- [ans-toy-1](https://plazmi.gg/book/answers#ex-ans-toy-1) (A first toy; runs): `(defobject name {…})`, `(get m :k)`, `:k`, `inc`, `put!`, `say`, `str`, `{:k v}`
- [ans-toy-2](https://plazmi.gg/book/answers#ex-ans-toy-2) (A first toy; runs): `(defobject name {…})`, `(get m :k)`, `:k`, `inc`, `put!`, `say`, `str`, `{:k v}`
- [ans-toy-3](https://plazmi.gg/book/answers#ex-ans-toy-3) (A first toy; runs): `(defobject name {…})`, `(get m :k)`, `(if t … …)`, `:k`, `=`, `inc`, `put!`, `say` …
- [ans-toy-4](https://plazmi.gg/book/answers#ex-ans-toy-4) (A first toy; runs): `(defobject name {…})`
- [ans-listen-1](https://plazmi.gg/book/answers#ex-ans-listen-1) (A toy that listens; runs): `(defobject name {…})`, `(if t … …)`, `hash-set`, `lower`, `say`, `some`, `words`
- [ans-listen-3](https://plazmi.gg/book/answers#ex-ans-listen-3) (A toy that listens; runs): `(defobject name {…})`, `(get m :k)`, `(if t … …)`, `and`, `includes?`, `lower`, `nil?`, `not` …
- [ans-dawn-1](https://plazmi.gg/book/answers#ex-ans-dawn-1) (Keeping time; runs): `(defobject name {…})`, `(get m :k)`, `:k`, `inc`, `put!`, `say`, `str`, `{:k v}`
- [ans-dawn-2](https://plazmi.gg/book/answers#ex-ans-dawn-2) (Keeping time; runs): `(= :night (:time (sky)))`, `(defobject name {…})`, `(if t … …)`, `say`
- [ans-dawn-3](https://plazmi.gg/book/answers#ex-ans-dawn-3) (Keeping time; runs): `(defobject name {…})`, `(get m :k)`, `name`, `say`, `str`, `weather`
- [ans-dawn-4](https://plazmi.gg/book/answers#ex-ans-dawn-4) (Keeping time; runs): `(defobject name {…})`, `(if t … …)`, `glow-colour`, `say`
- [ans-memory-1](https://plazmi.gg/book/answers#ex-ans-memory-1) (A toy with a memory; runs): `(defobject name {…})`, `(get m :k)`, `(if t … …)`, `(join sep l)`, `(let [x (atom v)] …)`, `:k`, `conj`, `do` …
- [ans-memory-2](https://plazmi.gg/book/answers#ex-ans-memory-2) (A toy with a memory; runs): `(defobject name {…})`, `(get m :k)`, `(if t … …)`, `(let [x (atom v)] …)`, `:k`, `apply`, `count`, `empty?` …
- [ans-game-3](https://plazmi.gg/book/answers#ex-ans-game-3) (A small game; runs): `(defobject name {…})`, `(get m :k)`, `(get m k)`, `(if t … …)`, `(let [x (atom v)] …)`, `:k`, `=`, `assoc` …
- [ans-designs-1](https://plazmi.gg/book/answers#ex-ans-designs-1) (Pictures and dances; runs): `design`
- [ans-designs-2](https://plazmi.gg/book/answers#ex-ans-designs-2) (Pictures and dances; runs): `(defn f [a] …)`, `(dotimes [i n] …)`, `(f a b)`, `(if t … …)`, `(join sep l)`, `(mapv (fn [x] …) l)`, `(range a b)`, `design` …
- [ans-designs-3](https://plazmi.gg/book/answers#ex-ans-designs-3) (Pictures and dances; runs): `defdance`
- [ans-designs-4-first](https://plazmi.gg/book/answers#ex-ans-designs-4-first) (Pictures and dances; runs): `defdance`
- [ans-designs-4](https://plazmi.gg/book/answers#ex-ans-designs-4) (Pictures and dances; runs): `(vec (reverse l))`, `defdance`
- [ans-house-1](https://plazmi.gg/book/answers#ex-ans-house-1) (The house as a form; runs): `(get m :k)`, `(let [x (atom v)] …)`, `+`, `first`, `house`, `roof`
- [ans-house-2](https://plazmi.gg/book/answers#ex-ans-house-2) (The house as a form; runs): `window-box`
- [ans-house-3](https://plazmi.gg/book/answers#ex-ans-house-3) (The house as a form; runs): `paint`, `rand-nth`
- [ans-house-4](https://plazmi.gg/book/answers#ex-ans-house-4) (The house as a form; runs): `(+ 2 3)`, `(get m :k)`, `(map f l)`, `:k`, `house`, `house`
- [ans-limits-1](https://plazmi.gg/book/answers#ex-ans-limits-1) (Limits, errors and refusals; runs): `(+ 2 3)`, `nth`
- [ans-limits-2](https://plazmi.gg/book/answers#ex-ans-limits-2) (Limits, errors and refusals; runs): `(+ 2 3)`, `(get m :k)`, `(let [x (atom v)] …)`, `:k`, `>`, `cond`, `or`, `{:k v}`
- [ans-limits-4](https://plazmi.gg/book/answers#ex-ans-limits-4) (Limits, errors and refusals; is refused): `(+ 2 3)`, `(vec (range a b))`


---

Before: [Glossary](https://plazmi.gg/book/glossary.md). Next: [Answers to the exercises](https://plazmi.gg/book/answers.md). Contents: https://plazmi.gg/book.md
