@@ -210,6 +210,52 @@ is `[14 15]`
210210
211211Hopefully this isn't terribly hard to follow.
212212
213+### Editing a Noun, `#`
214+
215+```
216+#[1 a b] a
217+#[(a + a) b c] #[a [b /[(a + a + 1) c]] c]
218+#[(a + a + 1) b c] #[a [/[(a + a) c] b] c]
219+```
220+
221+The `#` operator replaces part of a noun with another noun. `#[x y z]` replaces address `x` of `z` with the noun `y`.
222+
223+Take some noun, say, `[22 33 44 55]`. Let's replace part of it with another noun, `[123 456]`. We can replace the entire original noun as follows:
224+
225+```
226+#[1 [123 456] [22 33 44 55]]
227+```
228+
229+is
230+
231+```
232+[123 456]
233+```
234+
235+If we only want to replace the value at address `2`:
236+
237+```
238+#[2 [123 456] [22 33 44 55]]
239+```
240+
241+is
242+
243+```
244+[[123 456] 33 44 55]
245+```
246+
247+And we can replace address `3`:
248+
249+```
250+#[3 [123 456] [22 33 44 55]]
251+```
252+
253+is
254+
255+```
256+[22 123 456]
257+```
258+
213259## Instructions
214260
215261These rules define Nock itself - ie, the `*` operator.
@@ -227,6 +273,7 @@ Note that we're using Hoon syntax here. Since we do not use Nock
227273from Hoon all that often (it's sort of like embedding assembly in
228274C), we've left it a little cumbersome. In Hoon, instead of
229275writing `*[a 0 b]`, we write
276+
230277```
231278.*(a [0 b])
232279```
@@ -281,10 +328,10 @@ This gives the same `[153 218]`
281328```
282329*[a 3 b] ?*[a b]
283330*[a 4 b] +*[a b]
284−*[a 5 b] =*[a b]
331+*[a 5 b c] =[*[a b] *[a c]]
285332```
286333
287−In lines 23-25, we meet our axiomatic functions again:
334+These are axiomatic functions:
288335
289336For instance, if `x` is a formula that calculates some product,
290337`[4 x]` calculates that product plus one. Hence:
@@ -322,7 +369,7 @@ We could write this line less formally:
322369In other words, if you have two Nock formulas `x` and `y`, a
323370formula that computes the pair of them is just `[x y]`. We can
324371recognize this because no atom is a valid formula, and
325−every formula that *does not* use line 19 has an atomic head.
372+every formula that *does not* use distribution has an atomic head.
326373
327374If you know Lisp, you can think of this feature as a sort of
328375"implicit cons." Where in Lisp you would write `(cons x y)`,
@@ -353,45 +400,45 @@ we get
353400[43 1]
354401```
355402
356−Except for the crash defaults (lines 6, 10, 17, and 35), we've actually
403+Except for the crash defaults, we've actually
357404completed all the _essential_ aspects of Nock. The instructions up
358405through 5 provide all necessary computational functionality.
359406Nock, though very simple, is actually much more complex than it
360407formally needs to be.
361408
362−Operators 6 through 10 are macros. They exist because Nock is
409+Operators 6 through 11 are sugar. They exist because Nock is
363410not a toy, but a practical interpreter. Let's see them all
364411together:
365412
366−## Macros
413+## Sugar
367414
368415```
369−*[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]
370−*[a 7 b c] *[a 2 b 1 c]
371−*[a 8 b c] *[a 7 [[7 [0 1] b] 0 1] c]
372−*[a 9 b c] *[a 7 c 2 [0 1] 0 b]
373−*[a 10 [b c] d] *[a 8 c 7 [0 3] d]
374−*[a 10 b c] *[a c]
416+*[a 6 b c d] *[a *[[c d] 0 *[[2 3] 0 *[a 4 4 b]]]]
417+*[a 7 b c] *[*[a b] c]
418+*[a 8 b c] *[[*[a b] a] c]
419+*[a 9 b c] *[*[a c] 2 [0 1] 0 b]
420+*[a 10 [b c] d] #[b *[a c] *[a d]]
421+
422+*[a 11 [b c] d] *[[*[a c] *[a d]] 0 3]
423+*[a 11 b c] *[a c]
375424```
376425
377−Notice that instructions `6` through `10` are macros: each just
378−expands to a larger formula. Let's try to figure out what these
379−macros do, simplest first:
426+Let's try to figure out what these do, simplest first:
380427
381−### `10`, hint
428+### `11`, hint
382429
383430```
384−*[a 10 b c] *[a c]
431+*[a 11 b c] *[a c]
385432```
386433
387434If `x` is an atom and `y` is a formula, the formula `[10 x y]`
388435appears to be equivalent to... `y`. For instance:
389436
390437```
391−.*([132 19] [10 37 [4 0 3]])
438+.*([132 19] [11 37 [4 0 3]])
392439```
393440
394−Why would we want to do this? `10` is actually a hint instruction.
441+Why would we want to do this? `11` is actually a hint instruction.
395442The `37` in this example is discarded information - it is not
396443used, formally, in the computation. It may help the interpreter
397444compute the expression more efficiently, however.
@@ -403,13 +450,13 @@ the Nock spec. Some are defined in Hoon. Indeed, a naive Nock
403450interpreter not optimized for Hoon will run Hoon quite poorly.
404451When it gets the product, however, the product will be right.
405452
406−There is another instruction `10` rule:
453+There is another instruction `11` rule:
407454
408455```
409−*[a 10 [b c] d] *[a 8 c 7 [0 3] d]
456+*[a 11 [b c] d] *[[*[a c] *[a d]] 0 3]
410457```
411458
412−Once we see what `7` and `8` do, we'll see that this complex hint
459+This complex hint
413460throws away an arbitrary `b`, but computes the formula `c`
414461against the subject and... throws away the product. This formula
415462is simply equivalent to `d`. Of course, in practice the product
@@ -418,12 +465,12 @@ wind up as a side effect.
418465
419466(Why do we even care that `c` is computed? Because `c` could
420467crash. A correct Nock cannot simply ignore it, and treat both
421−variants of `10` as equivalent.)
468+variants of `11` as equivalent.)
422469
423470### `7`, compose
424471
425472```
426−*[a 7 b c] *[a 2 b 1 c]
473+*[a 7 b c] *[*[a b] c]
427474```
428475
429476Suppose we have two formulas, `b` and `c`. What is the formula
@@ -435,13 +482,13 @@ Suppose we have two formulas, `b` and `c`. What is the formula
435482```
436483
437484Good old composition, on Nock formulas. It's easy to see how
438−this is built out of `2`. The data to evaluate is simply `b`,
485+this is a variant of Nock `2`. The data to evaluate is simply `b`,
439486and the formula is `c` quoted.
440487
441488### `8`, extend
442489
443490```
444−*[a 8 b c] *[a 7 [[7 [0 1] b] 0 1] c]
491+*[a 8 b c] *[[*[a b] a] c]
445492```
446493
447494`8` is `7`, except that the subject for `c` is not simply the
@@ -464,22 +511,16 @@ likely to generate an `8`, because the variable is computed
464511against the present subject, and used in a calculation which
465512depends both on the original subject and the new variable.
466513
467−For extra credit, explain why we can't just define
468−
469−```
470−*[a 8 b c] *[a 7 [b 0 1] c]
471−```
472−
473514### `9`, invoke
474515
475516`9` is a calling convention:
476517
477518```
478−*[a 9 b c] *[a 7 c 2 [0 1] 0 b]
519+*[a 9 b c] *[*[a c] 2 [0 1] 0 b]
479520```
480521
481522With `c`, we produce a noun which contains both code and data - a
482−*core*. We use this core as the subject, and evaulate the
523+*core*. We use this core as the subject, and evaluate the
483524formula within it at slot `b`.
484525
485526### `6`, if-then-else
@@ -487,7 +528,7 @@ formula within it at slot `b`.
487528This looks much scarier than it is:
488529
489530```
490−*[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]
531+*[a 6 b c d] *[a *[[c d] 0 *[[2 3] 0 *[a 4 4 b]]]]
491532```
492533
493534If `b` evaluates to `0`, we produce `c`; if `b` evaluates to `1`,