From d3114681ed5f56f4261bff652109cc96ea86affc Mon Sep 17 00:00:00 2001 From: Sigilante Date: Tue, 4 Aug 2026 15:15:37 -0600 Subject: [PATCH] docs: regenerate drifted stdlib source blocks from sys/hoon.hoon Against urbit@08026c84b2. 35 `#### Source` blocks in content/hoon/stdlib/ no longer matched the arms they quote. Regenerated mechanically rather than by hand, because two earlier PRs in this series showed that hand-reconstructing a source tail produces plausible, wrong Hoon (+rig and +hew, both caught by diffing). METHOD Every `## +arm` / `### +arm:door` heading was paired with its `#### Source` block and diffed against the arm of the same qualified name extracted from hoon.hoon, with comments stripped and leading indentation normalised. Where they differed, the doc block was replaced with the source verbatim. Final state, by the same script: 681 blocks match, 26 are deliberate excerpts, 0 drift. THREE CLASSES OF FALSE POSITIVE HAD TO BE EXCLUDED FIRST, or the run would have done real damage: 1. Door headers. `+by`, `+in`, `+ja`, `+to`, `+rs` and friends quote only the first few lines of a core -- through `|@` or `|_` -- because the full arm is hundreds of lines. A naive regeneration would have inlined all 262 lines of `+by` into the reference. Detected by testing whether the doc block is a PREFIX of the source. 2. Blocks that omit the leading `++ name` line. Some entries start at `~/ %po`. Compared against both the full arm and the arm minus its first line, and the replacement preserves whichever convention the block already used. Without this, `+in` and `+po` looked like drift. 3. Arms already corrected in other open PRs of this series (trim, bif, apt, del, dif, shas, mink, mock, mack, inde, iny, peg, mure, mute, rend, molt, rt, stab, mes, hif, clz, ctz, ham, rig, hew, slub) were excluded by name, so this branch does not conflict with them. ONE BLOCK WAS FIXED BY HAND: `+by`'s header is genuine drift, not an excerpt -- it still shows `=* node ?>(?=(^ a) n.a)`, an alias that appears NOWHERE in hoon.hoon and is used by none of the door's arms. Removed that single line rather than replacing the block, which would have inlined the whole core. Representative corrections, all now verbatim: +bool `0`/`1` -> `%.y`/`%.n` loobean literals, and an explicit ^- type +ape:ag `(cold 0 ...)` -> `(cold `@`0 ...)` +mot:ag gained `dub`, the UIP-135 leading-zero date segment +welp +zing +corl +curr +cury +bend +comp +here +knee +int/+uni/+uno dropped their `=+ ... |@ ++ $ ... --` wrappers for direct wet gates VERIFIED AFTER THE RUN - re-ran the differ: 0 drift remaining - code-fence balance checked in every stdlib file - cross-file anchors checked: 0 broken - the 6 `#### Source` blocks followed by prose rather than a fence were checked against upstream/master and are PRE-EXISTING, not damage from this change Co-Authored-By: Claude Opus 5 --- content/hoon/stdlib/1a.md | 1 + content/hoon/stdlib/2b.md | 22 +++----- content/hoon/stdlib/2e.md | 32 ++++++----- content/hoon/stdlib/2h.md | 65 ++++++++++------------ content/hoon/stdlib/2i.md | 110 +++++++++++++++++--------------------- content/hoon/stdlib/2n.md | 17 +++--- content/hoon/stdlib/3b.md | 8 +-- content/hoon/stdlib/3g.md | 5 +- content/hoon/stdlib/4b.md | 18 ++++--- content/hoon/stdlib/4e.md | 54 +++++++++---------- content/hoon/stdlib/4f.md | 27 ++++------ content/hoon/stdlib/4i.md | 10 ++-- content/hoon/stdlib/4j.md | 3 +- content/hoon/stdlib/4l.md | 4 +- content/hoon/stdlib/5a.md | 83 ++++++++++++++-------------- content/hoon/stdlib/5c.md | 17 +++--- 16 files changed, 218 insertions(+), 258 deletions(-) diff --git a/content/hoon/stdlib/1a.md b/content/hoon/stdlib/1a.md index b244fc7c..d009c324 100644 --- a/content/hoon/stdlib/1a.md +++ b/content/hoon/stdlib/1a.md @@ -217,6 +217,7 @@ A cell of `$atom`s. ```hoon ++ dvr + ~/ %dvr |: [a=`@`1 b=`@`1] ^- [p=@ q=@] ~_ leaf+"divide-by-zero" diff --git a/content/hoon/stdlib/2b.md b/content/hoon/stdlib/2b.md index aec71c3e..42b1ada3 100644 --- a/content/hoon/stdlib/2b.md +++ b/content/hoon/stdlib/2b.md @@ -1560,13 +1560,10 @@ A `+list`. ```hoon ++ welp ~/ %welp - =| [* *] - |@ - ++ $ - ?~ +<- - +<-(. +<+) - +<-(+ $(+<- +<->)) - -- + |* [* *] + ?~ +<- + +<-(. +<+) + +<-(+ $(+<- +<->)) ``` #### Examples @@ -1611,13 +1608,10 @@ A `+list`. ```hoon ++ zing ~/ %zing - =| * - |@ - ++ $ - ?~ +< - +< - (welp +<- $(+< +<+)) - -- + |* * + ?~ +< + +< + (welp +<- $(+< +<+)) ``` #### Examples diff --git a/content/hoon/stdlib/2e.md b/content/hoon/stdlib/2e.md index 7a7d9b6b..dc80446d 100644 --- a/content/hoon/stdlib/2e.md +++ b/content/hoon/stdlib/2e.md @@ -101,21 +101,19 @@ An atom. #### Source ```hoon -++ muk :: standard murmur3 - ~% %muk ..muk ~ - =+ ~(. fe 5) +++ muk + ~/ %muk |= [syd=@ len=@ key=@] + ^- @ + =+ ~(. fe 5) =. syd (end 5 syd) - =/ pad (sub len (met 3 key)) - =/ data (weld (rip 3 key) (reap pad 0)) - =/ nblocks (div len 4) :: intentionally off-by-one + =/ nblocks (div len 4) =/ h1 syd =+ [c1=0xcc9e.2d51 c2=0x1b87.3593] - =/ blocks (rip 5 key) =/ i nblocks =. h1 =/ hi h1 |- ?: =(0 i) hi - =/ k1 (snag (sub nblocks i) blocks) :: negative array index + =/ k1 (cut 5 [(sub nblocks i) 1] key) =. k1 (sit (mul k1 c1)) =. k1 (rol 0 15 k1) =. k1 (sit (mul k1 c2)) @@ -123,31 +121,31 @@ An atom. =. hi (rol 0 13 hi) =. hi (sum (sit (mul hi 5)) 0xe654.6b64) $(i (dec i)) - =/ tail (slag (mul 4 nblocks) data) + =/ tail (rsh [3 (mul 4 nblocks)] key) =/ k1 0 =/ tlen (dis len 3) =. h1 - ?+ tlen h1 :: fallthrough switch - %3 =. k1 (mix k1 (lsh [0 16] (snag 2 tail))) - =. k1 (mix k1 (lsh [0 8] (snag 1 tail))) - =. k1 (mix k1 (snag 0 tail)) + ?+ tlen h1 + %3 =. k1 (mix k1 (lsh [0 16] (cut 3 [2 1] tail))) + =. k1 (mix k1 (lsh [0 8] (cut 3 [1 1] tail))) + =. k1 (mix k1 (cut 3 [0 1] tail)) =. k1 (sit (mul k1 c1)) =. k1 (rol 0 15 k1) =. k1 (sit (mul k1 c2)) (mix h1 k1) - %2 =. k1 (mix k1 (lsh [0 8] (snag 1 tail))) - =. k1 (mix k1 (snag 0 tail)) + %2 =. k1 (mix k1 (lsh [0 8] (cut 3 [1 1] tail))) + =. k1 (mix k1 (cut 3 [0 1] tail)) =. k1 (sit (mul k1 c1)) =. k1 (rol 0 15 k1) =. k1 (sit (mul k1 c2)) (mix h1 k1) - %1 =. k1 (mix k1 (snag 0 tail)) + %1 =. k1 (mix k1 (cut 3 [0 1] tail)) =. k1 (sit (mul k1 c1)) =. k1 (rol 0 15 k1) =. k1 (sit (mul k1 c2)) (mix h1 k1) == - =. h1 (mix h1 len) + =. h1 (mix h1 (end 5 len)) |^ (fmix32 h1) ++ fmix32 |= h=@ diff --git a/content/hoon/stdlib/2h.md b/content/hoon/stdlib/2h.md index 4074e3e4..a2a170f9 100644 --- a/content/hoon/stdlib/2h.md +++ b/content/hoon/stdlib/2h.md @@ -530,22 +530,19 @@ A `+set`. ```hoon ++ int ~/ %int - =+ b=a - |@ - ++ $ - |- ^+ a - ?~ b - ~ - ?~ a - ~ - ?. (mor n.a n.b) - $(a b, b a) - ?: =(n.b n.a) - a(l $(a l.a, b l.b), r $(a r.a, b r.b)) - ?: (gor n.b n.a) - %- uni(a $(a l.a, r.b ~)) $(b r.b) - %- uni(a $(a r.a, l.b ~)) $(b l.b) - -- + |* b=_a + |- ^+ a + ?~ b + ~ + ?~ a + ~ + ?. (mor n.a n.b) + $(a b, b a) + ?: =(n.b n.a) + a(l $(a l.a, b l.b), r $(a r.a, b r.b)) + ?: (gor n.b n.a) + %- uni(a $(a l.a, r.b ~)) $(b r.b) + %- uni(a $(a r.a, l.b ~)) $(b l.b) ``` #### Examples @@ -767,25 +764,22 @@ A `+set`. ```hoon ++ uni ~/ %uni - =+ b=a - |@ - ++ $ - ?: =(a b) a - |- ^+ a - ?~ b - a - ?~ a - b - ?: =(n.b n.a) - b(l $(a l.a, b l.b), r $(a r.a, b r.b)) - ?: (mor n.a n.b) - ?: (gor n.b n.a) - $(l.a $(a l.a, r.b ~), b r.b) - $(r.a $(a r.a, l.b ~), b l.b) - ?: (gor n.a n.b) - $(l.b $(b l.b, r.a ~), a r.a) - $(r.b $(b r.b, l.a ~), a l.a) - -- + |* b=_a + ?: =(a b) a + |- ^+ a + ?~ b + a + ?~ a + b + ?: =(n.b n.a) + b(l $(a l.a, b l.b), r $(a r.a, b r.b)) + ?: (mor n.a n.b) + ?: (gor n.b n.a) + $(l.a $(a l.a, r.b ~), b r.b) + $(r.a $(a r.a, l.b ~), b l.b) + ?: (gor n.a n.b) + $(l.b $(b l.b, r.a ~), a r.a) + $(r.b $(b r.b, l.a ~), a l.a) ``` #### Examples @@ -828,7 +822,6 @@ An `$atom`. ~% %wyt + ~ |. ^- @ ?~(a 0 +((add $(a l.a) $(a r.a)))) --- ``` #### Examples diff --git a/content/hoon/stdlib/2i.md b/content/hoon/stdlib/2i.md index ab8f61d9..5723dc99 100644 --- a/content/hoon/stdlib/2i.md +++ b/content/hoon/stdlib/2i.md @@ -31,7 +31,6 @@ Container arm for `+map` operation arms. A `+map` is a `+set` of key-value pairs ++ by ~/ %by =| a=(tree (pair)) :: (map) - =* node ?>(?=(^ a) n.a) |@ ``` @@ -704,26 +703,23 @@ A `+map`. ```hoon ++ int ~/ %int - =+ b=a - |@ - ++ $ - |- ^+ a - ?~ b - ~ - ?~ a - ~ - ?: (mor p.n.a p.n.b) - ?: =(p.n.b p.n.a) - b(l $(a l.a, b l.b), r $(a r.a, b r.b)) - ?: (gor p.n.b p.n.a) - %- uni(a $(a l.a, r.b ~)) $(b r.b) - %- uni(a $(a r.a, l.b ~)) $(b l.b) - ?: =(p.n.a p.n.b) - b(l $(b l.b, a l.a), r $(b r.b, a r.a)) - ?: (gor p.n.a p.n.b) - %- uni(a $(b l.b, r.a ~)) $(a r.a) - %- uni(a $(b r.b, l.a ~)) $(a l.a) - -- + |* b=_a + |- ^+ a + ?~ b + ~ + ?~ a + ~ + ?: (mor p.n.a p.n.b) + ?: =(p.n.b p.n.a) + b(l $(a l.a, b l.b), r $(a r.a, b r.b)) + ?: (gor p.n.b p.n.a) + %- uni(a $(a l.a, r.b ~)) $(b r.b) + %- uni(a $(a r.a, l.b ~)) $(b l.b) + ?: =(p.n.a p.n.b) + b(l $(b l.b, a l.a), r $(b r.b, a r.a)) + ?: (gor p.n.a p.n.b) + %- uni(a $(b l.b, r.a ~)) $(a r.a) + %- uni(a $(b r.b, l.a ~)) $(a l.a) ``` #### Examples @@ -1179,24 +1175,21 @@ A `+map`. ```hoon ++ uni ~/ %uni - =+ b=a - |@ - ++ $ - |- ^+ a - ?~ b - a - ?~ a - b - ?: =(p.n.b p.n.a) - b(l $(a l.a, b l.b), r $(a r.a, b r.b)) - ?: (mor p.n.a p.n.b) - ?: (gor p.n.b p.n.a) - $(l.a $(a l.a, r.b ~), b r.b) - $(r.a $(a r.a, l.b ~), b l.b) - ?: (gor p.n.a p.n.b) - $(l.b $(b l.b, r.a ~), a r.a) - $(r.b $(b r.b, l.a ~), a l.a) - -- + |* b=_a + |- ^+ a + ?~ b + a + ?~ a + b + ?: =(p.n.b p.n.a) + b(l $(a l.a, b l.b), r $(a r.a, b r.b)) + ?: (mor p.n.a p.n.b) + ?: (gor p.n.b p.n.a) + $(l.a $(a l.a, r.b ~), b r.b) + $(r.a $(a r.a, l.b ~), b l.b) + ?: (gor p.n.a p.n.b) + $(l.b $(b l.b, r.a ~), a r.a) + $(r.b $(b r.b, l.a ~), a l.a) ``` #### Examples @@ -1240,27 +1233,24 @@ A `+map`. ```hoon ++ uno - =+ b=a - |@ - ++ $ - |= meg=$-([_p:node _q:node _q:node] _q:node) - |- ^+ a - ?~ b - a - ?~ a - b - ?: =(p.n.b p.n.a) - :+ [p.n.a (meg p.n.a q.n.a q.n.b)] - $(b l.b, a l.a) - $(b r.b, a r.a) - ?: (mor p.n.a p.n.b) - ?: (gor p.n.b p.n.a) - $(l.a $(a l.a, r.b ~), b r.b) - $(r.a $(a r.a, l.b ~), b l.b) - ?: (gor p.n.a p.n.b) - $(l.b $(b l.b, r.a ~), a r.a) - $(r.b $(b r.b, l.a ~), a l.a) - -- + |* b=_a + |* meg=$-([* * *] *) + |- ^+ a + ?~ b + a + ?~ a + b + ?: =(p.n.b p.n.a) + :+ [p.n.a `_?>(?=(^ a) q.n.a)`(meg p.n.a q.n.a q.n.b)] + $(b l.b, a l.a) + $(b r.b, a r.a) + ?: (mor p.n.a p.n.b) + ?: (gor p.n.b p.n.a) + $(l.a $(a l.a, r.b ~), b r.b) + $(r.a $(a r.a, l.b ~), b l.b) + ?: (gor p.n.a p.n.b) + $(l.b $(b l.b, r.a ~), a r.a) + $(r.b $(b r.b, l.a ~), a l.a) ``` #### Examples diff --git a/content/hoon/stdlib/2n.md b/content/hoon/stdlib/2n.md index 57f0e4b0..be68379a 100644 --- a/content/hoon/stdlib/2n.md +++ b/content/hoon/stdlib/2n.md @@ -103,10 +103,9 @@ This is the inverse of [`+cork`](#cork). ```hoon ++ corl |* [a=$-(* *) b=$-(* *)] - =< +:|.((a (b))) :: type check - =+ c=+<.b - |@ ++ $ (a (b c)) - -- + =< +:|.((a (b))) + |* c=_,.+<.b + (a (b c)) ``` #### Examples @@ -144,9 +143,8 @@ A gate. ```hoon ++ curr |* [a=$-(^ *) c=*] - =+ b=+<+.a - |@ ++ $ (a b c) - -- + |* b=_,.+<-.a + (a b c) ``` #### Examples @@ -184,9 +182,8 @@ A gate. ```hoon ++ cury |* [a=$-(^ *) b=*] - =+ c=+<+.a - |@ ++ $ (a b c) - -- + |* c=_,.+<+.a + (a b c) ``` #### Examples diff --git a/content/hoon/stdlib/3b.md b/content/hoon/stdlib/3b.md index ccd34b5c..b19d5f41 100644 --- a/content/hoon/stdlib/3b.md +++ b/content/hoon/stdlib/3b.md @@ -27,10 +27,10 @@ Produces either a float (`%f`), an infinity of other sign (`%i`), or not-a-numbe ```hoon ++ fn - $% [%f s=? e=@s a=@u] - [%i s=?] - [%n ~] - == + $% [%f s=? e=@s a=@u] + [%i s=?] + [%n ~] + == ``` #### Examples diff --git a/content/hoon/stdlib/3g.md b/content/hoon/stdlib/3g.md index 1dfe15b5..733159c7 100644 --- a/content/hoon/stdlib/3g.md +++ b/content/hoon/stdlib/3g.md @@ -361,9 +361,8 @@ Pull result out of a [`$edge`](#edge), or crash if there's no result. #### Source ```hoon -++ wonk =+ veq=$:edge - |@ ++ $ ?~(q.veq !! p.u.q.veq) - -- +++ wonk |* veq=_$:edge + ?~(q.veq !! p.u.q.veq) ``` #### Examples diff --git a/content/hoon/stdlib/4b.md b/content/hoon/stdlib/4b.md index d40c27d1..db7d30a9 100644 --- a/content/hoon/stdlib/4b.md +++ b/content/hoon/stdlib/4b.md @@ -772,8 +772,6 @@ A `$flag`. |= a=@ta |= b=@ ^- ? ?. =(%t (end 3 a)) - :: XX more and better sanity - :: & =+ [inx=0 len=(met 3 b)] ?: =(%tas a) @@ -797,12 +795,18 @@ A `$flag`. $(inx +(inx)) == |- ^- ? - ?: =(0 b) & - =+ cur=(end 3 b) + ?: =(inx len) & + =+ cur=(cut 3 [inx 1] b) ?: &((lth cur 32) !=(10 cur)) | - =+ len=(teff cur) - ?& |(=(1 len) =+(i=1 |-(|(=(i len) &((gte (cut 3 [i 1] b) 128) $(i +(i))))))) - $(b (rsh [3 len] b)) + =+ tef=(teff cur) + ?& ?| =(1 tef) + =+ i=1 + |- ^- ? + ?| =(i tef) + ?& (gte (cut 3 [(add i inx) 1] b) 128) + $(i +(i)) + == == == + $(inx (add inx tef)) == ``` diff --git a/content/hoon/stdlib/4e.md b/content/hoon/stdlib/4e.md index bdda7bd4..153b627d 100644 --- a/content/hoon/stdlib/4e.md +++ b/content/hoon/stdlib/4e.md @@ -38,22 +38,19 @@ A `$rule`. ```hoon ++ bend ~/ %bend - =+ raq=|*([a=* b=*] [~ u=[a b]]) - |@ - ++ $ - ~/ %fun - |* [vex=edge sab=rule] - ?~ q.vex - vex - =+ yit=(sab q.u.q.vex) - =+ yur=(last p.vex p.yit) - ?~ q.yit - [p=yur q=q.vex] - =+ vux=(raq p.u.q.vex p.u.q.yit) - ?~ vux - [p=yur q=q.vex] - [p=yur q=[~ u=[p=u.vux q=q.u.q.yit]]] - -- + |* raq=_|*([a=* b=*] [~ u=[a b]]) + ~/ %fun + |* [vex=edge sab=rule] + ?~ q.vex + vex + =+ yit=(sab q.u.q.vex) + =+ yur=(last p.vex p.yit) + ?~ q.yit + [p=yur q=q.vex] + =+ vux=(raq p.u.q.vex p.u.q.yit) + ?~ vux + [p=yur q=q.vex] + [p=yur q=[~ u=[p=u.vux q=q.u.q.yit]]] ``` #### Examples @@ -114,20 +111,17 @@ A `$rule`. ```hoon ++ comp ~/ %comp - =+ raq=|*([a=* b=*] [a b]) - |@ - ++ $ - ~/ %fun - |* [vex=edge sab=rule] - ~! +< - ?~ q.vex - vex - =+ yit=(sab q.u.q.vex) - =+ yur=(last p.vex p.yit) - ?~ q.yit - [p=yur q=q.yit] - [p=yur q=[~ u=[p=(raq p.u.q.vex p.u.q.yit) q=q.u.q.yit]]] - -- + |* raq=_|*([a=* b=*] [a b]) + ~/ %fun + |* [vex=edge sab=rule] + ~! +< + ?~ q.vex + vex + =+ yit=(sab q.u.q.vex) + =+ yur=(last p.vex p.yit) + ?~ q.yit + [p=yur q=q.yit] + [p=yur q=[~ u=[p=(raq p.u.q.vex p.u.q.yit) q=q.u.q.yit]]] ``` #### Examples diff --git a/content/hoon/stdlib/4f.md b/content/hoon/stdlib/4f.md index 240e49d4..4fe86e1b 100644 --- a/content/hoon/stdlib/4f.md +++ b/content/hoon/stdlib/4f.md @@ -399,16 +399,13 @@ A `$rule`. ```hoon ++ here ~/ %here - =+ [hez=|=([a=pint b=*] [a b]) sef=*rule] - |@ - ++ $ - ~/ %fun - |= tub=nail - =+ vex=(sef tub) - ?~ q.vex - vex - [p=p.vex q=[~ u=[p=(hez [p.tub p.q.u.q.vex] p.u.q.vex) q=q.u.q.vex]]] - -- + |* [hez=_|=([a=pint b=*] [a b]) sef=rule] + ~/ %fun + |= tub=nail + =+ vex=(sef tub) + ?~ q.vex + vex + [p=p.vex q=[~ u=[p=(hez [p.tub p.q.u.q.vex] p.u.q.vex) q=q.u.q.vex]]] ``` #### Examples @@ -655,12 +652,10 @@ A `$rule`. ```hoon ++ knee - =| [gar=* sef=_|.(*rule)] - |@ ++ $ - |= tub=nail - ^- (like _gar) - ((sef) tub) - -- + |* [gar=* sef=_|.(*rule)] + |= tub=nail + ^- (like _gar) + ((sef) tub) ``` #### Examples diff --git a/content/hoon/stdlib/4i.md b/content/hoon/stdlib/4i.md index e8e6a4f8..7c4dc31f 100644 --- a/content/hoon/stdlib/4i.md +++ b/content/hoon/stdlib/4i.md @@ -990,10 +990,10 @@ Parse single-soq cord with `\{gap}/` anywhere in the middle, or triple-single qu ;~ less soz (ifix [soq soq] (boss 256 (more gon qit))) == - =+ hed=;~(pose ;~(plug (plus ace) vul) (just '\0a')) - %- iny %+ ifix - :- ;~(plug soz hed) - ;~(plug (just '\0a') soz) + %+ iny + =+ vul=;~(plug col col (star prn)) + :- ;~(plug soz ;~(pose ;~(plug (plus ace) vul) (easy ~))) + soz (boss 256 (star qat)) == == @@ -1174,7 +1174,7 @@ Parse comments and produce a null. Note that a comment must be ended with a newl ++ vul %+ cold ~ ;~ plug col col (star prn) - (just `@`10) + ;~(pose (just `@`10) (full (easy ~))) == ``` diff --git a/content/hoon/stdlib/4j.md b/content/hoon/stdlib/4j.md index bfcc2616..55929ca6 100644 --- a/content/hoon/stdlib/4j.md +++ b/content/hoon/stdlib/4j.md @@ -1181,7 +1181,7 @@ A `$rule`. #### Source ```hoon -++ ape |*(fel=rule ;~(pose (cold 0 (just '0')) fel)) +++ ape |*(fel=rule ;~(pose (cold `@`0 (just '0')) fel)) ``` #### Examples @@ -1548,6 +1548,7 @@ Parse a numerical month (1-12). (just '1') (cook |=(a=@ (add 10 (sub a '0'))) (shim '0' '2')) == + dub sed:ab == ``` diff --git a/content/hoon/stdlib/4l.md b/content/hoon/stdlib/4l.md index 442bc18a..afc47957 100644 --- a/content/hoon/stdlib/4l.md +++ b/content/hoon/stdlib/4l.md @@ -595,8 +595,8 @@ Parsing `$rule`. Parse a `@da`-formatted date string (sans the leading `~`) to a %+ cook |=([a=@ b=?] [b a]) ;~(plug dim:ag ;~(pose (cold | hep) (easy &))) - ;~(pfix dot mot:ag) :: month - ;~(pfix dot dip:ag) :: day + ;~(pfix dot mot:ag) + ;~(pfix dot dap:ag) ;~ pose ;~ pfix ;~(plug dot dot) diff --git a/content/hoon/stdlib/5a.md b/content/hoon/stdlib/5a.md index 53756c0b..33ba5eb5 100644 --- a/content/hoon/stdlib/5a.md +++ b/content/hoon/stdlib/5a.md @@ -34,7 +34,9 @@ Make loobean. #### Source ```hoon -++ bool `type`(fork [%atom %f `0] [%atom %f `1] ~) +++ bool + ^- type + (fork [%atom %f `%.y] [%atom %f `%.n] ~) ``` --- @@ -188,11 +190,10 @@ Combine two formulas. ~/ %cond |= [pex=nock yom=nock woq=nock] ^- nock - ?- pex - [%1 %0] yom - [%1 %1] woq - * [%6 pex yom woq] - == + ?: =([%1 &] pex) yom + ?: =([%1 |] pex) woq + ?: =([%0 0] pex) pex + [%6 pex yom woq] ``` --- @@ -245,10 +246,10 @@ Aura compatibility. =(0 p.wux) &(!=(0 p.wux) (lte p.wux p.yoz)) == - |- ?| =(%$ p.yoz) - =(%$ p.wux) - ?& =((end 3 p.yoz) (end 3 p.wux)) - $(p.yoz (rsh 3 p.yoz), p.wux (rsh 3 p.wux)) + |- ?| =(%$ q.yoz) + =(%$ q.wux) + ?& =((end 3 q.yoz) (end 3 q.wux)) + $(q.yoz (rsh 3 q.yoz), q.wux (rsh 3 q.wux)) == == == @@ -267,19 +268,18 @@ Loobean `&`. ~/ %flan |= [bos=nock nif=nock] ^- nock - ?: =(bos nif) bos - ?: =([%0 0] bos) nif - ?: =([%0 0] nif) bos - ?- bos - [%1 %1] bos - [%1 %0] nif - * - ?- nif - [%1 %1] nif - [%1 %0] bos - * [%6 bos nif [%1 1]] - == - == + ?: ?| =(bos nif) + =([%1 |] bos) + =([%1 &] nif) + =([%0 0] bos) + == + bos + ?: ?| =([%1 &] bos) + =([%1 |] nif) + =([%0 0] nif) + == + nif + [%6 bos nif [%1 |]] ``` --- @@ -311,19 +311,18 @@ Loobean `|`. ~/ %flor |= [bos=nock nif=nock] ^- nock - ?: =(bos nif) bos - ?: =([%0 0] bos) nif - ?: =([%0 0] nif) bos - ?- bos - [%1 %1] nif - [%1 %0] bos - * - ?- nif - [%1 %1] bos - [%1 %0] nif - * [%6 bos [%1 0] nif] - == - == + ?: ?| =(bos nif) + =([%1 &] bos) + =([%1 |] nif) + =([%0 0] bos) + == + bos + ?: ?| =([%1 |] bos) + =([%1 &] nif) + =([%0 0] nif) + == + nif + [%6 bos [%1 &] nif] ``` --- @@ -484,25 +483,21 @@ Compiler utility. |- ^- (unit [p=axis q=hoon]) ?- dom ~ ~ - :: [* ~ ~] - %+ bind (look cog q.q.n.dom) + %+ bind (look cog q.n.dom) |=((pair axis hoon) [(peg axe p) q]) - :: [* ~ *] - =+ yep=(look cog q.q.n.dom) + =+ yep=(look cog q.n.dom) ?^ yep [~ (peg (peg axe 2) p.u.yep) q.u.yep] $(axe (peg axe 3), dom r.dom) - :: [* * ~] - =+ yep=(look cog q.q.n.dom) + =+ yep=(look cog q.n.dom) ?^ yep [~ (peg (peg axe 2) p.u.yep) q.u.yep] $(axe (peg axe 3), dom l.dom) - :: [* * *] - =+ yep=(look cog q.q.n.dom) + =+ yep=(look cog q.n.dom) ?^ yep [~ (peg (peg axe 2) p.u.yep) q.u.yep] =+ pey=$(axe (peg axe 6), dom l.dom) diff --git a/content/hoon/stdlib/5c.md b/content/hoon/stdlib/5c.md index b9906da4..b4d1c066 100644 --- a/content/hoon/stdlib/5c.md +++ b/content/hoon/stdlib/5c.md @@ -593,13 +593,12 @@ A `(unit vase)`. ```hoon ++ slew - |= [axe=@ vax=vase] ^- (unit vase) - ?. |- ^- ? - ?: =(1 axe) & - ?. ?=(^ q.vax) | - $(axe (mas axe), q.vax .*(q.vax [0 (cap axe)])) - ~ - `[(~(peek ut p.vax) %free axe) .*(q.vax [0 axe])] + |= [axe=@ vax=vase] + =/ typ |. (~(peek ut p.vax) %free axe) + |- ^- (unit vase) + ?: =(1 axe) `[$:typ q.vax] + ?@ q.vax ~ + $(axe (mas axe), q.vax ?-((cap axe) %2 -.q.vax, %3 +.q.vax)) ``` #### Examples @@ -707,7 +706,7 @@ Superficial arm. [%core *] |- ^- ? ?~ q.r.q.typ | - ?| (~(has by q.q.n.q.r.q.typ) cog) + ?| (~(has by q.n.q.r.q.typ) cog) $(q.r.q.typ l.q.r.q.typ) $(q.r.q.typ r.q.r.q.typ) == @@ -743,7 +742,7 @@ A `(list term)`. %- zing %+ turn ~(tap by q.r.q.typ) |= [* b=tome] - %+ turn ~(tap by q.b) + %+ turn ~(tap by b) |= [a=term *] a ==