on master help sign in
Merge branch 'cleanorg' of github.com:urbit/docs into free
commit16d4dc400ec02d147c20558e1bfb0fd606008299 authorGalen Wolfe-Pauly <root@office-for.com> dateWed 23 Mar 2016, 10:54 (11 years ago) parent97e0cdff35d42e
267 files changed+4492−2140
docs/system/hoon/core.md+24 docs/system/hoon/core/demo.md+56 docs/system/hoon/core/examples.md+453 docs/system/hoon/core/jargon.md+83 docs/system/hoon/core/mint.md+25 docs/system/hoon/core/nock.md+160 docs/system/hoon/core/noun.md+33 docs/system/hoon/core/philosophy.md+41 docs/system/hoon/core/span.md+118 docs/system/hoon/core/twig.md+48 docs/system/hoon/core/twig/atom.md+107 docs/system/hoon/core/twig/call.md+121 docs/system/hoon/core/twig/cast.md+53 docs/system/hoon/core/twig/cell.md+81 docs/system/hoon/core/twig/core.md+90 docs/system/hoon/core/twig/flow.md+143 docs/system/hoon/core/twig/limb.md+103 docs/system/hoon/core/twig/mold.md+136 docs/system/hoon/core/twig/nock.md+36 docs/system/hoon/core/twig/syntax.md+20 docs/system/hoon/core/twig/syntax/design.md+297 docs/system/hoon/core/twig/syntax/motivation.md+56 docs/system/hoon/core/twig/test.md+143 docs/system/hoon/library/src/1a/gate/add.md+1−1 docs/system/hoon/library/src/1a/gate/dec.md+2−3 docs/system/hoon/library/src/1a/gate/div.md+2−2 docs/system/hoon/library/src/1a/gate/gte.md+3−3 docs/system/hoon/library/src/1a/gate/gth.md+4−3 docs/system/hoon/library/src/1a/gate/lte.md+3−2 docs/system/hoon/library/src/1a/gate/lth.md+5−6 docs/system/hoon/library/src/1a/gate/max.md+2−3 docs/system/hoon/library/src/1a/gate/min.md+3−4 docs/system/hoon/library/src/1a/gate/mod.md+3−3 docs/system/hoon/library/src/1a/gate/mul.md+3−4 docs/system/hoon/library/src/1a/gate/sub.md+9−9 docs/system/hoon/library/src/1b/gate/cap.md+14−14 docs/system/hoon/library/src/1b/gate/mas.md+11−11 docs/system/hoon/library/src/1b/gate/peg.md+5−6 docs/system/hoon/library/src/1c/mold/bloq.md+1−2 docs/system/hoon/library/src/1c/mold/each.md+7−6 docs/system/hoon/library/src/1c/mold/gate.md+9−11 docs/system/hoon/library/src/1c/mold/list.md+9−7 docs/system/hoon/library/src/1c/mold/lone.md+2−4 docs/system/hoon/library/src/1c/mold/pair.md+3−2 docs/system/hoon/library/src/1c/mold/pole.md+5−2 docs/system/hoon/library/src/1c/mold/qual.md+3−2 docs/system/hoon/library/src/1c/mold/trap.md+3−4 docs/system/hoon/library/src/1c/mold/tree.md+4−2 docs/system/hoon/library/src/1c/mold/trel.md+5−3 docs/system/hoon/library/src/1c/mold/unit.md+13−7 docs/system/hoon/library/src/2a/gate/biff.md+5−4 docs/system/hoon/library/src/2a/gate/bind.md+6−5 docs/system/hoon/library/src/2a/gate/bond.md+4−3 docs/system/hoon/library/src/2a/gate/both.md+3−2 docs/system/hoon/library/src/2a/gate/clap.md+7−6 docs/system/hoon/library/src/2a/gate/drop.md+5−4 docs/system/hoon/library/src/2a/gate/fall.md+4−3 docs/system/hoon/library/src/2a/gate/lift.md+6−5 docs/system/hoon/library/src/2a/gate/mate.md+12−11 docs/system/hoon/library/src/2a/gate/need.md+7−6 docs/system/hoon/library/src/2b/gate/flop.md+2−1 docs/system/hoon/library/src/2b/gate/homo.md+4−3 docs/system/hoon/library/src/2b/gate/lent.md+4−3 docs/system/hoon/library/src/2b/gate/levy.md+7−4 docs/system/hoon/library/src/2b/gate/lien.md+16−7 docs/system/hoon/library/src/2b/gate/limo.md+1−1 docs/system/hoon/library/src/2b/gate/murn.md+6−5 docs/system/hoon/library/src/2b/gate/reap.md+5−4 docs/system/hoon/library/src/2b/gate/reel.md+6−5 docs/system/hoon/library/src/2b/gate/skid.md+6−4 docs/system/hoon/library/src/2b/gate/skim.md+12−9 docs/system/hoon/library/src/2b/gate/skip.md+5−4 docs/system/hoon/library/src/2b/gate/slag.md+3−2 docs/system/hoon/library/src/2b/gate/snag.md+4−3 docs/system/hoon/library/src/2b/gate/sort.md+7−6 docs/system/hoon/library/src/2b/gate/swag.md+4−3 docs/system/hoon/library/src/2b/gate/turn.md+4−3 docs/system/hoon/library/src/2b/gate/weld.md+4−3 docs/system/hoon/library/src/2b/gate/welp.md+5−4 docs/system/hoon/library/src/2b/gate/zing.md+3−1 docs/system/hoon/library/src/2c/gate/bex.md+2−2 docs/system/hoon/library/src/2c/gate/can.md+4−4 docs/system/hoon/library/src/2c/gate/cat.md+4−3 docs/system/hoon/library/src/2c/gate/cut.md+3−3 docs/system/hoon/library/src/2c/gate/end.md+5−4 docs/system/hoon/library/src/2c/gate/fil.md+5−4 docs/system/hoon/library/src/2c/gate/lsh.md+4−3 docs/system/hoon/library/src/2c/gate/met.md+3−3 docs/system/hoon/library/src/2c/gate/rap.md+4−4 docs/system/hoon/library/src/2c/gate/rep.md+3−3 docs/system/hoon/library/src/2c/gate/rip.md+4−4 docs/system/hoon/library/src/2c/gate/rsh.md+3−3 docs/system/hoon/library/src/2c/gate/swp.md+3−3 docs/system/hoon/library/src/2c/gate/xeb.md+3−3 docs/system/hoon/library/src/2d/gate/con.md+4−4 docs/system/hoon/library/src/2d/gate/dis.md+6−6 docs/system/hoon/library/src/2d/gate/mix.md+2−2 docs/system/hoon/library/src/2d/gate/not.md+4−3 docs/system/hoon/library/src/2e/gate/fnv.md+2−2 docs/system/hoon/library/src/2e/gate/mug.md+4−3 docs/system/hoon/library/src/2e/gate/mum.md+6−15 docs/system/hoon/library/src/2f/gate/aor.md+4−3 docs/system/hoon/library/src/2f/gate/dor.md+3−2 docs/system/hoon/library/src/2f/gate/gor.md+4−3 docs/system/hoon/library/src/2f/gate/hor.md+5−3 docs/system/hoon/library/src/2f/gate/vor.md+3−2 docs/system/hoon/library/src/2h/core/in.md+75−66 docs/system/hoon/library/src/2i/core/by.md+99−87 docs/system/hoon/library/src/2j/core/ja.md+11−166 docs/system/hoon/library/src/2j/core/ju.md+25−20 docs/system/hoon/library/src/2k/core/to.md+40−36 docs/system/hoon/library/src/2n/gate/cork.md+3−2 docs/system/hoon/library/src/2n/gate/corl.md+4−2 docs/system/hoon/library/src/2n/gate/curr.md+6−5 docs/system/hoon/library/src/2n/gate/cury.md+8−6 docs/system/hoon/library/src/2n/gate/hard.md+7−8 docs/system/hoon/library/src/2n/gate/soft.md+9−8 docs/system/hoon/library/src/2o/mold/jar.md+4−3 docs/system/hoon/library/src/2o/mold/jug.md+3−2 docs/system/hoon/library/src/2o/mold/map.md+12−11 docs/system/hoon/library/src/2o/mold/qeu.md+3−4 docs/system/hoon/library/src/2o/mold/set.md+5−5 docs/system/hoon/library/src/2p/gate/cue.md+6−6 docs/system/hoon/library/src/2p/gate/jam.md+4−4 docs/system/hoon/library/src/2p/gate/mat.md+4−3 docs/system/hoon/library/src/2p/gate/rub.md+2−2 docs/system/hoon/library/src/2q/mold/char.md+3−3 docs/system/hoon/library/src/2q/mold/cord.md+4−4 docs/system/hoon/library/src/2q/mold/date.md+4−3 docs/system/hoon/library/src/2q/mold/tank.md+8−8 docs/system/hoon/library/src/2q/mold/tape.md+1−1 docs/system/hoon/library/src/2q/mold/tarp.md+4−4 docs/system/hoon/library/src/2q/mold/term.md+3−3 docs/system/hoon/library/src/2q/mold/wain.md+2−22 docs/system/hoon/library/src/2q/mold/wall.md+5−11 docs/system/hoon/library/src/3a/core/fe.md+25−24 docs/system/hoon/library/src/3a/core/si.md+32−32 docs/system/hoon/library/src/3a/gate/egcd.md+4−3 docs/system/hoon/library/src/3c/core/yo.md+11−11 docs/system/hoon/library/src/3c/gate/yall.md+8−7 docs/system/hoon/library/src/3c/gate/yawn.md+3−2 docs/system/hoon/library/src/3c/gate/year.md+5−4 docs/system/hoon/library/src/3c/gate/yell.md+4−2 docs/system/hoon/library/src/3c/gate/yore.md+3−2 docs/system/hoon/library/src/3c/gate/yule.md+5−4 docs/system/hoon/library/src/3d/core/og.md+6−6 docs/system/hoon/library/src/3d/gate/shad.md+2−1 docs/system/hoon/library/src/3d/gate/shaf.md+1−1 docs/system/hoon/library/src/3d/gate/shak.md+1−1 docs/system/hoon/library/src/3d/gate/shal.md+2−2 docs/system/hoon/library/src/3d/gate/sham.md+1−1 docs/system/hoon/library/src/3d/gate/shan.md+3−2 docs/system/hoon/library/src/3d/gate/shas.md+1−1 docs/system/hoon/library/src/3d/gate/shaw.md+1−1 docs/system/hoon/library/src/3d/gate/shax.md+5−86 docs/system/hoon/library/src/3d/gate/shaz.md+1−1 docs/system/hoon/library/src/3f/core/ob.md+61−53 docs/system/hoon/library/src/3f/core/un.md+23−20 docs/system/hoon/library/src/3g/mold/coin.md+4−4 docs/system/hoon/library/src/3g/mold/dime.md+6−5 docs/system/hoon/library/src/3g/mold/edge.md+3−2 docs/system/hoon/library/src/3g/mold/hair.md+2−1 docs/system/hoon/library/src/3g/mold/like.md+5−1 docs/system/hoon/library/src/3g/mold/nail.md+2−1 docs/system/hoon/library/src/3g/mold/path.md+3−2 docs/system/hoon/library/src/3g/mold/pint.md+3−2 docs/system/hoon/library/src/3g/mold/rule.md+2−1 docs/system/hoon/library/src/3g/mold/spot.md+3−2 docs/system/hoon/library/src/3g/mold/toon.md+6−3 docs/system/hoon/library/src/4a/core/po.md+55−52 docs/system/hoon/library/src/4b/core/at.md+12−10 docs/system/hoon/library/src/4b/gate/cass.md+2−3 docs/system/hoon/library/src/4b/gate/crip.md+1−1 docs/system/hoon/library/src/4b/gate/cuss.md+2−2 docs/system/hoon/library/src/4b/gate/mesc.md+4−4 docs/system/hoon/library/src/4b/gate/runt.md+2−2 docs/system/hoon/library/src/4b/gate/sand.md+7−7 docs/system/hoon/library/src/4b/gate/sane.md+5−5 docs/system/hoon/library/src/4b/gate/teff.md+4−5 docs/system/hoon/library/src/4b/gate/trim.md+10−10 docs/system/hoon/library/src/4b/gate/trip.md+3−2 docs/system/hoon/library/src/4b/gate/tuba.md+4−4 docs/system/hoon/library/src/4b/gate/tufa.md+4−4 docs/system/hoon/library/src/4b/gate/tuft.md+8−8 docs/system/hoon/library/src/4b/gate/turf.md+15−13 docs/system/hoon/library/src/4b/gate/wack.md+3−3 docs/system/hoon/library/src/4b/gate/wick.md+18−14 docs/system/hoon/library/src/4b/gate/woad.md+9−9 docs/system/hoon/library/src/4b/gate/wood.md+8−12 docs/system/hoon/library/src/4c/core/re.md+30−42 docs/system/hoon/library/src/4c/gate/show.md+28−28 docs/system/hoon/library/src/4d/gate/last.md+4−5 docs/system/hoon/library/src/4d/gate/lust.md+4−3 docs/system/hoon/library/src/4e/gate/bend.md+14−14 docs/system/hoon/library/src/4e/gate/comp.md+9−8 docs/system/hoon/library/src/4e/gate/fail.md+3−3 docs/system/hoon/library/src/4e/gate/glue.md+3−3 docs/system/hoon/library/src/4e/gate/less.md+4−4 docs/system/hoon/library/src/4e/gate/pfix.md+3−4 docs/system/hoon/library/src/4e/gate/plug.md+3−3 docs/system/hoon/library/src/4e/gate/pose.md+6−4 docs/system/hoon/library/src/4e/gate/sfix.md+3−2 docs/system/hoon/library/src/4e/gate/simu.md+3−3 docs/system/hoon/library/src/4f/gate/bass.md+9−7 docs/system/hoon/library/src/4f/gate/boss.md+9−7 docs/system/hoon/library/src/4f/gate/cold.md+6−7 docs/system/hoon/library/src/4f/gate/cook.md+6−6 docs/system/hoon/library/src/4f/gate/easy.md+2−2 docs/system/hoon/library/src/4f/gate/full.md+2−2 docs/system/hoon/library/src/4f/gate/funk.md+4−5 docs/system/hoon/library/src/4f/gate/here.md+6−6 docs/system/hoon/library/src/4f/gate/ifix.md+7−3 docs/system/hoon/library/src/4f/gate/jest.md+7−7 docs/system/hoon/library/src/4f/gate/just.md+4−4 docs/system/hoon/library/src/4f/gate/knee.md+5−5 docs/system/hoon/library/src/4f/gate/mask.md+5−5 docs/system/hoon/library/src/4f/gate/more.md+3−2 docs/system/hoon/library/src/4f/gate/most.md+3−2 docs/system/hoon/library/src/4f/gate/next.md+3−3 docs/system/hoon/library/src/4f/gate/plus.md+4−3 docs/system/hoon/library/src/4f/gate/sear.md+7−7 docs/system/hoon/library/src/4f/gate/shim.md+4−4 docs/system/hoon/library/src/4f/gate/slug.md+7−5 docs/system/hoon/library/src/4f/gate/stag.md+3−3 docs/system/hoon/library/src/4f/gate/star.md+4−4 docs/system/hoon/library/src/4f/gate/stet.md+1−1 docs/system/hoon/library/src/4f/gate/stew.md+8−6 docs/system/hoon/library/src/4f/gate/stir.md+19−12 docs/system/hoon/library/src/4f/gate/stun.md+9−9 docs/system/hoon/library/src/4g/gate/rash.md+3−2 docs/system/hoon/library/src/4g/gate/rush.md+4−3 docs/system/hoon/library/src/4g/gate/rust.md+3−2 docs/system/hoon/library/src/4g/gate/scan.md+4−4 docs/system/hoon/library/src/4j/core/ab.md+53−53 docs/system/hoon/library/src/4j/core/mu.md+12−11 docs/system/hoon/library/src/4j/core/ne.md+6−6 docs/system/hoon/library/src/4k/core/co.md+140−214 docs/system/hoon/library/src/4k/gate/iny.md+3−3 docs/system/hoon/library/src/4k/gate/mes.md+1−1 docs/system/hoon/library/src/4k/gate/ven.md+2−2 docs/system/hoon/library/src/4k/gate/vit.md+3−3 docs/system/hoon/library/src/4k/gate/vul.md+1−1 docs/system/hoon/library/src/4l/core/so.md+195−76 docs/system/hoon/library/src/4m/gate/scot.md+2−2 docs/system/hoon/library/src/4m/gate/scow.md+2−2 docs/system/hoon/library/src/4m/gate/slat.md+8−8 docs/system/hoon/library/src/4m/gate/slav.md+3−3 docs/system/hoon/library/src/4m/gate/slaw.md+15−14 docs/system/hoon/library/src/4m/gate/slay.md+13−9 docs/system/hoon/library/src/4m/gate/smyt.md+7−7 docs/system/hoon/library/src/4m/gate/spat.md+2−2 docs/system/hoon/library/src/4m/gate/spud.md+3−3 docs/system/hoon/library/src/4m/gate/stab.md+5−4 docs/system/hoon/library/src/4n/gate/mack.md+7−6 docs/system/hoon/library/src/4n/gate/mink.md+44−42 docs/system/hoon/library/src/4n/gate/mock.md+7−6 docs/system/hoon/library/src/4n/gate/mong.md+13−13 docs/system/hoon/library/src/4n/gate/mook.md+22−33 docs/system/hoon/library/src/4n/gate/mule.md+6−5 docs/system/hoon/library/src/4n/gate/mute.md+10−21 docs/system/hoon/library/src/5f/mold/mane.md+2−2 docs/system/hoon/library/src/5f/mold/manx.md+3−3 docs/system/hoon/library/src/5f/mold/mars.md+3−2 docs/system/hoon/library/src/5f/mold/mart.md+4−4 docs/system/hoon/library/src/5f/mold/marx.md+2−2 docs/system/hoon/library/src/5f/mold/ring.md+1−1 docs/system/hoon/library/src/5f/mold/time.md+2−2
docs/system/hoon/core.mdnew file+24
@@ -0,0 +1,24 @@
1+---
2+sort: 1
3+---
4+
5+# Core Hoon
6+
7+Hoon is strict, typed functional programming without math.
8+
9+Hoon is named after a Wallace Stevens poem. Coincidentally, it
10+means "hooligan" in Australian. Practically, "Hoon" is a short
11+punchy name which search engines handle well.
12+
13+This manual defines a practical Hoon subset we call Core Hoon.
14+(Some of the internal structures we present are simplified to
15+reflect the Core subset.)
16+
17+To read it for the first time, read these links in order:
18+
19+<list>
20+</list>
21+
22+Once you've been through all this material, you can try some
23+[exercises]() if you feel you're ready, or read [Deep Hoon]() for
24+a more narrative introduction.
docs/system/hoon/core/demo.mdnew file+56
@@ -0,0 +1,56 @@
1+---
2+sort: 1
3+---
4+
5+# Demo
6+
7+Here's everyone's favorite whiteboard example, FizzBuzz. Each
8+line is commented with its number:
9+
10+```
11+:gate end/atom :: 1
12+:var count 1 :: 2
13+:loop :: 3
14+:if =(end count) :: 4
15+ ~ :: 5
16+:cons :: 6
17+ :if =(0 (mod count 15)) :: 7
18+ "FizzBuzz" :: 8
19+ :if =(0 (mod count 5)) :: 9
20+ "Fizz" :: 10
21+ :if =(0 (mod count 3)) :: 11
22+ "Buzz" :: 12
23+ (text :wrap(count)) :: 13
24+:moar(count (add 1 count)) :: 14
25+```
26+
27+Can you understand this code by just looking at it? Hopefully,
28+but let's explain it anyway.
29+
30+Hoon is a functional language. FizzBuzz is usually defined as a
31+side effect, but Hoon has no side effects. This code will
32+*make* a list of strings, not *print* a list of strings.
33+
34+Line 1 defines a function of one argument, `end`, an unsigned
35+integer.
36+
37+Line 2 declares a variable, `count`, with initial value `1`.
38+
39+Line 3 begins a loop.
40+
41+Line 4 checks if `count` equals `end`. If so, line 5 (and the
42+whole loop) produces the value `~`, null. If not, line 6 begins
43+an ordered pair.
44+
45+The head of the pair is "FizzBuzz", or "Fizz", or "Buzz", if the
46+respective tests hit. If not, line 13 wraps a runtime type
47+around `count`, then prints the type-value pair to a string (like
48+C `sprintf()`). This string is the first item in the output list.
49+
50+The tail of the pair is line 14, which repeats the loop (like
51+Clojure `recur`), with `count` incremented. This list of strings
52+is the rest of the output list.
53+
54+You can test this code by typing it into `home/gen/fizzbuzz.hoon`
55+in your Urbit mount directory, then typing `+fizzbuzz 100` in the
56+Urbit dojo (shell).
docs/system/hoon/core/examples.mdnew file+453
@@ -0,0 +1,453 @@
1+---
2+sort: 9
3+---
4+
5+# Examples
6+
7+Now we know enough to write two quick examples: the Sieve of
8+Eratosthenes (a naive prime sieve) and a tictactoe engine.
9+
10+(Note that these are not examples of perfect Hoon code; they are
11+meant for teaching. They err, more than usual for Hoon, on the
12+side of simple manual construction over high-octane FP.)
13+
14+## `sieve`: code in basic style
15+
16+A function that produces the list of primes less than or equal to
17+than its argument, an atom:
18+```
19+:gate thru/atom :: 1
20+:cast (list atom) :: 2
21+:var field/(set atom) (silt (gulf 2 thru)) :: 3
22+:rap abet:main :: 4
23+:core :: 5
24+++ abet :: 6
25+ (sort (~(tap in field) ~) lth) :: 7
26+:: :: 8
27+++ main :: 9
28+ :var factor/atom 2 :: 10
29+ :loop :like ..main :: 11
30+ :if (gth (mul factor factor) thru) :: 12
31+ ..main :: 13
32+ :moar(factor +(factor), ..main (reap factor)) :: 14
33+:: :: 15
34+++ reap :: 16
35+ :gate factor/atom :: 17
36+ :var count/atom (mul 2 factor) :: 18
37+ :loop :like ..reap :: 19
38+ :if (gth count thru) :: 20
39+ ..reap :: 21
40+ :moar :: 22
41+ count (add count factor) :: 23
42+ field (~(del in field) count) :: 24
43+ == :: 25
44+-- :: 26
45+```
46+
47+## `sieve`: explanation
48+
49+Line `1`: we are building a gate (function) whose sample
50+(argument) is `thru`, an atom.
51+
52+Line `2`: the product of this gate is a list of atoms.
53+
54+Line `3`: we introduce a variable `field`, whose type is a set of
55+atoms. The `silt` function converts a list to a set. The `gulf`
56+function creates the range `2` through `thru` inclusive, as a
57+list of atoms.
58+
59+Line `4`: below, we introduce a core which does our work. With
60+reverse flow, we compute `main` on this core, then `abet` on the
61+product of `main`. (`abet:main` means `:rap(abet main)`.)
62+
63+The core is a state machine; `main` produces the core itself,
64+with the computation completed. `abet` then extracts the result.
65+
66+Line `5`: we wrap a core around our existing subject. The
67+`field` and `thru` atoms are within the payload and of course
68+remain accessible.
69+
70+Lines `6` and `7`: the `abet` arm, which produces the field as a
71+sorted list. `in` is the set core; `tap` is an arm which
72+produces a gate that exports the set as a list, prepending it to
73+a tail which is nil in this case (and most cases). We sort this
74+list in ascending order with `lth` (less-than).
75+
76+Line `9`: the `main` arm, which performs the main calculation.
77+
78+Line `10`: we declare a counter, `factor`, which will iterate
79+up through the factors we're removing.
80+
81+Line `11`: we start a loop. The product of the loop is cast to
82+`..main`, which is the core we're in (`+1.main`).
83+
84+Lines `12` and `13`: we terminate the loop, returning `..main`,
85+if the square of the counter exceeds the range.
86+
87+Line `14`: repeats the loop, incrementing the counter, and
88+replacing the core with a version sieved by `reap`.
89+
90+Lines `16` and `17`: the `reap` arm, which produces a gate that
91+removes multiples of a factor from the field (set of possible
92+primes). The sample of this gate is the factor to remove.
93+
94+Line `18`: we declare a variable `count`, an atom, with the
95+initial value `(mul 2 factor)`.
96+
97+Line `19`: we enter a loop. This loop produces the core itself.
98+
99+Lines `20` and `21`: we are done if the counter is out of range.
100+
101+Lines `22` to `25`: repeat the loop, stepping `count` to the next
102+multiple of `factor`, and deleting it from `field`.
103+
104+## `sieve`: code in kernel style
105+
106+Finally, the same code transliterated into runes (and in a more
107+concise "kernel" style).
108+
109+```
110+|= top/@
111+^- (list @)
112+=+ fed=(silt (gulf 2 top))
113+=< abet:main
114+|%
115+++ abet (sort (~(tap in fed)) lth)
116+++ main
117+ =+ fac=2
118+ |- ^+ ..main
119+ ?: (gth (mul fac fac) top)
120+ ..main
121+ $(fac +(fac), ..main (reap fac))
122+::
123+++ reap
124+ |= fac/atom
125+ =+ cot=(mul 2 fac)
126+ |- ^+ ..reap
127+ ?: (gth cot top)
128+ ..reap
129+ $(cot (add cot fac), fed (~(del in fed) cot))
130+--
131+```
132+
133+### `toe`: tictactoe engine
134+
135+The `toe` tictactoe engine applies a list of events to a game
136+state, producing a list of game actions. Events are tictactoe
137+moves (`move)`; actions are tictactoe results (`fact`).
138+
139+```
140+:rap :gate feed/(list move) :: 1
141+ :new game/game :: 2
142+ :loop :cast (list fact) :: 3
143+ :ifno feed ~ :: 4
144+ :sip this/(unit fact) :: 5
145+ game :: 6
146+ (~(do go game) i.feed) :: 7
147+ :var rest/(list fact) :moar(feed t.feed) :: 8
148+ :ifno(this rest [u.this rest]) :: 9
149+:: :: 10
150+:per :core :: 11
151+ ++ side atom :: 12
152+ ++ spot {x/atom y/atom} :: 13
153+ ++ fact :book {$tie $~} :: 14
154+ {$win p/cord} :: 15
155+ == :: 16
156+ ++ move :book {$x p/spot} :: 17
157+ {$o p/spot} :: 18
158+ {$z $~} :: 19
159+ == :: 20
160+ ++ game :bank w/? :: 21
161+ a/side :: 22
162+ z/side :: 23
163+ == :: 24
164+ -- :: 25
165+:core :: 26
166+++ bo :: 27
167+ :door half/side :: 28
168+ ++ bit :gate(a/atom =(1 (cut 0 [a 1] half))) :: 29
169+ ++ off :gate(a/spot (add x.a (mul 3 y.a))) :: 30
170+ ++ get :gate(a/spot (bit (off a))) :: 31
171+ ++ set :gate(a/spot (con half (bex (off a)))) :: 32
172+ ++ win :calt lien :: 33
173+ (rip 4 0wl04h0.4A0Aw.4A00s.0e070) :: 34
174+ :gate(a/atom =(a (dis a half))) :: 35
175+ -- :: 36
176+++ go :: 37
177+ :door game/game :: 38
178+ ++ do :: 39
179+ :gate act/move :: 40
180+ :cast {(unit fact) ^game} :: 41
181+ :case act :: 42
182+ {$x *} :sure(w.game ~(mo on p.act)) :: 43
183+ {$o *} :deny(w.game ~(mo on p.act)) :: 44
184+ {$z *} [~ nu] :: 45
185+ == :: 46
186+ :: :: 47
187+ ++ nu :like(game [& 0 0]) :: 48
188+ ++ on :: 49
189+ :door here/spot :: 50
190+ ++ is :or (~(get bo a.game) here) :: 51
191+ (~(get bo z.game) here) :: 52
192+ == :: 53
193+ ++ mo :cast {(unit fact) ^game} :: 54
194+ :deny is :: 55
195+ :var next/side (~(set bo a.game) here) :: 56
196+ :if ~(win bo next) :: 57
197+ [[~ %win ?:(w.game %x %o)] nu] :: 58
198+ [~ game(w !w.game, a z.game, z next)] :: 59
199+ -- :: 60
200+ -- :: 62
201+-- :: 63
202+```
203+
204+### `toe`: explanation
205+
206+Line `1` wraps a conclusion around a stack of cores. The cores
207+at `11` and `26` are the data structures and functions of the
208+engine; the conclusion is the interface and top-level logic. It
209+produces a gate whose sample is `feed`, a list of `move`.
210+
211+Line `2` declares a blank new variable named `game`, whose type
212+is the `game` mold (tictactoe game state) defined on line `21`.
213+Under line `2`, `game` pulls the variable and `^game` the mold.
214+
215+Line `3` enters a loop producing a list of game events, `fact`.
216+
217+Line `4` produces nil, `~`, if `feed` is empty.
218+
219+Lines `5` through `7` apply the move. We open a `go` core on the
220+current game state, produce a `do` gate, and call that gate on
221+the move. The product of the `do` gate is a pair; the head is
222+`(unit fact)`, either `~` or `[~ fact]`; the tail is a new
223+`game`. The `:sip` twig declares the head as a new variable,
224+`this`; it modifies the subject by setting `game` to the tail.
225+
226+Line `8` declares a new variable, `rest`, which is all the facts
227+generated by the moves in `t.feed`, the tail of the move list.
228+(Yes, this is gratuitous head recursion.) Line `9` produces
229+`rest` if the `i.feed` move produced no fact; otherwise it
230+prepends the new fact to `rest`.
231+
232+Line `11` wraps a library core around a data structure core, a
233+common pattern. (You could put the molds and the gates in the
234+same core, but the compiler couldn't constant-fold gate samples
235+that use these molds, an efficiency cost.)
236+
237+Line `12` defines the `side` mold, an alias for `atom` (`@`).
238+A side is a half of the board, as a marked/unmarked bitfield.
239+
240+Line `13` defines the `spot` mold, a 2D coordinate.
241+
242+Lines `14` to `16` define the `fact` mold, a game event (ie,
243+output action), as a book (tagged union). There are two forms of
244+`fact`: `[%tie ~]` (reporting a tie), and `[%win cord]`
245+(reporting that `'X'` or `'O'` won a game.
246+
247+Lines `17` to `20` define the `move` mold, a game move. This is
248+either `[%x spot]`, `[%o spot]`, or `[%z ~]` to reset the board.
249+
250+Lines `21` to `23` define the `game` mold, the game state. This
251+is an `a` side, the next side to move; a `z` side, the other
252+side; and `w`, which is `&` (yes) if `a` is X and `b` is O; `|`
253+otherwise. (Obviously, we swap `a` and `z` on every move.)
254+
255+Line `26` introduces the library core, which contains the doors
256+`bo` (for `side` bitfields) and `go` (for game state).
257+
258+Lines `27` to `28` begin the `bo` core, a door around `half`, a
259+board side.
260+
261+Line `29` is the `bit` gate, which tests a bit in `half`.
262+
263+Line `30` is the `off` gate, which maps from a `spot` (coordinate)
264+to a bit index.
265+
266+Line `31` is the `get` gate, which produces the bit at a `spot`.
267+
268+Line `32` is the `set` gate, which produces a new side with the
269+bit at a `spot` set. It works by ORing (`con`) `half` with the
270+binary exponent (`bex`) of the offset (`off`) of the spot.
271+
272+Lines `33` to `35` are a victory test. It calls the
273+standard `lien` function, which iterates a boolean gate over a
274+list and produces `&` (yes) if any item tests as true, against a
275+list of magic bitfields (expanded from a base64 constant), each
276+of which must equal itself when ANDed (`dis`) with `half`.
277+
278+Lines `37` to `38` begin the `go` core, a door around a `game`.
279+Again we name the sample `game`. (This is a legitimate style,
280+but not used much.)
281+
282+Lines `40` to `42` begin the `do` gate, whose sample is `act`, a
283+move. The product is cast to a pair of `(unit fact)` and a new
284+game state, written `^game` to skip to the second binding.
285+
286+Lines `42` through `46` switch on the form of `act`. If it's an
287+`%x` or `%o` move, we assert that it's the right turn, then use
288+the `mo` door to apply the move. If it's a `%z` move, we clear
289+the board.
290+
291+Line `48` is the `nu` arm, which produces a blank game state.
292+
293+Lines `49` to `50` begin the `on` door, a door around `here`, a
294+`spot`. Just as we have multiple computed attributes against the
295+game state, we have multiple computed attributes (`is` and `mo`)
296+against the combination of game state and coordinate.
297+
298+Lines `51` to `53` define the `is` arm, which is `&` (yes) iff
299+either `a` or `z` has played `here`.
300+
301+Line `54` begins the `mo` arm, which produces (with a
302+nonessential cast) a pair of `(unit fact)` and game state.
303+Again we see `^game` to pull the mold, since `game` is the
304+current game state in the `go` core.
305+
306+Line `55` asserts that no one has yet played `here`.
307+
308+Line `56` declares a variable `next`, as game side `a` with
309+`here` played in it.
310+
311+Lines `57` and `58` test if `a` has won with this move. If so,
312+we produce the win fact and a blank game state.
313+
314+Line `59` produces no fact (since nothing has happened), but
315+inverts the `w` turn indicator, replaces side `a` with the other
316+side `z`, and replaces `z` with `next`.
317+
318+### `toe`: code, kernel style
319+
320+```
321+=< |= fed/(list move)
322+ =| mag/game
323+ |- ^- (list fact)
324+ ?~ fed ~
325+ =^ did/(unit fact) mag (~(do go mag) i.fed)
326+ =+ res=$(fed t.fed)
327+ ?~(did res [u.did res])
328+=> |%
329+ ++ side @
330+ ++ spot {x/@ y/@}
331+ ++ fact $% {$tie $~}
332+ {$win p/cord}
333+ ==
334+ ++ move $% {$x p/spot}
335+ {$o p/spot}
336+ {$z $~}
337+ ==
338+ ++ game $: w/?
339+ a/side
340+ z/side
341+ ==
342+ --
343+|%
344+++ bo
345+ |_ haf/side
346+ ++ bit |=(a/atom =(1 (cut 0 [a 1] haf)))
347+ ++ get |=(a/spot (bit (off a)))
348+ ++ off |=(a/spot (add x.a (mul 3 y.a)))
349+ ++ set |=(a/spot (con haf (bex (off a))))
350+ ++ win %+ lien
351+ (rip 4 0wl04h0.4A0Aw.4A00s.0e070)
352+ |=(a/atom =(a (dis a haf)))
353+ --
354+++ go
355+ |_ mag/game
356+ ++ do
357+ |= act/move
358+ ^- {(unit fact) game}
359+ ?- act
360+ {$x *} ?>(w.mag ~(mo on p.act))
361+ {$o *} ?<(w.mag ~(mo on p.act))
362+ {$z *} [~ nu]
363+ ==
364+ ::
365+ ++ nu `game`[& 0 0]
366+ ++ on
367+ =| her/spot
368+ |%
369+ ++ is ?| (~(get bo a.mag) her)
370+ (~(get bo z.mag) her)
371+ ==
372+ ++ mo ^- {(unit fact) game}
373+ ?< is
374+ =+ next=(~(set bo a.mag) her)
375+ ?: ~(win bo next)
376+ [[~ %win ?:(w.mag %x %o)] nu]
377+ [~ mag(w !w.mag, a z.mag, z next)]
378+ --
379+ --
380+--
381+```
382+
383+## Basic molds
384+```
385+++ atom @ :: just an atom
386+++ axis @ :: tree address
387+++ bean ? :: 0=&=yes, 1=|=no
388+++ bloq @ :: blockclass
389+++ char @tD :: UTF-8 byte
390+++ cord @t :: text atom (UTF-8)
391+++ gate $-(* *) :: general gate
392+++ knot @ta :: ASCII text
393+++ noun * :: any noun
394+++ null $~ :: null, nil, etc
395+++ time @da :: galactic time
396+++ path (list knot) :: eg, fs location
397+++ tang (list tank) :: error trace
398+++ tank ::
399+ $% {$leaf p/tape} :: printing formats
400+ $: $palm :: backstep list
401+ p/{p/tape q/tape r/tape s/tape} ::
402+ q/(list tank) ::
403+ == ::
404+ $: $rose :: flat list
405+ p/{p/tape q/tape r/tape} :: mid open close
406+ q/(list tank) ::
407+ == ::
408+ == ::
409+++ tanq :: future tank
410+ $? {$~ p/(list tanq)} :: list of printables
411+ {$~ $~ p/tape} :: simple string
412+ (pair @tas tanq) :: captioned
413+ == ::
414+++ tape (list char) :: string as list
415+++ term @tas :: ascii symbol
416+++ wall (list tape) :: text lines (no \n)
417+++ wain (list cord) :: text lines (no \n)
418+
419+::::
420+::::
421+
422+++ tree |* a/gate :: binary tree
423+ $@($~ {n/a l/(tree a) r/(tree a)}) ::
424+++ trap |*(a/_* _|?(*a)) :: makes perfect sense
425+++ trel |* {a/gate b/gate c/gate} :: just a triple
426+ {p/a q/b r/c} ::
427+++ each |* {a/gate b/gate} :: either a or b
428+ $%({$& p/a} {$| p/b}) :: a default
429+
430+++ qual |* {a/gate b/gate c/gate d/gate} :: just a quadruple
431+ {p/a q/b r/c s/d} ::
432+++ pair |*({a/gate b/gate} {p/a q/b}) :: just a pair
433+++ quid |*({a/gate b/*} {a _b}) :: for =^
434+++ quip |*({a/gate b/*} {(list a) _b}) :: for =^
435+++ unit |* a/gate :: maybe
436+ $@($~ {$~ u/a}) ::
437+++ list |* a/gate :: null-term list
438+ $@($~ {i/a t/(list a)}) ::
439+++ lone |*(a/gate p/a) :: just one thing
440+
441+::::
442+::::
443+++ map |* {a/gate b/gate} :: associative tree
444+ $@($~ {n/{p/a q/b} l/(map a b) r/(map a b)}) ::
445+++ qeu |* a/gate :: queue
446+ $@($~ {n/a l/(qeu a) r/(qeu a)}) ::
447+++ set |* a/gate :: set
448+ $@($~ {n/a l/(set a) r/(set a)}) ::
449+++ jar |*({a/gate b/gate} (map a (list b))) :: map of lists
450+++ jug |*({a/gate b/gate} (map a (set b))) :: map of sets
451+```
452+
453+### Basic libraries
docs/system/hoon/core/jargon.mdnew file+83
@@ -0,0 +1,83 @@
1+---
2+sort: 3
3+---
4+
5+# Terminology
6+
7+Usually, a new language is an improvement on one you already
8+know. If it isn't, it probably at least shares concepts with a
9+large family of relatives. These concepts come with words, like
10+*type* or *function*, that map cleanly onto its semantics.
11+
12+In Hoon we throw away almost all these words and invent new
13+ones, which mean almost the same things. But wait, wat?
14+
15+## Motivation
16+
17+Hoon has no close relatives, and the normal jargon of programming
18+maps poorly onto its semantics. For example, although Hoon is a
19+typed language, the term *type* is not formally defined in Hoon.
20+It's a great word, but Hoon has three quite separate concepts
21+which could comfortably claim it. We say *type* all the time;
22+we mean `span`, or `mold`, or `mark`, or possibly all three.
23+Sometimes this is ok and sometimes it isn't.
24+
25+Other common programming concepts used only informally in Hoon
26+are "function," "object," "event," "expression," "variable,"
27+"label," "closure", "environment," "stack," and probably a few
28+more. We can get away with any of these conventional words --
29+and we do. But when we do, we're making an analogy that relies
30+on context for precision.
31+
32+## Notation
33+
34+Any `word` in code font is a `limb` (label) in the Hoon kernel.
35+Any jargon that isn't a limb is in *italics*.
36+
37+## Enumeration
38+
39+Top-level Hoon concepts: `noun` (data), `nock` (interpreter),
40+`mint` (compiler), `span` (type), `twig` (expression).
41+
42+## Execution
43+
44+### `noun` (data)
45+
46+A value in Hoon is called a [`noun`](noun). A noun is either a
47+unsigned integer of any size (`atom`), or an ordered pair of any
48+two nouns (`cell`). Nouns are like Lisp S-expressions, but
49+simpler (Lisp atoms effectively have dynamic type bits).
50+
51+### `nock` (interpreter)
52+
53+Hoon compiles itself to the [Nock](nock) VM, a "functional assembly
54+language" whose spec fits on a T-shirt. You don't need to know
55+Nock to use Urbit, but it helps. Nock is an interpreter function
56+that maps a pair `{data nock}` to a *product* noun, where `data`
57+is the *subject* (input) and `nock` is the *formula* (program).
58+
59+## Compilation
60+
61+### `mint` (compiler)
62+
63+[`mint`](mint) is the Hoon compiler. It maps a cell `{span twig}` to a
64+cell `{span nock}`, where a `span` is a type, a `twig` is a compiled
65+expression (AST), and a `nock` is a Nock formula. `mint` accepts
66+a subject type and a source expression; it produces a product type
67+and an executable formula.
68+
69+### `span` (type, as range)
70+
71+A [`span`](span) is a Hoon type. It defines a set (finite or
72+infinite) of nouns and ascribes some semantics to it. There is
73+no syntax for spans; they are always defined by inference (ie, by
74+`mint`), usually using a constructor (`mold`).
75+### `twig` (expression)
76+
77+A [`twig`](twig) is a Hoon AST node, the result of parsing a
78+source expression. In general, a twig is a tagged union of the
79+form `{stem bulb}`, where `stem` is a symbolic atom which
80+controls the type of `bulb`. The regular form is a Hoon keyword
81+`:stem` and a *rune*, or digraph keyword, made of two ASCII
82+punctuation marks. The rune prefix character defines a twig
83+category, like `:`
docs/system/hoon/core/mint.mdnew file+25
@@ -0,0 +1,25 @@
1+---
2+sort: 6
3+---
4+
5+# Compiler: `mint`
6+
7+`mint` is the Hoon compiler. It maps a cell `{subject/span
8+source/twig}` to a cell `{product/span formula/nock}`, where
9+`span` is a type, `twig` is a compiled expression, and `nock` is
10+a Nock formula.
11+
12+Calculating the output type from the input type and the source
13+code is called "type inference." If you've used another typed
14+functional language, like Haskell, Hoon's type inference does the
15+same job but with less intelligence.
16+
17+Haskell infers backward and forward; Hoon only infers forward.
18+Hoon can't figure out the type of a noun from how you use it,
19+only from how you make it. Hoon can infer tail recursion, but
20+not head recursion.
21+
22+Low-powered type inference means you need more type annotations,
23+which makes your program more readable anyway. (Also, the dumber
24+the compiler, the easier it is for a dumb human to understand
25+what the compiler is thinking.)
docs/system/hoon/core/nock.mdnew file+160
@@ -0,0 +1,160 @@
1+---
2+sort: 5
3+---
4+
5+# Interpreter: `nock`
6+
7+The Nock VM is a Turing-complete function that maps a cell
8+`{subject formula}` to a noun `product`, where `subject` is the
9+data, `formula` is the code, and `product` is the result.
10+
11+To program in Hoon, this is all you need to know about Nock.
12+It's probably at least worth skimming this definition, though.
13+
14+(Also, the Hoon programmer should know that (a) tail call
15+elimination in Nock is straightforward; and (b) tail calls in
16+Hoon always become tail calls in Nock.)
17+
18+## Rules
19+
20+Nock is a combinator interpreter defined by the spec below.
21+
22+This pseudocode (any system of axioms is properly defined in
23+pseudocode) is a system of problem reduction rules. Variables
24+match any noun; the first rule from the top matches.
25+
26+A problem that reduces to itself is an infinite loop, hence a
27+crash ("bottom" in formal logic). Obviously a real interpreter
28+can detect this crash and produce an out-of-band value instead.
29+
30+```
31+?[a b] 0
32+?a 1
33++[a b] +[a b]
34++a 1 + a
35+=[a a] 0
36+=[a b] 1
37+=a =a
38+
39+/[1 a] a
40+/[2 a b] a
41+/[3 a b] b
42+/[(a + a) b] /[2 /[a b]]
43+/[(a + a + 1) b] /[3 /[a b]]
44+/a /a
45+
46+*[a [b c] d] [*[a b c] *[a d]]
47+
48+*[a 0 b] /[b a]
49+*[a 1 b] b
50+*[a 2 b c] *[*[a b] *[a c]]
51+*[a 3 b] ?*[a b]
52+*[a 4 b] +*[a b]
53+*[a 5 b] =*[a b]
54+
55+*[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0]
56+ 2 [1 2 3] [1 0] 4 4 b]
57+*[a 7 b c] *[a 2 b 1 c]
58+*[a 8 b c] *[a 7 [[7 [0 1] b] 0 1] c]
59+*[a 9 b c] *[a 7 c 2 [0 1] 0 b]
60+*[a 10 [b c] d] *[a 8 c 7 [0 3] d]
61+*[a 10 b c] *[a c]
62+
63+*a *a
64+```
65+
66+## Operators
67+
68+The pseudocode notation defines five prefix operators: `?`, `+`,
69+`=`, `/`, and `*`.
70+
71+`?[x]` produces `0` if `x` is a cell, `1` if an atom.
72+
73+`+[x]` produces the atom `x` plus `1`.
74+
75+`=[x y]` produces `0` if `x` and `y` are the same noun, `1`
76+otherwise.
77+
78+`/` is a tree addressing operator. The root of the tree is `1`;
79+the left child of any node `n` is `2n`; the right child is
80+`2n+1`. `/[x y]` is the subtree of `y` at address `x`.
81+
82+(For instance, `/[1 [531 25 99]]` is `[531 25 99]`; `/[2 [531 25
83+99]]` is `531`; `/[3 [531 25 99]]` is `[25 99]`; `/[6 [531 25
84+99]]` is `25`; `/[12 [531 25 99]]` crashes.)
85+
86+`*[x y]` is the Nock interpreter function. `x` is the subject,
87+`y` is the formula.
88+
89+An invalid use of any operator (eg, incrementing a cell) crashes.
90+This is specified as an infinite loop, but it's not actually an
91+infinite loop.
92+
93+## Instructions
94+
95+A valid formula is always a cell. If the head of the formula is a
96+cell, Nock treats both head and tail as formulas, resolves each
97+against the subject, and produces the cell of their products. In
98+other words, the Lisp program `(cons x y)` becomes the Nock
99+formula `[x y]`.
100+
101+If the head of the formula is an atom, it's an instruction from
102+`0` to `10`.
103+
104+A formula `[0 b]` produces the noun at tree address `b`
105+in the subject.
106+
107+A formula `[1 b]` produces the constant noun `b`.
108+
109+A formula `[2 b c]` treats `b` and `c` is formulas, resolves each
110+against the subject, then computes Nock again with the product of
111+`b` as the subject, `c` as the formula.
112+
113+In formulas `[3 b]`, `[4 b]`, and `[5 b]`, `b` is another
114+formula, whose product against the subject becomes the input to
115+an axiomatic operator. `3` is `?`, `4` is `+`, `5` is `=`.
116+
117+Instructions `6` through `10` are macros; deleting them
118+from Nock would decrease compactness, but not expressiveness.
119+
120+`[6 b c d]` is *if* `b`, *then* `c`, *else* `d`. Each of `b`,
121+`c`, `d` is a formula against the subject. Remember that `0` is
122+true and `1` is false.
123+
124+`[7 b c]` composes the formulas `b` and `c`.
125+
126+`[8 b c]` produces the product of formula `c`, against
127+a subject whose head is the product of formula `b` with the
128+original subject, and whose tail is the original subject. (Think
129+of `8` as a ``variable declaration'' or ``stack push.'')
130+
131+`[9 b c]` computes the product of formula `c` with the
132+current subject; from that product `d` it extracts a formula
133+`e` at tree address `b`, then computes `*[d e]`.
134+(Think, very roughly, of `d` as an object and `e` as a
135+method.)
136+
137+`[10 b c]` is a *hint* semantically equivalent to the formula
138+`c`. If `b` is an atom, it's a *static hint*, which is just
139+discarded. If `b` is a cell, it's a *dynamic* hint; the head of
140+`b` is discarded, and the tail of `b` is executed as a formula
141+against the current subject; the product of this is discarded.
142+
143+A practical interpreter can do anything with discarded data, so
144+long as the result it computes complies with the semantics of
145+Nock. For example, the simplest use of hints is the ordinary
146+"debug printf." It is erroneous for an interpreter to skip
147+computing dynamic hints; they might crash.
148+
149+## Implementation
150+
151+The reader might wonder how an interpreter whose only arithmetic
152+operation is increment can ever be practical.
153+
154+The short answer is that a Nock interpreter doesn't have to use
155+the algorithm above; it just has to get the same result as the
156+algorithm above.
157+
158+The algorithm for decrementing an atom is to count up to it, an
159+O(n) operation. But if we know we are running a decrement
160+formula,
docs/system/hoon/core/noun.mdnew file+33
@@ -0,0 +1,33 @@
1+---
2+sort: 4
3+---
4+
5+# Data model: `noun`
6+
7+A value in Hoon is called a `noun`. A noun is either a unsigned
8+integer of any size (`atom`), or an ordered pair of any two
9+nouns (`cell`). In other words, a noun is a binary tree whose
10+leaves are unsigned integers.
11+
12+Nouns are a Nock concept; there is no Nock syntax; so there is no
13+general noun syntax. But nouns are usually written with square
14+brackets associating right; `[a b c]` means `[a [b c]]`. In Hoon
15+we also see `{a b c}`, a constructor (`mold`) for `[a b c]`.
16+
17+Nouns are almost like Lisp's S-expressions, but S-expressions
18+have dynamic type tags in atoms. Nouns can lose this feature
19+because they're designed to sit under a static type system. For
20+the same reason, nouns tend to be tuple-centric where Lisp is
21+list-centric. Lisp `(a b c)` as a noun is `[a b c 0]`; Nock `[a
22+b c]` is Lisp `(a . b . c)`.
23+
24+Nouns are immutable and acyclic. A naive implementation uses
25+reference counting and needs no tracing GC. There is no test for
26+pointer equality as in Lisp. But indirect nouns have a lazily
27+computed short hash, so nonduplicates have O(1) comparison cost.
28+
29+All kinds of atomic values can be and are stored as atoms:
30+unsigned integers, signed integers (with sign bit low), dates,
31+floats, UTF-8 strings (LSB first), even whole files. Again,
32+a static type system is essential; an atom is not usable or even
33+printable if we don't know what it means.
docs/system/hoon/core/philosophy.mdnew file+41
@@ -0,0 +1,41 @@
1+---
2+sort: 2
3+---
4+
5+# Philosophy
6+
7+Hoon is a strict, typed functional language which compiles itself
8+to the Nock VM (whose spec fits on a T-shirt).
9+
10+Hoon's design goal is to support higher-order typed functional
11+programming without category theory, formal logic, or other
12+interesting math. The reasoning: (a) a programming language is a
13+user interface for programmers; (b) most programmers are not very
14+good at math. Hoon is not quite as expressive as Haskell, though
15+fairly close.
16+
17+Good Hoon style varies from good Haskell style. Hoon encourages
18+coders to use higher-order programming as little as possible --
19+again, simply for UI reasons. For example, multiple arguments
20+are curried by default in Haskell and tupled by default in Hoon.
21+The house style has been described as "procedural programming in
22+a functional language." The power of Haskell, or close, is there
23+when we really need it. But we try not to swat flies with it.
24+
25+Hoon is objectively simple: its complexity is bounded by the size
26+of the compiler, about 3000 lines of Hoon. This is split about
27+halfway half between frontend (parsing and macro expansion) and
28+backend (code generation and type inference).
29+
30+This parser-heavy ratio reflects the belief that our brains are
31+better than everyone thinks at learning languages (symbols and/or
32+grammars), and worse at learning abstractions (proofs and/or
33+algorithms). At first glance, Hoon may look gnarly (though its
34+squiggles are more structured than most ASCII-heavy languages).
35+But there's surprisingly little under the hood.
36+
37+Keeping the Hoon-to-Nock mapping straightforward is a priority.
38+Very roughly, Hoon is to Haskell as C is to Pascal. Pascal tries
39+to conceal its implementation beneath a layer of abstract
40+concepts; C, an "advanced macro assembler," tries to provide a
41+similar user experience with few abstract ideas as possible.
docs/system/hoon/core/span.mdnew file+118
@@ -0,0 +1,118 @@
1+---
2+sort: 7
3+---
4+
5+# Type: `span`
6+
7+A `span` is a type as most languages define it: a set of values
8+and a semantic interpretation of these values.
9+
10+## `mold`: type (as constructor)
11+
12+Why isn't `span` called "type"? Because Hoon also has a `mold`,
13+a completely different concept that could also be called a "type."
14+Hoon has no syntax for declaring spans. Spans are always created
15+by `mint`, using type inference.
16+
17+But we do want to define data structures with regular shapes. A
18+*mold* is an idempotent function (`gate`), accepting any noun.
19+The span of our structure is the result set of this function.
20+
21+In theory, either molds or spans could be called "types." In
22+practice, they're both called "types." The T-word has to stay
23+informal: it can't be banned, and it's already confusing enough.
24+
25+## `span`: definition
26+
27+This twig defines a mold named `span`, whose icon is the set of
28+all spans. Don't worry about the syntax yet:
29+
30+```
31+++ span
32+ $@ $? $noun
33+ $void
34+ == $% {$atom p/term q/(unit atom)}
35+ {$cell p/span q/span}
36+ {$core p/span q/(map term span)}
37+ {$face p/term q/span}
38+ {$fork p/(set span)}
39+ {$hold p/span q/twig}
40+ ==
41+```
42+
43+## `$noun` and `$void`
44+
45+`$noun` is the set of all nouns. `$void` is the set of
46+no nouns.
47+
48+## `{$cell p/span q/span}`
49+
50+`{$cell p/span q/span}` is the set of all cells with head `p` and
51+tail `q`.
52+
53+## `{$fork p/(set span)}
54+
55+`{$fork p/(set span)}` is the union of all spans in the set `p`.
56+
57+## `{$hold p/span q/twig}`
58+
59+A `$hold` span, with span `p` and twig `q`, is a lazy reference
60+to the span of `(mint p q)`. In English it means: "the type of
61+the product when we compile `q` with the subject `p`. (Hoon is
62+a strict language and the Hoon compiler is written in Hoon, so
63+laziness has to be implemented manually.)
64+
65+## `{$face p/term q/span}
66+
67+A `{$face p/term q/span}` wraps the label `p` around the span
68+`q`. See the twig section for how labels are resolved.
69+
70+## `{%atom p/term q/(unit atom))}
71+
72+An `$atom` is an atom, with two twists. `q` is a `unit`, Hoon's
73+equivalent of `Maybe` in Haskell or a nullable in Rust. If `q`
74+is `~`, null, the span is *warm*; any atom is in the span.
75+If `q` is `[~ x]`, where `x` is any atom, the span is *cold*;
76+its only legal value is the constnat `x`.
77+
78+`p` in the atom is a terminal used as an *aura*, or soft atom
79+type. Auras are a lightweight, advisory representation of the
80+units, semantics, and/or syntax of an atom. Two auras are
81+compatible if one is a prefix of the other.
82+
83+For instance, `@t` means UTF-8 text (LSB low), `@ta` means ASCII
84+text, and `@tas` means an ASCII symbol. `@u` means an unsigned
85+integer, `@ud` an unsigned decimal, `@ux` an unsigned
86+hexadecimal. You can use a `@ud` atom as a `@u` or vice versa,
87+but not as a `@tas`.
88+
89+Auras are truly soft; you can turn any aura into any other,
90+statically, by casting through the empty aura `@`. Hoon is not
91+dependently typed and can't enforce data constraints.
92+
93+## `{$core p/span q/(map term span)}
94+
95+A `$core` is a code-data cell. The data (or *payload*) is the
96+tail; the code (or *battery*) is the head. `p`, a span, is the
97+span of the payload. `q`, a name-twig table, is the source code
98+for the battery.
99+
100+Each twig in the battery source is compiled to a formula, with
101+the core itself as the subject. The battery is a tree of these
102+formulas, or *arms*. An arm is a computed attribute against its
103+core.
104+
105+All code-data structures in normal languages (functions, objects,
106+modules, etc) become cores in Hoon. A Hoon battery looks a bit
107+like a method table, but not every arm is a "method" in the OO
108+sense. An arm is a computed attribute. A method is an arm whose
109+product is a Hoon function (or *gate*).
110+
111+A gate is a core with one arm, whose name is the empty symbol
112+`$`, and a payload whose shape is `{sample context}`. The
113+*context* is the subject in which the gate was defined; the
114+*sample* is the argument.
115+
116+To call this function on an argument `x`, replace the sample (at
117+tree address `6` in the core) with `x`, then compute the arm.
118+(Of course, we don't mutate the noun, we make a mutant copy.)
docs/system/hoon/core/twig.mdnew file+48
@@ -0,0 +1,48 @@
1+---
2+sort: 8
3+---
4+
5+# Expression: `twig`
6+
7+A `twig` is an AST node: the noun that the Hoon compiler makes
8+when it parses a source expression.
9+
10+The definition of `twig` is the definition of Hoon. So let's
11+define the syntax and semantics of Hoon, a twig at a time. But
12+first, basic twig anatomy.
13+
14+## Twig anatomy
15+
16+A twig is a tagged union (`book`) with the form `{stem bulb}`,
17+where the `stem` is an atomic symbol. The bulb for each stem has
18+its own type, which varies by stem. (Compare with Lisp, where
19+every AST node is a tag and a list of child nodes.)
20+
21+There are no user-level macros. All stems are built into Hoon.
22+Most stems are implemented as internal macros, however.
23+
24+The bulb is usually a tuple, sometimes a list or map. An element
25+of this structure is a *subexpression*.
26+
27+Usually a subexpression is itself a `twig`; sometimes it's an
28+`@tas` (symbol) or a `wing` (reference path). Solely for
29+clarity, we use the type alias `moss` for twigs meant to produce
30+molds. A `moss` is just a twig, both in syntax and semantics.
31+
32+## Twig categories
33+
34+Fortunately, the twigs fit neatly into clear categories which
35+match their rune prefix. Read forward by category:
36+
37+<div><list/></div>
38+
39+## Structures
40+
41+The whole Crash twig system, as a
42+
43+```
44+|%
45+++
46+--
47+```
48+
docs/system/hoon/core/twig/atom.mdnew file+107
@@ -0,0 +1,107 @@
1+---
2+sort: 2
3+---
4+
5+# Constants and interpolations
6+
7+A constant is a twig whose product does not depend on the
8+subject. If you know Nock, the formula produced is always
9+is always `[1 constant]`.
10+
11+(Some of the "constant" syntax below can interpolate dynamic
12+twigs. When it does, it obviously isn't constant at all.)
13+
14+## Twigs
15+
16+```
17+|%
18+++ twig
19+ {$rock p/@tas q/@}
20+ {$sand p/@tas q/@}
21+ {$knit p/(list $@(@ {$~ p/twig}))}
22+ {$path p/(list (each @tas twig))
23+--
24+```
25+
26+## Syntax
27+
28+All Hoon constants are irregular; they have no rune form. The
29+stems described below are `$rock` (cold / constant), `$sand`
30+(warm / open), `$knit` (iterative string), and `$path` (Unix
31+style path).
32+
33+### Atoms
34+
35+Recall the `$atom` span, `{$atom p/aura q/(unit @)}`.
36+
37+Each atom constant syntax implies an aura. Note that the aura is
38+used indiscriminately to convey units, interpretations, parsing
39+syntax, and/or printing syntax.
40+
41+### Hardcoded auras
42+
43+### Cold or warm, single or arbitrary
44+
45+A span is a set of nouns; an `$atom` span contains either one
46+atom (*cold*) or all atoms (a *warm*).
47+
48+In general, the `%` prefix is added to indicate coldness. `42`
49+is warm and `%42` is cold. `@tas` symbols (which start with `%`
50+already, see below) are always cold.
51+
52+### Unsigned integer: `@ud`, `@ux`, `@uw`.
53+
54+Unsigned integers are broken into groups of 3 for decimals, and 4
55+for non-decimals, separated German style by `.`; `420` plus `999`
56+is `1.419`, a `@ud`.
57+
58+A hex (`@ux`) favorite is `0xcafe.babe`.
59+
60+`0w` is base64: `0-9`, `a-z` + 10, `A-Z` + 36, `-` and `~`. For
61+giant numbers, you can put whitespace/newlines after the `.`.
62+
63+### Boolean and null: `@f`, `@n`.
64+
65+Booleans in Hoon (`@f`) are `&` for yes (`@f`) and `|` for no.
66+Remember that `&` is `0` and `|` is `1` (which is why we say
67+"yes" and "no" rather than "true" and "false").
68+
69+Nil (aura `@n`) is `~` (with the value `0`).
70+
71+### Atomic string
72+
73+`'text'` in single quotes, `@t`, is a UTF-8 string LSB first.
74+
75+`%symbol`, `@tas`, containing only `a-z`, `0-9` and `-`, starting
76+with `a-z`, and ending with `a-z0-9`, is a valid symbolic name.
77+
78+`%$` is an empty `@tas`, ie, `0` with span `@tas`.
79+
80+### Signed integer: `@sd`
81+
82+Signed integers (`@sd`) are encoded with sign bit *low*. This
83+means we need a special syntax for positive signed integers,
84+since their atomic value can't be their unsigned value. For
85+example, `-3` is the atom `7`, whereas `--3` encodes to `6`.
86+
87+### Iterative string
88+
89+Hoon also has list-shaped strings (less compact, more editable).
90+Use double quotes: `"hello, world"`. The mold is `tape` or
91+`(list char)`, where `char` is a UTF-8 byte.
92+
93+Within a quoted string, interpolate with `{}`: `"hello, {(weld
94+"wo" "rld")}"`. It's also worth noting that `<`, `gar`, and `>`,
95+`gal` (angle brackets) stringify any twig: `"hello, {<mul 6
96+7>}"`. (Obviously, an interpolated string is not a constant.)
97+
98+### Path
99+
100+The path `/foo/bar/baz` is the constant `[%foo %bar %baz ~]`.
101+A path can be dynamically interpolated with `[]`:
102+
103+```
104+/foo/[:(if & %bar %rab)]/baz`
105+```
106+
107+equals `/foo/bar/baz`.
docs/system/hoon/core/twig/call.mdnew file+121
@@ -0,0 +1,121 @@
1+---
2+sort: 7
3+---
4+
5+# Full make (`%` runes)
6+
7+We've already covered the irregular-only twigs `$wing` and
8+`$limb`. These are simple forms of the *invocation* family of
9+twigs, `%`, whose general form is `$make`, `%=`.
10+
11+## Regular forms
12+
13+The rune prefix is `%`. Suffixes: `=` for `:make`, `~` for
14+`:open`, `-` for `:call`, `+` for `:calt`, `^` for `:calq`, `*`
15+for `:calp`.
16+
17+### `:make`, `%=`, "centis", `{$make p/wing q/(list (pair wing twig))}`
18+
19+Syntax: *1-fixed*, then *jogging*.
20+
21+The product: `p`, modified by the change list `q`.
22+
23+If `p` resolves to a leg, `q` is a list of changes to that leg.
24+If `p` resolves to an arm, `q` is a list of changes to the core
25+containing that arm. We compute the arm on the modified core.
26+
27+### `:open`, `%~`, "censig", `{$open p/wing q/twig r/twig}`
28+
29+Syntax: *3-fixed*.
30+
31+Expands to:
32+
33+```
34+ :pin q
35+ :make(p.+2 +6 :per(+3 r))
36+```
37+
38+We pin `q`, making our subject `[q subject]`. We make arm `p` on
39+`q`, changing leg `6` to `r` (per the original subject).
40+
41+Wut? Why? `$open` is a general case of `$call`; see below.
42+
43+### `:call`, `%-`, "cenhep", `{$call p/twig q/twig}`/
44+
45+Syntax: *2-fixed*.
46+
47+Expands to: `:open($ p q)`.
48+
49+`$call` is a function call; `p` is the function (`gate`), `q` the
50+argument. `$call` is a special case of `$open`, and a gate is a
51+special case of a `door` (see the [core](../core) twigs).
52+
53+In a gate, the modified core has only one anonymous arm; in a
54+door it gets a full battery. Intuitively, a gate defines one
55+algorithm it can compute upon its sample, `+6`. A door defines
56+many such algorithms.
57+
58+In classical languages, doors correspond to groups of functions
59+with the same argument list, or at least sharing a prefix. In
60+Hoon, this shared sample is likely to be pulled into a door.
61+
62+### `:calt`, `%+`, "cenlus", `{$calt p/twig q/twig r/twig}`
63+
64+Syntax: *3-fixed*.
65+
66+Expands to: `:(call p [q r])`.
67+
68+### `:calq`, `%^`, "cenket", `{$cnkt p/twig q/twig r/twig s/twig}`
69+
70+Syntax: *4-fixed*.
71+
72+Expands to: `:(call p [q r s])`.
73+
74+### `:calp`, `%*`, "centar", `{$cntr p/twig q/(list twig)}`
75+
76+Syntax: *4-fixed*.
77+
78+Expands to: `:(call p [q])`.
79+
80+## Irregular forms
81+
82+### Classic call, `(p q r s)`
83+
84+Translation:
85+
86+```
87+(p) :per(p $)
88+(p q) :call(p q)
89+(p q r s) :call(p [q r s])
90+```
91+
92+### Modified wing, `p.q(r s, t u, v w)`
93+
94+Translation:
95+
96+```
97+p.q(r s, t u, v w) :make(p.q r s, t u, v w)
98+```
99+
100+### Anonymous recursion, `:moar*`.
101+
102+Translation:
103+
104+```
105+:moar $
106+:moar(a b, c d, e f) $(a b, c d, e f)
107+:moarr ^$
108+:moarrrr ^^^$
109+```
110+
111+`:moar` has tall and wide form like a regular stem, though it has
112+no rune and is not a regular stem.
113+
114+`$` is a label like any other. But loops, gates, and traps all
115+hardcode this label. `$` thus implies recursing back to the
116+nearest `:loop` (`|-)`, `:gate` (`|=`), or `:trap` (`|.`). (Or
117+`^$` for the second nearest, `^^$` for the third, etc.
118+
119+`$` *seems* like a language primitive (eg, Clojure's `recur`), so
120+we made it look like one. Keyword enthusiasts and cats who love
121+cheeseburgers will appreciate `:moar`. Others can use `$`.
docs/system/hoon/core/twig/cast.mdnew file+53
@@ -0,0 +1,53 @@
1+---
2+sort: 10
3+---
4+
5+# Type manipulation (`^` runes).
6+
7+`$cast`, `$like`, and `$name` let us adjust spans without
8+violating type constraints.
9+
10+The `nest` algorithm which tests span subtyping is conservative;
11+it never allows invalid nests, it sometimes rejects valid nests.
12+
13+## Regular forms
14+
15+### `:like`, `^+`, "ketlus", `{$like p/twig q/twig}`
16+
17+Syntax: *2-fixed*.
18+
19+The product is the formula of `q` with the span of `p`, provided
20+nouns within the span of `q` can be shown to nest within the span
21+of `p`.
22+
23+### `:cast`, `^-`, "ketlus", `{$like p/moss q/twig}`
24+
25+Syntax: *2-fixed*.
26+
27+Expands to: `:like($.p q)`.
28+
29+`$like` is a typecheck by example; `$cast` is a typecheck by
30+mold.
31+
32+### `:name`, `^=`, "kettis", `{$name p/@tas q/twig}
33+
34+Syntax: *2-fixed*.
35+
36+The product: the formula of `q`, with the span of `q` labeled by
37+symbol `p`.
38+
39+### Irregular forms
40+
41+### Backtick cast: `\`foo\`bar`
42+
43+Translation:
44+```
45+`foo`bar ^-(foo bar)
46+```
47+
48+### Infix name: `foo=bar`
49+
50+Translation:
51+```
52+foo=bar ^=(foo bar)
53+```
docs/system/hoon/core/twig/cell.mdnew file+81
@@ -0,0 +1,81 @@
1+---
2+sort: 4
3+---
4+
5+# Cell construction (`:` runes)
6+
7+The cell twigs, `$cons` and friends, are simple and regular.
8+All `:` twigs expand to `$cons`.
9+
10+## Twigs
11+
12+```
13+|%
14+++ twig
15+ {$scon p/twig q/twig}
16+ {$conq p/twig q/twig r/twig s/twig}
17+ {$cons p/twig q/twig}
18+ {$cont p/twig q/twig r/twig}
19+ {$conl p/(list twig)}
20+ {$conp p/(list twig)}
21+--
22+```
23+
24+All construction stems expand to one natural stem, `$cons`, the
25+pair constructor, named for the Lisp special form.
26+
27+Synthetic stems change the last letter to indicate the bulb type:
28+`$cont` for triple, `$conq` for quad, `$conp` for tuple, `$conl`
29+for list. `$scon` is the reverse.
30+
31+## Regular forms
32+
33+The rune prefix is `:`. Suffixes: `-` for pair, `+` for triple,
34+`^` for quad, `*` for tuple, `~` for list, `_` for reverse.
35+
36+### `:cons`, `:-`, "colhep", `{$cons p/twig q/twig}`, "construct"
37+
38+Syntax: *2-fixed*.
39+
40+The product: the cell of `p` and `q`, each compiled against
41+the subject.
42+
43+### `:cont`, `:+`, "collus", `{$cont p/twig q/twig r/twig}`, "cons-3"
44+
45+Syntax: *3-fixed*.
46+
47+Expands to: `:cons(p :cons(q r))`.
48+
49+### `:conq`, `:^`, "colket", `{$cont p/twig q/twig r/twig s/twig}`, "cons-4"
50+
51+Syntax: *4-fixed*.
52+
53+Expands to: `:cons(p :cont(q r s))`.
54+
55+### `:conp`, `:*`, "coltar", `{$conp p/(list twig)}`, "construct tuple"
56+
57+Syntax: *running*.
58+
59+Expands by: `|-(?~(p ~ ?~(t.p i.p [%cons i.p $(p t.p)])))`.
60+
61+### `:conl`, `:~`, "colsig", `{$conl p/(list twig)}`, "construct list"
62+
63+Syntax: *running*.
64+
65+Expands by: `|-(?~(p [%rock %n ~] [%cons i.p $(p t.p)]))`.
66+
67+### `:scon`, `:_`, "colcab", `{$scon p/twig q/twig}`, "construct backward"
68+
69+Syntax: *running*.
70+
71+Expands to: `[%cons q p]`.
72+
73+## Irregular forms
74+
75+### Bracket tuple, `[p q r s]`
76+
77+Translation:
78+
79+```
80+[p q r s] :conp(p q r s)
81+```
docs/system/hoon/core/twig/core.mdnew file+90
@@ -0,0 +1,90 @@
1+---
2+sort: 6
3+---
4+
5+# Cores (`|` runes)
6+
7+Core twigs are flow twigs. The compiler essentially pins a Nock
8+formula, or battery of formulas, to the subject.
9+
10+All `|` twigs are macros around `$core`. (See the `$core`
11+section in [`span`](../span) above.) `$core` uses the subject as
12+the payload of a battery, whose arms are compiled with the core
13+itself as the subject.
14+
15+## Regular forms
16+
17+The rune prefix is `|`. Suffixes: `%` for `:core`, `=` for
18+`:gate`, `-` for `:loop`, `.` for `:trap`, `_` for `:door`.
19+
20+### `:core`, `|%`, "barcen", `{$core p/(map term twig)}`
21+
22+Syntax: *battery*
23+
24+The product: a core with battery `p`. Payload is the subject.
25+
26+### `:gate`, `|=`, "bartis", `{$gate p/moss q/twig}
27+
28+Syntax: *2-fixed*.
29+
30+Expands to:
31+
32+```
33+:new p
34+:core
35+++ $
36+ q
37+--
38+```
39+
40+A `$gate` produces a function from `p` to `q`. `p` is the
41+*sample*, or argument. The core has one formula, named `$` (the
42+empty name). The payload is of the form `{sample context}`,
43+where `context` is the subject of the gate.
44+
45+### `:loop`, `|-`, "barhep", `{$loop p/twig}`
46+
47+Syntax: *1-fixed*.
48+
49+Expands to:
50+
51+```
52+ :rap $
53+ :core
54+ ++ $
55+ p
56+ --
57+```
58+
59+A `$loop` makes a core with one anonymous arm `p`, then takes
60+that arm.
61+
62+### `:trap`, `|.`, "bardot", `{$trap p/twig}`
63+
64+Syntax: *1-fixed*.
65+
66+Expands to:
67+
68+```
69+ :core
70+ ++ $ p
71+ --
72+```
73+
74+A `$trap` is a deferred value.
75+
76+### `:door`, `|_`, "barcab", `{$door p/moss q/(map term twig)}`
77+
78+Syntax: *1-fixed*, then *battery*.
79+
80+Expands to:
81+
82+```
83+ :new p
84+ :core
85+ q
86+ ==
87+```
88+
89+A `gate` is a function; a `door` is the general case of a
90+function. Wut? We'll look at this again from the caller's side.
docs/system/hoon/core/twig/flow.mdnew file+143
@@ -0,0 +1,143 @@
1+---
2+sort: 5
3+---
4+
5+# Subject flow (`=` runes)
6+
7+Flow twigs change the subject. (Or more precisely, a flow twig
8+compiles at least one of its subtwigs with a different subject.)
9+All non-flow twigs (except cores) pass the subject down unchanged.
10+
11+## Overview
12+
13+The simplest way to change the subject is to compose two twigs,
14+`p` and `q`. Let `x` be `(mint subject p)`, with product span
15+`p.x` and nock formula `q.x`. Let `y` be `(mint p.x q)`. Then
16+their composition is `[p.y [7 q.x q.y]]`.
17+
18+This composition is the `$per` twig. A close relative is `$pin`,
19+which is `$per` over `[p .]`. The new subject is a cell of `p`
20+and the old subject. `$pin` is the simplest Hoon equivalent of
21+"declaring a variable" (introducing new data into the subject).
22+
23+Another way to change the subject is to mutate it. With the
24+`$set` twig, given a wing that resolves to a leg, we can write
25+instead of reading, *installing* a new value at that leg. Of
26+course, we are creating a copy, not modifying the original.
27+
28+## Structures
29+
30+### `taco`: name with optional filling
31+
32+A `taco` is either a symbol or a symbol-mold cell. The mold is a
33+typecheck and cast. For instance, when "initializing a variable"
34+with `:var`, we can cast the inferred type of the initial value
35+to match an explicit `taco` mold, or just state the symbol and
36+use the inferred type.
37+
38+The `taco` syntax is `foo` for the symbol foo, or `foo/bar` for
39+symbol `foo` and mold `bar`.
40+
41+## Definitions
42+
43+The rune prefix is `=`. Suffixes: `>` for `:per`, `<` for
44+`:rap`, `+` for `:pin`, `-` for `:nip`, `|` for `:new`, `/` for
45+`:var`, `;` for `:rev`, `.` for `:set`, and `^` for `:sip`.
46+
47+### `:per`, `=>`, "tisgar", `{$per p/twig q/twig}`, "compose"
48+
49+The product: `q`, compiled against the product of `p`.
50+
51+Intuitively: uses `p` as the subject of `q`.
52+
53+### `:rap`, `=<`, "tisgal", `{$rap p/twig q/twig}`, "reverse compose"
54+
55+Expands to: `:per(q p)`
56+
57+Intuitively: reverse of `:per`.
58+
59+### `:pin`, `=+`, "tislus", `{$pin p/twig q/twig}`, "work with"
60+
61+Expands to: `:per(:cons(p .) q)`
62+
63+Intuitively: uses `[p subject]` as the subject of `q`.
64+
65+### `:nip`, `=-`, "tishep", `{$nip p/twig q/twig}`, "work over"
66+
67+Expands to: `:pin(q p)`
68+
69+Intuitively: reverse of `:pin`.
70+
71+### `:var`, `=/`, "tisfas", `{$var p/taco q/twig r/twig}, "with variable"
72+
73+Expands to: `?@(p :pin(:name(p q) r) :pin(:cast(:(coat p) q) r)`
74+
75+Intuitively: uses `[p=q subject]` as the subject of `r`. If `p`
76+contains a mold, cast `q` to that mold.
77+
78+### `:rev`, `=;`, "tissem", `{$var p/taco q/twig r/twig}, "over variable"
79+
80+Expands to: `:var(p r q)`
81+
82+Intuitively: reverse of `:var`.
83+
84+### `:new`, `=|`, "tisbar", `{$new p/moss q/twig}`, "with blank"
85+
86+Expands to: `:pin(:per($ p) q)`
87+
88+Intuitively: pin the default value of `p`.
89+
90+### `:set`, `=.`, "tisdot", `{$set p/wing q/twig r/twig}`, "mutate"
91+
92+The product: `r`, compiled against a version of the subject
93+with wing `p` modified to the product of `q`.
94+
95+Intuitively: `r` with `p` set to `q`. Almost an assignment.
96+
97+### `:sip`, `=^`, "tisket", `{$sip p/taco q/wing r/twig s/twig}`, "advance"
98+
99+The product is `s`, compiled against a version of the subject
100+in which the head of `r` is bound to variable `p`, and the tail
101+of `r` is assigned into the wing `q`.
102+
103+Intuitively: `r` produces a cell; we pin the head and install the
104+tail.
105+
106+Whyuppose we have a state machine with a function that
107+produces a cell, whose head is a result and whose tail is a new
108+state. We want to use the head as a new variable, and stuff the
109+tail back into wherever we stored the old state. This may also
110+remind you of Haskell's State monad.
111+
112+## Irregular forms
113+
114+### Infix colon, p:q
115+
116+Not to be confused with the wing `p.q`. Translation:
117+```
118+p:q:r :rap(p :rap(q r))
119+```
120+
121+## Structures
122+
123+Using a mold syntax we haven't learned yet:
124+
125+```
126+|%
127+++ taco
128+ ?@(term {term moss})
129+::
130+++ twig
131+ {$per p/twig q/twig}
132+ {$rap p/twig q/twig}
133+
134+ {$pin p/twig q/twig}
135+ {$nip p/twig q/twig}
136+
137+ {$new p/moss q/twig}
138+ {$var p/taco q/twig r/twig}
139+ {$rev p/taco q/twig r/twig}
140+ {$set p/wing q/twig r/twig}
141+ {$sip p/taco q/wing r/twig s/twig}
142+--
143+```
docs/system/hoon/core/twig/limb.mdnew file+103
@@ -0,0 +1,103 @@
1+---
2+sort: 3
3+---
4+
5+# Limbs and wings
6+
7+One feature Hoon lacks: a context that isn't a first-class value.
8+Hoon has no concept of scope, environment, etc. A twig has one
9+data source, the *subject*, a noun like any other.
10+
11+In most languages "variable" and "attribute" are different
12+things. They are both symbols, but a variable is in "the
13+environment" and a attribute is on "an object." In Hoon, "the
14+environment" is "an object" -- the subject.
15+
16+`$limb` and `$wing` are two basic twig stems that extract
17+information from the subject. A `limb` is an attribute; a `wing`
18+is an attribute path, ie, a list of limbs.
19+
20+## Twigs
21+
22+Using a mold
23+```
24+++ limb
25+ $% {$& p/@ud}
26+ {$| p/@ud q/@tas}
27+ ==
28+++ twig
29+ $% {$limb p/limb}
30+ {$wing p/wing}
31+ ==
32+++ wing (list limb)
33+```
34+
35+The basic reference twigs are `$limb` and `$wing`. `$limb`
36+is a single reference step into the subject. `$wing` is a path
37+of reference steps.
38+
39+## Limbs and wings
40+
41+A `limb` is either *geometric*, `{$& p/@ud}`, or *symbolic*,
42+`{$| p/@ud q/@tas}`.
43+
44+The result of compiling a limb is either an *arm* or a *leg*. A
45+leg is a subtree of the subject. An arm is a computed attribute
46+on a core which is a subtree of the subject. (See `$core` in
47+[span](../span).)
48+
49+A geometric limb always compiles to a leg. A symbolic limb may
50+compile to an arm or a leg, depending on the subject.
51+
52+### Geometric limb, `{$& p/@ud}`
53+
54+`p` is a Nock tree address in the subject. If you don't know
55+Nock, tree addresses are a way of designating a subtree of a noun
56+with an atom. The root is `1`, the left child of any node `n` is
57+`(mul 2 n)`, the right child is `(add 1 (mul 2 n))`.
58+
59+### Symbolic limb
60+
61+A symbolic limb has a name `q` and a *skip count* `p`.
62+
63+To resolve the limb to arm or leg, we search the subject
64+headfirst and depth-first. If we descend to a `$face` span whose
65+label matches the limb symbol, the descent address is a leg; the
66+span is the span beneath the label. But if the `$face` label
67+differs, the search ignores this leg.
68+
69+If we descend into a `$core` span in which the limb symbol is an
70+arm, we produce that arm. If the limb symbol is not bound, we
71+descend into the payload (data) of the core.
72+
73+If the skip count `p` is nonzero, we pretend our first `p`
74+matches are actually mismatches. This lets the programmer "look
75+through" an overriding label. No label anywhere is inaccessible.
76+
77+### Wing
78+
79+A `wing` is a symbolic reference path, `(list limb)`. Taking a
80+wing is not quite the same as composing each of these limbs,
81+though; the product of a wing is still either an arm or a leg.
82+
83+This is trivial if each step in the wing is a leg. If an
84+intermediate step in a wing compiles to an arm, this arm is
85+rewritten; it becomes a leg to the arm's core.
86+
87+### Syntax
88+
89+All limb references are irregular.
90+
91+A geometric limb `x` is `+x`. `.` means `+1`.
92+
93+A symbolic limb `foo` is `foo`; the symbol is naked. To set a
94+nonzero skip count, use a unary `^` prefix; thus `^foo` skips one
95+match, and `^^^foo` skips three.
96+
97+The empty name `$` is the label whose value is 0. By convention,
98+`$` is always an arm, usually on a one-armed core (such as a
99+function or loop).
100+
101+A wing is written outside-in with `.` as a separator. So
102+`foo.bar.baz` is "foo, in bar, in baz." Yes, this is the
103+opposite of what you're used to.
docs/system/hoon/core/twig/mold.mdnew file+136
@@ -0,0 +1,136 @@
1+---
2+sort: 8
3+---
4+
5+# Molds (`$` runes).
6+
7+A *mold* is a `gate` (function) that helps us build simple and
8+rigorous data structures. (In fact, since "mold" sounds nasty,
9+molds are often called "structures.")
10+
11+## Overview
12+
13+While Hoon can't check this property statically, any true mold
14+is a *rectifier*: an idempotent function across all nouns. If
15+the sample of a gate has span `%noun`, and its body obeys the
16+constraint that for any x, `=((mold x) (mold (mold x)))`, it's a
17+rectifier and can be used as a mold.
18+
19+Twigs in the `$` family are macros designed for making molds.
20+But any Hoon twig may produce a mold. (This is why `moss` is a
21+synonym for `twig`).
22+
23+Many macros *bunt* a mold, producing `:per(mold $)`. This value,
24+simply the result of executing the gate on the default sample,
25+is a constant by definition and normally can be compiled as such.
26+The range of a mold (the span of its bunt) is called its *icon*.
27+
28+Molds have two uses: defining simple and rigorous structures, and
29+validating untrusted input data. Validation, though very
30+important, is a rare use case. Except for direct raw input,
31+it's generally a faux pas to rectify nouns at runtime -- or even
32+in userspace.
33+
34+As a structure definition, a mold has three common uses. One,
35+its bunt is a default value (such as the sample in a gate.) Two,
36+the product of some computation is cast to its icon, both
37+checking the type and regularizing it. Three, it's used as a
38+building block in other molds.
39+
40+## Regular forms
41+
42+The rune prefix is `$`. Suffixes:
43+
44+### `:bank`, `$:`, "buccol", `{$bank p/(list moss)}`
45+
46+Syntax: *running*.
47+
48+The product: a rectifier gate producing the tuple `p`.
49+
50+Where `a`, `b` and `c` produce molds, `:bank(a b c)` produces a
51+mold whose icon is the span `[$.a $.b $.c]`.
52+
53+### `:coat`, `$=`, "buctis", `{$coat p/@tas q/moss}`
54+
55+Syntax: *2-fixed*.
56+
57+The product: a rectifier gate producing mold `q` under label `p`.
58+
59+Where `q` produces a mold, `:coat(p q)` produces a mold whose
60+icon matches the span of `:name(p $.q)`.
61+
62+### `:pick`, `$?`, "bucwut", `{$pick p/(list moss)}`
63+
64+Syntax: *running*.
65+
66+The product: a rectifier gate producing the union of the molds in
67+`p`.
68+
69+Where `a`, `b`, and `c` produce molds, `:pick(a b c)` produces a
70+mold whose icon matches the span of `?:(& $.a ?:(& $.b $.c))`.
71+
72+The default mold is the first item in `p`. To avoid an infinite
73+loop, it has to be a termination case (such as a constant).
74+
75+### `:book`, `$%`, "buccen", `{$book p/(list moss)}`
76+
77+Syntax: *running*.
78+
79+The product: a rectifier gate producing the tagged union of the
80+molds in `p`, all of which must be of the form `:bank(stem
81+bulb)`, where `stem` is an atomic mold.
82+
83+`$book` has the same icon as `$pick`, but rectifies better.
84+
85+The default mold is the first item in `p`. To avoid an infinite
86+loop, it has to be a termination case (such as a constant).
87+
88+### `:shoe`, `$_`, "buccab", "{$shoe p/twig}"
89+
90+Syntax: *1-fixed*.
91+
92+Expands to: `:gate(* p)`.
93+
94+A `$shoe` is not useful for rectification; it ignores its input.
95+It is only useful for defaults and typechecks. Sometimes we have
96+no choice but to describe by example.
97+
98+### `:lamb`, `$-`, `"buchep"`, `{$lamb p/moss q/moss}`
99+
100+Syntax: *1-fixed*.
101+
102+Expands to: `:shoe(:gate(p $.q))`.
103+
104+`$lamb` is a lambda. We shoe a trivial function from `p` to `q`.
105+Like any `$shoe`, a `$lamb` is not useful for rectification (eg,
106+you can't use it to typecheck cores sent over the network).
107+
108+## Irregular forms
109+
110+### Primitives
111+
112+`*` means any noun; `@` with an aura means an atom, such as `@ud`
113+for unsigned decimal, or just `@` for a generic noun; `?` for
114+boolean; `^` for a cell (of `*`).
115+
116+### Constants
117+
118+For a mold producing a cold atom, replace the `%` of the constant
119+syntax with `$`. `%42` is the constant number `42`; `$42` is a
120+function that, passed 42 or any other argument, produces `%42`.
121+
122+Similarly, `%foo` is the number `7.303.014` or `0x6f.6f66`;
123+`$foo` is a function that produces `%foo`.
124+
125+`$~` produces `~`.
126+
127+### Miscellaneous
128+
129+Translation:
130+
131+```
132+{a b c}` :bank(a b c)
133+a/b :coat(a b)
134+?(a b c) :pick(a b c)
135+_a :shoe(a)
136+```
docs/system/hoon/core/twig/nock.mdnew file+36
@@ -0,0 +1,36 @@
1+---
2+sort: 11
3+---
4+
5+# Intrinsics (`.` runes)
6+
7+Anything Nock can do, Hoon can do.
8+
9+## Regular forms
10+
11+### `:bump`, `.+`, "dotlus", `{$bump p/twig}`
12+
13+Syntax: *1-fixed*
14+
15+The product: the product of `p`, which must be an atom, plus 1.
16+
17+### `:same`, `.=`, "dottis", `{$same p/twig q/twig}`
18+
19+Syntax: *2-fixed*.
20+
21+The product: yes iff `p` and `q` produce the same value. The span
22+of `p` must nest within the span of `q`, or vice versa.
23+
24+### `:nock`, `.*`, "dottar", `{$nock p/twig q/twig}`
25+
26+The product: Nock of the formula produced by `q`, with the
27+subject produced by `p`. Typeless.
28+
29+### `:wish`, `.^`, "dotket", `{$wish p/moss q/twig}`
30+
31+The product: the noun `q` dereferenced in the Urbit global
32+namespace. The product must nest within the icon of `p`.
33+
34+Only available in user-level code. Not blocking except in
35+dojo-level code (blocks for a generator, fails if it would block
36+for an app).
docs/system/hoon/core/twig/syntax.mdnew file+20
@@ -0,0 +1,20 @@
1+---
2+sort: 1
3+---
4+
5+# Hoon syntax
6+
7+Hoon's semantics are simple, but unusual. Hoon's syntax is
8+complex, and unusual. Sorry.
9+
10+An excuse: the normal human brain doesn't have hardware support
11+for math, but it does have hardware support for syntax. Learning
12+math is harder than it looks. Learning syntax is easier.
13+
14+An explanation: the Hoon syntax is trying to solve three serious
15+problems in functional syntax design.
16+
17+Read the [motivation](motivation) if you care; or go straight to
18+the actual [design](design).
19+
20+<list></list>
docs/system/hoon/core/twig/syntax/design.mdnew file+297
@@ -0,0 +1,297 @@
1+# Design
2+
3+Because each twig stem has its own bulb, each has its own parser
4+rule. We'll describe these grammars as we go through the stems.
5+
6+But Hoon has a general syntax design with common principles and
7+regularities. We'll cover those here.
8+
9+## Glyphs and characters
10+
11+Hoon is a heavy punctuation user. To make ASCII great again,
12+we've mapped each punctuation glyph to a syllable:
13+
14+```
15+ ace [1 space] gal < pal (
16+ bar | gap [>1 space, nl] par )
17+ bas \ gar > sel [
18+ buc $ hax # sem ;
19+ cab _ hep - ser ]
20+ cen % kel { sig ~
21+ col : ker } soq '
22+ com , ket ^ tar *
23+ doq " lus + tec `
24+ dot . pam & tis =
25+ fas / pat @ wut ?
26+ zap !
27+```
28+
29+You don't need to memorize these glyph names, but it helps. Code
30+is often vocalized or subvocalized. "pal" is easier to say,
31+aloud or silently, then "left paren."
32+
33+Note that the list includes two separate whitespace forms: `ace`
34+for a single space, `gap` for 2+, comment or newline. Hoon
35+Besides `ace` versus `gap`, whitespace is not significant.
36+
37+Comments start with `::` and run to the end of the line. Hard
38+tab characters are illegal, and an 80-column right margin is
39+strongly encouraged. Really well-groomed Hoon uses a 55-column
40+code margin and puts a standard line comment at column 57.
41+
42+Hoon does not accept non-ASCII text in source files, except UTF-8
43+in quoted strings.
44+
45+## Tall and flat forms
46+
47+There are two kinds of Hoon expression syntax: *tall* and *flat*.
48+Most stems have both tall and flat forms. Tall twigs can contain
49+flat twigs, but not vice versa.
50+
51+Visually, a tall twig looks like a "statement" and a flat twig
52+like an "expression," preserving the attractive visual shape of
53+procedural code without the nasty side effects.
54+
55+## Regular and irregular forms
56+
57+Most stems have *regular forms*, which share a common design.
58+There is a regular flat form and a regular tall form; most stems
59+implement both. All tall forms are regular.
60+
61+Some twigs also have *irregular forms*, which follow no
62+principles at all. All irregular forms are flat.
63+
64+Some twigs (simple leafy ones) have *only* irregular forms.
65+
66+## Keywords versus runes
67+
68+A regular form starts with a *sigil*, which is either a
69+*keyword* or a *rune* -- at the programmer's choice.
70+
71+A *keyword* is `:` and then the stem label - eg, `:cons`.
72+
73+A *rune* is a pair of ASCII punctuation marks (a digraph) - eg,
74+`:-`. The first glyph in the rune indicates the category - eg,
75+`:` runes make cells. Runes can be pronounced by their glyphs or
76+by their stem -- for `:-`, you can say either "colhep" or "cons".
77+
78+Keywords may be less challenging for early learners. Rune style
79+is less cluttered and distracting for experienced programmers;
80+the system codebase is all in rune style. Beginners can start
81+with keywords and move to runes; start with runes and stick
82+with runes; or start with keywords and stick with keywords.
83+
84+Here's the FizzBuzz demo code, in idiomatic rune syntax. Compare
85+with the [original](../../demo).
86+
87+```
88+ |= end/atom
89+ =/ count 1
90+ |- ^- (list tape)
91+ ?: =(100 count) ~
92+ :_ $(count (add 1 count))
93+ ?: =(0 (mod count 15))
94+ "FizzBuzz"
95+ ?: =(0 (mod count 5))
96+ "Fizz"
97+ ?: =(0 (mod count 3))
98+ "Buzz"
99+ (text !>(count))
100+```
101+
102+## Tall regular form
103+
104+Tall regular form starts with the sigil, followed by a `gap`
105+(any whitespace except `ace`), followed by a bulb whose twigs are
106+separated by `gap`.
107+
108+There are four body subtypes: *fixed*, *running*, *jogging*, and
109+*battery*. Stems with a *fixed* number of subexpressions
110+self-terminate. For instance, `:if` has three subexpressions and
111+is self-terminating. Otherwise the twig is terminated by a
112+`gap`, then either `==` (*running* or *jogging*, most twigs) or
113+`--` (*battery*).
114+
115+The *running* body is a list of twigs. The *jogging* body is a
116+list of twig pairs, separated by a `gap`. The *battery* body is
117+a list of symbol-twig pairs, separated by a gap, prefixed by `++`
118+and then a gap.
119+
120+This definition is enough to parse. But the proper shape of the
121+whitespace gaps demands an informal convention.
122+
123+Whitespace design in Hoon is an art, not a science. It involves
124+both tall/flat mode switches and well-shaped gaps. (Hoon layout
125+could probably be done automatically with reasonable quality.
126+But it would at least take machine learning, not a rule engine.)
127+
128+There only two real *rules* in Hoon whitespace design: don't
129+go past 80 characters, and don't use (completely) blank lines.
130+Otherwise, if it looks good and is easy to read, it's good. But
131+the best way to learn the art is to do everything by convention
132+until you know what you're doing. Here are the conventions:
133+
134+### Conventions: *fixed*
135+
136+Bulbs with *fixed* fanout use "backstep" indentation, which slopes
137+backward and to the right by two spaces per line. The first
138+child is two spaces after the end of the sigil.
139+
140+Some *1-fixed*, *2-fixed*, *3-fixed* and *4-fixed* examples:
141+
142+```
143+|.
144+p
145+
146+=| p
147+q
148+
149+?: p
150+ q
151+r
152+
153+%^ p
154+ q
155+ r
156+s
157+```
158+
159+The hope of backstep indentation is that the heaviest twigs are
160+at the bottom, keeping code flow vertical rather than diagonal.
161+Alternate, reversing
162+
163+### Conventions: *running*
164+
165+A *running* bulb (a simple child list) puts the first child two
166+spaces after the end of the sigil, and the following children
167+straight down:
168+
169+A *running* example:
170+
171+```
172+:* p
173+ q
174+ r
175+ s
176+ t
177+==
178+```
179+
180+### Conventions: *jogging*
181+
182+A *jogging* bulb (a list of child pairs) is like a running bulb,
183+but backsteps the head of the pair above the tail. Most jogging
184+twigs start with a *fixed* sequence; the first jogging pair is
185+below and two steps backward from the last fixed child.
186+
187+There are two jogging conventions: *flat* (pair on one line) and
188+*tall* (pair split across lines).
189+
190+A *flat jogging* example (preceded by *1-fixed* `p`)
191+
192+```
193+?- p
194+ q r
195+ s t
196+ u v
197+==
198+```
199+
200+A *tall jogging* example (preceded by *1-fixed* `p`):
201+
202+```
203+?- p
204+ q
205+ r
206+ s
207+ t
208+ u
209+ v
210+==
211+```
212+
213+### Conventions: *battery*
214+
215+A *battery* bulb is a list of symbol-twig pairs, for the battery
216+of a core. A conventional example:
217+
218+```
219+|%
220+++ foo
221+ p
222+++ bar
223+ q
224+--
225+```
226+
227+## Flat regular form
228+
229+Flat regular form starts with the sigil, followed by `pal`
230+(`(`, left parenthesis), followed by a bulb whose subexpressions
231+are separated by `ace` (one space), followed by `par` (`)`, right
232+parenthesis).
233+
234+A twig in flat form, `:if`, `?:`, `{$if p/twig q/twig r/twig}`:
235+
236+```
237+:if(p q r)
238+
239+?:(p q r)
240+```
241+
242+The only exception is *jogging* bodies, in which subexpression
243+pairs are separated by commas:
244+
245+```
246+:make(foo bar 42, baz 55, moo 17)
247+```
248+
249+There is no flat regular form for *battery* bodies. Be tall.
250+
251+## Naming conventions
252+
253+Hoon does not enforce any rule on symbols, except that capitals
254+are not allowed (use kebab-case). However, a lot of system code
255+is written in using "lapidary" conventions that need explanation.
256+
257+Naming things is one of the hard problems in CS. Dodging this
258+problem is one of the reasons mathematicians use Greek letters,
259+not variable names. Meaningful names also interpose a verbal
260+interpretation, distracting at best and confusing at worst, on
261+the formula or algorithm. Greek letters are not *meaningful*,
262+but they are *memorable*. And their interpretation is defined by
263+the formula and nothing else.
264+
265+### Lapidary and ultralapidary
266+
267+In the *lapidary* naming style, labels are pronounceable
268+three-letter strings, usually CVC (consonant-vowel-consonant).
269+Sometimes they encode a mnemonic, but usually they are just
270+memorable. Labels are reused wherever the analogy seems
271+appropriate.
272+
273+In the *ultralapidary* naming style, labels are single letters,
274+starting in order of construction from `a`, or within a tuple
275+mold `p`. Hoon uses single-letter names for the same reason
276+Algol style languages pass arguments by order, rather than
277+keyword. Naming items by order makes sense when there are no
278+more than three or four; five is stretching it; six is too many.
279+
280+For example, when defining `add`, we want to name the operands
281+`a` and `b`. It's silly to call them `foo` and `bar`, let alone
282+`left-operand` and `right-operand`. The smaller the scale of an
283+algorithm, the simpler its names should be.
284+
285+### When in doubt, don't be lapidary
286+
287+This works in the other direction: namelessness doesn't scale.
288+Most normal code shouldn't use lapidary naming at all. (There is
289+too much lapidary Hoon in Urbit.)
290+
291+Lapidary naming is only for *inherently simple code*: code that
292+both aspires to high elegance and clarity, and *is solving a
293+simple and elegant problem*.
294+
295+Given an ugly or complex problem, lapidary naming is a liability,
296+no matter the excellence of the programmer. When in doubt, use
297+long names and/or kebab-case.
docs/system/hoon/core/twig/syntax/motivation.mdnew file+56
@@ -0,0 +1,56 @@
1+# Motivation
2+
3+The three problems are *terminator piles*, *indentation creep*,
4+and *feature/label confusion*.
5+
6+## Terminator piles
7+
8+*Terminator piles* are like Lisp's stacks of right parens. If a
9+syntax uses matching glyphs besides `)`, they get truly ugly.
10+Significant whitespace solves this problem but introduces others.
11+
12+Hoon has no terminator piles. Except for a 1-space / more-space
13+distinction, it has no significant whitespace.
14+
15+## Indentation creep
16+
17+*Indentation creep* is a problem caused by indentation conventions
18+where the indentation point is a function of expression tree
19+depth. It's true that short functions are better than long ones,
20+but long ones sometimes need to be written.
21+
22+A procedural block has a backbone of statements which flows
23+straight down. Most expressions are flat and of limited depth.
24+With some bulging, a long function flows *down* the page.
25+
26+A functional language lacks the expression/statement distinction.
27+So a long function means a deep tree. Given normal indentation
28+conventions, a long function wants to flow *down and across*.
29+This *diagonal* shape fits poorly into most editor windows.
30+
31+Thanks to backstep indentation (see below), Hoon programs are
32+shaped more or less like procedural programs.
33+
34+## Feature/label confusion
35+
36+*Feature/label confusion* is any syntax which makes it hard for
37+the eye to tell whether a token on the screen is a feature of the
38+language, or a label in the program. For example, in Lisp a
39+special form has the same syntax as a function call.
40+
41+The worst-case result of FLC is "DSL cancer". Every source file
42+is effectively written in its own domain-specific language. To
43+read a new file is to learn a new language -- "write-only code."
44+
45+A fixed reserved-word set, especially with syntax highlighting,
46+and especially with orthogonal grammar (in C, you don't write
47+`for(a b c)`), may not be too bad. User-level macros, operator
48+overloading, even excessive use of higher-order programming,
49+can all lead quickly to the tragedy of write-only code.
50+
51+Hoon has very weak FLC in keyword style, none in rune style.
52+It has no user-level macros or overloading. It does support
53+higher-order programming; write-only Hoon can certainly be
54+(and has been) written. But good Hoon style is to avoid it.
55+
56+
docs/system/hoon/core/twig/test.mdnew file+143
@@ -0,0 +1,143 @@
1+---
2+sort: 9
3+---
4+
5+# Tests (`?` runes)
6+
7+Hoon has the usual branches and logical tests. For pattern
8+matching, it also has a `$fits` twig that tests whether a value
9+matches the icon of a mold. And it has branch inference,
10+learning from `$fits` tests in the condition of `:if` twigs.
11+
12+## Overview
13+
14+All `?` runes expand to `$if` (`?:`) and/or `$fits` (`?=`).
15+
16+If the condition of an `$if` is a `$fits`, *and* the `$fits` is
17+testing a leg of the subject, the compile specializes the subject
18+span for the branches of the `$if`. Branch inference also works
19+for twigs which expand to `$if`.
20+
21+The test does not have to be a single `$fits`; the compiler can
22+analyze arbitrary boolean logic (`$and`, `$or`, `$not`) with full
23+short-circuiting. Equality tests (`=`) are *not* analyzed.
24+
25+If the compiler detects that the branch is degenerate (only one
26+side is taken), it fails with an error.
27+
28+## Regular forms
29+
30+The rune prefix is `?`. Suffixes: `=` for `:fits`, `:` for
31+`:if`, `.` for `:lest`, `-` for `:case`, `+` for `:deft`, `|` for
32+`:or`, `&` for `:and`, `!` for `:not`, `>` for `$sure`, `<` for
33+`$deny`, `^` for `:ifcl`, `@` for `:ifat`, `~` for `:ifno`.
34+
35+### `:fits`, `?=`, "wuttis", `{$fits p/moss q/twig}`
36+
37+Syntax: *2-fixed*.
38+
39+The product: `&` if the product of `q` is in the icon of `p`,
40+`|` otherwise.
41+
42+The icon of `p` must be finite / nonrecursive. In general,
43+always match one layer of a data structure at a time.
44+
45+### `:if`, `?:`, "wutcol", `{$if p/twig q/twig r/twig}`
46+
47+Syntax: *3-fixed*.
48+
49+The product: `q` if `p` has the value `&` (0), `r` for `|` (1).
50+`p` must be statically boolean.
51+
52+### `:lest`, `?.`, "wutdot", `{$lest p/twig q/twig r/twig}`
53+
54+Syntax: *3-fixed*.
55+
56+Expands to: `:if(p r q)`.
57+
58+### `:case`, `?-`, "wuthep", `{$case p/twig q/(list (pair moss twig))}`
59+
60+Syntax: *1-fixed*, then *jogging*.
61+
62+Expands by:
63+
64+```
65+|-(?~(q [%lost p] [%if [%fits p.i.q p] q.i.q $(q t.q)]))
66+```
67+
68+A pattern-matching switch. Fails to compile if the pattern is
69+incomplete or irrelevant.
70+
71+### `:deft`, `?+`, "wutlus", `{$case p/twig q/twig r/(list (pair moss twig))}`
72+
73+Syntax: *1-fixed*, then *jogging*.
74+
75+Expands by: `[%case p (weld r [[%base %noun] q])]`
76+
77+A pattern-matching switch, with default.
78+
79+### `:or`, `?|`, "wutbar", `{$or p/(list twig)}`
80+
81+Syntax: *running*.
82+
83+Expands by: `|-(?~(p [%rock %f |] [%if i.p [%rock %f &]] $(p t.p)))`
84+
85+Logical or (`&` (`0`) is yes, `|` (`1`) is no).
86+
87+### `:and`, `?&`, "wutpam", `{$and p/(list twig)}`
88+
89+Syntax: *running*.
90+
91+Expands by: `|-(?~(p [%rock %f &] [%if i.p $(p t.p) [%rock %f |]]))`
92+
93+Logical and (`&` (`0`) is yes, `|` (`1`) is no).
94+
95+### `:not`, `?!`, "wutzap", `{$not p/twig}`
96+
97+Syntax: *1-fixed*.
98+
99+Expands to: `:if(p %| %&)`.
100+
101+Logical not (`&` (`0`) is yes, `|` (`1`) is no).
102+
103+### `:sure`, `?>`, "wutgar", `{$sure p/twig q/twig}`
104+
105+Expands to: `:if(p q !!)`.
106+
107+An assertion.
108+
109+### `:deny`, `?<`, "wutgal", `{$deny p/twig q/twig}`
110+
111+Expands to: `:if(p !! q)`.
112+
113+A negative assertion.
114+
115+### `:ifno`, `?~`, "wutsig", `{$ifno p/twig q/twig r/twig}`
116+
117+Expands to: `:if(:fits($~ p) q r)`.
118+
119+Branches on whether `p` is null.
120+
121+### `:ifat`, `?@`, "wutpat", `{$ifat p/twig q/twig r/twig}`
122+
123+Expands to: `:if(:fits(@ p) q r)`.
124+
125+Branches on whether `p` is atomic.
126+
127+### `:ifcl`, `?^`, "wutket", `{$ifat p/twig q/twig r/twig}`
128+
129+Expands to: `:if(:fits(^ p) q r)`.
130+
131+Branches on whether `p` is cellular.
132+
133+## Irregular forms
134+
135+### Light logic
136+
137+Translations:
138+
139+```
140+&(a b c) ?&(a b c)
141+|(a b c) ?|(a b c)
142+!a ?!(a)
143+```
docs/system/hoon/library/src/1a/gate/add.md+1−1
@@ -7,7 +7,7 @@ Produces the sum of `a` and `b`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212`b` is an atom.
1313
docs/system/hoon/library/src/1a/gate/dec.md+2−3
@@ -7,7 +7,7 @@ Decrements `a` by `1`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212Produces
1313--------
@@ -19,14 +19,13 @@ Source
1919
2020 ++ dec :: decrement
2121 ~/ %dec
22− |= a=@
22+ |= a/@
2323 ~| %decrement-underflow
2424 ?< =(0 a)
2525 =+ b=0
2626 |- ^- @
2727 ?: =(a +(b)) b
2828 $(b +(b))
29− ::
3029
3130Examples
3231--------
docs/system/hoon/library/src/1a/gate/div.md+2−2
@@ -7,9 +7,9 @@ Computes `a` divided by `b`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
12−`b` is an [atom]().
12+`b` is an atom.
1313
1414Produces
1515--------
docs/system/hoon/library/src/1a/gate/gte.md+3−3
@@ -7,7 +7,7 @@ Tests whether `a` is greater than a number `b`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212`b` is an atom.
1313
@@ -21,10 +21,10 @@ Source
2121
2222 ++ gte :: greater-equal
2323 ~/ %gte
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
2525 ^- ?
2626 !(lth a b)
27− ::
27+
2828
2929Examples
3030--------
docs/system/hoon/library/src/1a/gate/gth.md+4−3
@@ -7,7 +7,7 @@ Tests whether `a` is greater than `b`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212`b` is an atom.
1313
@@ -21,10 +21,11 @@ Source
2121
2222 ++ gth :: greater-than
2323 ~/ %gth
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
2525 ^- ?
2626 !(lte a b)
27− ::
27+
28+
2829
2930Examples
3031--------
docs/system/hoon/library/src/1a/gate/lte.md+3−2
@@ -7,7 +7,7 @@ Tests whether `a` is less than or equal to `b`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212`b` is an atom.
1313
@@ -21,8 +21,9 @@ Source
2121
2222 ++ lte :: less-equal
2323 ~/ %lte
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
2525 |(=(a b) (lth a b))
26+
2627 ::
2728
2829Examples
docs/system/hoon/library/src/1a/gate/lth.md+5−6
@@ -21,15 +21,14 @@ Source
2121
2222 ++ lth :: less-than
2323 ~/ %lth
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
2525 ^- ?
26− ?& !=(a b)
27− |-
28− ?| =(0 a)
29− ?& !=(0 b)
26+ ?& !=(a b)
27+ |-
28+ ?| =(0 a)
29+ ?& !=(0 b)
3030 $(a (dec a), b (dec b))
3131 == == ==
32− ::
3332
3433Examples
3534--------
docs/system/hoon/library/src/1a/gate/max.md+2−3
@@ -7,7 +7,7 @@ Computes the greater of `a` and `b`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212`b` is an atom.
1313
@@ -21,11 +21,10 @@ Source
2121
2222 ++ max :: maximum
2323 ~/ %max
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
2525 ^- @
2626 ?: (gth a b) a
2727 b
28− ::
2928
3029Examples
3130--------
docs/system/hoon/library/src/1a/gate/min.md+3−4
@@ -7,7 +7,7 @@ Computes the lesser of `a` and `b`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212`b` is an atom.
1313
@@ -21,12 +21,11 @@ Source
2121
2222 ++ min :: minimum
2323 ~/ %min
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
2525 ^- @
2626 ?: (lth a b) a
2727 b
28− ::
29−
28+
3029Examples
3130--------
3231
docs/system/hoon/library/src/1a/gate/mod.md+3−3
@@ -7,7 +7,7 @@ Computes the remainder of dividing `a` by `b`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212`b` is an atom.
1313
@@ -21,11 +21,11 @@ Source
2121
2222 ++ mod :: remainder
2323 ~/ %mod
24− |= [a=@ b=@]
24+ |: [a=`@`1 b=`@`1]
2525 ^- @
2626 ?< =(0 b)
2727 (sub a (mul b (div a b)))
28− ::
28+
2929
3030Examples
3131--------
docs/system/hoon/library/src/1a/gate/mul.md+3−4
@@ -7,7 +7,7 @@ Multiplies `a` by `b`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212`b` is an atom.
1313
@@ -21,14 +21,13 @@ Source
2121
2222 ++ mul :: multiply
2323 ~/ %mul
24− |= [a=@ b=@]
24+ |: [a=`@`1 b=`@`1]
2525 ^- @
2626 =+ c=0
2727 |-
2828 ?: =(0 a) c
2929 $(a (dec a), c (add b c))
30− ::
31−
30+
3231Examples
3332--------
3433
docs/system/hoon/library/src/1a/gate/sub.md+9−9
@@ -7,9 +7,9 @@ Subtracts `b` from `a`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
12−`b` is an [atom]().
12+`b` is an atom.
1313
1414Produces
1515--------
@@ -19,13 +19,13 @@ An atom.
1919Source
2020------
2121
22− ++ sub :: subtract
23− ~/ %sub
24− |= [a=@ b=@]
25− ~| %subtract-underflow
26− ^- @
27− ?: =(0 b) a
28− $(a (dec a), b (dec b))
22+ ++ sub :: subtract
23+ ~/ %sub
24+ |= [a=@ b=@]
25+ ~| %subtract-underflow
26+ ^- @
27+ ?: =(0 b) a
28+ $(a (dec a), b (dec b))
2929
3030Examples
3131--------
docs/system/hoon/library/src/1b/gate/cap.md+14−14
@@ -2,8 +2,8 @@
22
33Tree head
44
5−Tests whether an `a` is in the head or tail of a [noun](). Produces the
6−[cube]() `%2` if it is within the head, or the cube `%3` if it is
5+Tests whether an `a` is in the head or tail of a noun. Produces the
6+cube `%2` if it is within the head, or the cube `%3` if it is
77within the tail.
88
99Accepts
@@ -14,22 +14,22 @@ Accepts
1414Produces
1515--------
1616
17−A [cube]().
17+A cube.
1818
1919Source
2020------
2121
22− ++ cap :: tree head
23− ~/ %cap
24− |= a=@
25− ^- ?(%2 %3)
26− ?- a
27− %2 %2
28− %3 %3
29− ?(%0 %1) !!
30− * $(a (div a 2))
31− ==
32− ::
22+ ++ cap :: tree head
23+ ~/ %cap
24+ |= a=@
25+ ^- ?(%2 %3)
26+ ?- a
27+ %2 %2
28+ %3 %3
29+ ?(%0 %1) !!
30+ * $(a (div a 2))
31+ ==
32+ ::
3333
3434Examples
3535--------
docs/system/hoon/library/src/1b/gate/mas.md+11−11
@@ -17,17 +17,17 @@ An atom.
1717Source
1818------
1919
20− ++ mas :: tree body
21− ~/ %mas
22− |= a=@
23− ^- @
24− ?- a
25− 1 !!
26− 2 1
27− 3 1
28− * (add (mod a 2) (mul $(a (div a 2)) 2))
29− ==
30− ::
20+ ++ mas :: tree body
21+ ~/ %mas
22+ |= a=@
23+ ^- @
24+ ?- a
25+ 1 !!
26+ 2 1
27+ 3 1
28+ * (add (mod a 2) (mul $(a (div a 2)) 2))
29+ ==
30+ ::
3131
3232Examples
3333--------
docs/system/hoon/library/src/1b/gate/peg.md+5−6
@@ -7,7 +7,7 @@ Computes the axis of `b` within axis `a`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212`b` is an atom.
1313
@@ -21,15 +21,14 @@ Source
2121
2222 ++ peg :: tree connect
2323 ~/ %peg
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
2525 ^- @
2626 ?- b
27− 1 a
28− 2 (mul a 2)
29− 3 +((mul a 2))
27+ $1 a
28+ $2 (mul a 2)
29+ $3 +((mul a 2))
3030 * (add (mod b 2) (mul $(b (div b 2)) 2))
3131 ==
32− ::
3332
3433Examples
3534--------
docs/system/hoon/library/src/1c/mold/bloq.md+1−2
@@ -4,11 +4,10 @@ Blocksize
44
55Atom representing a blocksize, by convention expressed as a power of 2.
66
7−
87Source
98------
109
11− ++ bloq ,@ :: blockclass
10+ ++ bloq @ :: blockclass
1211
1312Examples
1413--------
docs/system/hoon/library/src/1c/mold/each.md+7−6
@@ -2,20 +2,21 @@
22
33Mold of fork between two
44
5−[mold]() generator: produces a dicriminated [fork]() between two types.
5+mold generator: produces a dicriminated fork between two types.
66
77Source
88------
99
10− ++ each |*([a=$+(* *) b=$+(* *)] $%([& p=a] [| p=b])) :: either a or b
10+ ++ each
11+ |* {a/$-(* *) b/$-(* *)} :: either a or b
12+ $%({$& p/a} {$| p/b}) :: a default
13+
1114
1215Examples
1316--------
1417
15− ~zod/try=> :type; *(each cord time)
18+ > ? *(each cord time)
19+ ?({$.y p/@t} {$.n p/@da})
1620 [%.y p='']
17− {[%.y p=@t] [%.n p=@da]}
18−
19−
2021
2122***
docs/system/hoon/library/src/1c/mold/gate.md+9−11
@@ -3,28 +3,26 @@
33Function
44
55A core with one arm, `$`--the empty name--which transforms a sample noun into a product
6−noun. If used [dryly]() as a type, the [subject]() must have a sample type of [`*`]().
6+noun. If used dryly as a type, the subject must have a sample type of `*`.
77
88
99Source
1010------
1111
12− ++ gate $+(* *) :: general gate
12+ ++ gate $-(* *) :: general gate
13+
1314
1415Examples
1516--------
1617
17−See also: [`++lift`](), [`++cork`]()
18+See also: `++lift`, `++cork`
1819
19− ~zod/try=> *gate
20− <1|mws [* <101.jzo 1.ypj %164>]>
21− ~zod/try=> `gate`|=(* 0)
22− <1|mws [* <101.jzo 1.ypj %164>]>
20+ > ? gate
21+ <1.ybc {* <110.jyx 1.ztu $151>}>
22+ <1.ybc {* <110.jyx 1.ztu $151>}>
2323
24− ~zod/try=> (|=(a=* [a 'b']) 'c')
25− [99 'b']
26− ~zod/try=> (`gate`|=(a=* [a 'b']) 'c')
27− [99 98]
24+ > (`gate`|=(a/* [a 'b']) 1)
25+ [1 'b']
2826
2927
3028
docs/system/hoon/library/src/1c/mold/list.md+9−7
@@ -2,26 +2,28 @@
22
33List
44
5−[mold]() generator. `++list` generates a mold of a null-termanated list of a
5+mold generator. `++list` generates a mold of a null-termanated list of a
66homogenous type.
77
88
99Source
1010------
1111
12− ++ list |* a=_,* :: null-term list
12+ ++ list |* a/$-(* *) :: null-term list
13+ $@($~ {i/a t/(list a)}) ::
14+
1315
1416Examples
1517--------
1618
17−See also: [`++turn`](), [`++snag`]()
19+See also: `++turn`, `++snag`
1820
19− ~zod/try=> *(list)
21+ > *(list)
2022 ~
21− ~zod/try=> `(list ,@)`"abc"
23+ > `(list @)`"abc"
2224 ~[97 98 99]
23− ~zod/try=> (snag 0 "abc")
24− ~~a
25+ > (snag 0 "abc")
26+ 'a'
2527
2628
2729
docs/system/hoon/library/src/1c/mold/lone.md+2−4
@@ -1,14 +1,12 @@
11### `++lone`
22
3−Tile generator. `++lone` puts face of `p` on something.
3+`++lone` puts face of `p` on something.
44
55XX unused
66
77Source
88------
99
10− ++ lone |*(a=$+(* *) ,p=a) :: just one thing
11−
12−
10+ ++ lone |*(a/$-(* *) p/a) :: just one thing
1311
1412***
docs/system/hoon/library/src/1c/mold/pair.md+3−2
@@ -2,13 +2,14 @@
22
33Mold of pair of types
44
5−[mold]() generator. Produces a tuple of two of the types passed in.
5+mold generator. Produces a tuple of two of the types passed in.
66
77
88Source
99------
1010
11− ++ pair |*([a=$+(* *) b=$+(* *)] ,[p=a q=b]) :: just a pair
11+ ++ pair |*({a/$-(* *) b/$-(* *)} {p/a q/b}) :: just a pair
12+
1213
1314
1415Examples
docs/system/hoon/library/src/1c/mold/pole.md+5−2
@@ -2,12 +2,15 @@
22
33Faceless list
44
5−A [`++list`]() without the [face]()s `i` and `t`.
5+A `++list` without the faces `i` and `t`.
66
77Source
88------
99
10− ++ pole |* a=_,* :: nameless list
10+ ++ pole |* a/$-(* *) :: nameless list
11+ $@($~ {a (pole a)}) ::
12+
13+
1114
1215Examples
1316--------
docs/system/hoon/library/src/1c/mold/qual.md+3−2
@@ -7,7 +7,8 @@ A `++qual` is a tuple of four of the types passed in.
77Source
88------
99
10− ++ qual |* [a=$+(* *) b=$+(* *) c=$+(* *) d=$+(* *)] :: just a quadruple
10+ ++ qual |* {a/$-(* *) b/$-(* *) c/$-(* *) d/$-(* *)} :: just a quadruple
11+ {p/a q/b r/c s/d} ::
1112
1213Examples
1314--------
@@ -17,4 +18,4 @@ Examples
1718
1819
1920
20−***
21+ ***
docs/system/hoon/library/src/1c/mold/trap.md+3−4
@@ -2,18 +2,17 @@
22
33Core with one arm `$`
44
5−A trap is a core with one arm `++$`. Used when XX
5+A trap is a core with one arm `++$`.
66
77Source
88------
99
10− ++ trap ,_|.(_*) :: makes perfect sense
10+ ++ trap |*(a/_* _|?(*a)) :: makes perfect sense
11+
1112
1213Examples
1314--------
1415
15−See also: `|.`
16−
1716 ~zod/try=> *trap
1817 <1.mws 101.jzo 1.ypj %164>
1918 ~zod/try=> (*trap)
docs/system/hoon/library/src/1c/mold/tree.md+4−2
@@ -8,12 +8,14 @@ left/right sub `++tree` of the same type. Pretty-printed with `{}`.
88Source
99------
1010
11− ++ tree |* a=_,* :: binary tree
11+ ++ tree |* a/$-(* *) :: binary tree
12+ $@($~ {n/a l/(tree a) r/(tree a)}) ::
13+
1214
1315Examples
1416--------
1517
16− ~zod/try=> `(tree ,[@ tape])`[[1 "hi"] [[2 "bye"] ~ ~] ~]
18+ ~zod/try=> `(tree {@ tape})`[[1 "hi"] [[2 "bye"] ~ ~] ~]
1719 {[2 "bye"] [1 "hi"]}
1820
1921
docs/system/hoon/library/src/1c/mold/trel.md+5−3
@@ -2,17 +2,19 @@
22
33Mold of three types
44
5−[`++mold`]() of the tuple of the three types passed in.
5+`++mold` of the tuple of the three types passed in.
66
77Source
88------
99
10− ++ trel |* [a=$+(* *) b=$+(* *) c=$+(* *)] :: just a triple
10+ ++ trel |* {a/$-(* *) b/$-(* *) c/$-(* *)} :: just a triple
11+ {p/a q/b r/c} ::
12+
1113
1214Examples
1315--------
1416
15− ~zod/try=> *(trel ,@ud ,@t ,@s)
17+ ~zod/try=> *(trel @ud @t @s)
1618 [p=0 q='' r=--0]
1719
1820
docs/system/hoon/library/src/1c/mold/unit.md+13−7
@@ -2,26 +2,32 @@
22
33Maybe
44
5−[mold]() generator. A `++unit` is either `~` or `[~ u=a]` where `a` is the
5+mold generator. A `++unit` is either `~` or `[~ u=a]` where `a` is the
66type that was passed in.
77
88
99Source
1010------
1111
12− ++ unit |* a=_,* :: maybe
12+ ++ unit |* a/$-(* *) :: maybe
13+ $@($~ {$~ u/a}) ::
14+
1315
1416Examples
1517--------
1618
17−See also: [`++bind`]()
19+See also: `++bind`
1820
19− ~zod/try=> :type; *(unit time)
21+ ~zod/try=> ? *(unit time)
22+ ?({$~ u/@da} $~)
2023 ~
21− u(@da)
22− ~zod/try=> `(unit time)`[~ -<-]
23− [~ ~2014.9.24..19.25.10..7dd5]
2424
25+ ~zod/try=> > =a |= a/@
26+ ^- (unit @)
27+ ?~ a ~
28+ [~ a]
29+ > (a 2)
30+ [~ u=2]
2531
2632
2733***
docs/system/hoon/library/src/2a/gate/biff.md+5−4
@@ -2,7 +2,7 @@
22
33Unit as argument
44
5−Applies a function `b` that produces a unit to the unwrapped value of [++unit]()
5+Applies a function `b` that produces a unit to the unwrapped value of ++unit
66`a` (`u.a`). If `a` is empty, `~` is produced.
77
88Accepts
@@ -21,16 +21,17 @@ Source
2121------
2222
2323 ++ biff :: apply
24− |* [a=(unit) b=$+(* (unit))]
24+ |* {a/(unit) b/$-(* (unit))}
2525 ?~ a ~
2626 (b u.a)
2727
28+
2829Examples
2930--------
3031
31− ~zod/try=> (biff (some 5) |=(a=@ (some (add a 2))))
32+ ~zod/try=> (biff (some 5) |=(a/@ (some (add a 2))))
3233 [~ u=7]
33− ~zod/try=> (biff ~ |=(a=@ (some (add a 2))))
34+ ~zod/try=> (biff ~ |=(a/@ (some (add a 2))))
3435 ~
3536
3637
docs/system/hoon/library/src/2a/gate/bind.md+6−5
@@ -2,7 +2,7 @@
22
33Non-unit function to unit, producing unit
44
5−Applies a function `b` to the value (`u.a`) of a [++unit]() `a`, producing
5+Applies a function `b` to the value (`u.a`) of a ++unit `a`, producing
66a unit. Used when you want a function that does not accept or produce a
77unit to both accept and produce a unit.
88
@@ -22,17 +22,18 @@ Source
2222------
2323
2424 ++ bind :: argue
25− |* [a=(unit) b=gate]
25+ |* {a/(unit) b/gate}
2626 ?~ a ~
2727 [~ u=(b u.a)]
2828
29+
2930Examples
3031--------
3132
32− ~zod/try=> (bind ((unit ,@) [~ 97]) ,@t)
33+ ~zod/try=> (bind ((unit @) [~ 97]) ,@t)
3334 [~ `a`]
34− ~zod/try=> =a |=(a=@ (add a 1))
35− ~zod/try=> (bind ((unit ,@) [~ 2]) a)
35+ ~zod/try=> =a |=(a/@ (add a 1))
36+ ~zod/try=> (bind ((unit @) [~ 2]) a)
3637 [~ 3]
3738
3839
docs/system/hoon/library/src/2a/gate/bond.md+4−3
@@ -2,7 +2,7 @@
22
33Replace null
44
5−Replaces an empty [++unit]() `b` with the product of a called [trap]()
5+Replaces an empty ++unit `b` with the product of a called trap
66`a`. If the unit is not empty, then the original unit is produced.
77
88Accepts
@@ -21,11 +21,12 @@ Source
2121------
2222
2323 ++ bond :: replace
24− |* a=trap
25− |* b=(unit)
24+ |* a/(trap)
25+ |* b/(unit)
2626 ?~ b $:a
2727 u.b
2828
29+
2930Examples
3031--------
3132
docs/system/hoon/library/src/2a/gate/both.md+3−2
@@ -3,7 +3,7 @@
33Group unit values into pair
44
55Produces `~` if either `a` or `b` are empty. Otherwise, produces a
6−[++unit]() whose value is a cell of the values of two input units `a` and
6+++unit whose value is a cell of the values of two input units `a` and
77`b`.
88
99Accepts
@@ -22,11 +22,12 @@ Source
2222------
2323
2424 ++ both :: all the above
25− |* [a=(unit) b=(unit)]
25+ |* {a/(unit) b/(unit)}
2626 ?~ a ~
2727 ?~ b ~
2828 [~ u=[u.a u.b]]
2929
30+
3031Examples
3132--------
3233
docs/system/hoon/library/src/2a/gate/clap.md+7−6
@@ -2,7 +2,7 @@
22
33Apply function to two units
44
5−Applies a binary function `c`--which does not usually accept or produce a [`++unit`]()--
5+Applies a binary function `c`--which does not usually accept or produce a `++unit`--
66to the values of two units, `a` and `b`, producing a unit.
77
88Accepts
@@ -23,20 +23,21 @@ Source
2323------
2424
2525 ++ clap :: combine
26− |* [a=(unit) b=(unit) c=_|=(^ +<-)]
26+ |* {a/(unit) b/(unit) c/_|=(^ +<-)}
2727 ?~ a b
2828 ?~ b a
2929 [~ u=(c u.a u.b)]
3030
31+
3132Examples
3233--------
3334
34− ~zod/try=> =u ((unit ,@t) [~ 'a'])
35− ~zod/try=> =v ((unit ,@t) [~ 'b'])
35+ ~zod/try=> =u ((unit @t) [~ 'a'])
36+ ~zod/try=> =v ((unit @t) [~ 'b'])
3637 ~zod/try=> (clap u v |=([a=@t b=@t] (welp (trip a) (trip b))))
3738 [~ u="ab"]
38− ~zod/try=> =a ((unit ,@u) [~ 1])
39− ~zod/try=> =b ((unit ,@u) [~ 2])
39+ ~zod/try=> =a ((unit @u) [~ 1])
40+ ~zod/try=> =b ((unit @u) [~ 2])
4041 ~zod/try=> =c |=([a=@ b=@] (add a b))
4142 ~zod/try=> (clap a b c)
4243 [~ 3]
docs/system/hoon/library/src/2a/gate/drop.md+5−4
@@ -2,7 +2,7 @@
22
33Unit to list
44
5−Makes a [++list]() of the unwrapped value (`u.a`) of a [`++unit`]() `a`.
5+Makes a ++list of the unwrapped value (`u.a`) of a `++unit` `a`.
66
77Accepts
88-------
@@ -18,17 +18,18 @@ Source
1818------
1919
2020 ++ drop :: enlist
21− |* a=(unit)
21+ |* a/(unit)
2222 ?~ a ~
2323 [i=u.a t=~]
2424
25+
2526Examples
2627--------
2728
28− ~zod/try=> =a ((unit ,@) [~ 97])
29+ ~zod/try=> =a ((unit @) [~ 97])
2930 ~zod/try=> (drop a)
3031 [i=97 t=~]
31− ~zod/try=> =a ((unit ,@) [~])
32+ ~zod/try=> =a ((unit @) [~])
3233 ~zod/try=> (drop a)
3334 ~
3435
docs/system/hoon/library/src/2a/gate/fall.md+4−3
@@ -2,14 +2,14 @@
22
33Give unit a default value
44
5−Produces a default value `b` for a [`++unit`]() `a` in cases where `a` is null.
5+Produces a default value `b` for a `++unit` `a` in cases where `a` is null.
66
77Accepts
88-------
99
1010`a` is a unit.
1111
12−`b` is a [noun]() that's used as the default value.
12+`b` is a noun that's used as the default value.
1313
1414Produces
1515--------
@@ -20,9 +20,10 @@ Source
2020------
2121
2222 ++ fall :: default
23− |* [a=(unit) b=*]
23+ |* {a/(unit) b/*}
2424 ?~(a b u.a)
2525
26+
2627Examples
2728--------
2829
docs/system/hoon/library/src/2a/gate/lift.md+6−5
@@ -2,7 +2,7 @@
22
33Curried bind
44
5−Accepts a [`++gate`]() `a` and produces a function that accepts [`++unit`]()
5+Accepts a `++gate` `a` and produces a function that accepts `++unit`
66`b` to which it applies `a`. Used when you want a function that does not accept
77or produce a unit to both accept and produce a unit.
88
@@ -22,16 +22,17 @@ Source
2222------
2323
2424 ++ lift :: lift gate (fmap)
25− |* a=gate :: flipped
26− |* b=(unit) :: curried
25+ |* a/gate :: flipped
26+ |* b/(unit) :: curried
2727 (bind b a) :: bind
2828
29+
2930Examples
3031--------
3132
32− ~zod/try=> ((lift dec) `(unit ,@)`~)
33+ ~zod/try=> ((lift dec) `(unit @)`~)
3334 ~
34− ~zod/try=> ((lift dec) `(unit ,@)`[~ 20])
35+ ~zod/try=> ((lift dec) `(unit @)`[~ 20])
3536 [~ 19]
3637
3738
docs/system/hoon/library/src/2a/gate/mate.md+12−11
@@ -23,25 +23,26 @@ A unit or crash.
2323Source
2424------
2525
26−++ mate :: choose
27− |* [a=(unit) b=(unit)]
28− ?~ b a
29− ?~ a b
30− ?.(=(u.a u.b) ~|('mate' !!) a)
26+ ++ mate :: choose
27+ |* {a/(unit) b/(unit)}
28+ ?~ b a
29+ ?~ a b
30+ ?.(=(u.a u.b) ~|('mate' !!) a)
31+
3132
3233Examples
3334--------
3435
35− ~zod/try=> =a ((unit ,@) [~ 97])
36− ~zod/try=> =b ((unit ,@) [~ 97])
36+ ~zod/try=> =a ((unit @) [~ 97])
37+ ~zod/try=> =b ((unit @) [~ 97])
3738 ~zod/try=> (mate a b)
3839 [~ 97]
39− ~zod/try=> =a ((unit ,@) [~ 97])
40− ~zod/try=> =b ((unit ,@) [~])
40+ ~zod/try=> =a ((unit @) [~ 97])
41+ ~zod/try=> =b ((unit @) [~])
4142 ~zod/try=> (mate a b)
4243 [~ 97]
43− ~zod/try=> =a ((unit ,@) [~ 97])
44− ~zod/try=> =b ((unit ,@) [~ 98])
44+ ~zod/try=> =a ((unit @) [~ 97])
45+ ~zod/try=> =b ((unit @) [~ 98])
4546 ~zod/try=> (mate a b)
4647 ! 'mate'
4748 ! exit
docs/system/hoon/library/src/2a/gate/need.md+7−6
@@ -2,7 +2,7 @@
22
33Unwrap unit
44
5−Retrieve the value from a [`++unit`]() and crash if the unit is null.
5+Retrieve the value from a `++unit` and crash if the unit is null.
66
77Accepts
88-------
@@ -18,20 +18,21 @@ Source
1818------
1919
2020 ++ need :: demand
21− |* a=(unit)
22− ?~ a !!
21+ |* a/(unit)
22+ ?~ a ~|(%need !!)
2323 u.a
2424
25+
2526Examples
2627--------
2728
28− ~zod/try=> =a ((unit ,[@t @t]) [~ ['a' 'b']])
29+ ~zod/try=> =a ((unit [@t @t]) [~ ['a' 'b']])
2930 ~zod/try=> (need a)
3031 ['a' 'b']
31− ~zod/try=> =a ((unit ,@ud) [~ 17])
32+ ~zod/try=> =a ((unit @ud) [~ 17])
3233 ~zod/try=> (need a)
3334 17
34− ~zod/try=> =a ((unit ,@) [~])
35+ ~zod/try=> =a ((unit @) [~])
3536 ~zod/try=> (need a)
3637 ! exit
3738
docs/system/hoon/library/src/2b/gate/flop.md+2−1
@@ -19,7 +19,7 @@ Source
1919
2020 ++ flop :: reverse
2121 ~/ %flop
22− |* a=(list)
22+ |* a/(list)
2323 => .(a (homo a))
2424 ^+ a
2525 =+ b=`_a`~
@@ -28,6 +28,7 @@ Source
2828 $(a t.a, b [i.a b])
2929
3030
31+
3132Examples
3233--------
3334
docs/system/hoon/library/src/2b/gate/homo.md+4−3
@@ -2,7 +2,7 @@
22
33Homogenize
44
5−Produces a [`++list`]() whose type is a fork of all the contained types in the
5+Produces a `++list` whose type is a fork of all the contained types in the
66list `a`. Used when you want to make all the types of the elements of a list the same.
77
88Accepts
@@ -19,12 +19,13 @@ Source
1919------
2020
2121 ++ homo :: homogenize
22− |* a=(list)
22+ |* a/(list)
2323 ^+ =< $
24− |% +- $ ?:(_? ~ [i=(snag 0 a) t=$])
24+ |% +- $ ?:(*? ~ [i=(snag 0 a) t=$])
2525 --
2626 a
2727
28+
2829Examples
2930--------
3031
docs/system/hoon/library/src/2b/gate/lent.md+4−3
@@ -2,7 +2,7 @@
22
33List length
44
5−Produces the length of any [`++list`]() `a` as an atom.
5+Produces the length of any `++list` `a` as an atom.
66
77Accepts
88-------
@@ -19,13 +19,14 @@ Source
1919
2020 ++ lent :: length
2121 ~/ %lent
22− |= a=(list)
22+ |= a/(list)
2323 ^- @
2424 =+ b=0
2525 |-
26− ?~ a b
26+ ?~ a b
2727 $(a t.a, b +(b))
2828
29+
2930Examples
3031--------
3132
docs/system/hoon/library/src/2b/gate/levy.md+7−4
@@ -2,7 +2,7 @@
22
33Logical "and" on list
44
5−Computes the Boolean logical "and" on the results of [gate]() `b` applied to each individual element in [`++list`]() `a`.
5+Computes the Boolean logical "and" on the results of gate `b` applied to each individual element in `++list` `a`.
66
77Accepts
88-------
@@ -14,24 +14,27 @@ Accepts
1414Produces
1515--------
1616
17+A boolean.
18+
1719Source
1820------
1921
2022 ++ levy
2123 ~/ %levy :: all of
22− |* [a=(list) b=_|=(p=* .?(p))]
24+ |* {a/(list) b/$-(* ?)}
2325 |- ^- ?
2426 ?~ a &
2527 ?. (b i.a) |
2628 $(a t.a)
2729
30+
2831Examples
2932--------
3033
31− ~zod/try=> =a |=(a=@ (lte a 1))
34+ ~zod/try=> =a |=(a/@ (lte a 1))
3235 ~zod/try=> (levy (limo [0 1 2 1 ~]) a)
3336 %.n
34− ~zod/try=> =a |=(a=@ (lte a 3))
37+ ~zod/try=> =a |=(a/@ (lte a 3))
3538 ~zod/try=> (levy (limo [0 1 2 1 ~]) a)
3639 %.y
3740
docs/system/hoon/library/src/2b/gate/lien.md+16−7
@@ -2,19 +2,28 @@
22
33Logical "or" on list
44
5+Computes the Boolean logical "or" on the results of applying [gate]() `b` to every element of [`++list`]() `a`.
6+
7+Accepts
8+-------
9+
10+`a` is a list.
11+
12+`b` is a gate.
13+
14+Source
15+------
16+
517 ++ lien :: some of
618 ~/ %lien
7− |* [a=(list) b=$+(* ?)]
19+ |* {a/(list) b/$-(* ?)}
820 |- ^- ?
921 ?~ a |
1022 ?: (b i.a) &
1123 $(a t.a)
12−
13−Computes the Boolean logical "or" on the results of applying [gate]() `b` to every element of [`++list`]() `a`.
14−
15−`a` is a list.
16−
17−`b` is a gate.
24+
25+Examples
26+--------
1827
1928 ~zod/try=> =a |=(a=@ (gte a 1))
2029 ~zod/try=> (lien (limo [0 1 2 1 ~]) a)
docs/system/hoon/library/src/2b/gate/limo.md+1−1
@@ -12,7 +12,7 @@ Accepts
1212Produces
1313--------
1414
15−A list
15+A `++list`.
1616
1717Source
1818------
docs/system/hoon/library/src/2b/gate/murn.md+6−5
@@ -2,16 +2,16 @@
22
33Maybe transform
44
5−Passes each member of [`++list`]() `a` to [gate]() `b`, which must produce a
6−[`++unit`](). Produces a new list with all the results that do not produce
5+Passes each member of `++list` `a` to gate `b`, which must produce a
6+`++unit`. Produces a new list with all the results that do not produce
77`~`.
88
99Accepts
1010-------
1111
12−`a` is a [list]().
12+`a` is a list.
1313
14−`b` is a [gate]() that produces a [unit]().
14+`b` is a gate that produces a unit.
1515
1616Produces
1717--------
@@ -22,7 +22,8 @@ Source
2222------
2323
2424 ++ murn :: maybe transform
25− |* [a=(list) b=$+(* (unit))]
25+ ~/ %murn
26+ |* {a/(list) b/$-(* (unit))}
2627 |-
2728 ?~ a ~
2829 =+ c=(b i.a)
docs/system/hoon/library/src/2b/gate/reap.md+5−4
@@ -2,12 +2,12 @@
22
33Replicate
44
5−Replicate: produces a [`++list`]() containing `a` copies of `b`.
5+Replicate: produces a `++list` containing `a` copies of `b`.
66
77Accepts
88-------
99
10−`b` is a [noun]()
10+`b` is a noun.
1111
1212Produces
1313--------
@@ -18,8 +18,9 @@ Source
1818------
1919
2020 ++ reap :: replicate
21− |* [a=@ b=*]
22− |- ^- (list ,_b)
21+ ~/ %reap
22+ |* {a/@ b/*}
23+ |- ^- (list _b)
2324 ?~ a ~
2425 [b $(a (dec a))]
2526
docs/system/hoon/library/src/2b/gate/reel.md+6−5
@@ -2,8 +2,8 @@
22
33Right fold
44
5−Right fold: moves right to left across a [`++list`]() `a`, recursively slamming
6−a binary [gate]() `b` with an element from `a` and an accumulator, producing
5+Right fold: moves right to left across a `++list` `a`, recursively slamming
6+a binary gate `b` with an element from `a` and an accumulator, producing
77the final value of the accumulator.
88
99Accepts
@@ -14,19 +14,20 @@ Accepts
1414Produces
1515--------
1616
17−The accumulator, which is a [noun]().
17+The accumulator, which is a noun.
1818
1919Source
2020------
2121
22− ++ reel :: right fold
22+ ++ reel :: right fold
2323 ~/ %reel
24− |* [a=(list) b=_|=([* *] +<+)]
24+ |* {a/(list) b/_|=({* *} +<+)}
2525 |- ^+ +<+.b
2626 ?~ a
2727 +<+.b
2828 (b i.a $(a t.a))
2929
30+
3031Examples
3132--------
3233
docs/system/hoon/library/src/2b/gate/skid.md+6−4
@@ -2,8 +2,8 @@
22
33Separate
44
5−Separates a [`++list`]() `a` into two lists - Those elements of `a` who produce
6−true when slammed to [gate]() `b` and those who produce `%.n`.
5+Separates a `++list` `a` into two lists - Those elements of `a` who produce
6+true when slammed to gate `b` and those who produce `%.n`.
77
88Accepts
99-------
@@ -19,17 +19,19 @@ Source
1919------
2020
2121 ++ skid :: separate
22− |* [a=(list) b=$+(* ?)]
22+ ~/ %skid
23+ |* {a/(list) b/$-(* ?)}
2324 |- ^+ [p=a q=a]
2425 ?~ a [~ ~]
2526 =+ c=$(a t.a)
2627 ?:((b i.a) [[i.a p.c] q.c] [p.c [i.a q.c]])
2728
2829
30+
2931Examples
3032--------
3133
32− ~zod/try=> =a |=(a=@ (gth a 1))
34+ ~zod/try=> =a |=(a/@ (gth a 1))
3335 ~zod/try=> (skid (limo [0 1 2 3 ~]) a)
3436 [p=[i=2 t=[i=3 t=~]] q=[i=0 t=[i=1 t=~]]]
3537
docs/system/hoon/library/src/2b/gate/skim.md+12−9
@@ -9,26 +9,29 @@ producing a list of all of the members that produce `%.y`. Inverse of
99Accepts
1010-------
1111
12−`b` is a [gate]() that accepts one argument and produces a loobean.
12+`b` is a gate that accepts one argument and produces a boolean.
1313
1414Produces
1515--------
1616
17+A boolean
18+
1719Source
1820------
1921
20−++ skim :: only
21− ~/ %skim
22− |* [a=(list) b=_|=(p=* .?(p))]
23− |-
24− ^+ a`
25− ?~ a ~
26− ?:((b i.a) [i.a $(a t.a)] $(a t.a))
22+ ++ skim :: only
23+ ~/ %skim
24+ |* {a/(list) b/$-(* ?)}
25+ |-
26+ ^+ a
27+ ?~ a ~
28+ ?:((b i.a) [i.a $(a t.a)] $(a t.a))
29+
2730
2831Examples
2932--------
3033
31− ~zod/try=> =a |=(a=@ (gth a 1))
34+ ~zod/try=> =a |=(a/@ (gth a 1))
3235 ~zod/try=> (skim (limo [0 1 2 3 ~]) a)
3336 [i=2 t=[i=3 t=~]]
3437
docs/system/hoon/library/src/2b/gate/skip.md+5−4
@@ -2,14 +2,14 @@
22
33Except
44
5−Cycles through the members of [`++list`]() `a`, passing them to a [gate]() `b`.
5+Cycles through the members of `++list` `a`, passing them to a gate `b`.
66Produces a list of all of the members that produce `%.n`. Inverse of
77`++skim`.
88
99Accepts
1010-------
1111
12−`b` is a [gate]() that accepts one argument and produces a loobean.
12+`b` is a gate that accepts one argument and produces a loobean.
1313
1414Produces
1515--------
@@ -21,16 +21,17 @@ Source
2121
2222 ++ skip :: except
2323 ~/ %skip
24− |* [a=(list) b=_|=(p=* .?(p))]
24+ |* {a/(list) b/$-(* ?)}
2525 |-
2626 ^+ a
2727 ?~ a ~
2828 ?:((b i.a) $(a t.a) [i.a $(a t.a)])
2929
30+
3031Examples
3132--------
3233
33− ~zod/try=> =a |=(a=@ (gth a 1))
34+ ~zod/try=> =a |=(a/@ (gth a 1))
3435 ~zod/try=> (skip (limo [0 1 2 3 ~]) a)
3536 [i=0 t=[i=1 t=~]]
3637
docs/system/hoon/library/src/2b/gate/slag.md+3−2
@@ -8,7 +8,7 @@ Accepts an atom `a` and list `b`, producing the remaining elements from
88Accepts
99-------
1010
11−`b` is a [list]().
11+`b` is a list.
1212
1313Produces
1414--------
@@ -20,12 +20,13 @@ Source
2020
2121 ++ slag :: suffix
2222 ~/ %slag
23− |* [a=@ b=(list)]
23+ |* {a/@ b/(list)}
2424 |- ^+ b
2525 ?: =(0 a) b
2626 ?~ b ~
2727 $(b t.b, a (dec a))
2828
29+
2930Examples
3031--------
3132
docs/system/hoon/library/src/2b/gate/snag.md+4−3
@@ -2,13 +2,13 @@
22
33Index
44
5−Accepts an atom `a` and a [`++list`]() `b`, producing the element at the index
5+Accepts an atom `a` and a `++list` `b`, producing the element at the index
66of `a`and failing if the list is null. Lists are 0-indexed.
77
88Accepts
99-------
1010
11−`b` is a [list]().
11+`b` is a list.
1212
1313Produces
1414--------
@@ -20,13 +20,14 @@ Source
2020
2121 ++ snag :: index
2222 ~/ %snag
23− |* [a=@ b=(list)]
23+ |* {a/@ b/(list)}
2424 |-
2525 ?~ b
2626 ~|('snag-fail' !!)
2727 ?: =(0 a) i.b
2828 $(b t.b, a (dec a))
2929
30+
3031Examples
3132--------
3233
docs/system/hoon/library/src/2b/gate/sort.md+7−6
@@ -2,7 +2,7 @@
22
33Quicksort
44
5−Quicksort: accepts a [`++list`]() `a` and a [gate]() `b` which accepts two nouns and
5+Quicksort: accepts a `++list` `a` and a gate `b` which accepts two nouns and
66produces a loobean. `++sort` then produces a list of the elements of `a`,
77sorted according to `b`.
88
@@ -19,21 +19,22 @@ A list
1919Source
2020------
2121
22− ++ sort :: quicksort
22+ ++ sort !. :: quicksort
2323 ~/ %sort
24− |* [a=(list) b=$+([* *] ?)]
24+ |* {a/(list) b/$-([* *] ?)}
2525 => .(a ^.(homo a))
2626 |- ^+ a
2727 ?~ a ~
2828 %+ weld
29− $(a (skim t.a |=(c=_i.a (b c i.a))))
29+ $(a (skim t.a |=(c/_i.a (b c i.a))))
3030 ^+ t.a
31− [i.a $(a (skim t.a |=(c=_i.a !(b c i.a))))]
31+ [i.a $(a (skim t.a |=(c/_i.a !(b c i.a))))]
32+
3233
3334Examples
3435--------
3536
36− ~zod/try=> =a =|([p=@ q=@] |.((gth p q)))
37+ ~zod/try=> =a =|({p=@ q=@} |.((gth p q)))
3738 ~zod/try=> (sort (limo [0 1 2 3 ~]) a)
3839 ~[3 2 1 0]
3940
docs/system/hoon/library/src/2b/gate/swag.md+4−3
@@ -8,7 +8,7 @@ inclusive index `a`, producing `b` number of characters.
88Accepts
99-------
1010
11−`c` is a [list]().
11+`c` is a list.
1212
1313Produces
1414--------
@@ -19,8 +19,9 @@ Source
1919------
2020
2121 ++ swag :: infix
22− |* [[a=@ b=@] c=(list)]
23− (scag b (slag a c))
22+ |* {{a/@ b/@} c/(list)}
23+ (scag +<-> (slag +<-< c))
24+
2425
2526Examples
2627--------
docs/system/hoon/library/src/2b/gate/turn.md+4−3
@@ -2,7 +2,7 @@
22
33Gate to list
44
5−Accepts a [`++list`]() `a` and a [gate]() `b`. Produces a list with the gate applied
5+Accepts a `++list` `a` and a gate `b`. Produces a list with the gate applied
66to each element of the original list.
77
88Accepts
@@ -20,17 +20,18 @@ Source
2020
2121 ++ turn :: transform
2222 ~/ %turn
23− |* [a=(list) b=_,*]
23+ |* {a/(list) b/$-(* *)}
2424 |-
2525 ?~ a ~
2626 [i=(b i.a) t=$(a t.a)]
2727
28+
2829Examples
2930--------
3031
3132 ~zod/try=> (turn (limo [104 111 111 110 ~]) ,@t)
3233 <|h o o n|>
33− ~zod/try=> =a |=(a=@ (add a 4))
34+ ~zod/try=> =a |=(a/@ (add a 4))
3435 ~zod/try=> (turn (limo [1 2 3 4 ~]) a)
3536 ~[5 6 7 8]
3637
docs/system/hoon/library/src/2b/gate/weld.md+4−3
@@ -2,24 +2,25 @@
22
33Concatenate
44
5−Concatenate two [`++list`]()s `a` and `b`.
5+Concatenate two `++list`s `a` and `b`.
66
77Accepts
88-------
99
10−`a` and `b` are [list]()s.
10+`a` and `b` are lists.
1111
1212Source
1313------
1414
1515 ++ weld :: concatenate
1616 ~/ %weld
17− |* [a=(list) b=(list)]
17+ |* {a/(list) b/(list)}
1818 => .(a ^.(homo a), b ^.(homo b))
1919 |- ^+ b
2020 ?~ a b
2121 [i.a $(a t.a)]
2222
23+
2324Examples
2425--------
2526
docs/system/hoon/library/src/2b/gate/welp.md+5−4
@@ -2,7 +2,7 @@
22
33Perfect weld
44
5−Concatenate two [`++list`]()s `a` and `b` without losing their type information
5+Concatenate two `++list`s `a` and `b` without losing their type information
66to homogenization.
77
88Accepts
@@ -21,7 +21,7 @@ Source
2121------
2222
2323 ++ welp :: perfect weld
24− =| [* *]
24+ =| {* *}
2525 |%
2626 +- $
2727 ?~ +<-
@@ -29,6 +29,7 @@ Source
2929 +<-(+ $(+<- +<->))
3030 --
3131
32+
3233Examples
3334--------
3435
@@ -36,10 +37,10 @@ Examples
3637 "foobar"
3738 ~zod/arvo=/hoon/hoon> (welp ~[60 61 62] ~[%a %b %c])
3839 [60 61 62 %a %b %c ~]
39− ~zod/arvo=/hoon/hoon> :type; (welp ~[60 61 62] ~[%a %b %c])
40+ ~zod/arvo=/hoon/hoon>? (welp ~[60 61 62] ~[%a %b %c])
4041 [60 61 62 %a %b %c ~]
4142 [@ud @ud @ud %a %b %c %~]
42− ~zod/arvo=/hoon/hoon> (welp [sa/1 so/2 ~] si/3)
43+ ~zod/arvo=/hoon/hoon> (welp [sa+1 so+2 ~] si/3)
4344 [[%sa 1] [%so 2] %si 3]
4445
4546
docs/system/hoon/library/src/2b/gate/zing.md+3−1
@@ -2,7 +2,7 @@
22
33Cons
44
5−Turns a [`++list`]() of lists into a single list by promoting the elements of
5+Turns a `++list` of lists into a single list by promoting the elements of
66each sublist into the higher.
77
88Accepts
@@ -27,6 +27,8 @@ Source
2727 (welp +<- $(+< +<+))
2828 --
2929
30+
31+
3032Examples
3133--------
3234
docs/system/hoon/library/src/2c/gate/bex.md+2−2
@@ -2,7 +2,7 @@
22
33Binary exponent
44
5−Computes the result of `2^a`, producing an [atom]().
5+Computes the result of `2^a`, producing an atom.
66
77Accepts
88-------
@@ -19,7 +19,7 @@ Source
1919
2020 ++ bex :: binary exponent
2121 ~/ %bex
22− |= a=@
22+ |= a/@
2323 ^- @
2424 ?: =(0 a) 1
2525 (mul 2 $(a (dec a)))
docs/system/hoon/library/src/2c/gate/can.md+4−4
@@ -3,16 +3,16 @@
33
44Assemble
55
6−Produces an [atom]() from a list `b` of length-value pairs `p` and `q`,
6+Produces an atom from a list `b` of length-value pairs `p` and `q`,
77where `p` is the length in bloqs of size `a`, and `q` is an atomic
88value.
99
1010Accepts
1111-------
1212
13−`a` is a block size (see [`++bloq`]()).
13+`a` is a block size (see `++bloq`).
1414
15−`b` is a [`++list`]() of length value pairs, `p` and `q`.
15+`b` is a `++list` of length value pairs, `p` and `q`.
1616
1717Produces
1818--------
@@ -24,7 +24,7 @@ Source
2424
2525 ++ can :: assemble
2626 ~/ %can
27− |= [a=bloq b=(list ,[p=@ q=@])]
27+ |= [a/bloq b/(list [p=@ q=@])]
2828 ^- @
2929 ?~ b 0
3030 (mix (end a p.i.b q.i.b) (lsh a p.i.b $(b t.b)))
docs/system/hoon/library/src/2c/gate/cat.md+4−3
@@ -2,13 +2,13 @@
22
33Concatenate
44
5−Concatenates two [atom]()s, `b` and `c`, according to bloq size `a`, producing an
5+Concatenates two atoms, `b` and `c`, according to bloq size `a`, producing an
66atom.
77
88Accepts
99-------
1010
11−`a` is a block size (see [`++bloq`]()).
11+`a` is a block size (see `++bloq`).
1212
1313`b` is an atom.
1414
@@ -24,9 +24,10 @@ Source
2424
2525 ++ cat :: concatenate
2626 ~/ %cat
27− |= [a=bloq b=@ c=@]
27+ |= {a/bloq b/@ c/@}
2828 (add (lsh a (met a b) c) b)
2929
30+
3031Examples
3132--------
3233
docs/system/hoon/library/src/2c/gate/cut.md+3−3
@@ -7,9 +7,9 @@ Slices `c` blocks of size `a` that are `b` blocks from the end of `d`.
77Accepts
88-------
99
10−`a` is a block size (see [++bloq]()).
10+`a` is a block size (see ++bloq).
1111
12−`b` is an [atom]().
12+`b` is an atom.
1313
1414`c` is an atom.
1515
@@ -23,7 +23,7 @@ Source
2323
2424 ++ cut :: slice
2525 ~/ %cut
26− |= [a=bloq [b=@ c=@] d=@]
26+ |= {a/bloq {b/@u c/@u} d/@}
2727 (end a c (rsh a b d))
2828
2929Examples
docs/system/hoon/library/src/2c/gate/end.md+5−4
@@ -2,16 +2,16 @@
22
33Tail
44
5−Produces an [atom]() by taking the last `b` blocks of size `a` from `c`.
5+Produces an atom by taking the last `b` blocks of size `a` from `c`.
66
77Accepts
88-------
99
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
1111
1212`b` is an atom.
1313
14−`c` is an [atom]().
14+`c` is an atom.
1515
1616Produces
1717--------
@@ -24,9 +24,10 @@ Source
2424
2525 ++ end :: tail
2626 ~/ %end
27− |= [a=bloq b=@ c=@]
27+ |= {a/bloq b/@u c/@}
2828 (mod c (bex (mul (bex a) b)))
2929
30+
3031Examples
3132--------
3233
docs/system/hoon/library/src/2c/gate/fil.md+5−4
@@ -2,16 +2,16 @@
22
33Fill bloqstream
44
5−Produces an [atom]() by repeating `c` for `b` blocks of size `a`.
5+Produces an atom by repeating `c` for `b` blocks of size `a`.
66
77Accepts
88-------
99
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
1111
1212`b` is an atom.
1313
14−`c` is an [atom]().
14+`c` is an atom.
1515
1616Produces
1717--------
@@ -22,7 +22,7 @@ Source
2222------
2323
2424 ++ fil :: fill bloqstream
25− |= [a=bloq b=@ c=@]
25+ |= {a/bloq b/@u c/@}
2626 =+ n=0
2727 =+ d=c
2828 |- ^- @
@@ -30,6 +30,7 @@ Source
3030 (rsh a 1 d)
3131 $(d (add c (lsh a 1 d)), n +(n))
3232
33+
3334Examples
3435--------
3536
docs/system/hoon/library/src/2c/gate/lsh.md+4−3
@@ -2,12 +2,12 @@
22
33Left-shift
44
5−Produces an [atom]() by left-shifting `c` by `b` blocks of size `a`.
5+Produces an atom by left-shifting `c` by `b` blocks of size `a`.
66
77Accepts
88-------
99
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
1111
1212`b` is an atom.
1313
@@ -23,9 +23,10 @@ Source
2323
2424 ++ lsh :: left-shift
2525 ~/ %lsh
26− |= [a=bloq b=@ c=@]
26+ |= {a/bloq b/@u c/@}
2727 (mul (bex (mul (bex a) b)) c)
2828
29+
2930Examples
3031--------
3132
docs/system/hoon/library/src/2c/gate/met.md+3−3
@@ -2,9 +2,9 @@
22
33Measure
44
5−Computes the number of blocks of size `a` in `b`, producing an [atom]().
5+Computes the number of blocks of size `a` in `b`, producing an atom.
66
7−`a` is a block size (see [`++bloq`]()).
7+`a` is a block size (see `++bloq`).
88
99`b` is an atom.
1010
@@ -13,7 +13,7 @@ Source
1313
1414 ++ met :: measure
1515 ~/ %met
16− |= [a=bloq b=@]
16+ |= {a/bloq b/@}
1717 ^- @
1818 =+ c=0
1919 |-
docs/system/hoon/library/src/2c/gate/rap.md+4−4
@@ -2,14 +2,14 @@
22
33Assemble non-zero
44
5−Concatenates a list of [atom]()s `b` using blocksize `a`, producing an atom.
5+Concatenates a list of atoms `b` using blocksize `a`, producing an atom.
66
77Accepts
88-------
99
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
1111
12−`b` is a [`++list`]() of [atom]()s.
12+`b` is a `++list` of atoms.
1313
1414Produces
1515--------
@@ -21,7 +21,7 @@ Source
2121
2222 ++ rap :: assemble nonzero
2323 ~/ %rap
24− |= [a=bloq b=(list ,@)]
24+ |= {a/bloq b/(list @)}
2525 ^- @
2626 ?~ b 0
2727 (cat a i.b $(b t.b))
docs/system/hoon/library/src/2c/gate/rep.md+3−3
@@ -2,12 +2,12 @@
22
33Assemble single
44
5−Produces an [atom]() by assembling a list of atoms `b` using block size `a`.
5+Produces an atom by assembling a list of atoms `b` using block size `a`.
66
77Accepts
88-------
99
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
1111
1212`b` is a list of atoms.
1313
@@ -21,7 +21,7 @@ Source
2121
2222 ++ rep :: assemble single
2323 ~/ %rep
24− |= [a=bloq b=(list ,@)]
24+ |= {a/bloq b/(list @)}
2525 ^- @
2626 =+ c=0
2727 |-
docs/system/hoon/library/src/2c/gate/rip.md+4−4
@@ -2,12 +2,12 @@
22
33Disassemble
44
5−Produces a list of [atom]()s from the bits of `b` using block size `a`.
5+Produces a list of atoms from the bits of `b` using block size `a`.
66
77Accepts
88-------
99
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
1111
1212`b` is an atom.
1313
@@ -21,8 +21,8 @@ Source
2121
2222 ++ rip :: disassemble
2323 ~/ %rip
24− |= [a=bloq b=@]
25− ^- (list ,@)
24+ |= {a/bloq b/@}
25+ ^- (list @)
2626 ?: =(0 b) ~
2727 [(end a 1 b) $(b (rsh a 1 b))]
2828
docs/system/hoon/library/src/2c/gate/rsh.md+3−3
@@ -2,12 +2,12 @@
22
33Right-shift
44
5−Right-shifts `c` by `b` blocks of size `a`, producing an [atom]().
5+Right-shifts `c` by `b` blocks of size `a`, producing an atom.
66
77Accepts
88-------
99
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
1111
1212`b` is an atom.
1313
@@ -23,7 +23,7 @@ Source
2323
2424 ++ rsh :: right-shift
2525 ~/ %rsh
26− |= [a=bloq b=@ c=@]
26+ |= {a/bloq b/@u c/@}
2727 (div c (bex (mul (bex a) b)))
2828
2929Examples
docs/system/hoon/library/src/2c/gate/swp.md+3−3
@@ -2,14 +2,14 @@
22
33Reverse block order
44
5−Switches little endian to big and vice versa: produces an [atom]() by
5+Switches little endian to big and vice versa: produces an atom by
66reversing the block order of `b` using block size `a`.
77
88
99Accepts
1010-------
1111
12−`a` is a block size (see [`++bloq`]()).
12+`a` is a block size (see `++bloq`).
1313
1414`b` is an atom.
1515
@@ -21,7 +21,7 @@ An atom
2121Source
2222------
2323
24− ++ swap |=([a=bloq b=@] (rep a (flop (rip a b)))) :: reverse bloq order
24+ ++ swap |=({a/bloq b/@} (rep a (flop (rip a b)))) :: reverse bloq order
2525
2626Examples
2727--------
docs/system/hoon/library/src/2c/gate/xeb.md+3−3
@@ -2,7 +2,7 @@
22
33Binary logarithm
44
5−Computes the base-2 logarithm of `a`, producing an [atom]().
5+Computes the base-2 logarithm of `a`, producing an atom.
66
77Accepts
88-------
@@ -18,8 +18,8 @@ Source
1818------
1919
2020 ++ xeb :: binary logarithm
21− :: ~/ %xeb
22− |= a=@
21+ ~/ %xeb
22+ |= a/@
2323 ^- @
2424 (met 0 a)
2525
docs/system/hoon/library/src/2d/gate/con.md+4−4
@@ -22,7 +22,7 @@ Source
2222
2323 ++ con :: binary or
2424 ~/ %con
25− |= [a=@ b=@]
25+ |= {a/@ b/@}
2626 =+ [c=0 d=0]
2727 |- ^- @
2828 ?: ?&(=(0 a) =(0 b)) d
@@ -30,9 +30,9 @@ Source
3030 a (rsh 0 1 a)
3131 b (rsh 0 1 b)
3232 c +(c)
33− d %+ add d
34− %^ lsh 0 c
35− ?& =(0 (end 0 1 a))
33+ d %+ add d
34+ %^ lsh 0 c
35+ ?& =(0 (end 0 1 a))
3636 =(0 (end 0 1 b))
3737 ==
3838 ==
docs/system/hoon/library/src/2d/gate/dis.md+6−6
@@ -2,7 +2,7 @@
22
33Binary AND
44
5−Computes the bit-wise logical AND of two [atom]()s `a` and `b`, producing an
5+Computes the bit-wise logical AND of two atoms `a` and `b`, producing an
66atom.
77
88Accepts
@@ -22,17 +22,17 @@ Source
2222
2323 ++ dis :: binary and
2424 ~/ %dis
25− |= [a=@ b=@]
26− =| [c=@ d=@]
25+ |= {a/@ b/@}
26+ =| {c/@ d/@}
2727 |- ^- @
2828 ?: ?|(=(0 a) =(0 b)) d
2929 %= $
3030 a (rsh 0 1 a)
3131 b (rsh 0 1 b)
3232 c +(c)
33− d %+ add d
34− %^ lsh 0 c
35− ?| =(0 (end 0 1 a))
33+ d %+ add d
34+ %^ lsh 0 c
35+ ?| =(0 (end 0 1 a))
3636 =(0 (end 0 1 b))
3737 ==
3838 ==
docs/system/hoon/library/src/2d/gate/mix.md+2−2
@@ -2,7 +2,7 @@
22
33Binary XOR
44
5−Produces the bit-wise logical XOR of `a` and `b`, producing an [atom]().
5+Produces the bit-wise logical XOR of `a` and `b`, producing an atom.
66
77Accepts
88-------
@@ -21,7 +21,7 @@ Source
2121
2222 ++ mix :: binary xor
2323 ~/ %mix
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
2525 ^- @
2626 =+ [c=0 d=0]
2727 |-
docs/system/hoon/library/src/2d/gate/not.md+4−3
@@ -8,9 +8,9 @@ of `c`.
88Accepts
99-------
1010
11−`a` is a block size (see [`++bloq`]()).
11+`a` is a block size (see `++bloq`).
1212
13−`b` is an [atom]().
13+`b` is an atom.
1414
1515`c` is an atom.
1616
@@ -22,9 +22,10 @@ An atom.
2222Source
2323------
2424
25− ++ not |= [a=bloq b=@ c=@] :: binary not (sized)
25+ ++ not |= {a/bloq b/@ c/@} :: binary not (sized)
2626 (mix c (dec (bex (mul b (bex a)))))
2727
28+
2829Examples
2930--------
3031
docs/system/hoon/library/src/2e/gate/fnv.md+2−2
@@ -2,7 +2,7 @@
22
33Hashes an atom with the 32-bit FNV non-cryptographic hash algorithm.
44Multiplies `a` by the prime number 16,777,619 and then takes the block
5−of size 5 off the product's end, producing an [atom]().
5+of size 5 off the product's end, producing an atom.
66
77Accepts
88-------
@@ -18,7 +18,7 @@ An atom.
1818Source
1919------
2020
21− ++ fnv |=(a=@ (end 5 1 (mul 16.777.619 a))) :: FNV scrambler
21+ ++ fnv |=(a/@ (end 5 1 (mul 16.777.619 a))) :: FNV scrambler
2222
2323Examples
2424--------
docs/system/hoon/library/src/2e/gate/mug.md+4−3
@@ -1,12 +1,12 @@
11### `++mug`
22
33Hashes `a` with the 31-bit nonzero FNV-1a non-cryptographic hash
4−algorithm, producing an [atom]().
4+algorithm, producing an atom.
55
66Accepts
77-------
88
9−A is a [noun]().
9+A is a noun.
1010
1111Produces
1212--------
@@ -18,7 +18,7 @@ Source
1818
1919 ++ mug :: 31bit nonzero FNV1a
2020 ~/ %mug
21− |= a=*
21+ |= a/*
2222 ?^ a
2323 =+ b=[p=$(a -.a) q=$(a +.a)]
2424 |- ^- @
@@ -37,6 +37,7 @@ Source
3737 ^$(b +(b))
3838 $(c (fnv (mix c (cut 3 [d 1] a))), d +(d))
3939
40+
4041Examples
4142--------
4243
docs/system/hoon/library/src/2e/gate/mum.md+6−15
@@ -13,15 +13,15 @@ Source
1313
1414 ++ mum :: mug with murmur3
1515 ~/ %mum
16− |= a=*
16+ |= a/*
1717 |^ (trim ?@(a a (mix $(a -.a) (mix 0x7fff.ffff $(a +.a)))))
1818 ++ spec :: standard murmur3
19− |= [syd=@ key=@]
19+ |= {syd/@ key/@}
2020 ?> (lte (met 5 syd) 1)
2121 =+ ^= row
22− |= [a=@ b=@]
22+ |= {a/@ b/@}
2323 (con (end 5 1 (lsh 0 a b)) (rsh 0 (sub 32 a) b))
24− =+ mow=|=([a=@ b=@] (end 5 1 (mul a b)))
24+ =+ mow=|=({a/@ b/@} (end 5 1 (mul a b)))
2525 =+ len=(met 5 key)
2626 =- =. goc (mix goc len)
2727 =. goc (mix goc (rsh 4 1 goc))
@@ -35,22 +35,13 @@ Source
3535 ?: =(inx len) goc
3636 =+ kop=(cut 5 [inx 1] key)
3737 =. kop (mow kop 0xcc9e.2d51)
38− =. kop (row 15 kop)
38+ =. kop (row 15 kop)
3939 =. kop (mow kop 0x1b87.3593)
4040 =. goc (mix kop goc)
4141 =. goc (row 13 goc)
4242 =. goc (end 5 1 (add 0xe654.6b64 (mul 5 goc)))
4343 $(inx +(inx))
44− ::
45− ++ trim :: 31-bit nonzero
46− |= key=@
47− =+ syd=0xcafe.babe
48− |- ^- @
49− =+ haz=(spec syd key)
50− =+ ham=(mix (rsh 0 31 haz) (end 0 31 haz))
51− ?.(=(0 ham) ham $(syd +(syd)))
52− --
53− ::
44+
5445
5546Examples
5647--------
docs/system/hoon/library/src/2f/gate/aor.md+4−3
@@ -8,7 +8,7 @@ boolean.
88Accepts
99-------
1010
11−`a` is a [noun]().
11+`a` is a noun.
1212
1313`b` is a noun.
1414
@@ -21,9 +21,9 @@ A boolean atom.
2121Source
2222------
2323
24− ++ aor :: alphabetic-order
24+ ++ aor :: a-order
2525 ~/ %aor
26− |= [a=* b=*]
26+ |= {a/* b/*}
2727 ^- ?
2828 ?: =(a b) &
2929 ?. ?=(@ a)
@@ -38,6 +38,7 @@ Source
3838 $(a (rsh 3 1 a), b (rsh 3 1 b))
3939 (lth c d)
4040
41+
4142Examples
4243--------
4344
docs/system/hoon/library/src/2f/gate/dor.md+3−2
@@ -8,7 +8,7 @@ boolean.
88Accepts
99-------
1010
11−`a` is a [noun]().
11+`a` is a noun.
1212
1313`b` is a noun.
1414
@@ -22,7 +22,7 @@ Source
2222
2323 ++ dor :: d-order
2424 ~/ %dor
25− |= [a=* b=*]
25+ |= {a/* b/*}
2626 ^- ?
2727 ?: =(a b) &
2828 ?. ?=(@ a)
@@ -33,6 +33,7 @@ Source
3333 ?. ?=(@ b) &
3434 (lth a b)
3535
36+
3637Examples
3738--------
3839
docs/system/hoon/library/src/2f/gate/gor.md+4−3
@@ -7,27 +7,28 @@ XX revisit
77Accepts
88-------
99
10−`a` is a [noun]().
10+`a` is a noun.
1111
1212`b` is a noun.
1313
1414Produces
1515--------
1616
17−A boolean [atom]().
17+A boolean atom.
1818
1919Source
2020------
2121
2222 ++ gor :: g-order
2323 ~/ %gor
24− |= [a=* b=*]
24+ |= {a/* b/*}
2525 ^- ?
2626 =+ [c=(mug a) d=(mug b)]
2727 ?: =(c d)
2828 (dor a b)
2929 (lth c d)
3030
31+
3132Examples
3233--------
3334
docs/system/hoon/library/src/2f/gate/hor.md+5−3
@@ -9,14 +9,14 @@ Recursive hash comparator gate.
99Accepts
1010-------
1111
12−`a` is a [noun]().
12+`a` is a noun.
1313
1414`b` is a noun.
1515
1616Produces
1717--------
1818
19−A boolean [atom]().
19+A boolean atom.
2020
2121
2222Source
@@ -24,7 +24,7 @@ Source
2424
2525 ++ hor :: h-order
2626 ~/ %hor
27− |= [a=* b=*]
27+ |= {a/* b/*}
2828 ^- ?
2929 ?: ?=(@ a)
3030 ?. ?=(@ b) &
@@ -33,6 +33,8 @@ Source
3333 ?: =(-.a -.b)
3434 (gor +.a +.b)
3535 (gor -.a -.b)
36+ ::
37+
3638
3739Examples
3840--------
docs/system/hoon/library/src/2f/gate/vor.md+3−2
@@ -7,7 +7,7 @@ XX revisit
77Accepts
88-------
99
10−`a` is a [noun]()
10+`a` is a noun
1111
1212`b` is a noun
1313
@@ -19,13 +19,14 @@ Source
1919
2020 ++ vor :: v-order
2121 ~/ %vor
22− |= [a=* b=*]
22+ |= {a/* b/*}
2323 ^- ?
2424 =+ [c=(mug (mug a)) d=(mug (mug b))]
2525 ?: =(c d)
2626 (dor a b)
2727 (lth c d)
2828
29+
2930Examples
3031--------
3132
docs/system/hoon/library/src/2h/core/in.md+75−66
@@ -3,7 +3,7 @@
33
44Set operations
55
6−Core whose [arm]()s contain a variety of functions that operate on [`++set`]()s. Its [sample]() accepts the input [`++set`]() to be manipulated.
6+Core whose arms contain a variety of functions that operate on `++set`s. Its sample accepts the input `++set` to be manipulated.
77
88Accepts
99-------
@@ -15,7 +15,7 @@ Source
1515
1616 ++ in :: set engine
1717 ~/ %in
18− |/ a=(set)
18+ |_ a/(set)
1919
2020Examples
2121--------
@@ -33,9 +33,9 @@ producing a boolean.
3333Accepts
3434-------
3535
36−`a` is a [`++set`]().
36+`a` is a `++set`.
3737
38−`b` is a [wet]() [gate]() that accepts a [noun]() and produces a boolean.
38+`b` is a wet gate that accepts a noun and produces a boolean.
3939
4040Produces
4141--------
@@ -47,21 +47,21 @@ Source
4747
4848 +- all :: logical AND
4949 ~/ %all
50− |* b=$+(* ?)
50+ |* b/$-(* ?)
5151 |- ^- ?
5252 ?~ a
5353 &
5454 ?&((b n.a) $(a l.a) $(a r.a))
55− ::
55+
5656
5757Examples
5858--------
5959
60− ~zod/try=> =b (sa `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
61− ~zod/try=> (~(all in b) |=(a=* ?@(+.a & |)))
60+ ~zod/try=> =b (sa `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
61+ ~zod/try=> (~(all in b) |=(a/* ?@(+.a & |)))
6262 %.n
63− ~zod/try=> =b (sa `(list ,@t)`['john' 'bonita' 'daniel' 'madeleine' ~])
64− ~zod/try=> (~(all in b) |=(a=@t (gte a 100)))
63+ ~zod/try=> =b (sa `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
64+ ~zod/try=> (~(all in b) |=(a/@t (gte a 100)))
6565 %.y
6666
6767------------------------------------------------------------------------
@@ -75,9 +75,9 @@ Computes the logical OR on every element of `a` slammed with `b`.
7575Accepts
7676-------
7777
78−`a` is a [`++set`]().
78+`a` is a `++set`.
7979
80−`b` is a [gate]() that accepts a noun and produces a boolean.
80+`b` is a gate that accepts a noun and produces a boolean.
8181
8282Produces
8383--------
@@ -89,21 +89,22 @@ Source
8989
9090 +- any :: logical OR
9191 ~/ %any
92− |* b=$+(* ?)
92+ |* b/$-(* ?)
9393 |- ^- ?
9494 ?~ a
9595 |
9696 ?|((b n.a) $(a l.a) $(a r.a))
9797 ::
9898
99+
99100Examples
100101--------
101102
102− ~zod/try=> =b (sa `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
103− ~zod/try=> (~(any in b) |=(a=* ?@(+.a & |)))
103+ ~zod/try=> =b (sa `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
104+ ~zod/try=> (~(any in b) |=(a/* ?@(+.a & |)))
104105 %.y
105− ~zod/try=> =b (sa `(list ,@t)`['john' 'bonita' 'daniel' 'madeleine' ~])
106− ~zod/try=> (~(any in b) |=(a=@t (lte a 100)))
106+ ~zod/try=> =b (sa `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
107+ ~zod/try=> (~(any in b) |=(a/@t (lte a 100)))
107108 %.n
108109
109110------------------------------------------------------------------------
@@ -112,14 +113,14 @@ Examples
112113
113114Remove noun
114115
115−Removes `b` from the [`++set`]() `a`.
116+Removes `b` from the `++set` `a`.
116117
117118Accepts
118119-------
119120
120121`a` is a set.
121122
122−`b` is a [noun]().
123+`b` is a noun.
123124
124125Produces
125126--------
@@ -131,7 +132,7 @@ Source
131132
132133 +- del :: b without any a
133134 ~/ %del
134− |* b=*
135+ |* b/*
135136 |- ^+ a
136137 ?~ a
137138 ~
@@ -139,7 +140,7 @@ Source
139140 ?: (hor b n.a)
140141 [n.a $(a l.a) r.a]
141142 [n.a l.a $(a r.a)]
142− |- ^- ?(~ _a)
143+ |- ^- {$?($~ _a)}
143144 ?~ l.a r.a
144145 ?~ r.a l.a
145146 ?: (vor n.l.a n.r.a)
@@ -151,10 +152,10 @@ Source
151152Examples
152153--------
153154
154− ~zod/try=> =b (sa `(list ,@t)`['a' 'b' 'c' ~])
155+ ~zod/try=> =b (sa `(list @t)`['a' 'b' 'c' ~])
155156 ~zod/try=> (~(del in b) 'a')
156157 {'c' 'b'}
157− ~zod/try=> =b (sa `(list ,@t)`['john' 'bonita' 'daniel' 'madeleine' ~])
158+ ~zod/try=> =b (sa `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
158159 ~zod/try=> (~(del in b) 'john')
159160 {'bonita' 'madeleine' 'daniel'}
160161 ~zod/try=> (~(del in b) 'susan')
@@ -171,34 +172,35 @@ Produce the axis of `b` within `a`.
171172Accepts
172173-------
173174
174−`a` is a [`++set`]().
175+`a` is a `++set`.
175176
176−`b` is a [noun]().
177+`b` is a noun.
177178
178179Produces
179180--------
180181
181−The [`++unit`]() of an atom.
182+The `++unit` of an atom.
182183
183184Source
184185------
185186
186187 +- dig :: axis of a in b
187− |= b=*
188+ |= b/*
188189 =+ c=1
189− |- ^- (unit ,@)
190+ |- ^- (unit @)
190191 ?~ a ~
191192 ?: =(b n.a) [~ u=(peg c 2)]
192− ?: (gor b n.a)
193+ ?: (hor b n.a)
193194 $(a l.a, c (peg c 6))
194195 $(a r.a, c (peg c 7))
195196 ::
196197
197198
199+
198200Examples
199201--------
200202
201− ~zod/try=> =a (sa `(list ,@)`[1 2 3 4 5 6 7 ~])
203+ ~zod/try=> =a (sa `(list @)`[1 2 3 4 5 6 7 ~])
202204 ~zod/try=> a
203205 {5 4 7 6 1 3 2}
204206 ~zod/try=> -.a
@@ -216,7 +218,7 @@ Examples
216218
217219Concatenate
218220
219−Insert the elements of a [`++list`]() `b` into a [`++set`]() `a`.
221+Insert the elements of a `++list` `b` into a `++set` `a`.
220222
221223Accepts
222224-------
@@ -235,11 +237,11 @@ Source
235237
236238 +- gas :: concatenate
237239 ~/ %gas
238− |= b=(list ,_?>(?=(^ a) n.a))
240+ |= b/(list _?>(?=(^ a) n.a))
239241 |- ^+ a
240242 ?~ b
241243 a
242− $(b t.b, a (put(+< a) i.b))
244+ $(b t.b, a (put i.b))
243245 ::
244246
245247
@@ -248,7 +250,7 @@ Examples
248250
249251 ~zod/try=> b
250252 {'bonita' 'madeleine' 'rudolf' 'john'}
251− ~zod/try=> (~(gas in b) `(list ,@t)`['14' 'things' 'number' '1.337' ~])
253+ ~zod/try=> (~(gas in b) `(list @t)`['14' 'things' 'number' '1.337' ~])
252254 {'1.337' '14' 'number' 'things' 'bonita' 'madeleine' 'rudolf' 'john'}
253255 ~zod/try=> (~(gas in s) `(list ,@t)`['1' '2' '3' ~])
254256 {'1' '3' '2' 'e' 'd' 'a' 'c' 'b'}
@@ -278,7 +280,7 @@ Source
278280
279281 +- has :: b exists in a check
280282 ~/ %has
281− |* b=*
283+ |* b/*
282284 |- ^- ?
283285 ?~ a
284286 |
@@ -293,7 +295,7 @@ Source
293295Examples
294296--------
295297
296− ~zod/try=> =a (~(gas in `(set ,@t)`~) `(list ,@t)`[`a` `b` `c` ~])
298+ ~zod/try=> =a (~(gas in `(set @t)`~) `(list @t)`[`a` `b` `c` ~])
297299 ~zod/try=> (~(has in a) `a`)
298300 %.y
299301 ~zod/try=> (~(has in a) 'z')
@@ -305,7 +307,7 @@ Examples
305307
306308Intersection
307309
308−Produces a set of the intersection between two [`++set`]()s of the same type,
310+Produces a set of the intersection between two `++set`s of the same type,
309311`a` and `b`.
310312
311313Accepts
@@ -318,14 +320,14 @@ Accepts
318320Produces
319321--------
320322
321−A [`++set`]().
323+A `++set`.
322324
323325Source
324326------
325327
326− +- int :: intersection
328+ +- int :: intersection
327329 ~/ %int
328− |* b=_a
330+ |* b/_a
329331 |- ^+ a
330332 ?~ b
331333 ~
@@ -336,8 +338,10 @@ Source
336338 ?: =(n.b n.a)
337339 [n.a $(a l.a, b l.b) $(a r.a, b r.b)]
338340 ?: (hor n.b n.a)
339− %- uni(+< $(a l.a, b [n.b l.b ~])) $(b r.b)
340− %- uni(+< $(a r.a, b [n.b ~ r.b])) $(b l.b)
341+ %- uni(a $(a l.a, b [n.b l.b ~])) $(b r.b)
342+ %- uni(a $(a r.a, b [n.b ~ r.b])) $(b l.b)
343+ ::
344+
341345
342346
343347Examples
@@ -358,26 +362,26 @@ Examples
358362
359363Put b in a
360364
361−Add an element `b` to the [`++set`]() `a`.
365+Add an element `b` to the `++set` `a`.
362366
363367Accepts
364368-------
365369
366370`a` is a set.
367371
368−`b` is a [noun]().
372+`b` is a noun.
369373
370374Produces
371375--------
372376
373−A [`++set`]().
377+A `++set`.
374378
375379Source
376380------
377381
378− +- put :: puts b in a
382+ +- put :: puts b in a, sorted
379383 ~/ %put
380− |* b=*
384+ |* b/*
381385 |- ^+ a
382386 ?~ a
383387 [b ~ ~]
@@ -400,7 +404,7 @@ Source
400404Examples
401405--------
402406
403− ~zod/try=> =a (~(gas in `(set ,@t)`~) `(list ,@t)`[`a` `b` `c` ~])
407+ ~zod/try=> =a (~(gas in `(set @t)`~) `(list @t)`[`a` `b` `c` ~])
404408 ~zod/try=> =b (~(put in a) `d`)
405409 ~zod/try=> b
406410 {`d` `a` `c` `b`}
@@ -413,14 +417,14 @@ Examples
413417
414418Accumulate
415419
416−Accumulate the elements of `a` using a [gate]() `c` and an accumulator `b`.
420+Accumulate the elements of `a` using a gate `c` and an accumulator `b`.
417421
418422Accepts
419423--------
420424
421−`a` is a [`++set`]().
425+`a` is a `++set`.
422426
423−`b` is a [noun]().
427+`b` is a noun.
424428
425429`c` is a gate.
426430
@@ -432,21 +436,21 @@ A noun.
432436Source
433437------
434438
435− +- rep :: replace by tile
436− |* [b=* c=_,*]
437− |-
438− ?~ a b
439− $(a r.a, b $(a l.a, b (c n.a b)))
440− ::
439+ +- rep :: replace by product
440+ |* b/_|=({* *} +<+)
441+ |-
442+ ?~ a +<+.b
443+ $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
444+
441445
442446
443447Examples
444448--------
445449
446− ~zod/try=> =a (~(gas in *(set ,@)) [1 2 3 ~])
450+ ~zod/try=> =a (~(gas in *(set @)) [1 2 3 ~])
447451 ~zod/try=> a
448452 {1 3 2}
449− ~zod/try=> (~(rep in a) 0 |=([a=@ b=@] (add a b)))
453+ ~zod/try=> (~(rep in a) 0 |=([a/@ b/@] (add a b)))
450454 6
451455
452456------------------------------------------------------------------------
@@ -455,7 +459,7 @@ Examples
455459
456460Set to list
457461
458−Flattens the [`++set`]() `a` into a [`++list`]().
462+Flattens the `++set` `a` into a `++list`.
459463
460464Accepts
461465-------
@@ -470,23 +474,24 @@ A list.
470474Source
471475------
472476
473− +- tap :: list tiles a set
477+ +- tap :: convert to list
474478 ~/ %tap
475− |= b=(list ,_?>(?=(^ a) n.a))
479+ |= b/(list _?>(?=(^ a) n.a))
476480 ^+ b
477481 ?~ a
478482 b
479− $(a r.a, b [n.a $(a l.a)])
483+ $(a r.a b [n.a $(a l.a)])
480484 ::
481485
482486
487+
483488Examples
484489--------
485490
486− ~zod/try=> =s (sa `(list ,@t)`['a' 'b' 'c' 'd' 'e' ~])
491+ ~zod/try=> =s (sa `(list @t)`['a' 'b' 'c' 'd' 'e' ~])
487492 ~zod/try=> s
488493 {'e' 'd' 'a' 'c' 'b'}
489− ~zod/try=> (~(tap in s) `(list ,@t)`['1' '2' '3' ~])
494+ ~zod/try=> (~(tap in s) `(list @t)`['1' '2' '3' ~])
490495 ~['b' 'c' 'a' 'd' 'e' '1' '2' '3']
491496 ~zod/try=> b
492497 {'bonita' 'madeleine' 'daniel' 'john'}
@@ -519,7 +524,8 @@ Source
519524
520525 +- uni :: union
521526 ~/ %uni
522− |* b=_a
527+ |* b/_a
528+ ?: =(a b) a
523529 |- ^+ a
524530 ?~ b
525531 a
@@ -536,6 +542,7 @@ Source
536542 ?: (hor n.a n.b)
537543 $(b [n.b $(b l.b, a [n.a l.a ~]) r.b], a r.a)
538544 $(b [n.b l.b $(b r.b, a [n.a ~ r.a])], a l.a)
545+ ::
539546
540547
541548Examples
@@ -574,6 +581,8 @@ Source
574581 +- wyt :: size of set
575582 |- ^- @
576583 ?~(a 0 +((add $(a l.a) $(a r.a))))
584+ --
585+
577586
578587
579588Examples
docs/system/hoon/library/src/2i/core/by.md+99−87
@@ -4,12 +4,13 @@ Map operations
44
55 ++ by :: map engine
66 ~/ %by
7− |/ a=(map)
7+ |_ a/(map)
8+
89
910Container arm for map operation arms. A map is a set of key, value
10−pairs. The contained arms inherit it's [sample]() [map](), `a`.
11+pairs. The contained arms inherit it's sample map, `a`.
1112
12−`a` is a [map]().
13+`a` is a map.
1314
1415 ~zod/try=> ~(. by (mo (limo [%a 1] [%b 2] ~)))
1516 <19.irb [nlr([p={%a %b} q=@ud]) <414.rvm 101.jzo 1.ypj %164>]>
@@ -22,26 +23,28 @@ Logical AND
2223
2324 +- all :: logical AND
2425 ~/ %all
25− |* b=$+(* ?)
26+ |* b/$-(* ?)
2627 |- ^- ?
2728 ?~ a
2829 &
2930 ?&((b q.n.a) $(a l.a) $(a r.a))
31+ ::
32+
3033
3134Computes the logical AND on the results of slamming every element in map
3235`a` with gate `b`. Produces a loobean.
3336
34−`a` is a [map]().
37+`a` is a map.
3538
36−`b` is a [wet gate]().
39+`b` is a wet gate.
3740
38− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
39− ~zod/try=> (~(all by b) |=(a=* ?@(a & |)))
41+ ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
42+ ~zod/try=> (~(all by b) |=(a/* ?@(a & |)))
4043 %.n
41− ~zod/try=> =a (mo `(list ,[@t @u])`[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
42− ~zod/try=> (~(all by a) |=(a=@ (lte a 6)))
44+ ~zod/try=> =a (mo `(list {@t @u})`[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
45+ ~zod/try=> (~(all by a) |=(a/@ (lte a 6)))
4346 %.y
44− ~zod/try=> (~(all by a) |=(a=@ (lte a 4)))
47+ ~zod/try=> (~(all by a) |=(a/@ (lte a 4)))
4548 %.n
4649
4750------------------------------------------------------------------------
@@ -61,14 +64,14 @@ Logical OR
6164Computes the logical OR on the results of slamming every element with
6265gate `b`. Produces a loobean.
6366
64−`a` is a [map]().
67+`a` is a map.
6568
66−`b` is a [wet gate]().
69+`b` is a wet gate.
6770
68− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
69− ~zod/try=> (~(all by b) |=(a=* ?@(a & |)))
71+ ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
72+ ~zod/try=> (~(all by b) |=(a/* ?@(a & |)))
7073 %.y
71− ~zod/try=> =a (mo `(list ,[@t @u])`[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
74+ ~zod/try=> =a (mo `(list {@t @u})`[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
7275 ~zod/try=> (~(any by a) |=(a=@ (lte a 4)))
7376 %.y
7477
@@ -80,7 +83,7 @@ Delete
8083
8184 +- del :: delete at key b
8285 ~/ %del
83− |* b=*
86+ |* b/*
8487 |- ^+ a
8588 ?~ a
8689 ~
@@ -88,20 +91,21 @@ Delete
8891 ?: (gor b p.n.a)
8992 [n.a $(a l.a) r.a]
9093 [n.a l.a $(a r.a)]
91− |- ^- ?(~ _a)
94+ |- ^- {$?($~ _a)}
9295 ?~ l.a r.a
9396 ?~ r.a l.a
9497 ?: (vor p.n.l.a p.n.r.a)
9598 [n.l.a l.l.a $(l.a r.l.a)]
9699 [n.r.a $(r.a l.r.a) r.r.a]
100+ ::
97101
98102Produces map `a` with the element located at key `b` removed.
99103
100−`a` is a [map]().
104+`a` is a map.
101105
102−`b` is a key as a [noun]().
106+`b` is a key as a noun.
103107
104− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
108+ ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
105109 ~zod/try=> (~(del by b) `a`)
106110 {[p=`b` q=[2 3]]}
107111
@@ -111,23 +115,25 @@ Produces map `a` with the element located at key `b` removed.
111115
112116Axis of key
113117
114− +- dig :: axis of key
115− |= b=*
118+ +- dig :: axis of b key
119+ |= b/*
116120 =+ c=1
117− |- ^- (unit ,@)
121+ |- ^- (unit @)
118122 ?~ a ~
119123 ?: =(b p.n.a) [~ u=(peg c 2)]
120124 ?: (gor b p.n.a)
121125 $(a l.a, c (peg c 6))
122126 $(a r.a, c (peg c 7))
127+ ::
128+
123129
124130Produce the axis of key `b` within map `a`.
125131
126−`a` is a [map]().
132+`a` is a map.
127133
128−`b` is a key as a [noun]().
134+`b` is a key as a noun.
129135
130− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
136+ ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
131137 ~zod/try=> (~(dig by b) `b`)
132138 [~ 2]
133139
@@ -139,21 +145,22 @@ Concatenate
139145
140146 +- gas :: concatenate
141147 ~/ %gas
142− |* b=(list ,[p=* q=*])
143− => .(b `(list ,_?>(?=(^ a) n.a))`b)
148+ |= b/(list _?>(?=(^ a) n.a))
144149 |- ^+ a
145150 ?~ b
146151 a
147− $(b t.b, a (put(+< a) p.i.b q.i.b))
152+ $(b t.b, a (put i.b))
153+ ::
154+
148155
149156Insert a list of key-value pairs `b` into map `a`.
150157
151−`a` is a [map]().
158+`a` is a map.
152159
153−`b` is a [list]() of [cells]() of key-value nouns `p` and `q`.
160+`b` is a list of cells of key-value nouns `p` and `q`.
154161
155− ~zod/try=> =a (mo `(list ,[@t *])`[[`a` 1] [`b` 2] ~])
156− ~zod/try=> =b `(list ,[@t *])`[[`c` 3] [`d` 4] ~]
162+ ~zod/try=> =a (mo `(list {@t *})`[[`a` 1] [`b` 2] ~])
163+ ~zod/try=> =b `(list {@t *})`[[`c` 3] [`d` 4] ~]
157164 ~zod/try=> (~(gas by a) b)
158165 {[p=`d` q=4] [p=`a` q=1] [p=`c` q=3] [p=`b` q=2]}
159166
@@ -177,11 +184,11 @@ Grab unit value
177184
178185Produce the unit value of the value located at key `b` within map `a`.
179186
180−`a` is a [map]()
187+`a` is a map
181188
182−`b` is a [key]() as a [noun]()
189+`b` is a key as a noun
183190
184− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
191+ ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
185192 ~zod/try=> (~(get by b) `b`)
186193 [~ [2 3]]
187194
@@ -192,18 +199,17 @@ Produce the unit value of the value located at key `b` within map `a`.
192199Assert
193200
194201 +- got
195− |* b=*
196− %- need
197− %- get(+< a) b
202+ |* b/*
203+ (need (get b))
198204
199205Produce the value located at key `b` within map `a`. Crash if key `b`
200206does not exist.
201207
202−`a` is a [map]().
208+`a` is a map.
203209
204−`b` is a [key]().
210+`b` is a key.
205211
206− ~zod/try=> =m (mo `(list ,[@t *])`[['a' 1] ['b' 2] ~])
212+ ~zod/try=> =m (mo `(list {@t *})`[['a' 1] ['b' 2] ~])
207213 ~zod/try=> m
208214 {[p='a' q=1] [p='b' q=2]}
209215 ~zod/try=> (~(get by m) 'a')
@@ -221,17 +227,18 @@ Key existence check
221227
222228 +- has :: key existence check
223229 ~/ %has
224− |* b=*
225− !=(~ (get(+< a) b))
230+ |* b/*
231+ !=(~ (get b))
232+
226233
227234Checks whether map `a` contains an element with key `b`, producing a
228235loobean.
229236
230−`a` is a [map]().
237+`a` is a map.
231238
232−`b` is a key as a [noun]().
239+`b` is a key as a noun.
233240
234− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
241+ ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
235242 ~zod/try=> (~(has by b) `b`)
236243 %.y
237244 ~zod/try=> (~(has by b) `c`)
@@ -245,7 +252,7 @@ Intersection
245252
246253 +- int :: intersection
247254 ~/ %int
248− |* b=_a
255+ |* b/_a
249256 |- ^+ a
250257 ?~ b
251258 ~
@@ -254,41 +261,42 @@ Intersection
254261 ?: (vor p.n.a p.n.b)
255262 ?: =(p.n.b p.n.a)
256263 [n.b $(a l.a, b l.b) $(a r.a, b r.b)]
257− ?: (hor p.n.b p.n.a)
258− %- uni(+< $(a l.a, b [n.b l.b ~])) $(b r.b)
259− %- uni(+< $(a r.a, b [n.b ~ r.b])) $(b l.b)
264+ ?: (gor p.n.b p.n.a)
265+ %- uni(a $(a l.a, b [n.b l.b ~])) $(b r.b)
266+ %- uni(a $(a r.a, b [n.b ~ r.b])) $(b l.b)
260267 ?: =(p.n.a p.n.b)
261268 [n.b $(b l.b, a l.a) $(b r.b, a r.a)]
262− ?: (hor p.n.a p.n.b)
263− %- uni(+< $(b l.b, a [n.a l.a ~])) $(a r.a)
264− %- uni(+< $(b r.b, a [n.a ~ r.a])) $(a l.a)
269+ ?: (gor p.n.a p.n.b)
270+ %- uni(a $(b l.b, a [n.a l.a ~])) $(a r.a)
271+ %- uni(a $(b r.b, a [n.a ~ r.a])) $(a l.a)
272+ ::
265273
266274Produces a map of the (key) intersection between two maps of the same
267275type, `a` and `b`. If both maps have an identical key that point to
268276different values, the element from map `b` is used.
269277
270−`a` is a [map]().
278+`a` is a map.
271279
272−`b` is a [map]().
280+`b` is a map.
273281
274− ~zod/try=> =n (mo `(list ,[@t *])`[['a' 1] ['c' 3] ~])
282+ ~zod/try=> =n (mo `(list {@t *})`[['a' 1] ['c' 3] ~])
275283 ~zod/try=> n
276284 {[p='a' q=1] [p='c' q=3]}
277285 ~zod/try=> m
278286 {[p='a' q=1] [p='b' q=2]}
279287 ~zod/try=> (~(int by m) n)
280288 {[p='a' q=1]}
281− ~ravpel-holber/try=> =p (mo `(list ,[@t *])`[['a' 2] ['b' 2] ~])
289+ ~ravpel-holber/try=> =p (mo `(list {@t *})`[['a' 2] ['b' 2] ~])
282290 ~zod/try=> p
283291 {[p='a' q=2] [p='b' q=2]}
284292 ~zod/try=> (~(int by p) n)
285293 {[p='a' q=2]}
286− ~zod/try=> =q (mo `(list ,[@t *])`[['a' 2] ['c' 2] ~])
294+ ~zod/try=> =q (mo `(list {@t *})`[['a' 2] ['c' 2] ~])
287295 ~zod/try=> q
288296 {[p='a' q=2] [p='b' q=2]}
289297 ~zod/try=> (~(int by p) q)
290298 {[p='a' q=2] [p='b' q=2]}
291− ~zod/try=> =o (mo `(list ,[@t *])`[['c' 3] ['d' 4] ~])
299+ ~zod/try=> =o (mo `(list {@t *})`[['c' 3] ['d' 4] ~])
292300 ~zod/try=> (~(int by m) o)
293301 {}
294302
@@ -337,7 +345,7 @@ Add key-value pair
337345
338346 +- put :: adds key-value pair
339347 ~/ %put
340− |* [b=* c=*]
348+ |* {b/* c/*}
341349 |- ^+ a
342350 ?~ a
343351 [[b c] ~ ~]
@@ -356,10 +364,11 @@ Add key-value pair
356364 ?: (vor p.n.a p.n.d)
357365 [n.a l.a d]
358366 [n.d [n.a l.a l.d] r.d]
367+ ::
359368
360369Produces `a` with the addition of the key-value pair of `b` and `c`.
361370
362−`a` is a [map]().
371+`a` is a map.
363372
364373`b` is a key of the same type as the keys in `a`.
365374
@@ -380,10 +389,11 @@ Produces `a` with the addition of the key-value pair of `b` and `c`.
380389### `+-rep:by`
381390
382391 +- rep :: replace by product
383− |* [b=* c=_,*]
392+ |* b/_|=({* *} +<+)
384393 |-
385− ?~ a b
386− $(a r.a, b $(a l.a, b (c q.n.a b)))
394+ ?~ a +<+.b
395+ $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
396+ ::
387397
388398Accumulate using gate from values in map
389399
@@ -394,7 +404,7 @@ XX interface changing.
394404### `+-rib:by`
395405
396406 +- rib :: transform + product
397− |* [b=* c=_,*]
407+ |* {b/* c/$-(* *)}
398408 |- ^+ [b a]
399409 ?~ a [b ~]
400410 =+ d=(c n.a b)
@@ -402,6 +412,7 @@ XX interface changing.
402412 =+ e=$(a l.a, b -.d)
403413 =+ f=$(a r.a, b -.e)
404414 [-.f [n.a +.e +.f]]
415+ ::
405416
406417Replace values with accumulator
407418
@@ -413,23 +424,23 @@ XX interface changing, possibly disappearing
413424
414425Transform values
415426
416− +- run :: turns to tuples
417− |* b=_,*
418− |-
427+ +- run :: apply gate to values
428+ |* b/$-(* *)
429+ |-
419430 ?~ a a
420− a(n (b q.n.a), l $(a l.a), r $(a r.a))
431+ [n=[p=p.n.a q=(b q.n.a)] l=$(a l.a) r=$(a r.a)]
421432
422433Iterates over every value in set `a` using gate `b`. Produces a map.
423434
424−`a` is a [map]().
435+`a` is a map.
425436
426−`b` is a [wet gate]().
437+`b` is a wet gate.
427438
428439 ~zod/try=> m
429440 {[p='a' q=1] [p='b' q=2]}
430441 ~zod/try=> ^+(m (~(run by m) dec))
431442 {[p='a' q=0] [p='b' q=1]}
432− ~zod/try=> `(map ,@tas ,@t)`(~(run by m) (cury scot %ux))
443+ ~zod/try=> `(map @tas @t)`(~(run by m) (cury scot %ux))
433444 {[p=%a q='0x1'] [p=%b q='0x2']}
434445
435446------------------------------------------------------------------------
@@ -440,18 +451,19 @@ Listify pairs
440451
441452 +- tap :: listify pairs
442453 ~/ %tap
443− |= b=(list ,_?>(?=(^ a) n.a))
454+ |= b/(list _?>(?=(^ a) n.a))
444455 ^+ b
445456 ?~ a
446457 b
447458 $(a r.a, b [n.a $(a l.a)])
459+ ::
448460
449461Produces the list of all elements in map `a` that is prepended to list
450462`b`, which is empty by default.
451463
452−`a` is a [map]().
464+`a` is a map.
453465
454−`b` is a [list]().
466+`b` is a list.
455467
456468 {[p='a' q=1] [p='b' q=2]}
457469 ~zod/try=> `*`m
@@ -469,7 +481,7 @@ Union
469481
470482 +- uni :: union, merge
471483 ~/ %uni
472− |* b=_a
484+ |* b/_a
473485 |- ^+ a
474486 ?~ b
475487 a
@@ -478,21 +490,21 @@ Union
478490 ?: (vor p.n.a p.n.b)
479491 ?: =(p.n.b p.n.a)
480492 [n.b $(a l.a, b l.b) $(a r.a, b r.b)]
481− ?: (hor p.n.b p.n.a)
493+ ?: (gor p.n.b p.n.a)
482494 $(a [n.a $(a l.a, b [n.b l.b ~]) r.a], b r.b)
483495 $(a [n.a l.a $(a r.a, b [n.b ~ r.b])], b l.b)
484496 ?: =(p.n.a p.n.b)
485497 [n.b $(b l.b, a l.a) $(b r.b, a r.a)]
486− ?: (hor p.n.a p.n.b)
498+ ?: (gor p.n.a p.n.b)
487499 $(b [n.b $(b l.b, a [n.a l.a ~]) r.b], a r.a)
488500 $(b [n.b l.b $(b r.b, a [n.a ~ r.a])], a l.a)
489501
490502Produces a map of the union between the keys of `a` and `b`. If `b`
491503shares a key with `a`, the tuple from `a` is preserved.
492504
493−`a` is a [map]().
505+`a` is a map.
494506
495−`b` is a [map]().
507+`b` is a map.
496508
497509 ~zod/try=> m
498510 {[p='a' q=1] [p='b' q=2]}
@@ -518,8 +530,8 @@ shares a key with `a`, the tuple from `a` is preserved.
518530
519531Turn (with key)
520532
521− +- urn :: turn
522− |* b=$+([* *] *)
533+ +- urn :: apply gate to nodes
534+ |* b/$-({* *} *)
523535 |-
524536 ?~ a ~
525537 [n=[p=p.n.a q=(b p.n.a q.n.a)] l=$(a l.a) r=$(a r.a)]
@@ -527,9 +539,9 @@ Turn (with key)
527539Iterates over every value in map `a` using gate `b`, which accepts both
528540the key and the value of each element as its sample.
529541
530−`a` is a [map]().
542+`a` is a map.
531543
532−`b` is a [wet gate]() that accepts two nouns (a key and a value) and
544+`b` is a wet gate that accepts two nouns (a key and a value) and
533545produces a noun (the new value).
534546
535547 ~zod/try=> m
@@ -553,7 +565,7 @@ Depth
553565
554566Produce the depth of the tree map `a`.
555567
556−`a` is a [map]().
568+`a` is a map.
557569
558570 ~zod/try=> m
559571 {[p='a' q=1] [p='b' q=2]}
docs/system/hoon/library/src/2j/core/ja.md+11−166
@@ -2,13 +2,12 @@
22
33Jar engine
44
5− ++ ja :: jar engine
6− |/ a=(jar)
5+ |_ a/(jar)
76
87A container arm for `++jar` operation arms. A `++jar` is a `++map` of
9−`++list`s. The contained arms inherit the [sample]() jar.
8+`++list`s. The contained arms inherit the sample jar.
109
11−`a` is a [jar]().
10+`a` is a jar.
1211
1312 ~zod/try=> ~(. ja (mo (limo a/"ho" b/"he" ~)))
1413 <2.dgz [nlr([p={%a %b} q=""]) <414.fvk 101.jzo 1.ypj %164>]>
@@ -19,14 +18,15 @@ A container arm for `++jar` operation arms. A `++jar` is a `++map` of
1918
2019Grab value by key
2120
22− +- get :: grab value by key
23− |* b=*
21+ +- get :: gets list by key
22+ |* b/*
2423 =+ c=(~(get by a) b)
2524 ?~(c ~ u.c)
25+ ::
2626
2727Produces a list retrieved from jar `a` using the key `b`.
2828
29−`a` is a [`++jar`](/doc/hoon/library/1#++jar).
29+`a` is a `++jar`.
3030
3131`b` is a key of the same type as the keys in `a`.
3232
@@ -47,14 +47,14 @@ Produces a list retrieved from jar `a` using the key `b`.
4747Prepend to list
4848
4949 +- add :: adds key-list pair
50− |* [b=* c=*]
51− =+ d=(get(+< a) b)
50+ |* {b/* c/*}
51+ =+ d=(get b)
5252 (~(put by a) b [c d])
5353
5454Produces jar `a` with value `c` prepended to the list located at key
5555`b`.
5656
57−`a` is a [jar]().
57+`a` is a jar.
5858
5959`b` is a key of the same type as the keys in `a`.
6060
@@ -73,159 +73,4 @@ Produces jar `a` with value `c` prepended to the list located at key
7373 ! type-fail
7474 ! exit
7575
76−------------------------------------------------------------------------
77−
78−### `++ju`
79−
80−Jug operations
81−
82− ++ ju :: jug engine
83− |/ a=(jug)
84−
85−Container arm for jug operation arms. A `++jug` is a `++map` of
86−`++sets`. The contained arms inherit its [sample]() jug, `a`.
87−
88−`a` is a [jug]().
89−
90− ~zod/try=> ~(. ju (mo (limo a/(sa "ho") b/(sa "he") ~)))
91− <2.dgz [nlr([p={%a %b} q={nlr(^$1{@tD $1}) nlr(^$3{@tD $3})}]) <414.fvk 101.jzo 1.ypj %164>]>
92−
93−### `+-del:ju`
94−
95−Remove
96−
97− +- del :: delete at key b
98− |* [b=* c=*]
99− ^+ a
100− =+ d=(get(+< a) b)
101− =+ e=(~(del in d) c)
102− ?~ e
103− (~(del by a) b)
104− (~(put by a) b e)
105−
106−Produces jug `a` with value `c` removed from set located at key `b`.
107−
108−`a` is a [jug]().
109−
110−`b` is a key of the same type as the keys in `a`.
111−
112−`c` is the value of the same type of the keys in `a` that is to be
113−removed.
114−
115− ~zod/try=> s
116− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
117− ~zod/try=> (~(del ju s) 'a' 1)
118− {[p='a' q={3 2}] [p='b' q={5 4 6}]}
119− ~zod/try=> (~(del ju s) 'c' 7)
120− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
121−
122−------------------------------------------------------------------------
123−
124−### `+-get:ju`
125−
126−Retrieve set
127−
128− +- get :: gets set by key
129− |* b=*
130− =+ c=(~(get by a) b)
131− ?~(c ~ u.c)
132−
133−Produces a set retrieved from jar `a` using key `b`.
134−
135−`a` is a [jar]().
136−
137−`b` is a key of the same type as the keys in `a`.
138−
139− ~zod/try=> s
140− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
141− ~zod/try=> (~(get ju s) 'a')
142− {1 3 2}
143− ~zod/try=> (~(get ju s) 'b')
144− {5 4 6}
145− ~zod/try=> (~(get ju s) 'c')
146− ~
147−
148−------------------------------------------------------------------------
149−
150−### `+-has:ju`
151−
152−Check contents
153−
154− +- has :: existence check
155− |* [b=* c=*]
156− ^- ?
157− (~(has in (get(+< a) b)) c)
158−
159−Computes whether a value `c` exists within the set located at key `b`
160−with jar `a`. Produces a loobean.
161−
162−`a` is a [set]().
163−
164−`b` is a key as a [noun]().
165−
166−`c` is a value as a [noun]().
167−
168− ~zod/try=> s
169− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
170− ~zod/try=> (~(has ju s) 'a' 3)
171− %.y
172− ~zod/try=> (~(has ju s) 'b' 6)
173− %.y
174− ~zod/try=> (~(has ju s) 'a' 7)
175− %.n
176− ~zod/try=> (~(has jus s) 'c' 7)
177− ! -find-limb.jus
178− ! find-none
179− ! exit
180− ~zod/try=> (~(has ju s) 'c' 7)
181− %.n
182−
183−------------------------------------------------------------------------
184−
185−### `+-put:ju`
186−
187−Add key-set pair
188−
189− +- put :: adds key-element pair
190− |* [b=* c=*]
191− ^+ a
192− =+ d=(get(+< a) b)
193− (~(put by a) b (~(put in d) c))
194−
195−Produces jar `a` with `c` added to the set value located at key `b`.
196−
197−`a` is a [set]().
198−
199−`b` is a key as a [noun]().
200−
201−`c` is a [value]().
202−
203− ~zod/try=> s
204− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
205− ~zod/try=> (~(put ju s) 'a' 7)
206− {[p='a' q={7 1 3 2}] [p='b' q={5 4 6}]}
207− ~zod/try=> (~(put ju s) 'a' 1)
208− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
209− ~zod/try=> (~(put ju s) 'c' 7)
210− {[p='a' q={1 3 2}] [p='c' q={7}] [p='b' q={5 4 6}]}
211−
212−------------------------------------------------------------------------
213−
214−### `++by`
215−
216−Map operations
217−
218− ++ by :: map engine
219− ~/ %by
220− |/ a=(map)
221−
222−Container arm for map operation arms. A map is a set of key, value
223−pairs. The contained arms inherit it's [sample]() [map](), `a`.
224−
225−`a` is a [map]().
226−
227− ~zod/try=> ~(. by (mo (limo [%a 1] [%b 2] ~)))
228− <19.irb [nlr([p={%a %b} q=@ud]) <414.rvm 101.jzo 1.ypj %164>]>
229−
230−
231−***
76+**
docs/system/hoon/library/src/2j/core/ju.md+25−20
@@ -3,12 +3,12 @@
33Jug operations
44
55 ++ ju :: jug engine
6− |/ a=(jug)
6+ |/ a/(jug)
77
88Container arm for jug operation arms. A `++jug` is a `++map` of
9−`++sets`. The contained arms inherit its [sample]() jug, `a`.
9+`++sets`. The contained arms inherit its sample jug, `a`.
1010
11−`a` is a [jug]().
11+`a` is a jug.
1212
1313 ~zod/try=> ~(. ju (mo (limo a/(sa "ho") b/(sa "he") ~)))
1414 <2.dgz [nlr([p={%a %b} q={nlr(^$1{@tD $1}) nlr(^$3{@tD $3})}]) <414.fvk 101.jzo 1.ypj %164>]>
@@ -17,18 +17,20 @@ Container arm for jug operation arms. A `++jug` is a `++map` of
1717
1818Remove
1919
20− +- del :: delete at key b
21− |* [b=* c=*]
20+ +- del :: del key-set pair
21+ |* {b/* c/*}
2222 ^+ a
23− =+ d=(get(+< a) b)
23+ =+ d=(get b)
2424 =+ e=(~(del in d) c)
2525 ?~ e
2626 (~(del by a) b)
2727 (~(put by a) b e)
28+ ::
29+
2830
2931Produces jug `a` with value `c` removed from set located at key `b`.
3032
31−`a` is a [jug]().
33+`a` is a jug.
3234
3335`b` is a key of the same type as the keys in `a`.
3436
@@ -49,13 +51,14 @@ removed.
4951Retrieve set
5052
5153 +- get :: gets set by key
52− |* b=*
54+ |* b/*
5355 =+ c=(~(get by a) b)
5456 ?~(c ~ u.c)
57+ ::
5558
5659Produces a set retrieved from jar `a` using key `b`.
5760
58−`a` is a [jar]().
61+`a` is a jar.
5962
6063`b` is a key of the same type as the keys in `a`.
6164
@@ -75,18 +78,20 @@ Produces a set retrieved from jar `a` using key `b`.
7578Check contents
7679
7780 +- has :: existence check
78− |* [b=* c=*]
81+ |* {b/* c/*}
7982 ^- ?
80− (~(has in (get(+< a) b)) c)
83+ (~(has in (get b)) c)
84+ ::
85+
8186
8287Computes whether a value `c` exists within the set located at key `b`
8388with jar `a`. Produces a loobean.
8489
85−`a` is a [set]().
90+`a` is a set.
8691
87−`b` is a key as a [noun]().
92+`b` is a key as a noun.
8893
89−`c` is a value as a [noun]().
94+`c` is a value as a noun.
9095
9196 ~zod/try=> s
9297 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
@@ -109,19 +114,19 @@ with jar `a`. Produces a loobean.
109114
110115Add key-set pair
111116
112− +- put :: adds key-element pair
113− |* [b=* c=*]
117+ +- put :: add key-set pair
118+ |* {b/* c/*}
114119 ^+ a
115− =+ d=(get(+< a) b)
120+ =+ d=(get b)
116121 (~(put by a) b (~(put in d) c))
117122
118123Produces jar `a` with `c` added to the set value located at key `b`.
119124
120−`a` is a [set]().
125+`a` is a set.
121126
122−`b` is a key as a [noun]().
127+`b` is a key as a noun.
123128
124−`c` is a [value]().
129+`c` is a value.
125130
126131 ~zod/try=> s
127132 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
docs/system/hoon/library/src/2k/core/to.md+40−36
@@ -3,18 +3,18 @@
33Queue operations
44
55Container arm for queue operation arms. The contained arms inherit its
6−[sample]() `++qeu` `a`.
6+sample `++qeu` `a`.
77
88Accepts
99-------
1010
11−`a` is a queue, [++qeu]().
11+`a` is a queue, ++qeu.
1212
1313Source
1414------
1515
1616 ++ to :: queue engine
17− |/ a=(qeu)
17+ |/ a/(qeu)
1818
1919### `+-bal:to`
2020
@@ -25,12 +25,12 @@ Vertically rebalances queue `a`.
2525Accepts
2626-------
2727
28−`a` is a [queue]().
28+`a` is a queue.
2929
3030Produces
3131--------
3232
33−A [queue]().
33+A queue.
3434
3535Source
3636------
@@ -38,13 +38,14 @@ Source
3838 +- bal
3939 |- ^+ a
4040 ?~ a ~
41− ?. |(?=(~ l.a) (vor n.a n.l.a))
41+ ?. |(?=($~ l.a) (vor n.a n.l.a))
4242 $(a [n.l.a l.l.a $(a [n.a r.l.a r.a])])
43− ?. |(?=(~ r.a) (vor n.a n.r.a))
43+ ?. |(?=($~ r.a) (vor n.a n.r.a))
4444 $(a [n.r.a $(a [n.a l.a l.r.a]) r.r.a])
4545 a
4646 ::
4747
48+
4849Examples
4950--------
5051
@@ -68,7 +69,7 @@ Produces the maximum depth of leaves (r.a and l.a) in queue `a`.
6869Accepts
6970-------
7071
71−`a` is a [queue]().
72+`a` is a queue.
7273
7374Produces
7475--------
@@ -84,16 +85,17 @@ Source
8485 +((max $(a l.a) $(a r.a)))
8586 ::
8687
88+
8789Examples
8890--------
8991
90− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 5 6 7 ~])
92+ ~zod/try=> =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 7 ~])
9193 ~zod/try=> ~(dep to a)
9294 4
93− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 ~])
95+ ~zod/try=> =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 ~])
9496 ~zod/try=> ~(dep to a)
9597 3
96− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 ~])
98+ ~zod/try=> =a (~(gas to `(qeu @)`~) `(list @)`[1 2 ~])
9799 ~zod/try=> ~(dep to a)
98100 2
99101 ~zod/try=> ~(dep to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~])
@@ -107,7 +109,7 @@ Examples
107109
108110Push list
109111
110−Push all elements of [`++list`]() `b` into the [`++queue`]().
112+Push all elements of `++list` `b` into the `++queue`.
111113
112114Accepts
113115-------
@@ -146,7 +148,7 @@ Examples
146148
147149Pop
148150
149−Produces the head and tail [`++queue`]() of `a`.
151+Produces the head and tail `++queue` of `a`.
150152
151153Accepts
152154-------
@@ -162,14 +164,14 @@ Source
162164------
163165
164166 +- get :: head-tail pair
165− |- ^+ [p=?>(?=(^ a) n.a) q=a]
167+ |- ^+ ?>(?=(^ a) [p=n.a q=*(qeu _n.a)])
166168 ?~ a
167169 !!
168170 ?~ r.a
169171 [n.a l.a]
170172 =+ b=$(a r.a)
171173 :- p.b
172− ?: |(?=(~ q.b) (vor n.a n.q.b))
174+ ?: |(?=($~ q.b) (vor n.a n.q.b))
173175 [n.a l.a q.b]
174176 [n.q.b [n.a l.a l.q.b] r.q.b]
175177 ::
@@ -177,7 +179,7 @@ Source
177179Examples
178180--------
179181
180− ~zod/try=> =s (~(gas to *(qeu ,@)) `(list ,@)`~[1 2 3])
182+ ~zod/try=> =s (~(gas to *(qeu @)) `(list @)`~[1 2 3])
181183 ~zod/try=> ~(get to s)
182184 [p=1 q={3 2}]
183185 ~zod/try=> ~(get to ~)
@@ -189,12 +191,12 @@ Examples
189191
190192Remove last element
191193
192−Removes the head of [`++queue`]() `a`, producing the resulting queue.
194+Removes the head of `++queue` `a`, producing the resulting queue.
193195
194196Accepts
195197-------
196198
197−`a` is a [queue]().
199+`a` is a queue.
198200
199201Produces
200202--------
@@ -207,14 +209,14 @@ Source
207209 +- nap :: removes head
208210 ?> ?=(^ a)
209211 ?: =(~ l.a) r.a
210− =+ b=get(+< l.a)
211− bal(+< ^+(a [p.b q.b r.a]))
212+ =+ b=get(a l.a)
213+ bal(a ^+(a [p.b q.b r.a]))
212214 ::
213215
214216Examples
215217--------
216218
217− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 5 6 ~])
219+ ~zod/try=> =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 ~])
218220 ~zod/try=> -.a
219221 n=6
220222 ~zod/try=> =b ~(nap to a)
@@ -231,13 +233,13 @@ Examples
231233
232234Insert
233235
234−Accept any [noun]() `b` and adds to [`++queue`]() `a` as the head, producing the
236+Accept any noun `b` and adds to `++queue` `a` as the head, producing the
235237resulting queue.
236238
237239Accepts
238240-------
239241
240−`a` is a [queue]().
242+`a` is a queue.
241243
242244`b` is any noun.
243245
@@ -250,17 +252,18 @@ Source
250252------
251253
252254 +- put :: insert new tail
253− |* b=*
255+ |* b/*
254256 |- ^+ a
255257 ?~ a
256258 [b ~ ~]
257− bal(+< a(l $(a l.a)))
259+ bal(a a(l $(a l.a)))
258260 ::
259261
262+
260263Examples
261264--------
262265
263− ~zod/try=> (~(gas to `(qeu ,@)`~) `(list ,@)`[3 1 2 4 5 6 ~])
266+ ~zod/try=> (~(gas to `(qeu @)`~) `(list @)`[3 1 2 4 5 6 ~])
264267 ~zod/try=> (~(put to a) 7)
265268 {7 6 5 4 2 1 3}
266269
@@ -270,18 +273,19 @@ Examples
270273
271274Queue to list
272275
273−Produces [`++queue`]() `a` as a [`++list`]() from front to back.
276+Produces `++queue` `a` as a `++list` from front to back.
274277
275278Accepts
276279-------
277280
278−`a` is a [queue]().
281+`a` is a queue.
279282
280283Source
281284------
282285
283− +- tap :: queue to list
284− |= b=(list ,_?>(?=(^ a) n.a))
286+ +- tap :: adds list to end
287+ |= b/(list _?>(?=(^ a) n.a))
288+ =+ z=0 :: XX breaks jet match
285289 ^+ b
286290 ?~ a
287291 b
@@ -291,22 +295,22 @@ Source
291295Examples
292296--------
293297
294− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[3 1 2 4 5 6 ~])
298+ ~zod/try=> =a (~(gas to `(qeu @)`~) `(list @)`[3 1 2 4 5 6 ~])
295299 ~zod/try=> `*`a
296300 [6 0 2 [4 [5 0 0] 0] 1 0 3 0 0]
297− ~zod/try=> (~(tap to a) `(list ,@)`[99 100 101 ~])
301+ ~zod/try=> (~(tap to a) `(list @)`[99 100 101 ~])
298302 ~[3 1 2 4 5 6 99 100 101]
299303
300304------------------------------------------------------------------------
301305
302306### `+-top:to`
303307
304−Produces the head of [`++queue`]() `a` as a [`++unit`]() (an empty queue has no head).
308+Produces the head of `++queue` `a` as a `++unit` (an empty queue has no head).
305309
306310Accepts
307311-------
308312
309−`a` is a [queue]().
313+`a` is a queue.
310314
311315Produces
312316--------
@@ -317,14 +321,14 @@ Source
317321------
318322
319323 +- top :: produces head
320− |- ^- (unit ,_?>(?=(^ a) n.a))
324+ |- ^- (unit _?>(?=(^ a) n.a))
321325 ?~ a ~
322326 ?~(r.a [~ n.a] $(a r.a))
323327
324328Examples
325329--------
326330
327− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 5 6 ~])
331+ ~zod/try=> =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 ~])
328332 ~zod/try=> ~(top to a)
329333 [~ 1]
330334
docs/system/hoon/library/src/2n/gate/cork.md+3−2
@@ -9,14 +9,15 @@ Build `f` such that `(f x) .= (b (a x))`.
99Source
1010------
1111
12− ++ cork |*([a=_,* b=gate] (corl b a)) :: compose forward
12+ ++ cork |*({a/_|=(* **) b/gate} (corl b a)) :: compose forward
13+
1314
1415Examples
1516--------
1617
1718 ~zod/try=> (:(cork dec dec dec) 20)
1819 17
19− ~zod/try=> =mal (mo (limo a/15 b/23 ~))
20+ ~zod/try=> =mal (mo (limo a+15 b+23 ~))
2021 ~zod/try=> ((cork ~(got by mal) dec) %a)
2122 14
2223 ~zod/try=> ((cork ~(got by mal) dec) %b)
docs/system/hoon/library/src/2n/gate/corl.md+4−2
@@ -12,9 +12,11 @@ Source
1212------
1313
1414 ++ corl :: compose backwards
15− |* [a=gate b=_,*]
16− |= c=_+<.b
15+ |* {a/gate b/_|=(* **)}
16+ =< +:|.((a (b))) :: span check
17+ |* c/_+<.b
1718 (a (b c))
19+ ::
1820
1921Examples
2022--------
docs/system/hoon/library/src/2n/gate/curr.md+6−5
@@ -7,9 +7,9 @@ Right curry a gate, binding the tail of its sample
77Accepts
88-------
99
10−`a` is a [gate]().
10+`a` is a gate.
1111
12−`c` is a [noun]().
12+`c` is a noun.
1313
1414Produces
1515--------
@@ -18,10 +18,11 @@ Produces
1818Source
1919------
2020
21− ++ curr
22− |* [a=_|=(^ _*) c=*]
23− |* b=_+<+.a
21+ ++ curr :: curry right
22+ |* {a/_|=(^ **) c/*}
23+ |* b/_+<+.a
2424 (a b c)
25+ ::
2526
2627Examples
2728--------
docs/system/hoon/library/src/2n/gate/cury.md+8−6
@@ -5,22 +5,24 @@ Curry a gate, binding the head of its sample
55Accepts
66-------
77
8−`a` is a [gate]().
8+`a` is a gate.
99
10−`b` is a [noun]().
10+`b` is a noun.
1111
1212Produces
1313--------
1414
15−A [gate]().
15+A gate.
1616
1717Source
1818------
1919
20− ++ cury
21− |* [a=_|=(^ _*) b=*]
22− |* c=_+<+.a
20+ ++ cury :: curry left
21+ |* {a/_|=(^ **) b/*}
22+ |* c/_+<+.a
2323 (a b c)
24+ ::
25+
2426
2527Examples
2628--------
docs/system/hoon/library/src/2n/gate/hard.md+7−8
@@ -6,21 +6,20 @@ not.
66Source
77------
88
9− ++ hard
10− |* han=$+(* *)
11− |= fud=* ^- han
12− ~| %hard
13− =+ gol=(han fud)
14− ?>(=(gol fud) gol)
9+ ++ cury :: curry left
10+ |* {a/_|=(^ **) b/*}
11+ |* c/_+<+.a
12+ (a b c)
13+ ::
1514
1615Examples
1716--------
1817
1918 ~zod/try=> ((hard (list)) (limo [1 2 3 ~]))
2019 ~[1 2 3]
21− ~zod/try=> ((hard ,@) (add 2 2))
20+ ~zod/try=> ((hard @) (add 2 2))
2221 4
23− ~zod/try=> ((hard ,@t) (crip "Tape to cord, bro!"))
22+ ~zod/try=> ((hard @t) (crip "Tape to cord, bro!"))
2423 'Tape to cord, bro'
2524 ~zod/try=> ((hard tape) (crip "...Tape to cord, bro?..."))
2625 ! hard
docs/system/hoon/library/src/2n/gate/soft.md+9−8
@@ -6,24 +6,25 @@ is not.
66Source
77------
88
9− ++ soft
10− |* han=$+(* *)
11− |= fud=* ^- (unit han)
9+ ++ soft :: maybe coerce to span
10+ |* han/$-(* *)
11+ |= fud/* ^- (unit han)
1212 =+ gol=(han fud)
1313 ?.(=(gol fud) ~ [~ gol])
14+ ::
1415
1516Examples
1617--------
1718
18− ~zod/try=> ((soft ,%4) (add 2 2))
19+ ~zod/try=> ((soft %4) (add 2 2))
1920 [~ %4]
20− ~zod/try=> ((soft ,@) (add 2 2))
21+ ~zod/try=> ((soft @) (add 2 2))
2122 [~ 4]
22− ~zod/try=> ((soft ,%5) (add 2 2))
23+ ~zod/try=> ((soft %5) (add 2 2))
2324 ~
24− ~zod/try=> ((soft ,@t) (crip "Tape to cord, Woohoo!"))
25+ ~zod/try=> ((soft @t) (crip "Tape to cord, Woohoo!"))
2526 [~ 'Tape to cord, Woohoo!']
26− ~zod/try=> ((soft ,@t) (trip 'Cmon man... Tape to cord? Please?!'))
27+ ~zod/try=> ((soft @t) (trip 'Cmon man... Tape to cord? Please?!'))
2728 ~
2829
2930
docs/system/hoon/library/src/2o/mold/jar.md+4−3
@@ -1,17 +1,18 @@
11### `++jar`
22
33
4−Tile generator. A [`++jar`]() is a [`++map`]() of [`++list`]().
4+Tile generator. A `++jar` is a `++map` of `++list`.
55
66Source
77------
88
9− ++ jar |*([a=_,* b=_,*] (map a (list b))) :: map of lists
9+ ++ jar |*({a/$-(* *) b/$-(* *)} (map a (list b))) :: map of lists
10+
1011
1112Examples
1213--------
1314
14−See also: [`++ja`](), [`++by`](), [`++map`](), [`++list`]()
15+See also: `++ja`, `++by`, `++map`, `++list`
1516
1617 ~zod/try=> =a (limo [1 2 ~])
1718 ~zod/try=> a
docs/system/hoon/library/src/2o/mold/jug.md+3−2
@@ -1,11 +1,12 @@
11### `++jug`
22
3−[mold]() generator. A `++jug` is a [`++map`]() of [`++set`]()s.
3+mold generator. A `++jug` is a `++map` of `++set`s.
44
55Source
66------
77
8− ++ jug |*([a=_,* b=_,*] (map a (set b))) :: map of sets
8+ ++ jug |*({a/$-(* *) b/$-(* *)} (map a (set b))) :: map of sets
9+
910
1011Examples
1112--------
docs/system/hoon/library/src/2o/mold/map.md+12−11
@@ -2,26 +2,27 @@
22
33Map
44
5−[mold]() generator. A `++map` is a [treap](http://en.wikipedia.org/wiki/Treap) of
6−key, value pairs.
5+mold generator. A `++map` is a treap of
6+key-value pairs.
77
88
99Source
1010------
1111
12− ++ map |* [a=_,* b=_,*] :: associative tree
12+ ++ map |* {a/$-(* *) b/$-(* *)} :: associative tree
13+ $@($~ {n/{p/a q/b} l/(map a b) r/(map a b)}) ::
14+
1315
1416Examples
1517--------
1618
17−See also: [`++by`]()
18−
19− ~zod/try=> :type; *(map ,@t ,@u)
20− {}
21− nlr([p=@t q=@u])
22− ~zod/try=> `(map ,@ta ,@ud)`(mo (limo a/1 b/2 ~))
23− {[p=~.a q=1] [p=~.b q=2]}
24−
19+See also: `++by`
2520
21+ ~zod/try=>? *(map @t @u)
22+ nlr({p/@t q/@u})
23+ {}
24+ ~zod/try=> (molt `(list (pair * *))`[[a+1 b+2] ~])
25+ {[p=[97 1] q=[98 2]]}
26+
2627
2728***
docs/system/hoon/library/src/2o/mold/qeu.md+3−4
@@ -2,16 +2,15 @@
22
33Queue
44
5−[mold]() generator. An ordered [treap](http://en.wikipedia.org/wiki/Treap) of
5+mold generator. An ordered [treap](http://en.wikipedia.org/wiki/Treap) of
66items.
77
88Source
99------
1010
11− ++ qeu |* a=_,* :: queue
12− $|(~ [n=a l=(qeu a) r=(qeu a)]) ::
11+ ++ qeu |* a/$-(* *) :: queue
12+ $@($~ {n/a l/(qeu a) r/(qeu a)}) ::
1313
14−See also: [`++to`]()
1514
1615Examples
1716--------
docs/system/hoon/library/src/2o/mold/set.md+5−5
@@ -2,19 +2,19 @@
22
33Set
44
5−[mold]() generator. A `++set` is a
6−[treap](http://en.wikipedia.org/wiki/Treap) with unique values.
5+mold generator. A `++set` is a treap with unique values.
76
87Source
98------
109
11− ++ set |* a=_,* :: set
12− $|(~ [n=a l=(set a) r=(set a)]) ::
10+ ++ set |* a/$-(* *) :: set
11+ $@($~ {n/a l/(set a) r/(set a)}) ::
12+
1313
1414Examples
1515--------
1616
17−See also: [`++in`]()
17+See also: `++in`
1818
1919 ~zod/try=> (sa "abc")
2020 {~~a ~~c ~~b}
docs/system/hoon/library/src/2p/gate/cue.md+6−6
@@ -7,24 +7,24 @@ Produces a noun unpacked from atom `a`. The inverse of jam.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212Produces
1313--------
1414
15−A [`++noun`]().
15+A `++noun`.
1616
1717Source
1818------
1919
20− ++ cue :: unpack atom to noun
20+ ++ cue :: unpack
2121 ~/ %cue
22− |= a=@
22+ |= a/@
2323 ^- *
2424 =+ b=0
25− =+ m=`(map ,@ ,*)`~
25+ =+ m=`(map @ *)`~
2626 =< q
27− |- ^- [p=@ q=* r=_m]
27+ |- ^- {p/@ q/* r/(map @ *)}
2828 ?: =(0 (cut 0 [b 1] a))
2929 =+ c=(rub +(b) a)
3030 [+(p.c) q.c (~(put by m) b q.c)]
docs/system/hoon/library/src/2p/gate/jam.md+4−4
@@ -7,7 +7,7 @@ Produces an atom unpacked from noun `a`. The inverse of cue.
77Accepts
88-------
99
10−`a` is a [noun]().
10+`a` is a noun.
1111
1212Produces
1313--------
@@ -19,12 +19,12 @@ Source
1919
2020 ++ jam :: pack
2121 ~/ %jam
22− |= a=*
22+ |= a/*
2323 ^- @
2424 =+ b=0
25− =+ m=`(map ,* ,@)`~
25+ =+ m=`(map * @)`~
2626 =< q
27− |- ^- [p=@ q=@ r=_m]
27+ |- ^- {p/@ q/@ r/(map * @)}
2828 =+ c=(~(get by m) a)
2929 ?~ c
3030 => .(m (~(put by m) a b))
docs/system/hoon/library/src/2p/gate/mat.md+4−3
@@ -19,16 +19,17 @@ A cell of two atoms, `p` and `q`.
1919Source
2020------
2121
22− ++ mat :: length-encode
22+ ++ mat :: length-encode
2323 ~/ %mat
24− |= a=@
25− ^- [p=@ q=@]
24+ |= a/@
25+ ^- {p/@ q/@}
2626 ?: =(0 a)
2727 [1 1]
2828 =+ b=(met 0 a)
2929 =+ c=(met 0 b)
3030 :- (add (add c c) b)
3131 (cat 0 (bex c) (mix (end 0 (dec c) b) (lsh 0 (dec c) a)))
32+ ::
3233
3334
3435Examples
docs/system/hoon/library/src/2p/gate/rub.md+2−2
@@ -24,8 +24,8 @@ Source
2424
2525 ++ rub :: length-decode
2626 ~/ %rub
27− |= [a=@ b=@]
28− ^- [p=@ q=@]
27+ |= {a/@ b/@}
28+ ^- {p/@ q/@}
2929 =+ ^= c
3030 =+ [c=0 m=(met 0 b)]
3131 |- ?< (gth c m)
docs/system/hoon/library/src/2q/mold/char.md+3−3
@@ -2,14 +2,14 @@
22
33Char
44
5−A single character. [odor]() [`@tD`]() designates a single unicode byte. All
6−parsers consume [`++tape`]()s, which are lists of `++char`.
5+A single character. odor `@tD` designates a single unicode byte. All
6+parsers consume `++tape`s, which are lists of `++char`.
77
88
99Source
1010------
1111
12− ++ char ,@tD :: UTF-8 byte
12+ ++ char @tD :: UTF-8 byte
1313
1414Examples
1515--------
docs/system/hoon/library/src/2q/mold/cord.md+4−4
@@ -2,19 +2,19 @@
22
33UTF-8 text
44
5−One of Hoon's two string types (the other being [`++tape`]()). A cord is an
6−atom of UTF-8 text. [`++trip`]() and [`++crip`]() convert between cord and
5+One of Hoon's two string types (the other being `++tape`). A cord is an
6+atom of UTF-8 text. `++trip` and `++crip` convert between cord and
77`++tape`.
88
99Source
1010------
1111
12− ++ cord ,@t :: text atom (UTF-8)
12+ ++ cord @t :: text atom (UTF-8)
1313
1414Examples
1515--------
1616
17−Odor [`@t`]() designates a Unicode atom, little-endian: the first character
17+Odor `@t` designates a Unicode atom, little-endian: the first character
1818in the text is the low byte.
1919
2020 ~zod/try=> `@ux`'foobar'
docs/system/hoon/library/src/2q/mold/date.md+4−3
@@ -3,17 +3,18 @@
33Point in time
44
55A boolean designating AD or BC, a year atom, a month
6−atom, and a [`++tarp`](), which is a day atom and a time.
6+atom, and a `++tarp`, which is a day atom and a time.
77
88Source
99------
1010
11− ++ date ,[[a=? y=@ud] m=@ud t=tarp] :: parsed date
11+ ++ date {{a/? y/@ud} m/@ud t/tarp} :: parsed date
12+
1213
1314Examples
1415--------
1516
16−See also: [`++year`](), [`++yore`]() [`++stud`](), [`++dust`]()
17+See also: `++year`, `++yore` `++stud`, `++dust`
1718
1819 ~zod/try=> `date`(yore ~2014.6.6..21.09.15..0a16)
1920 [[a=%.y y=2.014] m=6 t=[d=6 h=21 m=9 s=15 f=~[0xa16]]]
docs/system/hoon/library/src/2q/mold/tank.md+8−8
@@ -10,16 +10,16 @@ list of `++tank` delimted by the strings in `p`.
1010Source
1111------
1212
13− ++ tank $% [%leaf p=tape] :: printing formats
14− $: %palm :: backstep list
15− p=[p=tape q=tape r=tape s=tape] ::
16− q=(list tank) ::
13+ ++ tank $% {$leaf p/tape} :: printing formats
14+ $: $palm :: backstep list
15+ p/{p/tape q/tape r/tape s/tape} ::
16+ q/(list tank) ::
1717 == ::
18− $: %rose :: flat list
19− p=[p=tape q=tape r=tape] :: mid open close
20− q=(list tank) ::
18+ $: $rose :: flat list
19+ p/{p/tape q/tape r/tape} :: mid open close
20+ q/(list tank) ::
2121 == ::
22− ==
22+ == ::
2323
2424Examples
2525--------
docs/system/hoon/library/src/2q/mold/tape.md+1−1
@@ -3,7 +3,7 @@
33
44List of chars
55
6−One of Hoon's two string types, the other being [`++cord`](). A tape is a
6+One of Hoon's two string types, the other being `++cord`. A tape is a
77list of chars.
88
99Source
docs/system/hoon/library/src/2q/mold/tarp.md+4−4
@@ -2,18 +2,18 @@
22
33Day through second
44
5−The remaining part of a [`++date`](): day, hour, minute, second and a list
6−of [`@ux`]() for precision.
5+The remaining part of a `++date`: day, hour, minute, second and a list
6+of `@ux` for precision.
77
88Source
99------
1010
11− @ud h=@ud m=@ud s=@ud f=(list ,@ux)] :: parsed time
11+ ++ tarp {d/@ud h/@ud m/@ud s/@ud f/(list @ux)} :: parsed time
12+
1213
1314Examples
1415--------
1516
16−See also: [`++date`](), [`++yell`[]()/`++yule`]()
1717
1818 ~zod/try=> -<-
1919 ~2014.9.20..00.43.33..b52a
docs/system/hoon/library/src/2q/mold/term.md+3−3
@@ -4,15 +4,15 @@ Hoon constants
44
55A restricted text atom for Hoon constants. The only characters permitted are
66lowercase ASCII, `-`, and `0-9`, the latter two of which can neither be the first or last
7−character. The syntax for [`@tas`]() is the text itself, always preceded by `%`.
8−This means a term is always [cubical](). The empty `@tas` has a special syntax,
7+character. The syntax for `@tas` is the text itself, always preceded by `%`.
8+This means a term is always cubical. The empty `@tas` has a special syntax,
99`$`.
1010
1111
1212Source
1313------
1414
15− ++ term ,@tas :: Hoon ASCII subset
15+ ++ term @tas :: Hoon ASCII subset
1616
1717Examples
1818--------
docs/system/hoon/library/src/2q/mold/wain.md+2−22
@@ -2,33 +2,13 @@
22
33 ++ wain (list cord) :: text lines (no \n)
44
5−A list of lines. A `++wain` is used instead of a single [`++cord`]() with
5+A list of lines. A `++wain` is used instead of a single `++cord` with
66`\n`.
77
8−See also: [`++lore`](), [`++role`]()
8+See also: `++lore`, `++role`
99
1010 ~zod/try=> `wain`/som/del/rok
1111 <|som del rok|>
12− ~zod/try=> `wain`(lore ^:@t/=main=/bin/tree/hoon)
13− <|
14− !:
15− :: /===/bin/tree/hoon
16− |= ^
17− |= [pax=path fla=$|(~ [%full ~])]
18− =- ~[te/-]~
19− =+ len=(lent pax)
20− =+ rend=?~(fla |=(a=path +:(spud (slag len a))) spud)
21− |- ^- wain
22− =+ ark=;;(arch .^(cy/pax))
23− =- ?~ q.ark -
24− [(crip (rend pax)) -]
25− %- zing
26− %- turn :_ |=(a=@t ^$(pax (weld pax `path`/[a])))
27− %- sort :_ aor
28− %- turn :_ |=([a=@t ~] a)
29− (~(tap by r.ark))
30− |>
31−
3212
3313
3414***
docs/system/hoon/library/src/2q/mold/wall.md+5−11
@@ -3,7 +3,7 @@
33List of lines
44
55
6−A `++wall` is used instead of a single [`++tape`]() with
6+A `++wall` is used instead of a single `++tape` with
77`\n`.
88
99Source
@@ -14,20 +14,14 @@ Source
1414Examples
1515--------
1616
17−See also: [`++wash`]()
17+See also: `++wash`
1818
19− ~zod/try=> `wall`(wash [0 20] leaf/<(bex 256)>)
19+ ~zod/try=> `wall`(wash [0 20] leaf+<(bex 256)>)
2020 <<
21− "\/115.792.089.237.\/"
22− " 316.195.423.570."
23− " 985.008.687.907."
24− " 853.269.984.665."
25− " 640.564.039.457."
26− " 584.007.913.129."
27− " 639.936"
28− "\/ \/"
21+ "115.792.089.237.316.195.423.570.985.008.687.907.853.269.984.665.640.564.039.457.584.007.913.129.639.936"
2922 >>
3023
3124
3225
26+
3327***
docs/system/hoon/library/src/3a/core/fe.md+25−24
@@ -7,22 +7,22 @@ Core containing XX
77Accepts
88-------
99
10−`a` is a [`++bloq`]().
10+`a` is a `++bloq`.
1111
1212Source
1313------
1414
15− |_ a=bloq
15+ |_ a=bloq
1616
1717### `++dif`
1818
19−Produces the difference between two [atom]()s in the modular basis
19+Produces the difference between two atoms in the modular basis
2020representation.
2121
2222Accepts
2323-------
2424
25−`a` is a [`++bloq`]().
25+`a` is a `++bloq`.
2626
2727`b` is an atom.
2828
@@ -31,12 +31,12 @@ Accepts
3131Produces
3232--------
3333
34−A [`@s`]()
34+A `@s`
3535
3636Source
3737------
3838
39− ++ dif |=([b=@ c=@] (sit (sub (add out (sit b)) (sit c))))
39+ ++ dif |=([b/@ c/@] (sit (sub (add out (sit b)) (sit c))))
4040
4141Examples
4242--------
@@ -69,7 +69,7 @@ Inverts the order of the modular field.
6969Accepts
7070-------
7171
72−`b` is a [`++bloq`]().
72+`b` is a `++bloq`.
7373
7474Produces
7575--------
@@ -80,7 +80,7 @@ An atom.
8080Source
8181------
8282
83− ++ inv |=(b=@ (sub (dec out) (sit b)))
83+ ++ inv |=(b/@ (sub (dec out) (sit b)))
8484
8585Examples
8686--------
@@ -109,17 +109,17 @@ Revereses bytes within block.
109109Accepts
110110-------
111111
112−`b` is a [`++bloq`]().
112+`b` is a `++bloq`.
113113
114114Produces
115115--------
116116
117−An atom.=
117+An atom.
118118
119119Source
120120------
121121
122− ++ net |= b=@ ^- @
122+ ++ net |= b/@ ^- @
123123 => .(b (sit b))
124124 ?: (lte a 3)
125125 b
@@ -189,12 +189,12 @@ The maximum integer value that the current block can store.
189189Accepts
190190-------
191191
192−A [`++bloq`]().
192+A `++bloq`.
193193
194194Produces
195195--------
196196
197−An [atom]().
197+An atom.
198198
199199Source
200200------
@@ -234,7 +234,7 @@ Roll `d` to the left by `c` `b`-sized blocks.
234234Accepts
235235-------
236236
237−`a` is a [`++bloq`]().
237+`a` is a `++bloq`.
238238
239239`b` is a `++bloq`.
240240
@@ -250,7 +250,7 @@ An atom.
250250Source
251251------
252252
253− ++ rol |= [b=bloq c=@ d=@] ^- @ :: roll left
253+ ++ rol |= [b/bloq c/@ d/@] ^- @ :: roll left
254254 =+ e=(sit d)
255255 =+ f=(bex (sub a b))
256256 =+ g=(mod c f)
@@ -281,11 +281,11 @@ Roll `d` to the right by `c` `b`-sized blocks.
281281Accepts
282282-------
283283
284−`a` is a [`++bloq`]().
284+`a` is a `++bloq`.
285285
286286`b` is a `++bloq`.
287287
288−`c` is an [atom]().
288+`c` is an atom.
289289
290290`d` is an atom.
291291
@@ -297,12 +297,13 @@ An atom.
297297Source
298298------
299299
300− ++ ror |= [b=bloq c=@ d=@] ^- @ :: roll right
300+ ++ ror |= {b/bloq c/@ d/@} ^- @ :: roll right
301301 =+ e=(sit d)
302302 =+ f=(bex (sub a b))
303303 =+ g=(mod c f)
304304 (sit (con (rsh b g e) (lsh b (sub f g) e)))
305305
306+
306307Examples
307308--------
308309
@@ -330,9 +331,9 @@ Sum two numbers in this modular field.
330331Accepts
331332-------
332333
333−`a` is a [`++bloq`]().
334+`a` is a `++bloq`.
334335
335−`b` is an [atom]().
336+`b` is an atom.
336337
337338`c` is an atom.
338339
@@ -344,7 +345,7 @@ An atom.
344345Source
345346------
346347
347− ++ sum |=([b=@ c=@] (sit (add b c))) :: wrapping add
348+ ++ sum |=([b/@ c/@] (sit (add b c))) :: wrapping add
348349
349350Examples
350351--------
@@ -368,12 +369,12 @@ Examples
368369
369370Atom in mod block representation
370371
371−Produce an [atom]() in the current modular block representation.
372+Produce an atom in the current modular block representation.
372373
373374Accepts
374375-------
375376
376−`a` is a [`++bloq`]().
377+`a` is a `++bloq`.
377378
378379`b` is an atom.
379380
@@ -385,7 +386,7 @@ An atom.
385386Source
386387------
387388
388− ++ sit |=(b=@ (end a 1 b)) :: enforce modulo
389+ ++ sit |=(b/@ (end a 1 b)) :: enforce modulo
389390
390391Examples
391392--------
docs/system/hoon/library/src/3a/core/si.md+32−32
@@ -16,17 +16,17 @@ Produces the absolute value of a signed integer.
1616Accepts
1717-------
1818
19−`a` is a signed integer, [`@s`]().
19+`a` is a signed integer, `@s`.
2020
2121Produces
2222--------
2323
24−An [atom]().
24+An atom.
2525
2626Source
2727------
2828
29− ++ abs |=(a=@s (add (end 0 1 a) (rsh 0 1 a))) :: absolute value
29+ ++ abs |=(a/@s (add (end 0 1 a) (rsh 0 1 a))) :: absolute value
3030
3131Examples
3232--------
@@ -49,20 +49,20 @@ Produces the difference between two signed integers `b` and `c`.
4949Accepts
5050-------
5151
52−`a` is a signed integer, [`@s`]().
52+`a` is a signed integer, `@s`.
5353
5454`b` is a signed integer, `@s`.
5555
5656Produces
5757--------
5858
59−A [`@s`]().
59+A `@s`.
6060
6161
6262Source
6363------
6464
65− ++ dif |= [a=@s b=@s] :: subtraction
65+ ++ dif |= [a/@s b/@s] :: subtraction
6666 (sum a (new !(syn b) (abs b)))
6767
6868Examples
@@ -90,7 +90,7 @@ Accepts
9090
9191`a` is a signed integer, `@s`.
9292
93−`b` is an [atom]().
93+`b` is an atom.
9494
9595Produces
9696--------
@@ -100,7 +100,7 @@ An atom.
100100Source
101101------
102102
103− ++ dul |= [a=@s b=@] :: modulus
103+ ++ dul |= [a/@s b/@] :: modulus
104104 =+(c=(old a) ?:(-.c (mod +.c b) (sub b +.c)))
105105
106106Examples
@@ -128,19 +128,19 @@ Produces the quotient of two signed integers.
128128Accepts
129129-------
130130
131−`a` is a signed integer, [`@s`].
131+`a` is a signed integer, `@s`.
132132
133133`b` is a signed integer, `@s`.
134134
135135Produces
136136--------
137137
138−An [atom]().
138+An atom.
139139
140140Source
141141------
142142
143− ++ fra |= [a=@s b=@s] :: divide
143+ ++ fra |= [a/@s b/@s] :: divide
144144 (new =(0 (mix (syn a) (syn b))) (div (abs a) (abs b)))
145145
146146Examples
@@ -157,7 +157,7 @@ Examples
157157
158158Signed integer
159159
160−Produces a signed integer from a loobean sign value `a` and an [atom]() `b`.
160+Produces a signed integer from a loobean sign value `a` and an atom `b`.
161161
162162Accepts
163163-------
@@ -169,12 +169,12 @@ Accepts
169169Produces
170170--------
171171
172−A [`@s`]()
172+A `@s`
173173
174174Source
175175------
176176
177− ++ new |= [a=? b=@] :: [sign value] to @s
177+ ++ new |= [a/? b/@] :: [sign value] to @s
178178 `@s`?:(a (mul 2 b) ?:(=(0 b) 0 +((mul 2 (dec b)))))
179179
180180Examples
@@ -191,24 +191,24 @@ Examples
191191
192192### `++old`
193193
194−[sign value]
194+sign value
195195
196196Produces the cell `[sign value]` representations of a signed integer.
197197
198198Accepts
199199-------
200200
201−`a` is a [`@s`]().
201+`a` is a `@s`.
202202
203203Produces
204204--------
205205
206−A cell of a boolean and an [atom]().
206+A cell of a boolean and an atom.
207207
208208Source
209209------
210210
211− ++ old |=(a=@s [(syn a) (abs a)]) :: [sign value]
211+ ++ old |=(a/@s [(syn a) (abs a)]) :: [sign value]
212212
213213Examples
214214--------
@@ -236,7 +236,7 @@ Produces the product of two signed integers.
236236Accepts
237237-------
238238
239−`a` is a [`@s`]().
239+`a` is a `@s`.
240240
241241`b` is a `@s`.
242242
@@ -248,7 +248,7 @@ A `@s`.
248248Source
249249------
250250
251− ++ pro |= [a=@s b=@s] :: multiplication
251+ ++ pro |= [a/@s b/@s] :: multiplication
252252 (new =(0 (mix (syn a) (syn b))) (mul (abs a) (abs b)))
253253
254254Examples
@@ -274,7 +274,7 @@ Produces the remainder from a division of two signed integers.
274274Accepts
275275-------
276276
277−`a` is a [`@s`]().
277+`a` is a `@s`.
278278
279279`b` is a `@s`.
280280
@@ -286,7 +286,7 @@ A `@sd`.
286286Source
287287------
288288
289− ++ rem |=([a=@s b=@s] (dif a (pro b (fra a b)))) :: remainder
289+ ++ rem |=([a/@s b/@s] (dif a (pro b (fra a b)))) :: remainder
290290
291291Examples
292292--------
@@ -313,7 +313,7 @@ Sum two signed integers.
313313Accepts
314314-------
315315
316−`b` is a [`@s`]().
316+`b` is a `@s`.
317317
318318`c` is a signed integer `@s`.
319319
@@ -325,7 +325,7 @@ A `@s`.
325325Source
326326------
327327
328− ++ sum |= [a=@s b=@s] :: addition
328+ ++ sum |= [a/@s b/@s] :: addition
329329 ~| %si-sum
330330 =+ [c=(old a) d=(old b)]
331331 ?: -.c
@@ -360,23 +360,23 @@ Signed from unsigned
360360
361361Produces a signed integer from an unsigned integer.
362362
363−Note that the result must be manually cast to some [`@s`]() odor to be
363+Note that the result must be manually cast to some `@s` odor to be
364364inferred as an unsigned integer in the type system.
365365
366366Accepts
367367-------
368368
369−`a` is a [`@u`]().
369+`a` is a `@u`.
370370
371371Produces
372372--------
373373
374−A [`@s`]().
374+A `@s`.
375375
376376Source
377377------
378378
379− ++ sun |=(a=@u (mul 2 a)) :: @u to @s
379+ ++ sun |=(a/@u (mul 2 a)) :: @u to @s
380380
381381Examples
382382--------
@@ -403,7 +403,7 @@ Produce the sign of a signed integer, where `&` is posiitve, and `|` is negative
403403Accepts
404404-------
405405
406−`a` is a [`@s`]().
406+`a` is a `@s`.
407407
408408Produces
409409--------
@@ -413,7 +413,7 @@ A boolean.
413413Source
414414------
415415
416− ++ syn |=(a=@s =(0 (end 0 1 a))) :: sign test
416+ ++ syn |=(a/@s =(0 (end 0 1 a))) :: sign test
417417
418418Examples
419419--------
@@ -436,7 +436,7 @@ Compare two signed integers.
436436Accepts
437437-------
438438
439−`b` is a [`@s`]().
439+`b` is a `@s`.
440440
441441`c` is a `@s`.
442442
@@ -448,7 +448,7 @@ A `@s`.
448448Source
449449------
450450
451− ++ cmp |= [a=@s b=@s] :: compare
451+ ++ cmp |= [a/@s b/@s] :: compare
452452 ^- @s
453453 ?: =(a b)
454454 --0
docs/system/hoon/library/src/3a/gate/egcd.md+4−3
@@ -2,12 +2,12 @@
22
33GCD
44
5− ++ egcd :: schneier's egcd
6− |= [a=@ b=@]
5+ ++ egcd !: :: schneier's egcd
6+ |= {a/@ b/@}
77 =+ si
88 =+ [c=(sun a) d=(sun b)]
99 =+ [u=[c=(sun 1) d=--0] v=[c=--0 d=(sun 1)]]
10− |- ^- [d=@ u=@ v=@]
10+ |- ^- {d/@ u/@s v/@s}
1111 ?: =(--0 c)
1212 [(abs d) d.u d.v]
1313 :: ?> ?& =(c (sum (pro (sun a) c.u) (pro (sun b) c.v)))
@@ -22,6 +22,7 @@ GCD
2222 ==
2323 ::
2424
25+
2526Greatest common denominator
2627
2728 ~zod/try=> (egcd 20 15)
docs/system/hoon/library/src/3c/core/yo.md+11−11
@@ -13,7 +13,7 @@ days from leap years in a century (24).
1313Produces
1414--------
1515
16−An [atom]().
16+An atom.
1717
1818Source
1919------
@@ -39,7 +39,7 @@ Number of seconds in a day.
3939Produces
4040--------
4141
42−An [atom]().
42+An atom.
4343
4444Source
4545------
@@ -63,7 +63,7 @@ XX Revisit
6363Produces
6464--------
6565
66−An [atom]().
66+An atom.
6767
6868Source
6969------
@@ -86,7 +86,7 @@ seconds in a minute by the minutes in an hour.
8686Produces
8787--------
8888
89−An [atom]().
89+An atom.
9090
9191Source
9292------
@@ -134,7 +134,7 @@ The number of seconds in a minute.
134134Produces
135135--------
136136
137−An [atom]().
137+An atom.
138138
139139Source
140140------
@@ -160,12 +160,12 @@ month at the year at that index.
160160Produces
161161--------
162162
163−A [`++list`]() of [`@ud`]()
163+A `++list` of `@ud`
164164
165165Source
166166------
167167
168− ++ moh `(list ,@ud)`[31 28 31 30 31 30 31 31 30 31 30 31 ~]
168+ ++ moh `(list @ud)`[31 28 31 30 31 30 31 31 30 31 30 31 ~]
169169
170170Examples
171171--------
@@ -188,12 +188,12 @@ month at the leap-year at that index.
188188Examples
189189--------
190190
191−A [`++list`]() of [`@ud`]()
191+A `++list` of `@ud`
192192
193193Source
194194------
195195
196− ++ moy `(list ,@ud)`[31 29 31 30 31 30 31 31 30 31 30 31 ~]
196+ ++ moy `(list @ud)`[31 29 31 30 31 30 31 31 30 31 30 31 ~]
197197
198198Examples
199199--------
@@ -215,7 +215,7 @@ number of seconds in four years.
215215Produces
216216--------
217217
218−An [atom]().
218+An atom.
219219
220220Source
221221------
@@ -240,7 +240,7 @@ seconds in a day by 365.
240240Produces
241241--------
242242
243−An [atom]().
243+An atom.
244244
245245Source
246246------
docs/system/hoon/library/src/3c/gate/yall.md+8−7
@@ -17,10 +17,10 @@ Produces
1717Source
1818------
1919
20− ++ yall :: day # to day of year
21− |= day=@ud
22− ^- [y=@ud m=@ud d=@ud]
23− =+ [era=0 cet=0 lep=_?]
20+ ++ yall :: day / to day of year
21+ |= day/@ud
22+ ^- {y/@ud m/@ud d/@ud}
23+ =+ [era=0 cet=0 lep=*?]
2424 => .(era (div day era:yo), day (mod day era:yo))
2525 => ^+ .
2626 ?: (lth day +(cet:yo))
@@ -28,18 +28,19 @@ Source
2828 => .(lep |, cet 1, day (sub day +(cet:yo)))
2929 .(cet (add cet (div day cet:yo)), day (mod day cet:yo))
3030 =+ yer=(add (mul 400 era) (mul 100 cet))
31− |- ^- [y=@ud m=@ud d=@ud]
31+ |- ^- {y/@ud m/@ud d/@ud}
3232 =+ dis=?:(lep 366 365)
3333 ?. (lth day dis)
3434 =+ ner=+(yer)
3535 $(yer ner, day (sub day dis), lep =(0 (end 0 2 ner)))
36− |- ^- [y=@ud m=@ud d=@ud]
36+ |- ^- {y/@ud m/@ud d/@ud}
3737 =+ [mot=0 cah=?:(lep moy:yo moh:yo)]
38− |- ^- [y=@ud m=@ud d=@ud]
38+ |- ^- {y/@ud m/@ud d/@ud}
3939 =+ zis=(snag mot cah)
4040 ?: (lth day zis)
4141 [yer +(mot) +(day)]
4242 $(mot +(mot), day (sub day zis))
43+ ::
4344
4445Examples
4546--------
docs/system/hoon/library/src/3c/gate/yawn.md+3−2
@@ -17,13 +17,13 @@ Accepts
1717Produces
1818--------
1919
20−A [`@ud`]().
20+A `@ud`.
2121
2222Source
2323------
2424
2525 ++ yawn :: days since Jesus
26− |= [yer=@ud mot=@ud day=@ud]
26+ |= {yer/@ud mot/@ud day/@ud}
2727 ^- @ud
2828 => .(mot (dec mot), day (dec day))
2929 => ^+ .
@@ -46,6 +46,7 @@ Source
4646 =+ nec=(sub yer 100)
4747 $(yer nec, day (add day ?:((yelp nec) 36.525 36.524)))
4848 (add day (mul (div yer 400) (add 1 (mul 4 36.524))))
49+ ::
4950
5051Examples
5152--------
docs/system/hoon/library/src/3c/gate/year.md+5−4
@@ -6,25 +6,26 @@ its `@d`representation.
66Accepts
77-------
88
9−`det` is a [`++date`]()
9+`det` is a `++date`
1010
1111Produces
1212--------
1313
14−A [`@d`]().
14+A `@d`.
1515
1616Source
1717------
1818
1919 ++ year :: date to @d
20− |= det=date
21− ^- @d
20+ |= det/date
21+ ^- @da
2222 =+ ^= yer
2323 ?: a.det
2424 (add 292.277.024.400 y.det)
2525 (sub 292.277.024.400 (dec y.det))
2626 =+ day=(yawn yer m.det d.t.det)
2727 (yule day h.t.det m.t.det s.t.det f.t.det)
28+ ::
2829
2930Examples
3031--------
docs/system/hoon/library/src/3c/gate/yell.md+4−2
@@ -8,12 +8,12 @@ Source
88------
99
1010 ++ yell :: tarp from @d
11− |= now=@d
11+ |= now/@d
1212 ^- tarp
1313 =+ sec=(rsh 6 1 now)
1414 =+ ^= fan
1515 =+ [muc=4 raw=(end 6 1 now)]
16− |- ^- (list ,@ux)
16+ |- ^- (list @ux)
1717 ?: |(=(0 raw) =(0 muc))
1818 ~
1919 => .(muc (dec muc))
@@ -25,6 +25,8 @@ Source
2525 =+ mit=(div sec mit:yo)
2626 => .(sec (mod sec mit:yo))
2727 [day hor mit sec fan]
28+ ::
29+
2830
2931Examples
3032--------
docs/system/hoon/library/src/3c/gate/yore.md+3−2
@@ -10,13 +10,13 @@ Accepts
1010Produces
1111--------
1212
13−A [`++date`]().
13+A `++date`.
1414
1515Source
1616------
1717
1818 ++ yore :: @d to date
19− |= now=@d
19+ |= now/@da
2020 ^- date
2121 =+ rip=(yell now)
2222 =+ ger=(yall d.rip)
@@ -24,6 +24,7 @@ Source
2424 [a=& y=(sub y.ger 292.277.024.400)]
2525 [a=| y=+((sub 292.277.024.400 y.ger))]
2626 [m.ger d.ger h.rip m.rip s.rip f.rip]
27+ ::
2728
2829Examples
2930--------
docs/system/hoon/library/src/3c/gate/yule.md+5−4
@@ -2,24 +2,24 @@
22
33Daily time to time atom
44
5−Accept a [`++tarp`](/doc/hoon/library/1#++tarp), a parsed daily time, and produces a time atom,
5+Accept a `++tarp`, a parsed daily time, and produces a time atom,
66`@d`.
77
88Accepts
99-------
1010
11−`rip` is a [`++tarp`](/doc/hoon/library/1#++tarp).
11+`rip` is a `++tarp`.
1212
1313Produces
1414--------
1515
16−A [`@d`]().
16+A `@d`.
1717
1818Source
1919------
2020
2121 ++ yule :: time atom
22− |= rip=tarp
22+ |= rip/tarp
2323 ^- @d
2424 =+ ^= sec ;: add
2525 (mul d.rip day:yo)
@@ -34,6 +34,7 @@ Source
3434 => .(muc (dec muc))
3535 (add (lsh 4 muc i.f.rip) $(f.rip t.f.rip))
3636 (con (lsh 6 1 sec) fac)
37+ ::
3738
3839Examples
3940--------
docs/system/hoon/library/src/3d/core/og.md+6−6
@@ -3,14 +3,14 @@
33
44 ++ og :: shax-powered rng
55 ~/ %og
6− |_ a=@
6+ |_ a/@
77
88XX document
99
1010### `++rad`
1111
1212 ++ rad :: random in range
13− |= b=@ ^- @
13+ |= b/@ ^- @
1414 =+ c=(raw (met 0 b))
1515 ?:((lth c b) c $(a +(a)))
1616 ::
@@ -20,7 +20,7 @@ XX document
2020### `++rads`
2121
2222 ++ rads :: random continuation
23− |= b=@
23+ |= b/@
2424 =+ r=(rad b)
2525 [r +>.$(a (shas %og-s r))]
2626
@@ -30,11 +30,11 @@ XX document
3030
3131 ++ raw :: random bits
3232 ~/ %raw
33− |= b=@ ^- @
33+ |= b/@ ^- @
3434 %+ can
3535 0
3636 =+ c=(shas %og-a (mix b a))
37− |- ^- (list ,[@ @])
37+ |- ^- (list [@ @])
3838 ?: =(0 b)
3939 ~
4040 =+ d=(shas %og-b (mix b (mix a c)))
@@ -47,7 +47,7 @@ XX document
4747### `++raws`
4848
4949 ++ raws :: random bits continuation
50− |= b=@
50+ |= b/@
5151 =+ r=(raw b)
5252 [r +>.$(a (shas %og-s r))]
5353 --
docs/system/hoon/library/src/3d/gate/shad.md+2−1
@@ -1,6 +1,7 @@
11### `++shad`
22
3− ++ shad |=(ruz=@ (shax (shax ruz))) :: double sha-256
3+ ++ shad |=(ruz/@ (shax (shax ruz))) :: double sha-256
4+
45
56XX document
67
docs/system/hoon/library/src/3d/gate/shaf.md+1−1
@@ -1,7 +1,7 @@
11### `++shaf`
22
33 ++ shaf :: half sha-256
4− |= [sal=@ ruz=@]
4+ |= [sal/@ ruz/@]
55 =+ haz=(shas sal ruz)
66 (mix (end 7 1 haz) (rsh 7 1 haz))
77 ::
docs/system/hoon/library/src/3d/gate/shak.md+1−1
@@ -1,7 +1,7 @@
11### `++shak`
22
33 ++ shak :: XX shd be PBKDF
4− |= [who=@p wud=@]
4+ |= [who/@p wud/@]
55 (shas (mix %shak who) wud)
66 ::
77
docs/system/hoon/library/src/3d/gate/shal.md+2−2
@@ -2,9 +2,9 @@
22
33 ++ shal :: sha-512 with length
44 ~/ %shal
5− |= [len=@ ruz=@] ^- @
5+ |= {len/@ ruz/@} ^- @
66 => .(ruz (cut 3 [0 len] ruz))
7− =+ [few==>(fe .(a 6)) wac=|=([a=@ b=@] (cut 6 [a 1] b))]
7+ =+ [few==>(fe .(a 6)) wac=|=({a/@ b/@} (cut 6 [a 1] b))]
88 =+ [sum=sum.few ror=ror.few net=net.few inv=inv.few]
99 =+ ral=(lsh 0 3 len)
1010 =+ ^= ful
docs/system/hoon/library/src/3d/gate/sham.md+1−1
@@ -1,7 +1,7 @@
11### `++sham`
22
33 ++ sham :: noun hash
4− |= yux=* ^- @uvH ^- @
4+ |= yux/* ^- @uvH ^- @
55 ?@ yux
66 (shaf %mash yux)
77 (shaf %sham (jam yux))
docs/system/hoon/library/src/3d/gate/shan.md+3−2
@@ -1,8 +1,8 @@
11### `++shan`
22
33 ++ shan :: sha-1 (deprecated)
4− |= ruz=@
5− =+ [few==>(fe .(a 5)) wac=|=([a=@ b=@] (cut 5 [a 1] b))]
4+ |= ruz/@
5+ =+ [few==>(fe .(a 5)) wac=|=({a/@ b/@} (cut 5 [a 1] b))]
66 =+ [sum=sum.few ror=ror.few rol=rol.few net=net.few inv=inv.few]
77 =+ ral=(lsh 0 3 (met 3 ruz))
88 =+ ^= ful
@@ -65,6 +65,7 @@
6565 :(sum (rol 0 5 a) fz e (wac 2 kbx) (wac j wox))
6666 :(sum (rol 0 5 a) fy e (wac 3 kbx) (wac j wox))
6767 $(j +(j), a tem, b a, c (rol 0 30 b), d c, e d)
68+ ::
6869
6970XX document
7071
docs/system/hoon/library/src/3d/gate/shas.md+1−1
@@ -1,7 +1,7 @@
11### `++shas`
22
33 ++ shas :: salted hash
4− |= [sal=@ ruz=@]
4+ |= [sal/@ ruz/@]
55 (shax (mix sal (shax ruz)))
66 ::
77
docs/system/hoon/library/src/3d/gate/shaw.md+1−1
@@ -1,7 +1,7 @@
11### `++shaw`
22
33 ++ shaw :: hash to nbits
4− |= [sal=@ len=@ ruz=@]
4+ |= [sal/@ len/@ ruz/@]
55 (~(raw og (shas sal (mix len ruz))) len)
66 ::
77
docs/system/hoon/library/src/3d/gate/shax.md+5−86
@@ -1,91 +1,10 @@
11### `++shax`
22
3− ++ shax :: sha-256
4− ~/ %shax
5− |= ruz=@ ^- @
6− ~| %sha
7− =+ [few==>(fe .(a 5)) wac=|=([a=@ b=@] (cut 5 [a 1] b))]
8− =+ [sum=sum.few ror=ror.few net=net.few inv=inv.few]
9− =+ ral=(lsh 0 3 (met 3 ruz))
10− =+ ^= ful
11− %+ can 0
12− :~ [ral ruz]
13− [8 128]
14− [(mod (sub 960 (mod (add 8 ral) 512)) 512) 0]
15− [64 (~(net fe 6) ral)]
16− ==
17− =+ lex=(met 9 ful)
18− =+ ^= kbx 0xc671.78f2.bef9.a3f7.a450.6ceb.90be.fffa.
19− 8cc7.0208.84c8.7814.78a5.636f.748f.82ee.
20− 682e.6ff3.5b9c.ca4f.4ed8.aa4a.391c.0cb3.
21− 34b0.bcb5.2748.774c.1e37.6c08.19a4.c116.
22− 106a.a070.f40e.3585.d699.0624.d192.e819.
23− c76c.51a3.c24b.8b70.a81a.664b.a2bf.e8a1.
24− 9272.2c85.81c2.c92e.766a.0abb.650a.7354.
25− 5338.0d13.4d2c.6dfc.2e1b.2138.27b7.0a85.
26− 1429.2967.06ca.6351.d5a7.9147.c6e0.0bf3.
27− bf59.7fc7.b003.27c8.a831.c66d.983e.5152.
28− 76f9.88da.5cb0.a9dc.4a74.84aa.2de9.2c6f.
29− 240c.a1cc.0fc1.9dc6.efbe.4786.e49b.69c1.
30− c19b.f174.9bdc.06a7.80de.b1fe.72be.5d74.
31− 550c.7dc3.2431.85be.1283.5b01.d807.aa98.
32− ab1c.5ed5.923f.82a4.59f1.11f1.3956.c25b.
33− e9b5.dba5.b5c0.fbcf.7137.4491.428a.2f98
34− =+ ^= hax 0x5be0.cd19.1f83.d9ab.9b05.688c.510e.527f.
35− a54f.f53a.3c6e.f372.bb67.ae85.6a09.e667
36− =+ i=0
37− |- ^- @
38− ?: =(i lex)
39− (rep 5 (turn (rip 5 hax) net))
40− =+ ^= wox
41− =+ dux=(cut 9 [i 1] ful)
42− =+ wox=(rep 5 (turn (rip 5 dux) net))
43− =+ j=16
44− |- ^- @
45− ?: =(64 j)
46− wox
47− =+ :* l=(wac (sub j 15) wox)
48− m=(wac (sub j 2) wox)
49− n=(wac (sub j 16) wox)
50− o=(wac (sub j 7) wox)
51− ==
52− =+ x=:(mix (ror 0 7 l) (ror 0 18 l) (rsh 0 3 l))
53− =+ y=:(mix (ror 0 17 m) (ror 0 19 m) (rsh 0 10 m))
54− =+ z=:(sum n x o y)
55− $(wox (con (lsh 5 j z) wox), j +(j))
56− =+ j=0
57− =+ :* a=(wac 0 hax)
58− b=(wac 1 hax)
59− c=(wac 2 hax)
60− d=(wac 3 hax)
61− e=(wac 4 hax)
62− f=(wac 5 hax)
63− g=(wac 6 hax)
64− h=(wac 7 hax)
65− ==
66− |- ^- @
67− ?: =(64 j)
68− %= ^$
69− i +(i)
70− hax %+ rep 5
71− :~ (sum a (wac 0 hax))
72− (sum b (wac 1 hax))
73− (sum c (wac 2 hax))
74− (sum d (wac 3 hax))
75− (sum e (wac 4 hax))
76− (sum f (wac 5 hax))
77− (sum g (wac 6 hax))
78− (sum h (wac 7 hax))
79− ==
80− ==
81− =+ l=:(mix (ror 0 2 a) (ror 0 13 a) (ror 0 22 a)) :: s0
82− =+ m=:(mix (dis a b) (dis a c) (dis b c)) :: maj
83− =+ n=(sum l m) :: t2
84− =+ o=:(mix (ror 0 6 e) (ror 0 11 e) (ror 0 25 e)) :: s1
85− =+ p=(mix (dis e f) (dis (inv e) g)) :: ch
86− =+ q=:(sum h o p (wac j kbx) (wac j wox)) :: t1
87− $(j +(j), a (sum q n), b a, c b, d c, e (sum d q), f e, g f, h g)
88− ::
3+++ shax :: sha-256
4+ ~/ %shax
5+ |= ruz/@ ^- @
6+ (shay [(met 3 ruz) ruz])
7+::
898
909XX document
9110
docs/system/hoon/library/src/3d/gate/shaz.md+1−1
@@ -1,7 +1,7 @@
11### `++shaz`
22
33 ++ shaz :: sha-512
4− |= ruz=@ ^- @
4+ |= ruz/@ ^- @
55 (shal [(met 3 ruz) ruz])
66
77
docs/system/hoon/library/src/3f/core/ob.md+61−53
@@ -30,20 +30,23 @@ An atom.
3030Source
3131------
3232
33− ++ feen :: conceal structure v2
34− |= pyn=@ ^- @
35− ?: &((gte pyn 0x1.0000) (lte pyn 0xffff.ffff))
36− (add 0x1.0000 (fice (sub pyn 0x1.0000)))
37− ?: &((gte pyn 0x1.0000.0000) (lte pyn 0xffff.ffff.ffff.ffff))
38− =+ lo=(dis pyn 0xffff.ffff)
39− =+ hi=(dis pyn 0xffff.ffff.0000.0000)
40− %+ con hi
41− (add 0x1.0000 (fice (sub lo 0x1.0000)))
42− pyn
33+ ++ feen :: conceal structure v2
34+ |= pyn/@ ^- @
35+ ?: &((gte pyn 0x1.0000) (lte pyn 0xffff.ffff))
36+ (add 0x1.0000 (fice (sub pyn 0x1.0000)))
37+ ?: &((gte pyn 0x1.0000.0000) (lte pyn 0xffff.ffff.ffff.ffff))
38+ =+ lo=(dis pyn 0xffff.ffff)
39+ =+ hi=(dis pyn 0xffff.ffff.0000.0000)
40+ %+ con hi
41+ (add 0x1.0000 (fice (sub lo 0x1.0000)))
42+ pyn
43+ ::
44+
4345
4446Examples
4547--------
4648
49+XX
4750
4851------------------------------------------------------------------------
4952
@@ -54,7 +57,7 @@ XX
5457Randomly permutes atoms that fit into 17 to 32 bits into one another, and
5558randomly permutes the low 32 bits of atoms that fit into 33 to 64 bits;
5659otherwise, passes the atom through unchanged. The permutation is the inverse of
57−the one applied by [`++feen`]().
60+the one applied by `++feen`.
5861
5962Accepts
6063-------
@@ -69,16 +72,17 @@ An atom.
6972Source
7073------
7174
72− ++ fend :: restore structure v2
73− |= cry=@ ^- @
74− ?: &((gte cry 0x1.0000) (lte cry 0xffff.ffff))
75− (add 0x1.0000 (teil (sub cry 0x1.0000)))
76− ?: &((gte cry 0x1.0000.0000) (lte cry 0xffff.ffff.ffff.ffff))
77− =+ lo=(dis cry 0xffff.ffff)
78− =+ hi=(dis cry 0xffff.ffff.0000.0000)
79− %+ con hi
80− (add 0x1.0000 (teil (sub lo 0x1.0000)))
81− cry
75+ ++ fend :: restore structure v2
76+ |= cry/@ ^- @
77+ ?: &((gte cry 0x1.0000) (lte cry 0xffff.ffff))
78+ (add 0x1.0000 (teil (sub cry 0x1.0000)))
79+ ?: &((gte cry 0x1.0000.0000) (lte cry 0xffff.ffff.ffff.ffff))
80+ =+ lo=(dis cry 0xffff.ffff)
81+ =+ hi=(dis cry 0xffff.ffff.0000.0000)
82+ %+ con hi
83+ (add 0x1.0000 (teil (sub lo 0x1.0000)))
84+ cry
85+ ::
8286
8387Examples
8488--------
@@ -89,7 +93,6 @@ Examples
8993
9094XX
9195
92−Applies a 3-round Feistel-like cipher to randomly permute atoms in the range `0` to `2^32 - 2^16`. The construction given in Black and Rogaway is ideal for a domain with a size of that form, and as with a conventionel Feistel cipher, three rounds suffice to make the permutation pseudorandom.
9396
9497Accepts
9598-------
@@ -104,15 +107,17 @@ An atom.
104107Source
105108------
106109
107− ++ fice :: adapted from
108− |= nor=@ :: black and rogaway
109− ^- @ :: "ciphers with
110− =+ ^= sel :: arbitrary finite
111− %+ rynd 2 :: domains", 2002
112− %+ rynd 1
113− %+ rynd 0
114− [(mod nor 65.535) (div nor 65.535)]
115− (add (mul 65.535 -.sel) +.sel)
110+ ++ fice :: adapted from
111+ |= nor/@ :: black and rogaway
112+ ^- @ :: "ciphers with
113+ =+ ^= sel :: arbitrary finite
114+ %+ rynd 2 :: domains", 2002
115+ %+ rynd 1
116+ %+ rynd 0
117+ [(mod nor 65.535) (div nor 65.535)]
118+ (add (mul 65.535 -.sel) +.sel)
119+ ::
120+
116121
117122Examples
118123--------
@@ -123,7 +128,7 @@ Examples
123128
124129XX
125130
126−Applies the reverse of the Feistel-like cipher applied by [`++fice`](). Unlike
131+Applies the reverse of the Feistel-like cipher applied by `++fice`. Unlike
127132a conventional Feistel cipher that is its own inverse if keys are used in
128133reverse order, this Feistel-like cipher uses two moduli that must be swapped
129134when applying the reverse transformation.
@@ -141,15 +146,18 @@ An atom.
141146Source
142147------
143148
144− ++ teil :: reverse ++fice
145− |= vip=@
146− ^- @
147− =+ ^= sel
148− %+ rund 0
149− %+ rund 1
150− %+ rund 2
151− [(mod vip 65.535) (div vip 65.535)]
152− (add (mul 65.535 -.sel) +.sel)
149+ ++ teil :: reverse ++fice
150+ |= vip/@
151+ ^- @
152+ =+ ^= sel
153+ %+ rund 0
154+ %+ rund 1
155+ %+ rund 2
156+ [(mod vip 65.535) (div vip 65.535)]
157+ (add (mul 65.535 -.sel) +.sel)
158+ ::
159+
160+
153161
154162Examples
155163--------
@@ -160,7 +168,7 @@ Examples
160168
161169XX
162170
163−A single round of the Feistel-like cipher [`++fice`](). AES ([`++aesc`]()) is
171+A single round of the Feistel-like cipher `++fice`. AES (`++aesc`) is
164172used as the round function.
165173
166174Accepts
@@ -177,7 +185,7 @@ Source
177185------
178186
179187 ++ rynd :: feistel round
180− |= [n=@ l=@ r=@]
188+ |= [n/@ l/@ r/@]
181189 ^- [@ @]
182190 :- r
183191 ?~ (mod n 2)
@@ -193,7 +201,7 @@ Examples
193201
194202XX
195203
196−A single round of the Feistel-like reverse cipher [`++teil`]().
204+A single round of the Feistel-like reverse cipher `++teil`.
197205
198206Accepts
199207-------
@@ -208,13 +216,13 @@ A cell of two atoms.
208216Source
209217------
210218
211− ++ rund :: reverse round
212− |= [n=@ l=@ r=@]
213− ^- [@ @]
214− :- r
215− ?~ (mod n 2)
216− (~(dif fo 65.535) l (en:aesc (snag n raku) r))
217− (~(dif fo 65.536) l (en:aesc (snag n raku) r))
219+ ++ rund :: reverse round
220+ |= {n/@ l/@ r/@}
221+ ^- {@ @}
222+ :- r
223+ ?~ (mod n 2)
224+ (~(dif fo 65.535) l (en:aesc (snag n raku) r))
225+ (~(dif fo 65.536) l (en:aesc (snag n raku) r))
218226
219227Examples
220228--------
@@ -229,12 +237,12 @@ XX
229237Accepts
230238-------
231239
232−A list of atoms of [odor]() [`@ux`]() (hexadecimal).
240+A list of atoms of odor `@ux` (hexadecimal).
233241
234242Produces
235243--------
236244
237−Arbitrary keys for use with [`++aesc`]().
245+Arbitrary keys for use with `++aesc`.
238246
239247Source
240248------
docs/system/hoon/library/src/3f/core/un.md+23−20
@@ -21,26 +21,28 @@ on the result, pushing it forward. Produces an atom.
2121Accepts
2222-------
2323
24−`pyn` is an [atom]().
24+`pyn` is an atom.
2525
2626
2727Produces
2828--------
2929
30+An atom.
31+
3032Source
3133------
3234
3335 ++ wren :: conceal structure
34− |= pyn=@ ^- @
36+ |= pyn/@ ^- @
3537 =+ len=(met 3 pyn)
3638 ?: =(0 len)
3739 0
3840 => .(len (dec len))
3941 =+ mig=(zaft (xafo len (cut 3 [len 1] pyn)))
4042 %+ can 3
41− %- flop ^- (list ,[@ @])
43+ %- flop ^- (list {@ @})
4244 :- [1 mig]
43− |- ^- (list ,[@ @])
45+ |- ^- (list {@ @})
4446 ?: =(0 len)
4547 ~
4648 => .(len (dec len))
@@ -48,6 +50,7 @@ Source
4850 [[1 mog] $(mig mog)]
4951 ::
5052
53+
5154Examples
5255--------
5356
@@ -71,7 +74,7 @@ on the result, pushing it forward. Produces an atom.
7174Accepts
7275-------
7376
74−`cry` is an [atom]().
77+`cry` is an atom.
7578
7679Produces
7780--------
@@ -80,16 +83,16 @@ Source
8083------
8184
8285 ++ wred :: restore structure
83− |= cry=@ ^- @
86+ |= cry/@ ^- @
8487 =+ len=(met 3 cry)
8588 ?: =(0 len)
8689 0
8790 => .(len (dec len))
8891 =+ mig=(cut 3 [len 1] cry)
8992 %+ can 3
90− %- flop ^- (list ,[@ @])
93+ %- flop ^- (list {@ @})
9194 :- [1 (xaro len (zart mig))]
92− |- ^- (list ,[@ @])
95+ |- ^- (list {@ @})
9396 ?: =(0 len)
9497 ~
9598 => .(len (dec len))
@@ -123,7 +126,7 @@ A cell of two atoms, `a` and `b`.
123126Source
124127------
125128
126− ++ xafo |=([a=@ b=@] +((mod (add (dec b) a) 255)))
129+ ++ xafo |=([a/@ b/@] +((mod (add (dec b) a) 255)))
127130
128131Examples
129132--------
@@ -155,7 +158,7 @@ An atom.
155158Source
156159------
157160
158− ++ xaro |=([a=@ b=@] +((mod (add (dec b) (sub 255 (mod a 255))) 255)))
161+ ++ xaro |=([a/@ b/@] +((mod (add (dec b) (sub 255 (mod a 255))) 255)))
159162
160163Examples
161164--------
@@ -171,7 +174,7 @@ Examples
171174
172175Look up in 255 sub box
173176
174−The inverse of [`++zart`](). Looks up a nonzero byte`a\` in a substiution
177+The inverse of `++zart`. Looks up a nonzero byte `a`in a substiution
175178box with 255 values, producing a unique nonzero byte.
176179
177180Accepts
@@ -189,7 +192,7 @@ Source
189192------
190193
191194 ++ zaft :: forward 255-sbox
192− |= a=@D
195+ |= a/@D
193196 =+ ^= b
194197 0xcc.75bc.86c8.2fb1.9a42.f0b3.79a0.92ca.21f6.1e41.cde5.fcc0.
195198 7e85.51ae.1005.c72d.1246.07e8.7c64.a914.8d69.d9f4.59c2.8038.
@@ -222,7 +225,7 @@ Examples
222225
223226Reverse look up in 255 sub box
224227
225−The inverse of [`++zaft`](). Looks up the index of a nonzero byte `a` in
228+The inverse of `++zaft`. Looks up the index of a nonzero byte `a` in
226229the substitution box with 255 values, producing a unique nonzero byte.
227230
228231Accepts
@@ -239,7 +242,7 @@ Source
239242------
240243
241244 ++ zart :: reverse 255-sbox
242− |= a=@D
245+ |= a/@D
243246 =+ ^= b
244247 0x68.4f07.ea1c.73c9.75c2.efc8.d559.5125.f621.a7a8.8591.5613.
245248 dd52.40eb.65a2.60b7.4bcb.1123.ceb0.1bd6.3c84.2906.b164.19b3.
@@ -269,13 +272,13 @@ Examples
269272
270273Lookup byte in 256 sub box
271274
272−The inverse of [`++zyrt`](). Looks up a byte `a` in a substituion box
275+The inverse of `++zyrt`. Looks up a byte `a` in a substituion box
273276with 256 values, producing a byte.
274277
275278Accepts
276279-------
277280
278−`a` is an [atom]() of one byte in length.
281+`a` is an atom of one byte in length.
279282
280283Produces
281284--------
@@ -286,7 +289,7 @@ Source
286289------
287290
288291 ++ zyft :: forward 256-sbox
289− |= a=@D
292+ |= a/@D
290293 =+ ^= b
291294 0xbb49.b71f.b881.b402.17e4.6b86.69b5.1647.115f.dddb.7ca5.
292295 8371.4bd5.19a9.b092.605d.0d9b.e030.a0cc.78ba.5706.4d2d.
@@ -319,13 +322,13 @@ Examples
319322
320323Reverse lookup byte in 256 sub box
321324
322−The inverse of [`++zyft`](/doc/hoon/library/2en#++zyft). Looks up a byte `a` in a substituion box
325+The inverse of `++zyft`. Looks up a byte `a` in a substituion box
323326with 256 values, producing a byte.
324327
325328Accepts
326329-------
327330
328−`a` is an [atom]() of one byte in length.
331+`a` is an atom of one byte in length.
329332
330333Produces
331334--------
@@ -336,7 +339,7 @@ Source
336339------
337340
338341 ++ zyrt :: reverse 256-sbox
339− |= a=@D
342+ |= a/@D
340343 =+ ^= b
341344 0x9fc8.2753.6e02.8fcf.8b35.2b20.5598.7caa.c9a9.30b0.9b48.
342345 47ce.6371.80f6.407d.00dd.0aa5.ed10.ecb7.0f5a.5c3a.e605.
docs/system/hoon/library/src/3g/mold/coin.md+4−4
@@ -3,14 +3,14 @@
33Noun literal syntax cases
44
55Noun literal syntax cases: atoms, jammed nouns, and nestable tuples.
6−Parsed and printed using [`++so`]() and [`++co`]() cores.
6+Parsed and printed using `++so` and `++co` cores.
77
88Source
99------
1010
11− ++ coin $% [%$ p=dime] ::
12− [%blob p=*] ::
13− [%many p=(list coin)] ::
11+ ++ coin $% {$$ p/dime} ::
12+ {$blob p/*} ::
13+ {$many p/(list coin)} ::
1414 == ::
1515
1616Examples
docs/system/hoon/library/src/3g/mold/dime.md+6−5
@@ -2,15 +2,16 @@
22
33Odor-atom pair
44
5−Used in [`++coin`](). Convenience methods [`++scot`]() and [`++scow`]() (in
6−Section 2eL) print dimes as [`++cord`]() and [`++tape`](), respectively.
7−[`++slat`](), [`++slav`](), and [`++slaw`]() are used to parse atoms of
8−specific [odor]()s.
5+Used in `++coin`. Convenience methods `++scot` and `++scow` (in
6+Section 2eL) print dimes as `++cord` and `++tape`, respectively.
7+`++slat`, `++slav`, and `++slaw` are used to parse atoms of
8+specific odors.
99
1010Source
1111------
1212
13− ++ dime ,[p=@ta q=@] ::
13+ ++ dime {p/@ta q/@} ::
14+
1415
1516Examples
1617--------
docs/system/hoon/library/src/3g/mold/edge.md+3−2
@@ -7,12 +7,13 @@ Optional result `p` and parsing continuation `q`.
77Source
88------
99
10− ++ edge ,[p=hair q=(unit ,[p=* q=nail])] :: parsing output
10+ ++ hair {p/@ud q/@ud} :: parsing trace
11+
1112
1213Examples
1314--------
1415
15−See also: Section 2eD, [`++rule`]()
16+See also: Section 2eD, `++rule`
1617
1718 ~zod/try=> *edge
1819 [p=[p=0 q=0] q=~]
docs/system/hoon/library/src/3g/mold/hair.md+2−1
@@ -7,7 +7,8 @@ A pair of two [`@ud`]() used in parsing indicating line and column number.
77Source
88------
99
10− ++ hair ,[p=@ud q=@ud] :: parsing trace
10+ ++ hair {p/@ud q/@ud} :: parsing trace
11+
1112
1213Examples
1314--------
docs/system/hoon/library/src/3g/mold/like.md+5−1
@@ -7,11 +7,15 @@ Mold generator for an edge
77Source
88------
99
10− ++ like |* a=_,* :: generic edge
10+ ++ like |* a/$-(* *) :: generic edge
11+ |= b/_`*`[(hair) ~] ::
12+ :- p=(hair -.b) ::
13+ ^= q ::
1114 ?@ +.b ~ ::
1215 :- ~ ::
1316 u=[p=(a +>-.b) q=[p=(hair -.b) q=(tape +.b)]] ::
1417
18+
1519Examples
1620--------
1721 ~zod/try=> *(like char)
docs/system/hoon/library/src/3g/mold/nail.md+2−1
@@ -7,7 +7,8 @@ Indicates parsing position `p`, and remaining text to be parsed `q`.
77Source
88------
99
10− ++ nail ,[p=hair q=tape] :: parsing input
10+ ++ nail {p/hair q/tape} :: parsing input
11+
1112
1213Examples
1314--------
docs/system/hoon/library/src/3g/mold/path.md+3−2
@@ -2,13 +2,14 @@
22
33Filesystem path
44
5−A `++path` is a list of [`++span`]()s aka [`@ta`](). Used in
5+A `++path` is a list of `++span`s aka `@ta`. Used in
66`%clay` and `%eyre` extensively.
77
88Source
99------
1010
11− ++ path (list span) :: filesys location
11+ ++ path (list knot) :: filesys location
12+
1213
1314Examples
1415--------
docs/system/hoon/library/src/3g/mold/pint.md+3−2
@@ -3,12 +3,13 @@
33Parsing range
44
55Mostly used for stacktraces. A `++pint` is a pair of
6−[`++hair`](), indicating from `p` to `q`.
6+`++hair`, indicating from `p` to `q`.
77
88Source
99------
1010
11− ++ pint ,[p=[p=@ q=@] q=[p=@ q=@]] :: line/column range
11+ ++ pint {p/{p/@ q/@} q/{p/@ q/@}} :: line+column range
12+
1213
1314Examples
1415--------
docs/system/hoon/library/src/3g/mold/rule.md+2−1
@@ -9,7 +9,8 @@ that parsing rules match this with `_`.
99Source
1010------
1111
12− ++ rule |=(tub=nail `edge`[p.tub ~ ~ tub]) :: parsing rule
12+ ++ rule _|=(nail *edge) :: parsing rule
13+
1314
1415Examples
1516--------
docs/system/hoon/library/src/3g/mold/spot.md+3−2
@@ -2,12 +2,13 @@
22
33Stack trace line
44
5−A [`++spot`]() is what we print after crashing.
5+A `++spot` is what we print after crashing.
66
77Source
88------
99
10− ++ spot ,[p=path q=pint] :: range in file
10+ ++ spot {p/path q/pint} :: range in file
11+
1112
1213Examples
1314--------
docs/system/hoon/library/src/3g/mold/toon.md+6−3
@@ -8,13 +8,16 @@ failure with stack trace (`%2`).
88Source
99------
1010
11− ++ toon $% [%0 p=*] :: success
11+ ++ toon $% {$0 p/*} :: success
12+ {$1 p/(list)} :: blocks
13+ {$2 p/(list tank)} :: stack trace
14+ == ::
15+
1216
1317Examples
1418--------
15− ~zod/try=> (mock [[20 21] 0 3] ,~)
19+ ~zod/try=> (mock [[20 21] 0 3] $~)
1620 [%0 p=21]
17−
1821 ~zod/try=> (mock [[0] !=(.^(cy//=main/1))] ,~)
1922 [%1 p=~[[31.075 1.685.027.454 1.852.399.981 49 0]]]
2023 ~zod/try=> (path [31.075 1.685.027.454 1.852.399.981 49 0])
docs/system/hoon/library/src/4a/core/po.md+55−52
@@ -1,42 +1,42 @@
11### `++po`
22
3−++ po
4− ~/ %po
5− =+ :- ^= sis :: prefix syllables
6− 'dozmarbinwansamlitsighidfidlissogdirwacsabwissib\
7− /rigsoldopmodfoglidhopdardorlorhodfolrintogsilmir\
8− /holpaslacrovlivdalsatlibtabhanticpidtorbolfosdot\
9− /losdilforpilramtirwintadbicdifrocwidbisdasmidlop\
10− /rilnardapmolsanlocnovsitnidtipsicropwitnatpanmin\
11− /ritpodmottamtolsavposnapnopsomfinfonbanporworsip\
12− /ronnorbotwicsocwatdolmagpicdavbidbaltimtasmallig\
13− /sivtagpadsaldivdactansidfabtarmonranniswolmispal\
14− /lasdismaprabtobrollatlonnodnavfignomnibpagsopral\
15− /bilhaddocridmocpacravripfaltodtiltinhapmicfanpat\
16− /taclabmogsimsonpinlomrictapfirhasbosbatpochactid\
17− /havsaplindibhosdabbitbarracparloddosbortochilmac\
18− /tomdigfilfasmithobharmighinradmashalraglagfadtop\
19− /mophabnilnosmilfopfamdatnoldinhatnacrisfotribhoc\
20− /nimlarfitwalrapsarnalmoslandondanladdovrivbacpol\
21− /laptalpitnambonrostonfodponsovnocsorlavmatmipfap'
22− ^= dex :: suffix syllables
23− 'zodnecbudwessevpersutletfulpensytdurwepserwylsun\
24− /rypsyxdyrnuphebpeglupdepdysputlughecryttyvsydnex\
25− /lunmeplutseppesdelsulpedtemledtulmetwenbynhexfeb\
26− /pyldulhetmevruttylwydtepbesdexsefwycburderneppur\
27− /rysrebdennutsubpetrulsynregtydsupsemwynrecmegnet\
28− /secmulnymtevwebsummutnyxrextebfushepbenmuswyxsym\
29− /selrucdecwexsyrwetdylmynmesdetbetbeltuxtugmyrpel\
30− /syptermebsetdutdegtexsurfeltudnuxruxrenwytnubmed\
31− /lytdusnebrumtynseglyxpunresredfunrevrefmectedrus\
32− /bexlebduxrynnumpyxrygryxfeptyrtustyclegnemfermer\
33− /tenlusnussyltecmexpubrymtucfyllepdebbermughuttun\
34− /bylsudpemdevlurdefbusbeprunmelpexdytbyttyplevmyl\
35− /wedducfurfexnulluclennerlexrupnedlecrydlydfenwel\
36− /nydhusrelrudneshesfetdesretdunlernyrsebhulryllud\
37− /remlysfynwerrycsugnysnyllyndyndemluxfedsedbecmun\
38− /lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes'
39− |%
3+ ++ po
4+ ~/ %po
5+ =+ :- ^= sis :: prefix syllables
6+ 'dozmarbinwansamlitsighidfidlissogdirwacsabwissib\
7+ /rigsoldopmodfoglidhopdardorlorhodfolrintogsilmir\
8+ /holpaslacrovlivdalsatlibtabhanticpidtorbolfosdot\
9+ /losdilforpilramtirwintadbicdifrocwidbisdasmidlop\
10+ /rilnardapmolsanlocnovsitnidtipsicropwitnatpanmin\
11+ /ritpodmottamtolsavposnapnopsomfinfonbanporworsip\
12+ /ronnorbotwicsocwatdolmagpicdavbidbaltimtasmallig\
13+ /sivtagpadsaldivdactansidfabtarmonranniswolmispal\
14+ /lasdismaprabtobrollatlonnodnavfignomnibpagsopral\
15+ /bilhaddocridmocpacravripfaltodtiltinhapmicfanpat\
16+ /taclabmogsimsonpinlomrictapfirhasbosbatpochactid\
17+ /havsaplindibhosdabbitbarracparloddosbortochilmac\
18+ /tomdigfilfasmithobharmighinradmashalraglagfadtop\
19+ /mophabnilnosmilfopfamdatnoldinhatnacrisfotribhoc\
20+ /nimlarfitwalrapsarnalmoslandondanladdovrivbacpol\
21+ /laptalpitnambonrostonfodponsovnocsorlavmatmipfap'
22+ ^= dex :: suffix syllables
23+ 'zodnecbudwessevpersutletfulpensytdurwepserwylsun\
24+ /rypsyxdyrnuphebpeglupdepdysputlughecryttyvsydnex\
25+ /lunmeplutseppesdelsulpedtemledtulmetwenbynhexfeb\
26+ /pyldulhetmevruttylwydtepbesdexsefwycburderneppur\
27+ /rysrebdennutsubpetrulsynregtydsupsemwynrecmegnet\
28+ /secmulnymtevwebsummutnyxrextebfushepbenmuswyxsym\
29+ /selrucdecwexsyrwetdylmynmesdetbetbeltuxtugmyrpel\
30+ /syptermebsetdutdegtexsurfeltudnuxruxrenwytnubmed\
31+ /lytdusnebrumtynseglyxpunresredfunrevrefmectedrus\
32+ /bexlebduxrynnumpyxrygryxfeptyrtustyclegnemfermer\
33+ /tenlusnussyltecmexpubrymtucfyllepdebbermughuttun\
34+ /bylsudpemdevlurdefbusbeprunmelpexdytbyttyplevmyl\
35+ /wedducfurfexnulluclennerlexrupnedlecrydlydfenwel\
36+ /nydhusrelrudneshesfetdesretdunlernyrsebhulryllud\
37+ /remlysfynwerrycsugnysnyllyndyndemluxfedsedbecmun\
38+ /lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes'
39+ |%
4040
4141Provides the phonetic syllables and name generators for the Urbit naming
4242system. The two faces, `sis` and `dex` are available to the arms
@@ -54,20 +54,20 @@ Produces the byte of the right-hand syllable `a`.
5454Accepts
5555-------
5656
57−`a` is an [atom]().
57+`a` is an atom.
5858
5959Produces
6060--------
6161
62−A [`++unit`]() of an atom.
62+A `++unit` of an atom.
6363
6464Source
6565------
6666
67− ++ ind ~/ %ind :: parse prefix
68− |= a=@
67+ ++ ind ~/ %ind :: parse suffix
68+ |= a/@tas
6969 =+ b=0
70− |- ^- (unit ,@)
70+ |- ^- (unit @)
7171 ?:(=(256 b) ~ ?:(=(a (tod b)) [~ b] $(b +(b))))
7272
7373Examples
@@ -91,21 +91,22 @@ Produces the byte of the left-hand phonetic syllable `b`.
9191Accepts
9292-------
9393
94−`a` is an [atom]().
94+`a` is an atom.
9595
9696Produces
9797--------
98−A [`++unit`]() of an atom.
98+A `++unit` of an atom.
9999
100100Source
101101------
102102
103− ++ ins ~/ %ins :: parse suffix
104− |= a=@
103+ ++ ins ~/ %ins :: parse prefix
104+ |= a/@tas
105105 =+ b=0
106− |- ^- (unit ,@)
106+ |- ^- (unit @)
107107 ?:(=(256 b) ~ ?:(=(a (tos b)) [~ b] $(b +(b))))
108108
109+
109110Examples
110111--------
111112
@@ -125,7 +126,7 @@ Examples
125126Fetch prefix
126127
127128Produces the phonetic prefix syllable from index `a` within `dex` as an
128−[atom]().
129+atom.
129130
130131Accepts
131132-------
@@ -141,8 +142,10 @@ An atom.
141142Source
142143------
143144
144− ++ tod ~/ %tod :: fetch prefix
145− |=(a=@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] dex)))
145+ ++ tod ~/ %tod :: fetch suffix
146+ |=(a/@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] dex)))
147+
148+
146149
147150Examples
148151--------
@@ -167,7 +170,7 @@ Examples
167170Fetch suffix
168171
169172Produces the phonetic prefix syllable from index `a` within `sis` as an
170−[atom]().
173+atom.
171174
172175Accepts
173176-------
@@ -183,7 +186,7 @@ Source
183186------
184187
185188 ++ tos ~/ %tos :: fetch suffix
186− |=(a=@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] sis)))
189+ |=(a/@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] sis)))
187190
188191Examples
189192--------
docs/system/hoon/library/src/4b/core/at.md+12−10
@@ -1,7 +1,7 @@
11### `++at`
22
33 ++ at
4− |_ a=@
4+ |_ a/@
55
66XX document
77
@@ -27,25 +27,26 @@ XX document
2727
2828### `++rf`
2929
30− ++ rf `tape`[?-(a & '&', | '|', * !!) ~]
30+ ++ rf `tape`[?-(a $& '&', $| '|', * !!) ~]
31+
3132
3233XX document
3334
3435### `++rn`
3536
36− ++ rn `tape`[?>(=(0 a) '~') ~]
37+ ++ rn `tape`[?>(=(0 a) '~') ~]
3738
3839XX document
3940
4041### `++rt`
4142
42− ++ rt `tape`['\'' (weld (mesc (trip a)) `tape`['\'' ~])]
43+ ++ rt `tape`['\'' (weld (mesc (trip a)) `tape`['\'' ~])]
4344
4445XX document
4546
4647### `++rta`
4748
48− ++ rta rt
49+ ++ rta rt
4950
5051XX document
5152
@@ -57,20 +58,20 @@ XX document
5758
5859### `++rub`
5960
60− ++ rub `tape`['0' 'b' (rum 2 ~ |=(b=@ (add '0' b)))]
61+ ++ rub `tape`['0' 'b' (rum 2 ~ |=(b/@ (add '0' b)))]
6162
6263XX document
6364
6465### `++rud`
6566
66− ++ rud (rum 10 ~ |=(b=@ (add '0' b)))
67+ ++ rud (rum 10 ~ |=(b/@ (add '0' b)))
6768
6869XX document
6970
7071### `++rum`
7172
7273 ++ rum
73− |= [b=@ c=tape d=$+(@ @)]
74+ |= {b/@ c/tape d/$-(@ @)}
7475 ^- tape
7576 ?: =(0 a)
7677 [(d 0) c]
@@ -86,6 +87,7 @@ XX document
8687 ==
8788 ::
8889
90+
8991XX document
9092
9193### `++rup`
@@ -124,7 +126,7 @@ XX document
124126 %^ rum
125127 64
126128 ~
127− |= b=@
129+ |= b/@
128130 ?: =(63 b)
129131 '+'
130132 ?: =(62 b)
@@ -136,7 +138,7 @@ XX document
136138
137139### `++rux`
138140
139− ++ rux `tape`['0' 'x' (rum 16 ~ |=(b=@ (add b ?:((lth b 10) 48 87))))]
141+ ++ rux `tape`['0' 'x' (rum 16 ~ |=(b/@ (add b ?:((lth b 10) 48 87))))]
140142 --
141143 :::::::::::::::::::::::::::::::::::::::::::::::::::::: ::
142144
docs/system/hoon/library/src/4b/gate/cass.md+2−3
@@ -19,10 +19,9 @@ Source
1919------
2020
2121 ++ cass :: lowercase
22− |= vib=tape
22+ |= vib/tape
2323 %+ rap 3
24− (turn vib |=(a=@ ?.(&((gte a 'A') (lte a 'Z')) a (add 32 a))))
25− ::
24+ (turn vib |=(a/@ ?.(&((gte a 'A') (lte a 'Z')) a (add 32 a))))
2625
2726Examples
2827--------
docs/system/hoon/library/src/4b/gate/crip.md+1−1
@@ -2,7 +2,7 @@
22
33Tape to cord
44
5−Produce a [`++cord`]() from a [`++tape`]().
5+Produce a `++cord` from a `++tape`.
66
77Accepts
88-------
docs/system/hoon/library/src/4b/gate/cuss.md+2−2
@@ -2,8 +2,8 @@
22
33To uppercase
44
5−Turn all occurances of lowercase letters in any [`++tape`]() into uppercase
6−letters, as a [`++cord`]().
5+Turn all occurances of lowercase letters in any `++tape` into uppercase
6+letters, as a `++cord`.
77
88Accepts
99-------
docs/system/hoon/library/src/4b/gate/mesc.md+4−4
@@ -2,12 +2,12 @@
22
33Escape special chars
44
5−Escape special characters, used in [`++show`](/doc/hoon/library/2ez#++show)
5+Escape special characters, used in `++show`.
66
77Accepts
88-------
99
10−`vib` is a [`++tape`]().
10+`vib` is a `++tape`.
1111
1212Produces
1313--------
@@ -18,13 +18,13 @@ Source
1818------
1919
2020 ++ mesc :: ctrl code escape
21− |= vib=tape
21+ |= vib/tape
2222 ^- tape
2323 ?~ vib
2424 ~
2525 ?: =('\\' i.vib)
2626 ['\\' '\\' $(vib t.vib)]
27− ?: ?|((gth i.vib 126) (lth i.vib 32) =(39 i.vib))
27+ ?: ?|((gth i.vib 126) (lth i.vib 32) =(`@`39 i.vib))
2828 ['\\' (welp ~(rux at i.vib) '/' $(vib t.vib))]
2929 [i.vib $(vib t.vib)]
3030 ::
docs/system/hoon/library/src/4b/gate/runt.md+2−2
@@ -2,7 +2,7 @@
22
33Prepend `n` times
44
5−Add `a` repetitions of character `b` to the head of [`++tape`]() `c`.
5+Add `a` repetitions of character `b` to the head of `++tape` `c`.
66
77Accepts
88-------
@@ -20,7 +20,7 @@ Source
2020------
2121
2222 ++ runt :: prepend repeatedly
23− |= [[a=@ b=@] c=tape]
23+ |= [[a/@ b/@] c/tape]
2424 ^- tape
2525 ?: =(0 a)
2626 c
docs/system/hoon/library/src/4b/gate/sand.md+7−7
@@ -2,35 +2,35 @@
22
33Soft-cast by odor
44
5−Soft-cast validity by [odor]().
5+Soft-cast validity by odor.
66
77Accepts
88-------
99
10−`a` is a [`++span`]() (`@ta`).
10+`a` is a `++span` (`@ta`).
1111
1212`b` is an atom.
1313
1414Produces
1515--------
1616
17−A `(unit ,@)`.
17+A `(unit @)`.
1818
1919Source
2020------
2121
2222 ++ sand :: atom sanity
23− |= a=@ta
24− |= b=@ ^- (unit ,@)
23+ |= a/@ta
24+ |= b/@ ^- (unit @)
2525 ?.(((sane a) b) ~ [~ b])
2626 ::
2727
2828Examples
2929--------
3030
31− /~zod/try=> `(unit ,@ta)`((sand %ta) 'sym-som')
31+ /~zod/try=> `(unit @ta)`((sand %ta) 'sym-som')
3232 [~ ~.sym-som]
33− /~zod/try=> `(unit ,@ta)`((sand %ta) 'err!')
33+ /~zod/try=> `(unit @ta)`((sand %ta) 'err!')
3434 ~
3535
3636
docs/system/hoon/library/src/4b/gate/sane.md+5−5
@@ -2,14 +2,14 @@
22
33Check odor validity
44
5−Check validity by [odor](). Produces a [gate]().
5+Check validity by odor. Produces a gate.
66
77Accepts
88-------
99
10−`a` is a [`++span`]() (`@ta`).
10+`a` is a `++span` (`@ta`).
1111
12−`b` is an [atom]().
12+`b` is an atom.
1313
1414Produces
1515--------
@@ -20,8 +20,8 @@ Source
2020------
2121
2222 ++ sane :: atom sanity
23− |= a=@ta
24− |= b=@ ^- ?
23+ |= a/@ta
24+ |= b/@ ^- ?
2525 ?. =(%t (end 3 1 a))
2626 ~|(%sane-stub !!)
2727 =+ [inx=0 len=(met 3 b)]
docs/system/hoon/library/src/4b/gate/teff.md+4−5
@@ -7,7 +7,7 @@ Produces the number of utf8 bytes.
77Accepts
88-------
99
10−`a` is a [`@t`]().
10+`a` is a `@t`.
1111
1212Produces
1313--------
@@ -17,14 +17,13 @@ An atom.
1717Source
1818------
1919
20− ++ teff :: length utf8
21− |= a=@t ^- @
20+ |= a/@t ^- @
2221 =+ b=(end 3 1 a)
22+ ~| %bad-utf8
2323 ?: =(0 b)
24− ?>(=(0 a) 0)
24+ ?>(=(`@`0 a) 0)
2525 ?> |((gte b 32) =(10 b))
2626 ?:((lte b 127) 1 ?:((lte b 223) 2 ?:((lte b 239) 3 4)))
27− ::
2827
2928Examples
3029--------
docs/system/hoon/library/src/4b/gate/trim.md+10−10
@@ -2,7 +2,7 @@
22
33Tape split
44
5−Split first `a` characters off [`++tape`]() `b`.
5+Split first `a` characters off `++tape` `b`.
66
77Accepts
88-------
@@ -19,17 +19,17 @@ A cell of `++tape`s, `p` and `q`.
1919Source
2020------
2121
22− ++ trim :: tape split
23− |= [a=@ b=tape]
24− ^- [p=tape q=tape]
25− ?~ b
26− [~ ~]
27− ?: =(0 a)
28− [~ b]
29− =+ c=$(a (dec a), b t.b)
30− [[i.b p.c] q.c]
22+ ++ trim :: 31-bit nonzero
23+ |= key/@
24+ =+ syd=0xcafe.babe
25+ |- ^- @
26+ =+ haz=(spec syd key)
27+ =+ ham=(mix (rsh 0 31 haz) (end 0 31 haz))
28+ ?.(=(0 ham) ham $(syd +(syd)))
29+ --
3130 ::
3231
32+
3333Examples
3434--------
3535
docs/system/hoon/library/src/4b/gate/trip.md+3−2
@@ -2,7 +2,7 @@
22
33Cord to tape
44
5−Produce a [`++tape`]() from [`++cord`]().
5+Produce a `++tape` from `++cord`.
66
77Accepts
88-------
@@ -19,12 +19,13 @@ Source
1919
2020 ++ trip :: cord to tape
2121 ~/ %trip
22− |= a=@ ^- tape
22+ |= a/@ ^- tape
2323 ?: =(0 (met 3 a))
2424 ~
2525 [^-(@ta (end 3 1 a)) $(a (rsh 3 1 a))]
2626 ::
2727
28+
2829Examples
2930--------
3031
docs/system/hoon/library/src/4b/gate/tuba.md+4−4
@@ -2,7 +2,7 @@
22
33UTF8 to UTF32 tape
44
5−Convert [`++tape`]() to a [`++list`]() of codepoints ([`@c`]()).
5+Convert `++tape` to a `++list` of codepoints (`@c`).
66
77Accepts
88-------
@@ -12,14 +12,14 @@ Accepts
1212Produces
1313--------
1414
15−A `++list` of codepoints [`@c`]().
15+A `++list` of codepoints `@c`.
1616
1717Source
1818------
1919
2020 ++ tuba :: utf8 to utf32 tape
21− |= a=tape
22− ^- (list ,@c)
21+ |= a/tape
22+ ^- (list @c)
2323 (rip 5 (turf (rap 3 a))) :: XX horrible
2424 ::
2525
docs/system/hoon/library/src/4b/gate/tufa.md+4−4
@@ -2,12 +2,12 @@
22
33UTF32 to UTF8 tape
44
5−Wrap a [`++list`]() of utf32 codepoints into a utf8 [`++tape`]().
5+Wrap a `++list` of utf32 codepoints into a utf8 `++tape`.
66
77Accepts
88-------
99
10−`a` is a `++list` of [`@c`]().
10+`a` is a `++list` of `@c`.
1111
1212Produces
1313--------
@@ -18,7 +18,7 @@ Source
1818------
1919
2020 ++ tufa :: utf32 to utf8 tape
21− |= a=(list ,@c)
21+ |= a=(list @c)
2222 ^- tape
2323 ?~ a ""
2424 (weld (rip 3 (tuft i.a)) $(a t.a))
@@ -29,7 +29,7 @@ Examples
2929
3030 /~zod/try=> (tufa ~[~-~44f. ~-. ~-~442. ~-~443. ~-~442.])
3131 "я тут"
32− /~zod/try=> (tufa ((list ,@c) ~[%a %b 0xb1 %c]))
32+ /~zod/try=> (tufa ((list @c) ~[%a %b 0xb1 %c]))
3333 "ab±c"
3434
3535
docs/system/hoon/library/src/4b/gate/tuft.md+8−8
@@ -3,12 +3,12 @@
33UTF32 to UTF8 text
44
55Convert utf32 glyph to
6−[LSB](http://en.wikipedia.org/wiki/Least_significant_bit) utf8 [`++cord`]().
6+LSB utf8 `++cord`.
77
88Accepts
99-------
1010
11−`a` is a codepoint ([`@c`]()).
11+`a` is a codepoint (`@c`).
1212
1313Produces
1414--------
@@ -19,22 +19,22 @@ Source
1919------
2020
2121 ++ tuft :: utf32 to utf8 text
22− |= a=@c
22+ |= a/@c
2323 ^- @t
2424 %+ rap 3
25− |- ^- (list ,@)
26− ?: =(0 a)
25+ |- ^- (list @)
26+ ?: =(`@`0 a)
2727 ~
2828 =+ b=(end 5 1 a)
2929 =+ c=$(a (rsh 5 1 a))
30− ?: (lth b 0x7f)
30+ ?: (lte b 0x7f)
3131 [b c]
32− ?: (lth b 0x7ff)
32+ ?: (lte b 0x7ff)
3333 :* (mix 0b1100.0000 (cut 0 [6 5] b))
3434 (mix 0b1000.0000 (end 0 6 b))
3535 c
3636 ==
37− ?: (lth b 0xffff)
37+ ?: (lte b 0xffff)
3838 :* (mix 0b1110.0000 (cut 0 [12 4] b))
3939 (mix 0b1000.0000 (cut 0 [6 6] b))
4040 (mix 0b1000.0000 (end 0 6 b))
docs/system/hoon/library/src/4b/gate/turf.md+15−13
@@ -2,39 +2,41 @@
22
33UTF8 to UTF32 cord
44
5−Convert utf8 ([`++cord`]()) to utf32 codepoints.
5+Convert utf8 (`++cord`) to utf32 codepoints.
66
77Accepts
88-------
99
10−`a` is a [`@t`]().
10+`a` is a `@t`.
1111
1212Produces
1313--------
1414
15−A [`@c`](), UTF-32 codepoint.
15+A `@c`, UTF-32 codepoint.
1616
1717Source
1818------
1919
2020 ++ turf :: utf8 to utf32
21− |= a=@t
21+ |= a/@t
2222 ^- @c
2323 %+ rap 5
24− |- ^- (list ,@c)
24+ |- ^- (list @c)
2525 =+ b=(teff a)
2626 ?: =(0 b) ~
27− :- %+ can 0
27+ =+ ^= c
28+ %+ can 0
2829 %+ turn
29− ^- (list ,[p=@ q=@])
30+ ^- (list {p/@ q/@})
3031 ?+ b !!
31− 1 [[0 7] ~]
32− 2 [[8 6] [0 5] ~]
33− 3 [[16 6] [8 6] [0 4] ~]
34− 4 [[24 6] [16 6] [8 6] [0 3] ~]
32+ $1 [[0 7] ~]
33+ $2 [[8 6] [0 5] ~]
34+ $3 [[16 6] [8 6] [0 4] ~]
35+ $4 [[24 6] [16 6] [8 6] [0 3] ~]
3536 ==
36− |=([p=@ q=@] [q (cut 0 [p q] a)])
37− $(a (rsh 3 b a))
37+ |=({p/@ q/@} [q (cut 0 [p q] a)])
38+ ?. =((tuft c) (end 3 b a)) ~|(%bad-utf8 !!)
39+ [c $(a (rsh 3 b a))]
3840 ::
3941
4042Examples
docs/system/hoon/library/src/4b/gate/wack.md+3−3
@@ -2,7 +2,7 @@
22
33Coin format encode
44
5−Escape [`++span`]() `~` as `~~` and `_` as `~-`. Used for printing.
5+Escape `++span` `~` as `~~` and `_` as `~-`. Used for printing.
66
77Accepts
88-------
@@ -12,13 +12,13 @@ Accepts
1212Produces
1313--------
1414
15−A [`++span`]() (`@ta`).
15+A `++span` (`@ta`).
1616
1717Source
1818------
1919
2020 ++ wack :: coin format
21− |= a=@ta
21+ |= a/@ta
2222 ^- @ta
2323 =+ b=(rip 3 a)
2424 %+ rap 3
docs/system/hoon/library/src/4b/gate/wick.md+18−14
@@ -2,33 +2,37 @@
22
33Coin format decode
44
5−Unescape [`++span`]() `~~` as `~` and `~-` as `_`.
5+Unescape `++span` `~~` as `~` and `~-` as `_`.
66
77Accepts
88-------
99
10−`a` is a an [atom]().
10+`a` is a an atom.
1111
1212Produces
1313--------
1414
15−A [`++span`]() `@ta`.
15+A `++span` `@ta`.
1616
1717Source
1818------
1919
20− ++ wick :: coin format
21− |= a=@
22− ^- @ta
20+ ++ wick :: knot format
21+ |= a/@
22+ ^- (unit @ta)
2323 =+ b=(rip 3 a)
24− %+ rap 3
25− |- ^- tape
26− ?~ b
27− ~
28− ?: =('~' i.b)
29− ?~ t.b !!
30− [?:(=('~' i.t.b) '~' ?>(=('-' i.t.b) '_')) $(b t.t.b)]
31− [i.b $(b t.b)]
24+ =- ?^(b ~ (some (rap 3 (flop c))))
25+ =| c/tape
26+ |- ^- {b/tape c/tape}
27+ ?~ b [~ c]
28+ ?. =('~' i.b)
29+ $(b t.b, c [i.b c])
30+ ?~ t.b [b ~]
31+ ?- i.t.b
32+ $'~' $(b t.t.b, c ['~' c])
33+ $'-' $(b t.t.b, c ['_' c])
34+ @ [b ~]
35+ ==
3236 ::
3337
3438Examples
docs/system/hoon/library/src/4b/gate/woad.md+9−9
@@ -2,27 +2,27 @@
22
33Unescape cord
44
5−Unescape [`++cord`]() codepoints.
5+Unescape `++cord` codepoints.
66
77Accepts
88-------
99
10−`a` is a [`@ta`]().
10+`a` is a `@ta`.
1111
1212Produces
1313--------
1414
15−A [`++cord`]().
15+A `++cord`.
1616
1717Source
1818------
1919
2020 ++ woad :: cord format
21− |= a=@ta
21+ |= a/@ta
2222 ^- @t
2323 %+ rap 3
24− |- ^- (list ,@)
25− ?: =(0 a)
24+ |- ^- (list @)
25+ ?: =(`@`0 a)
2626 ~
2727 =+ b=(end 3 1 a)
2828 =+ c=(rsh 3 1 a)
@@ -34,7 +34,7 @@ Source
3434 ?+ b =- (weld (rip 3 (tuft p.d)) $(a q.d))
3535 ^= d
3636 =+ d=0
37− |- ^- [p=@ q=@]
37+ |- ^- {p/@ q/@}
3838 ?: =('.' b)
3939 [d c]
4040 ?< =(0 c)
@@ -46,8 +46,8 @@ Source
4646 ?: &((gte b '0') (lte b '9')) 48
4747 ?>(&((gte b 'a') (lte b 'z')) 87)
4848 ==
49− %'.' ['.' $(a c)]
50− %'~' ['~' $(a c)]
49+ $'.' ['.' $(a c)]
50+ $'~' ['~' $(a c)]
5151 ==
5252 ::
5353
docs/system/hoon/library/src/4b/gate/wood.md+8−12
@@ -2,50 +2,46 @@
22
33Escape cord
44
5−Escape [`++cord`]() codepoints.
5+Escape `++cord` codepoints.
66
77Accepts
88-------
99
10−`a` is a [`++span`]() (`@ta`).
10+`a` is a `++span` (`@ta`).
1111
1212Produces
1313--------
1414
15−A [`++span`]() (`@ta`).
15+A `++span` (`@ta`).
1616
1717Source
1818------
1919
2020 ++ wood :: cord format
21− |= a=@t
21+ |= a/@t
2222 ^- @ta
2323 %+ rap 3
24− |- ^- (list ,@)
25− ?: =(0 a)
24+ |- ^- (list @)
25+ ?: =(`@`0 a)
2626 ~
2727 =+ b=(teff a)
2828 =+ c=(turf (end 3 b a))
2929 =+ d=$(a (rsh 3 b a))
3030 ?: ?| &((gte c 'a') (lte c 'z'))
3131 &((gte c '0') (lte c '9'))
32− =('-' c)
32+ =(`@`'-' c)
3333 ==
3434 [c d]
3535 ?+ c
3636 :- '~'
3737 =+ e=(met 2 c)
3838 |- ^- tape
39− ?: =(0 c)
39+ ?: =(0 e)
4040 ['.' d]
4141 =. e (dec e)
4242 =+ f=(rsh 2 e c)
4343 [(add ?:((lte f 9) 48 87) f) $(c (end 2 e c))]
4444 ::
45− %' ' ['.' d]
46− %'.' ['~' '.' d]
47− %'~' ['~' '~' d]
48− ==
4945
5046Examples
5147--------
docs/system/hoon/library/src/4c/core/re.md+30−42
@@ -2,7 +2,7 @@
22
33Pretty-printing engine
44
5−Pretty-printing engine that accepts a [`++tank`](/doc/hoon/library/1#++tank) [sample]() and contains arms that perform computation on it.
5+Pretty-printing engine that accepts a `++tank` sample and contains arms that perform computation on it.
66
77Accepts
88-------
@@ -13,24 +13,24 @@ Produces
1313--------
1414
1515 ++ re
16− |_ tac=tank
16+ |_ tac/tank
1717
1818Examples
1919--------
2020
21− /~zod/try=> ~(. re leaf/"ham")
22− <2.ghl [[%leaf ""] <414.gly 100.xkc 1.ypj %164>]>
21+ /~zod/try=> ~(. re leaf+"ham")
22+ <2.gdc {tac/{$leaf ""} <402.arm 110.jyx 1.ztu $151>}>
2323
2424### `++ram`
2525
2626Flatten to tape
2727
28−Flatten [`++tank`]() out into a [`++tape`]().
28+Flatten `++tank` out into a `++tape`.
2929
3030Accepts
3131-------
3232
33−`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
33+`tac` is a `++tank`, taken from sample of `++re` core.
3434
3535Produces
3636--------
@@ -43,9 +43,9 @@ Source
4343 ++ ram
4444 ^- tape
4545 ?- -.tac
46− %leaf p.tac
47− %palm ram(tac [%rose [p.p.tac (weld q.p.tac r.p.tac) s.p.tac] q.tac])
48− %rose
46+ $leaf p.tac
47+ $palm ram(tac [%rose [p.p.tac (weld q.p.tac r.p.tac) s.p.tac] q.tac])
48+ $rose
4949 %+ weld
5050 q.p.tac
5151 |- ^- tape
@@ -59,9 +59,9 @@ Source
5959Examples
6060--------
6161
62− /~zod/try=> ~(ram re leaf/"foo")
62+ /~zod/try=> ~(ram re leaf+"foo")
6363 "foo"
64− /~zod/try=> ~(ram re rose/["." "(" ")"]^~[leaf/"bar" leaf/"baz" leaf/"bam"])
64+ /~zod/try=> ~(ram re rose+["." "(" ")"]^~[leaf+"bar" leaf+"baz" leaf+"bam"])
6565 "(bar.baz.bam)"
6666
6767### `++win`
@@ -73,25 +73,25 @@ Render at indent level `tab` and width `edg`.
7373Accepts
7474-------
7575
76−`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
76+`tac` is a `++tank`, taken from sample of `++re` core.
7777
7878`tab` and `edg` are atoms.
7979
8080Produces
8181--------
8282
83−A [`++wall`]() ([`++list`]() of [`++tapes`]()).
83+A `++wall` (`++list` of `++tapes`).
8484
8585Source
8686------
8787
8888 ++ win
89− |= [tab=@ edg=@]
89+ |= {tab/@ edg/@}
9090 =+ lug=`wall`~
9191 |^ |- ^- wall
9292 ?- -.tac
93− %leaf (rig p.tac)
94− %palm
93+ $leaf (rig p.tac)
94+ $palm
9595 ?: fit
9696 (rig ram)
9797 ?~ q.tac
@@ -111,30 +111,17 @@ Source
111111 ==
112112 (wig(lug qyr) q.p.tac)
113113 ::
114− %rose
115− ?: fit
116− (rig ram)
117− =+ ^= gyl
118− |- ^- wall
119− ?~ q.tac
120− ?:(=(%$ r.p.tac) lug (rig r.p.tac))
121− ^$(tac i.q.tac, lug $(q.tac t.q.tac), tab din)
122− ?: =(%$ q.p.tac)
123− gyl
124− (wig(lug gyl) q.p.tac)
125− ==
126− ::
127114
128115Examples
129116--------
130117
131− /~zod/try=> (~(win re leaf/"samoltekon-lapdok") 0 20)
118+ /~zod/try=> (~(win re leaf+"samoltekon-lapdok") 0 20)
132119 <<"samoltekon-lapdok">>
133− /~zod/try=> (~(win re leaf/"samoltekon-lapdok") 0 10)
120+ /~zod/try=> (~(win re leaf+"samoltekon-lapdok") 0 10)
134121 <<"\/samolt\/" " ekon-l" " apdok" "\/ \/">>
135− /~zod/try=> (~(win re rose/["--" "[" "]"]^~[leaf/"1423" leaf/"2316"]) 0 20)
122+ /~zod/try=> (~(win re rose+["--" "[" "]"]^~[leaf+"1423" leaf+"2316"]) 0 20)
136123 <<"[1423--2316]">>
137− /~zod/try=> (~(win re rose/["--" "[" "]"]^~[leaf/"1423" leaf/"2316"]) 0 10)
124+ /~zod/try=> (~(win re rose+["--" "[" "]"]^~[leaf+"1423" leaf+"2316"]) 0 10)
138125 <<"[ 1423" " 2316" "]">>
139126
140127### `++din`
@@ -185,28 +172,28 @@ Examples
185172
186173Wrap in `\/`
187174
188−Wrap [`++tape`]() in `\/` if it doesn't fit at current indentation. Internal to
189−[`++win`]()
175+Wrap `++tape` in `\/` if it doesn't fit at current indentation. Internal to
176+`++win`
190177
191178Accepts
192179-------
193180
194−`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
181+`tac` is a `++tank`, taken from sample of `++re` core.
195182
196183`hom` is a `++tape`.
197184
198185Produces
199186--------
200187
201−A [`++wall`]() (list of `++tape`s).
188+A `++wall` (list of `++tape`s).
202189
203190Source
204191------
205192
206193 ++ rig
207− |= hom=tape
194+ |= hom/tape
208195 ^- wall
209− ?: (lte (lent hom) (sub edg tab))
196+ ?: & ::(lte (lent hom) (sub edg tab))
210197 [(runt [tab ' '] hom) lug]
211198 => .(tab (add tab 2), edg (sub edg 2))
212199 =+ mut=(trim (sub edg tab) hom)
@@ -229,12 +216,12 @@ Examples
229216
230217`++win` render tape
231218
232−Render [`++tape`](). Internal to [`++win`]().
219+Render `++tape`. Internal to `++win`.
233220
234221Accepts
235222-------
236223
237−`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
224+`tac` is a `++tank`, taken from sample of `++re` core.
238225
239226`hom` is a `++tape`.
240227
@@ -242,7 +229,7 @@ Produces
242229--------
243230
244231 ++ wig
245− |= hom=tape
232+ |= hom/tape
246233 ^- wall
247234 ?~ lug
248235 (rig hom)
@@ -259,4 +246,5 @@ Produces
259246
260247
261248
249+
262250***
docs/system/hoon/library/src/4c/gate/show.md+28−28
@@ -1,49 +1,48 @@
11### `++show`
22
3− ++ show :: XX deprecated, use type
4− |= vem=*
3+ ++ show :: XX deprecated, use span
4+ |= vem/*
55 |^ ^- tank
66 ?: ?=(@ vem)
77 [%leaf (mesc (trip vem))]
88 ?- vem
9− [s=~ c=*]
9+ {s/$~ c/*}
1010 [%leaf '\'' (weld (mesc (tape +.vem)) `tape`['\'' ~])]
1111 ::
12− [s=%a c=@] [%leaf (mesc (trip c.vem))]
13− [s=%b c=*] (shop c.vem |=(a=@ ~(rub at a)))
14− [s=[%c p=@] c=*]
12+ {s/$a c/@} [%leaf (mesc (trip c.vem))]
13+ {s/$b c/*} (shop c.vem |=(a/@ ~(rub at a)))
14+ {s/{$c p/@} c/*}
1515 :+ %palm
1616 [['.' ~] ['-' ~] ~ ~]
1717 [[%leaf (mesc (trip p.s.vem))] $(vem c.vem) ~]
1818 ::
19− [s=%d c=*] (shop c.vem |=(a=@ ~(rud at a)))
20− [s=%k c=*] (tank c.vem)
21− [s=%h c=*]
22− ?: =(0 c.vem) :: XX remove after 220
23− [%leaf '#' ~]
19+ {s/$d c/*} (shop c.vem |=(a/@ ~(rud at a)))
20+ {s/$k c/*} (tank c.vem)
21+ {s/$h c/*}
2422 :+ %rose
2523 [['/' ~] ['/' ~] ~]
26− =+ yol=((list ,@ta) c.vem)
27− (turn yol |=(a=@ta [%leaf (trip a)]))
24+ =+ yol=((list @ta) c.vem)
25+ (turn yol |=(a/@ta [%leaf (trip a)]))
2826 ::
29− [s=%o c=*]
27+ {s/$l c/*} (shol c.vem)
28+ {s/$o c/*}
3029 %= $
3130 vem
3231 :- [%m '%h:<[%d %d].[%d %d]>']
3332 [-.c.vem +<-.c.vem +<+.c.vem +>-.c.vem +>+.c.vem ~]
3433 ==
3534 ::
36− [s=%p c=*] (shop c.vem |=(a=@ ~(rup at a)))
37− [s=%q c=*] (shop c.vem |=(a=@ ~(r at a)))
38− [s=%r c=*] $(vem [[%r ' ' '{' '}'] c.vem])
39− [s=%t c=*] (shop c.vem |=(a=@ ~(rt at a)))
40− [s=%v c=*] (shop c.vem |=(a=@ ~(ruv at a)))
41− [s=%x c=*] (shop c.vem |=(a=@ ~(rux at a)))
42− [s=[%m p=@] c=*] (shep p.s.vem c.vem)
43− [s=[%r p=@] c=*]
35+ {s/$p c/*} (shop c.vem |=(a/@ ~(rup at a)))
36+ {s/$q c/*} (shop c.vem |=(a/@ ~(r at a)))
37+ {s/$r c/*} $(vem [[%r ' ' '{' '}'] c.vem])
38+ {s/$t c/*} (shop c.vem |=(a/@ ~(rt at a)))
39+ {s/$v c/*} (shop c.vem |=(a/@ ~(ruv at a)))
40+ {s/$x c/*} (shop c.vem |=(a/@ ~(rux at a)))
41+ {s/{$m p/@} c/*} (shep p.s.vem c.vem)
42+ {s/{$r p/@} c/*}
4443 $(vem [[%r ' ' (cut 3 [0 1] p.s.vem) (cut 3 [1 1] p.s.vem)] c.vem])
4544 ::
46− [s=[%r p=@ q=@ r=@] c=*]
45+ {s/{$r p/@ q/@ r/@} c/*}
4746 :+ %rose
4847 :* p=(mesc (trip p.s.vem))
4948 q=(mesc (trip q.s.vem))
@@ -54,7 +53,7 @@
5453 ~
5554 [^$(vem -.c.vem) $(c.vem +.c.vem)]
5655 ::
57− [s=%z c=*] $(vem [[%r %$ %$ %$] c.vem])
56+ {s/$z c/*} $(vem [[%r %$ %$ %$] c.vem])
5857 * !!
5958 ==
6059
@@ -63,7 +62,7 @@ XX document
6362### `++shep`
6463
6564 ++ shep
66− |= [fom=@ gar=*]
65+ |= {fom/@ gar/*}
6766 ^- tank
6867 =+ l=(met 3 fom)
6968 =+ i=0
@@ -84,8 +83,8 @@ XX document
8483
8584### `++shop`
8685
87− ++ shop
88− |= [aug=* vel=$+(a=@ tape)]
86+ ++ shop
87+ |= {aug/* vel/$-(a/@ tape)}
8988 ^- tank
9089 ?: ?=(@ aug)
9190 [%leaf (vel aug)]
@@ -96,7 +95,8 @@ XX document
9695 ?: ?=(@ aug)
9796 [^$ ~]
9897 [^$(aug -.aug) $(aug +.aug)]
99− --
98+ ::
99+
100100
101101XX document
102102
docs/system/hoon/library/src/4d/gate/last.md+4−5
@@ -2,15 +2,15 @@
22
33Farther trace
44
5−Compares two line-column pairs, called [`++hair`]()s, `zyc` and `naz`, producing whichever
5+Compares two line-column pairs, called `++hair`s, `zyc` and `naz`, producing whichever
66is further along.
77
88Accepts
99-------
1010
11−`naz` is a [hair]().
11+`naz` is a hair.
1212
13−`zyc` is a [hair]().
13+`zyc` is a hair.
1414
1515Produces
1616--------
@@ -20,12 +20,11 @@ a `++hair`.
2020Source
2121------
2222
23− ++ last |= [zyc=hair naz=hair] :: farther trace
23+ ++ last |= {zyc/hair naz/hair} :: farther trace
2424 ^- hair
2525 ?: =(p.zyc p.naz)
2626 ?:((gth q.zyc q.naz) zyc naz)
2727 ?:((gth p.zyc p.naz) zyc naz)
28− ::
2928
3029
3130Examples
docs/system/hoon/library/src/4d/gate/lust.md+4−3
@@ -3,7 +3,7 @@
33
44Detect newline
55
6−Advances the [`++hair`]() `naz` by a row if the [`++char`]() `weq` is a newline, or by a
6+Advances the `++hair` `naz` by a row if the `++char` `weq` is a newline, or by a
77column if `weq` is any other character.
88
99Accepts
@@ -21,9 +21,10 @@ A hair.
2121Source
2222------
2323
24− ++ lust |= [weq=char naz=hair] :: detect newline
24+ ++ lust |= {weq/char naz/hair} :: detect newline
2525 ^- hair
26− ?:(=(10 weq) [+(p.naz) 1] [p.naz +(q.naz)])
26+ ?:(=(`@`10 weq) [+(p.naz) 1] [p.naz +(q.naz)])
27+
2728
2829
2930Examples
docs/system/hoon/library/src/4e/gate/bend.md+14−14
@@ -2,8 +2,8 @@
22
33Conditional composer
44
5−Parsing composer: connects the [`++edge`]() `vex` with the subsequent [`++rule`]() `sab`
6−as an optional suffix, using [gate]() `raq` to compose or reject its
5+Parsing composer: connects the `++edge` `vex` with the subsequent `++rule` `sab`
6+as an optional suffix, using gate `raq` to compose or reject its
77result. If there is no suffix, or if the suffix fails to be composed
88with the current result, the current result is produced. Used to map a
99group of rules to a specified output.
@@ -11,25 +11,25 @@ group of rules to a specified output.
1111Accepts
1212-------
1313
14−`raq` is a [gate]().
14+`raq` is a gate.
1515
16−`sab` is a [rule]().
16+`sab` is a rule.
1717
18−`vex` is an [edge]().
18+`vex` is an edge.
1919
2020Produces
2121--------
2222
23−A [`++rule`]().
23+A `++rule`.
2424
2525Source
2626------
2727
2828 ++ bend :: conditional comp
2929 ~/ %bend
30− |* raq=_|*([a=* b=*] [~ u=[a b]])
30+ |* raq/_|*({a/* b/*} [~ u=[a b]])
3131 ~/ %fun
32− |* [vex=edge sab=_rule]
32+ |* {vex/edge sab/rule}
3333 ?~ q.vex
3434 vex
3535 =+ yit=(sab q.u.q.vex)
@@ -45,18 +45,18 @@ Source
4545Examples
4646--------
4747
48− ~zod/try=> (;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qs")
48+ ~zod/try=> (;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qs")
4949 [p=[p=1 q=3] q=[~ u=[p=~~q q=[p=[p=1 q=2] q="s"]]]]
50− ~zod/try=> (;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qqq")
50+ ~zod/try=> (;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qqq")
5151 [p=[p=1 q=3] q=[~ u=[p=~~r q=[p=[p=1 q=3] q="q"]]]]
52− ~zod/try=> (scan "aa" ;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn))
52+ ~zod/try=> (scan "aa" ;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn))
5353 ~~b
54− ~zod/try=> (scan "ba" ;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn))
54+ ~zod/try=> (scan "ba" ;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn))
5555 ! {1 3}
5656 ! exit
57− ~zod/try=> `(unit ,@tas)`(scan "" ;~((bend) (easy ~) sym))
57+ ~zod/try=> `(unit @tas)`(scan "" ;~((bend) (easy ~) sym))
5858 ~
59− ~zod/try=> `(unit ,@tas)`(scan "sep" ;~((bend) (easy ~) sym))
59+ ~zod/try=> `(unit @tas)`(scan "sep" ;~((bend) (easy ~) sym))
6060 [~ %sep]
6161
6262
docs/system/hoon/library/src/4e/gate/comp.md+9−8
@@ -2,14 +2,14 @@
22
33Arbitrary compose
44
5−Parsing composer: connects the [`++edge`]() `vex` with a following [`++rule`]() `sab`,
5+Parsing composer: connects the `++edge` `vex` with a following `++rule` `sab`,
66combining the contents of `vex` with the result of `sab` using a binary
7−[gate]() `raq`. Used to fold over the results of several `++rules`.
7+gate `raq`. Used to fold over the results of several `++rules`.
88
99Accepts
1010-------
1111
12−`raq` is a gate that accepts a cell of two [nouns](), `a` and `b`, and
12+`raq` is a gate that accepts a cell of two nouns, `a` and `b`, and
1313produces a cell of two nouns.
1414
1515`sab` is a rule.
@@ -19,16 +19,17 @@ produces a cell of two nouns.
1919Produces
2020--------
2121
22−A [`++rule`]().
22+A `++rule`.
2323
2424Source
2525------
2626
2727 ++ comp
2828 ~/ %comp
29− |* raq=_|*([a=* b=*] [a b]) :: arbitrary compose
29+ |* raq/_|*({a/* b/*} [a b]) :: arbitrary compose
3030 ~/ %fun
31− |* [vex=edge sab=_rule]
31+ |* {vex/edge sab/rule}
32+ ~! +<
3233 ?~ q.vex
3334 vex
3435 =+ yit=(sab q.u.q.vex)
@@ -41,9 +42,9 @@ Source
4142Examples
4243--------
4344
44− ~zod/try=> (scan "123" ;~((comp |=([a=@u b=@u] (add a b))) dit dit dit))
45+ ~zod/try=> (scan "123" ;~((comp |=([a/@u b/@u] (add a b))) dit dit dit))
4546 6
46− ~zod/try=> (scan "12" ;~((comp |=([a=@u b=@u] (add a b))) dit dit dit))
47+ ~zod/try=> (scan "12" ;~((comp |=([a/@u b/@u] (add a b))) dit dit dit))
4748 ! {1 3}
4849 ! exit
4950
docs/system/hoon/library/src/4e/gate/fail.md+3−3
@@ -2,13 +2,13 @@
22
33Never parse
44
5−Produces an [`++edge`]() at the same text position ([`++hair`]()) with a failing
5+Produces an `++edge` at the same text position (`++hair`) with a failing
66result (`q=~`).
77
88Accepts
99-------
1010
11−`tub` is a [`++nail`]().
11+`tub` is a `++nail`.
1212
1313Produces
1414--------
@@ -18,7 +18,7 @@ An `++edge`.
1818Source
1919------
2020
21− ++ fail |=(tub=nail [p=p.tub q=~]) :: never parse
21+ ++ fail |=(tub/nail [p=p.tub q=~]) :: never parse
2222
2323Examples
2424--------
docs/system/hoon/library/src/4e/gate/glue.md+3−3
@@ -2,7 +2,7 @@
22
33Skip delimiter
44
5−Parsing composer: connects an [`++edge`]() `vex` with a following [`++rule`]() `sab` by
5+Parsing composer: connects an `++edge` `vex` with a following `++rule` `sab` by
66parsing the `++rule` `bus` (the delimiting symbol) and throwing out the
77result.
88
@@ -25,9 +25,9 @@ Source
2525
2626 ++ glue :: add rule
2727 ~/ %glue
28− |* bus=_rule
28+ |* bus/rule
2929 ~/ %fun
30− |* [vex=edge sab=_rule]
30+ |* {vex/edge sab/rule}
3131 (plug vex ;~(pfix bus sab))
3232 ::
3333
docs/system/hoon/library/src/4e/gate/less.md+4−4
@@ -2,8 +2,8 @@
22
33Parse unless
44
5−Parsing composer: if an [`++edge`]() `vex` reflects a success, fail. Otherwise,
6−connect `vex` with the following [`++rule`]().
5+Parsing composer: if an `++edge` `vex` reflects a success, fail. Otherwise,
6+connect `vex` with the following `++rule`.
77
88Accepts
99-------
@@ -21,11 +21,11 @@ Source
2121------
2222
2323 ++ less :: no first and second
24− |* [vex=edge sab=_rule]
24+ |* {vex/edge sab/rule}
2525 ?~ q.vex
2626 =+ roq=(sab)
2727 [p=(last p.vex p.roq) q=q.roq]
28− vex(q ~)
28+ (fail +<.sab)
2929 ::
3030
3131Examples
docs/system/hoon/library/src/4e/gate/pfix.md+3−4
@@ -2,13 +2,13 @@
22
33Discard first rule
44
5−Parsing composer: connects an [`++edge`]() `vex` with two subsequent [`++rule`]()s,
5+Parsing composer: connects an `++edge` `vex` with two subsequent `++rule`s,
66ignoring the result of the first and producing the result of the second.
77
88Accepts
99-------
1010
11−`vex` is an [edge]().
11+`vex` is an edge.
1212
1313Produces
1414--------
@@ -20,8 +20,7 @@ Source
2020
2121 ++ pfix :: discard first rule
2222 ~/ %pfix
23− (comp |*([a=* b=*] b))
24− ::
23+ (comp |*({a/* b/*} b))
2524
2625Examples
2726--------
docs/system/hoon/library/src/4e/gate/plug.md+3−3
@@ -2,8 +2,8 @@
22
33Parse to tuple
44
5−Parsing composer: connects an [`++edge`]() `vex` with a following [`++rule`]() `sab`, producing
6−a cell of both the results. See also: the monad applicator [;\~]() for a
5+Parsing composer: connects an `++edge` `vex` with a following `++rule` `sab`, producing
6+a cell of both the results. See also: the monad applicator ;\~ for a
77more detailed explanation.
88
99Accepts
@@ -23,7 +23,7 @@ Source
2323
2424 ++ plug :: first then second
2525 ~/ %plug
26− |* [vex=edge sab=_rule]
26+ |* {vex/edge sab/rule}
2727 ?~ q.vex
2828 vex
2929 =+ yit=(sab q.u.q.vex)
docs/system/hoon/library/src/4e/gate/pose.md+6−4
@@ -3,14 +3,14 @@
33Parse options
44
55Parsing composer: if `vex` reflects a failure, connect it with the
6−following rule `sab`. See also: the monad applicator [;\~]()
6+following rule `sab`. See also: the monad applicator ;\~
77
88Accepts
99-------
1010
11−`sab` is a [`++rule`]().
11+`sab` is a `++rule`.
1212
13−`vex` is an [`++edge`]().
13+`vex` is an `++edge`.
1414
1515Produces
1616--------
@@ -22,11 +22,13 @@ Source
2222
2323 ++ pose :: first or second
2424 ~/ %pose
25− |* [vex=edge sab=_rule]
25+ |* {vex/edge sab/rule}
2626 ?~ q.vex
2727 =+ roq=(sab)
2828 [p=(last p.vex p.roq) q=q.roq]
2929 vex
30+ ::
31+
3032
3133Examples
3234--------
docs/system/hoon/library/src/4e/gate/sfix.md+3−2
@@ -2,7 +2,7 @@
22
33Discard second rule
44
5−Parsing composer: connects [`++edge`]()s `vex` with two subsequent [`++rule`]()s returning the
5+Parsing composer: connects `++edge`s `vex` with two subsequent `++rule`s returning the
66result of the first and discarding the result of the second.
77
88Accepts
@@ -22,7 +22,8 @@ Source
2222
2323 ++ sfix :: discard second rule
2424 ~/ %sfix
25− (comp |*([a=* b=*] a))
25+ (comp |*({a/* b/*} a))
26+
2627
2728Examples
2829--------
docs/system/hoon/library/src/4e/gate/simu.md+3−3
@@ -2,8 +2,8 @@
22
33First and second
44
5−Parsing composer: if an [`++edge`]() `vex` reflects a failure, fail. Otherwise,
6−connect `vex` with the following [`++rule`]().
5+Parsing composer: if an `++edge` `vex` reflects a failure, fail. Otherwise,
6+connect `vex` with the following `++rule`.
77
88Accepts
99-------
@@ -21,7 +21,7 @@ Source
2121------
2222
2323 ++ simu :: first and second
24− |* [vex=edge sab=_rule]
24+ |* {vex/edge sab/rule}
2525 ?~ q.vex
2626 vex
2727 =+ roq=(sab)
docs/system/hoon/library/src/4f/gate/bass.md+9−7
@@ -1,31 +1,33 @@
11### `++bass`
22
3−Parser modifier: [LSB](http://en.wikipedia.org/wiki/Least_significant_bit)
4−ordered [`++list`]() as atom of a [`++base`]().
3+Parser modifier: LSB
4+ordered `++list` as atom of a `++base`.
55
66Accepts
77-------
88
99`wuc` is an atom.
1010
11−`tyd` is a [`++rule`]().
11+`tyd` is a `++rule`.
1212
1313Produces
1414--------
1515
16−A [`++rule`]().
16+A `++rule`.
1717
1818Source
1919------
2020
2121 ++ bass
22− |* [wuc=@ tyd=_rule]
22+ |* {wuc/@ tyd/rule}
2323 %+ cook
24− |= waq=(list ,@)
24+ |= waq/(list @)
2525 %+ roll
2626 waq
27− =|([p=@ q=@] |.((add p (mul wuc q))))
27+ =|({p/@ q/@} |.((add p (mul wuc q))))
2828 tyd
29+ ::
30+
2931
3032Examples
3133--------
docs/system/hoon/library/src/4f/gate/boss.md+9−7
@@ -1,32 +1,34 @@
11
22### `++boss`
33
4−Parser modifier: [LSB](http://en.wikipedia.org/wiki/Least_significant_bit)
5−ordered [`++list`]() as atom of a [`++base`]().
4+Parser modifier: LSB
5+
6+Ordered `++list` as atom of a `++base`.
67
78Accepts
89-------
910
1011`wuc` is an atom.
1112
12−`tyd` is a [`++rule`]().
13+`tyd` is a `++rule`.
1314
1415Produces
1516--------
1617
17−A [`++rule`]().
18+A `++rule`.
1819
1920Source
2021------
2122
2223 ++ boss
23− |* [wuc=@ tyd=_rule]
24+ |* {wuc/@ tyd/rule}
2425 %+ cook
25− |= waq=(list ,@)
26+ |= waq/(list @)
2627 %+ reel
2728 waq
28− =|([p=@ q=@] |.((add p (mul wuc q))))
29+ =|({p/@ q/@} |.((add p (mul wuc q))))
2930 tyd
31+ ::
3032
3133Examples
3234--------
docs/system/hoon/library/src/4f/gate/cold.md+6−7
@@ -2,34 +2,33 @@
22
33Replace with constant
44
5−Parser modifier. Accepts a [`++rule`]() `sef` and produces a parser that
5+Parser modifier. Accepts a `++rule` `sef` and produces a parser that
66produces a constant `cus`, assuming `sef` is successful.
77
88Accepts
99-------
1010
11−`cus` is a constant [noun]().
11+`cus` is a constant noun.
1212
1313`sef` is a `++rule`.
1414
1515Produces
1616--------
1717
18−An [`++edge`]().
18+An `++edge`.
1919
2020Source
2121------
2222
23− ++ cold :: replace w/ constant
23+ ++ cold :: replace w+ constant
2424 ~/ %cold
25− |* [cus=* sef=_rule]
25+ |* {cus/* sef/rule}
2626 ~/ %fun
27− |= tub=nail
27+ |= tub/nail
2828 =+ vex=(sef tub)
2929 ?~ q.vex
3030 vex
3131 [p=p.vex q=[~ u=[p=cus q=q.u.q.vex]]]
32− ::
3332
3433Examples
3534--------
docs/system/hoon/library/src/4f/gate/cook.md+6−6
@@ -3,28 +3,28 @@
33Apply gate
44
55Parser modifier. Produces a parser that takes a (successful) result of a
6−[`++rule`]() `sef` and slams it through `poq`.
6+`++rule` `sef` and slams it through `poq`.
77
88Accepts
99-------
1010
11−`poq` is a [gate]().
11+`poq` is a gate.
1212
13−`sef` is a [`++rule`]().
13+`sef` is a `++rule`.
1414
1515Produces
1616--------
1717
18−An [`++rule`]().
18+An `++rule`.
1919
2020Source
2121------
2222
2323 ++ cook :: apply gate
2424 ~/ %cook
25− |* [poq=_,* sef=_rule]
25+ |* {poq/$-(* *) sef/rule}
2626 ~/ %fun
27− |= tub=nail
27+ |= tub/nail
2828 =+ vex=(sef tub)
2929 ?~ q.vex
3030 vex
docs/system/hoon/library/src/4f/gate/easy.md+2−2
@@ -2,7 +2,7 @@
22
33Always parse
44
5−Parser generator. Produces a parser that succeeds with given [noun]() `huf`
5+Parser generator. Produces a parser that succeeds with given noun `huf`
66without consuming any text.
77
88Accepts
@@ -13,7 +13,7 @@ Accepts
1313Produces
1414--------
1515
16−A [`++rule`]().
16+A `++rule`.
1717
1818Source
1919------
docs/system/hoon/library/src/4f/gate/full.md+2−2
@@ -2,13 +2,13 @@
22
33Parse to end
44
5−Parser modifier. Accepts a [`++rule`]() `sef`, and produces a parser that succeeds only
5+Parser modifier. Accepts a `++rule` `sef`, and produces a parser that succeeds only
66when the of `tub` is fully consumed using `sef`.
77
88Accepts
99-------
1010
11−`sef` is a [`++rule`]().
11+`sef` is a `++rule`.
1212
1313Produces
1414--------
docs/system/hoon/library/src/4f/gate/funk.md+4−5
@@ -2,14 +2,14 @@
22
33Add to tape
44
5−Parser modifier: prepend text to [`++tape`]() before applying parser.
5+Parser modifier: prepend text to `++tape` before applying parser.
66
77Accepts
88-------
99
1010`pre` is a `++tape`
1111
12−`sef` is a [`++rule`]()
12+`sef` is a `++rule`
1313
1414Produces
1515--------
@@ -20,10 +20,9 @@ Source
2020------
2121
2222 ++ funk :: add to tape first
23− |* [pre=tape sef=_rule]
24− |= tub=nail
23+ |* {pre/tape sef/rule}
24+ |= tub/nail
2525 (sef p.tub (weld pre q.tub))
26− ::
2726
2827Examples
2928--------
docs/system/hoon/library/src/4f/gate/here.md+6−6
@@ -2,16 +2,16 @@
22
33Place-based apply
44
5−Parser modifier. Similar to [`++cook`]() in that it produces a parser that takes a
5+Parser modifier. Similar to `++cook` in that it produces a parser that takes a
66(successful) result of `sef` and slams it through `hez`. `hez` accepts a
7−[`++pint`]() `a` and a [noun]() `b`, which is what the parser parsed.
7+`++pint` `a` and a noun `b`, which is what the parser parsed.
88
99Accepts
1010-------
1111
12−`hez` is a [gate]().
12+`hez` is a gate.
1313
14−`sef` is a [`++rule`]()
14+`sef` is a `++rule`
1515
1616Produces
1717--------
@@ -23,9 +23,9 @@ Source
2323
2424 ++ here :: place-based apply
2525 ~/ %here
26− |* [hez=_|=([a=pint b=*] [a b]) sef=_rule]
26+ |* {hez/_|=({a/pint b/*} [a b]) sef/rule}
2727 ~/ %fun
28− |= tub=nail
28+ |= tub/nail
2929 =+ vex=(sef tub)
3030 ?~ q.vex
3131 vex
docs/system/hoon/library/src/4f/gate/ifix.md+7−3
@@ -2,7 +2,7 @@
22
33Infix
44
5−Parser modifier: surround with pair of [`++rule`]()s, the output of which is
5+Parser modifier: surround with pair of `++rule`s, the output of which is
66discarded.
77
88Accepts
@@ -21,8 +21,12 @@ Source
2121------
2222
2323 ++ ifix
24− |* [fel=[p=_rule q=_rule] hof=_rule]
25− ;~(pfix p.fel ;~(sfix hof q.fel))
24+ |* {fel/{rule rule} hof/rule}
25+ ~! +<
26+ ~! +<:-.fel
27+ ~! +<:+.fel
28+ ;~(pfix -.fel ;~(sfix hof +.fel))
29+ ::
2630
2731Examples
2832--------
docs/system/hoon/library/src/4f/gate/jest.md+7−7
@@ -7,24 +7,24 @@ Match and consume a cord.
77Accepts
88-------
99
10−`daf` is a [`@t`]().
10+`daf` is a `@t`.
1111
1212Produces
1313--------
1414
15−An [`++edge`]().
15+An `++edge`.
1616
1717Source
1818------
1919
2020 ++ jest :: match a cord
21− |= daf=@t
22− |= tub=nail
21+ |= daf/@t
22+ |= tub/nail
2323 =+ fad=daf
24− |- ^- (like ,@t)
25− ?: =(0 daf)
24+ |- ^- (like @t)
25+ ?: =(`@`0 daf)
2626 [p=p.tub q=[~ u=[p=fad q=tub]]]
27− ?: |(?=(~ q.tub) !=((end 3 1 daf) i.q.tub))
27+ ?: |(?=($~ q.tub) !=((end 3 1 daf) i.q.tub))
2828 (fail tub)
2929 $(p.tub (lust i.q.tub p.tub), q.tub t.q.tub, daf (rsh 3 1 daf))
3030 ::
docs/system/hoon/library/src/4f/gate/just.md+4−4
@@ -7,21 +7,21 @@ Match and consume a single character.
77Accepts
88-------
99
10−`daf` is a [`++char`]()
10+`daf` is a `++char`
1111
1212Produces
1313--------
1414
15−A [`++rule`]().
15+A `++rule`.
1616
1717Source
1818------
1919
2020 ++ just :: XX redundant, jest
2121 ~/ %just :: match a char
22− |= daf=char
22+ |= daf/char
2323 ~/ %fun
24− |= tub=nail
24+ |= tub/nail
2525 ^- (like char)
2626 ?~ q.tub
2727 (fail tub)
docs/system/hoon/library/src/4f/gate/knee.md+5−5
@@ -10,20 +10,20 @@ Accepts
1010
1111`gar` is a noun.
1212
13−`sef` is a [gate]() that accepts a [`++rule`]()
13+`sef` is a gate that accepts a `++rule`
1414
1515Produces
1616--------
1717
18−A [`++rule`]().
18+A `++rule`.
1919
2020Source
2121------
2222
2323 ++ knee :: callbacks
24− |* [gar=* sef=_|.(rule)]
25− |= tub=nail
26− ^- (like ,_gar)
24+ |* {gar/* sef/_|.(*rule)}
25+ |= tub/nail
26+ ^- (like _gar)
2727 ((sef) tub)
2828 ::
2929
docs/system/hoon/library/src/4f/gate/mask.md+5−5
@@ -8,25 +8,25 @@ characters.
88Accepts
99-------
1010
11−`bud` is a list of [`++char`]()
11+`bud` is a list of `++char`
1212
1313Produces
1414--------
1515
16−A [`++rule`]().
16+A `++rule`.
1717
1818Source
1919------
2020
2121 ++ mask :: match char in set
2222 ~/ %mask
23− |= bud=(list char)
23+ |= bud/(list char)
2424 ~/ %fun
25− |= tub=nail
25+ |= tub/nail
2626 ^- (like char)
2727 ?~ q.tub
2828 (fail tub)
29− ?. (lien bud |=(a=char =(i.q.tub a)))
29+ ?. (lien bud |=(a/char =(i.q.tub a)))
3030 (fail tub)
3131 (next tub)
3232 ::
docs/system/hoon/library/src/4f/gate/more.md+3−2
@@ -2,7 +2,7 @@
22
33Parse list with delimiter
44
5−Parser modifier: Parse a list of matches using a delimiter [`++rule`]().
5+Parser modifier: Parse a list of matches using a delimiter `++rule`.
66
77Accepts
88-------
@@ -20,8 +20,9 @@ Source
2020------
2121
2222 ++ more
23− |* [bus=_rule fel=_rule]
23+ |* {bus/rule fel/rule}
2424 ;~(pose (most bus fel) (easy ~))
25+ ::
2526
2627Examples
2728--------
docs/system/hoon/library/src/4f/gate/most.md+3−2
@@ -2,7 +2,7 @@
22
33Parse list of at least one match
44
5−Parser modifier: parse a [`++list`]() of at least one match using a delimiter [`++rule`]().
5+Parser modifier: parse a `++list` of at least one match using a delimiter `++rule`.
66
77Accepts
88-------
@@ -20,8 +20,9 @@ Source
2020------
2121
2222 ++ most
23− |* [bus=_rule fel=_rule]
23+ |* {bus/rule fel/rule}
2424 ;~(plug fel (star ;~(pfix bus fel)))
25+ ::
2526
2627Examples
2728--------
docs/system/hoon/library/src/4f/gate/next.md+3−3
@@ -7,18 +7,18 @@ Consume any character, producing it as a result.
77Accepts
88-------
99
10−`tub` is a [`++nail`]()
10+`tub` is a `++nail`
1111
1212Produces
1313--------
1414
15−An [`++edge`]().
15+An `++edge`.
1616
1717Source
1818------
1919
2020 ++ next :: consume a char
21− |= tub=nail
21+ |= tub/nail
2222 ^- (like char)
2323 ?~ q.tub
2424 (fail tub)
docs/system/hoon/library/src/4f/gate/plus.md+4−3
@@ -3,12 +3,12 @@
33
44List of at least one match.
55
6−Parser modifier: parse [`++list`]() of at least one match.
6+Parser modifier: parse `++list` of at least one match.
77
88Accepts
99-------
1010
11−`fel` is a [`++rule`]().
11+`fel` is a `++rule`.
1212
1313Produces
1414--------
@@ -18,7 +18,8 @@ A `++rule`.
1818Source
1919------
2020
21− ++ plus |*(fel=_rule ;~(plug fel (star fel)))
21+ ++ plus |*(fel/rule ;~(plug fel (star fel)))
22+
2223
2324Examples
2425--------
docs/system/hoon/library/src/4f/gate/sear.md+7−7
@@ -2,25 +2,24 @@
22
33Conditional `++cook`
44
5−Conditional [`++cook`](). Slams the result through a gate that produces
5+Conditional `++cook`. Slams the result through a gate that produces
66a unit; if that unit is empty, fail.
77
88Accepts
99-------
1010
11−`tub` is a [`++nail`](/doc/hoon/library/1#++nail)
12−
11+`tub` is a `++nail`.
1312Produces
1413--------
1514
16−A [`++rule`]().
15+A `++rule`.
1716
1817Source
1918------
2019
2120 ++ sear :: conditional cook
22− |* [pyq=_|=(* *(unit)) sef=_rule]
23− |= tub=nail
21+ |* {pyq/$-(* (unit)) sef/rule}
22+ |= tub/nail
2423 =+ vex=(sef tub)
2524 ?~ q.vex
2625 vex
@@ -30,10 +29,11 @@ Source
3029 [p=p.vex q=[~ u=[p=u.gey q=q.u.q.vex]]]
3130 ::
3231
32+
3333Examples
3434--------
3535
36− ~zod/try=> ((sear |=(a=* ?@(a (some a) ~)) (just `a`)) [[1 1] "abc"])
36+ ~zod/try=> ((sear |=(a/* ?@(a (some a) ~)) (just `a`)) [[1 1] "abc"])
3737 [p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]]
3838 ~zod/try=> ((sear |=(* ~) (just 'a')) [[1 1] "abc"])
3939 [p=[p=1 q=2] q=~]
docs/system/hoon/library/src/4f/gate/shim.md+4−4
@@ -2,7 +2,7 @@
22
33Char in range
44
5−Match characters ([`++char`]()) within a range.
5+Match characters (`++char`) within a range.
66
77Accepts
88-------
@@ -14,16 +14,16 @@ Accepts
1414Produces
1515--------
1616
17−A [`++rule`]().
17+A `++rule`.
1818
1919Source
2020------
2121
2222 ++ shim :: match char in range
2323 ~/ %shim
24− |= [les=@ mos=@]
24+ |= {les/@ mos/@}
2525 ~/ %fun
26− |= tub=nail
26+ |= tub/nail
2727 ^- (like char)
2828 ?~ q.tub
2929 (fail tub)
docs/system/hoon/library/src/4f/gate/slug.md+7−5
@@ -2,13 +2,13 @@
22
33Use gate to parse delimited list
44
5−Parser modifier: By composing with a [gate](), parse a delimited [`++list`]() of
5+Parser modifier: By composing with a gate, parse a delimited `++list` of
66matches.
77
88Accepts
99-------
1010
11−`bus` is a [`++rule`]().
11+`bus` is a `++rule`.
1212
1313`fel` is a `++rule`.
1414
@@ -21,16 +21,18 @@ Source
2121------
2222
2323 ++ slug
24− |* raq=_|*([a=* b=*] [a b])
25− |* [bus=_rule fel=_rule]
24+ |* raq/_|*({a/* b/*} [a b])
25+ |* {bus/rule fel/rule}
2626 ;~((comp raq) fel (stir +<+.raq raq ;~(pfix bus fel)))
27+ ::
28+
2729
2830Examples
2931--------
3032
3133 ~zod/try=> (scan "20+5+110" ((slug add) lus dem))
3234 135
33− ~zod/try=> `@t`(scan "a b c" ((slug |=(a=[@ @t] (cat 3 a))) ace alp))
35+ ~zod/try=> `@t`(scan "a b c" ((slug |=(a/[@ @t] (cat 3 a))) ace alp))
3436 'abc'
3537
3638
docs/system/hoon/library/src/4f/gate/stag.md+3−3
@@ -14,16 +14,16 @@ Accepts
1414Produces
1515--------
1616
17−A [`++rule`]().
17+A `++rule`.
1818
1919Source
2020------
2121
2222 ++ stag :: add a label
2323 ~/ %stag
24− |* [gob=* sef=_rule]
24+ |* {gob/* sef/rule}
2525 ~/ %fun
26− |= tub=nail
26+ |= tub/nail
2727 =+ vex=(sef tub)
2828 ?~ q.vex
2929 vex
docs/system/hoon/library/src/4f/gate/star.md+4−4
@@ -2,19 +2,19 @@
22
33List of matches
44
5−Parser modifier: parse [`++list`]() of matches.
5+Parser modifier: parse `++list` of matches.
66
77Accepts
88-------
99
10−`fel` is a [`++rule`]().
10+`fel` is a `++rule`.
1111
1212Produces
1313--------
1414
1515 ++ star :: 0 or more times
16− |* fel=_rule
17− (stir `(list ,_(wonk *fel))`~ |*([a=* b=*] [a b]) fel)
16+ |* fel/rule
17+ (stir `(list _(wonk *fel))`~ |*({a/* b/*} [a b]) fel)
1818
1919Examples
2020--------
docs/system/hoon/library/src/4f/gate/stet.md+1−1
@@ -18,7 +18,7 @@ Source
1818------
1919
2020 ++ stet
21− |* leh=(list ,[?(@ [@ @]) _rule])
21+ |* leh/(list {?(@ {@ @}) rule})
2222 |-
2323 ?~ leh
2424 ~
docs/system/hoon/library/src/4f/gate/stew.md+8−6
@@ -4,14 +4,14 @@ Switch by first
44
55 ++ stew :: switch by first char
66 ~/ %stew
7− |* leh=(list ,[p=?(@ [@ @]) q=_rule]) :: char/range keys
7+ |* leh/(list {p/?(@ {@ @}) q/rule}) :: char+range keys
88 =+ ^= wor :: range complete lth
9− |= [ort=?(@ [@ @]) wan=?(@ [@ @])]
9+ |= {ort/?(@ {@ @}) wan/?(@ {@ @})}
1010 ?@ ort
1111 ?@(wan (lth ort wan) (lth ort -.wan))
1212 ?@(wan (lth +.ort wan) (lth +.ort -.wan))
1313 =+ ^= hel :: build parser map
14− =+ hel=`(tree $_(?>(?=(^ leh) i.leh)))`~
14+ =+ hel=`(tree _?>(?=(^ leh) i.leh))`~
1515 |- ^+ hel
1616 ?~ leh
1717 ~
@@ -31,7 +31,7 @@ Switch by first
3131 [n.yal l.yal nuc]
3232 [n.nuc [n.yal l.yal l.nuc] r.nuc]
3333 ~% %fun ..^$ ~
34− |= tub=nail
34+ |= tub/nail
3535 ?~ q.tub
3636 (fail tub)
3737 |-
@@ -47,8 +47,10 @@ Switch by first
4747 $(hel r.hel)
4848 ::
4949
50−Parser generator. From an associative [`++list`]() of characters or character
51−ranges to [`++rule`]()s, construct a [`++map`](), and parse [`++tape`]()s only
50+
51+
52+Parser generator. From an associative `++list` of characters or character
53+ranges to `++rule`s, construct a `++map`, and parse `++tape`s only
5254with `++rules` associated with a range that the `++tape`'s first character falls in.
5355
5456
docs/system/hoon/library/src/4f/gate/stir.md+19−12
@@ -2,7 +2,7 @@
22
33Parse repeatedly
44
5−Parse with [`++rule`]() as many times as possible, and fold over results with a
5+Parse with `++rule` as many times as possible, and fold over results with a
66binary gate.
77
88Accepts
@@ -22,19 +22,26 @@ A rule.
2222Source
2323------
2424
25−++ stir :: parse repeatedly
26− ~/ %stir
27− |* [rud=* raq=_|*([a=* b=*] [a b]) fel=_rule]
28− ~/ %fun
29− |= tub=nail
30− ^- (like ,_rud)
25+ ++ stun :: parse several times
26+ |* {lig/{@ @} fel/rule}
27+ |= tub/nail
28+ ^- (like (list _(wonk (fel))))
29+ ?: =(0 +.lig)
30+ [p.tub [~ ~ tub]]
3131 =+ vex=(fel tub)
3232 ?~ q.vex
33− [p.vex [~ rud tub]]
34− =+ wag=$(tub q.u.q.vex)
35− ?> ?=(^ q.wag)
36− [(last p.vex p.wag) [~ (raq p.u.q.vex p.u.q.wag) q.u.q.wag]]
37− ::
33+ ?: =(0 -.lig)
34+ [p.vex [~ ~ tub]]
35+ vex
36+ =+ ^= wag %= $
37+ -.lig ?:(=(0 -.lig) 0 (dec -.lig))
38+ +.lig ?:(=(0 +.lig) 0 (dec +.lig))
39+ tub q.u.q.vex
40+ ==
41+ ?~ q.wag
42+ wag
43+ [p.wag [~ [p.u.q.vex p.u.q.wag] q.u.q.wag]]
44+
3845
3946Examples
4047--------
docs/system/hoon/library/src/4f/gate/stun.md+9−9
@@ -9,30 +9,30 @@ Accepts
99
1010`[les=@ mos=@]` is a cell of atoms indicating the bounds.
1111
12−`fel` is a [`++rule`]().
12+`fel` is a `++rule`.
1313
1414Produces
1515--------
1616
17−A [`++rule`]().
17+A `++rule`.
1818
1919Source
2020------
2121
2222 ++ stun :: parse several times
23− |* [[les=@ mos=@] fel=_rule]
24− |= tub=nail
25− ^- (like (list ,_(wonk (fel))))
26− ?: =(0 mos)
23+ |* {lig/{@ @} fel/rule}
24+ |= tub/nail
25+ ^- (like (list _(wonk (fel))))
26+ ?: =(0 +.lig)
2727 [p.tub [~ ~ tub]]
2828 =+ vex=(fel tub)
2929 ?~ q.vex
30− ?: =(0 les)
30+ ?: =(0 -.lig)
3131 [p.vex [~ ~ tub]]
3232 vex
3333 =+ ^= wag %= $
34− les ?:(=(0 les) 0 (dec les))
35− mos ?:(=(0 mos) 0 (dec mos))
34+ -.lig ?:(=(0 -.lig) 0 (dec -.lig))
35+ +.lig ?:(=(0 +.lig) 0 (dec +.lig))
3636 tub q.u.q.vex
3737 ==
3838 ?~ q.wag
docs/system/hoon/library/src/4g/gate/rash.md+3−2
@@ -2,7 +2,7 @@
22
33Parse or crash
44
5−Parse a cord with a given [`++rule`]() and crash if the [`++cord`]() isn't entirely
5+Parse a cord with a given `++rule` and crash if the `++cord` isn't entirely
66parsed.
77
88Accepts
@@ -20,7 +20,8 @@ The value of the parse result, or crash.
2020Source
2121------
2222
23− ++ rash |*([naf=@ sab=_rule] (scan (trip naf) sab)) ::
23+ ++ rash |*({naf/@ sab/rule} (scan (trip naf) sab)) ::
24+
2425
2526Examples
2627--------
docs/system/hoon/library/src/4g/gate/rush.md+4−3
@@ -8,9 +8,9 @@ entirely parsed.
88Accepts
99-------
1010
11−`naf` is an [atom]().
11+`naf` is an atom.
1212
13−`sab` is a [rule]().
13+`sab` is a rule.
1414
1515Produces
1616--------
@@ -20,7 +20,8 @@ The value of the parse result, or null.
2020Source
2121------
2222
23− ++ rush |*([naf=@ sab=_rule] (rust (trip naf) sab))
23+ ++ rush |*({naf/@ sab/rule} (rust (trip naf) sab))
24+
2425
2526Examples
2627--------
docs/system/hoon/library/src/4g/gate/rust.md+3−2
@@ -2,7 +2,7 @@
22
33Parse tape or null
44
5−Parse a [`++tape`]() with a given [`++rule`]() and produce null if the `++tape` isn't
5+Parse a `++tape` with a given `++rule` and produce null if the `++tape` isn't
66entirely parsed.
77
88Accepts
@@ -20,10 +20,11 @@ A `(unit ,@t)`
2020Source
2121------
2222
23− ++ rust |* [los=tape sab=_rule]
23+ ++ rust |* {los/tape sab/rule}
2424 =+ vex=((full sab) [[1 1] los])
2525 ?~(q.vex ~ [~ u=p.u.q.vex])
2626
27+
2728Examples
2829--------
2930
docs/system/hoon/library/src/4g/gate/scan.md+4−4
@@ -2,15 +2,15 @@
22
33Parse tape or crash
44
5−Parse a [`++tape`]() with a given [`++rule`]() and crash if the `++tape` isn't entirely
5+Parse a `++tape` with a given `++rule` and crash if the `++tape` isn't entirely
66parsed.
77
88Accepts
99-------
1010
11−`los` is a [tape]().
11+`los` is a tape.
1212
13−`sab` is a [rule]().
13+`sab` is a rule.
1414
1515Produces
1616--------
@@ -20,7 +20,7 @@ Either a `++tape` or a crash.
2020Source
2121------
2222
23− ++ scan |* [los=tape sab=_rule]
23+ ++ scan |* {los/tape sab/rule}
2424 =+ vex=((full sab) [[1 1] los])
2525 ?~ q.vex
2626 ~_ (show [%m '{%d %d}'] p.p.vex q.p.vex ~)
docs/system/hoon/library/src/4j/core/ab.md+53−53
@@ -22,7 +22,7 @@ Examples
2222
2323Parse hex pair
2424
25−Parsing [`++rule`](). Parses a pair of base-16 digits. Used in escapes.
25+Parsing `++rule`. Parses a pair of base-16 digits. Used in escapes.
2626
2727Accepts
2828-------
@@ -55,7 +55,7 @@ Examples
5555
5656Parse phonetic pair
5757
58−Parsing [`++rule`](). Parses an atom of [odor]() [`@pE`](), a phrase of two bytes
58+Parsing `++rule`. Parses an atom of odor `@pE`, a phrase of two bytes
5959encoded phonetically.
6060
6161Accepts
@@ -87,7 +87,7 @@ Examples
8787
8888Parse two phonetic pairs
8989
90−Parsing [`++rule`](). Parses and unscrambles an atom of odor [@pF](), a phrase
90+Parsing `++rule`. Parses and unscrambles an atom of odor @pF, a phrase
9191of two two-byte pairs that are encoded (and scrambled) phonetically.
9292
9393Accepts
@@ -104,7 +104,7 @@ Source
104104------
105105
106106 ++ huf %+ cook
107− |=([a=@ b=@] (wred:un ~(zug mu ~(zag mu [a b]))))
107+ |=([a/@ b/@] (wred:un ~(zug mu ~(zag mu [a b]))))
108108 ;~(plug hif ;~(pfix hep hif))
109109
110110Examples
@@ -123,13 +123,13 @@ Examples
123123
124124Parse 8 phonetic bytes
125125
126−Parsing [`++rule`](). Parses an atom of odor [@pG](), a phrase of eight of
126+Parsing `++rule`. Parses an atom of odor @pG, a phrase of eight of
127127phonetic bytes.
128128
129129Accepts
130130-------
131131
132−An atom of odor [`@pG`]()
132+An atom of odor `@pG`
133133
134134Produces
135135--------
@@ -155,12 +155,12 @@ Examples
155155
156156Parse \<= 5 base-32
157157
158−Parsing [`++rule`](). Parses up to five base-32 digits without a leading zero.
158+Parsing `++rule`. Parses up to five base-32 digits without a leading zero.
159159
160160Accepts
161161-------
162162
163−Up to five [@uv]() (base 64) digits.
163+Up to five @uv (base 64) digits.
164164
165165Produces
166166--------
@@ -191,12 +191,12 @@ Examples
191191
192192Parse \<= 5 base-64
193193
194−Parsing [`++rule`](). Parses up to five base-64 digits without a leading zero.
194+Parsing `++rule`. Parses up to five base-64 digits without a leading zero.
195195
196196Accepts
197197-------
198198
199−Up to five [@uw]() (base 64) digits.
199+Up to five @uw (base 64) digits.
200200
201201Produces
202202--------
@@ -230,7 +230,7 @@ Examples
230230
231231Parse 5 base-32
232232
233−Parsing [`++rule`](). Parses exactly five base-32 digits.
233+Parsing `++rule`. Parses exactly five base-32 digits.
234234
235235Accepts
236236-------
@@ -258,7 +258,7 @@ Examples
258258
259259Parse 5 base-64
260260
261−Parsing [`++rule`](). Parses exactly five base-64 digits.
261+Parsing `++rule`. Parses exactly five base-64 digits.
262262
263263Accepts
264264-------
@@ -266,8 +266,6 @@ Accepts
266266Produces
267267--------
268268
269−My name henry let's see how fast I can type.
270−
271269Source
272270------
273271
@@ -288,7 +286,7 @@ Examples
288286
289287Parse \<= 4 binary
290288
291−Parsing [`++rule`](). Parses a binary number of up to 4 digits in length without
289+Parsing `++rule`. Parses a binary number of up to 4 digits in length without
292290a leading zero.
293291
294292Accepts
@@ -324,7 +322,7 @@ Examples
324322
325323Parse \<= 4 hex
326324
327−Parsing [`++rule`](). Parses a hexadecimal number of up to 4 digits in length
325+Parsing `++rule`. Parses a hexadecimal number of up to 4 digits in length
328326without a leading zero.
329327
330328Accepts
@@ -358,7 +356,7 @@ Examples
358356
359357Parse 4 binary
360358
361−Parsing [`++rule`](). Parses exactly four binary digits.
359+Parsing `++rule`. Parses exactly four binary digits.
362360
363361Accepts
364362-------
@@ -388,7 +386,7 @@ Examples
388386
389387Parse 4 hex
390388
391−Parsing [`++rule`](). Parses exactly four hexadecimal digits.
389+Parsing `++rule`. Parses exactly four hexadecimal digits.
392390
393391Accepts
394392-------
@@ -418,7 +416,7 @@ Examples
418416
419417Parse 1
420418
421−Parsing [`++rule`](). Parses the number 1.
419+Parsing `++rule`. Parses the number 1.
422420
423421Accepts
424422-------
@@ -449,7 +447,7 @@ Examples
449447
450448Parse decimal
451449
452−Parsing [`++rule`](). Parses a nonzero decimal digit.
450+Parsing `++rule`. Parses a nonzero decimal digit.
453451
454452Accepts
455453-------
@@ -460,7 +458,7 @@ Produces
460458Source
461459------
462460
463− ++ sed (cook |=(a=@ (sub a '0')) (shim '1' '9'))
461+ ++ sed (cook |=(a/@ (sub a '0')) (shim '1' '9'))
464462
465463Examples
466464--------
@@ -477,7 +475,7 @@ Examples
477475
478476Parse base-32
479477
480−Parsing [`++rule`](). Parses a nonzero base-32 digit
478+Parsing `++rule`. Parses a nonzero base-32 digit
481479
482480Accepts
483481-------
@@ -505,7 +503,7 @@ Examples
505503
506504Parse base-64
507505
508−Parsing [`++rule`](). Parses a nonzero base-64 digit
506+Parsing `++rule`. Parses a nonzero base-64 digit
509507
510508Accepts
511509-------
@@ -533,7 +531,7 @@ Examples
533531
534532Parse hex
535533
536−Parsing [`++rule`](). Parses a nonzero hexadecimal digit.
534+Parsing `++rule`. Parses a nonzero hexadecimal digit.
537535
538536Accepts
539537-------
@@ -561,7 +559,7 @@ Examples
561559
562560Parse binary
563561
564−Parsing [`++rule`](). Parses a binary digit.
562+Parsing `++rule`. Parses a binary digit.
565563
566564Accepts
567565-------
@@ -572,7 +570,7 @@ Produces
572570Source
573571------
574572
575− ++ sib (cook |=(a=@ (sub a '0')) (shim '0' '1'))
573+ ++ sib (cook |=(a/@ (sub a '0')) (shim '0' '1'))
576574
577575Examples
578576--------
@@ -588,7 +586,7 @@ Examples
588586
589587Parse decimal
590588
591−Parsing [`++rule`](). Parses a decimal digit.
589+Parsing `++rule`. Parses a decimal digit.
592590
593591Accepts
594592-------
@@ -599,7 +597,7 @@ Produces
599597Source
600598------
601599
602− ++ sid (cook |=(a=@ (sub a '0')) (shim '0' '9'))
600+ ++ sid (cook |=(a/@ (sub a '0')) (shim '0' '9'))
603601
604602Examples
605603--------
@@ -613,7 +611,7 @@ Examples
613611
614612Parse base-32
615613
616−Parsing [`++rule`](). Parses a base-32 digit.
614+Parsing `++rule`. Parses a base-32 digit.
617615
618616Accepts
619617-------
@@ -638,7 +636,7 @@ Examples
638636
639637Parse base-64
640638
641−Parsing [`++rule`](). Parses a base-64 digit.
639+Parsing `++rule`. Parses a base-64 digit.
642640
643641Accepts
644642-------
@@ -663,7 +661,7 @@ Examples
663661
664662Parse hex
665663
666−Parsing [`++rule`](). Parses a hexadecimal digit.
664+Parsing `++rule`. Parses a hexadecimal digit.
667665
668666Accepts
669667-------
@@ -688,7 +686,7 @@ Examples
688686
689687Parse base-32
690688
691−Parsing [`++rule`](). Parses a base-32 letter.
689+Parsing `++rule`. Parses a base-32 letter.
692690
693691Accepts
694692-------
@@ -699,7 +697,7 @@ Produces
699697Source
700698------
701699
702− ++ sov (cook |=(a=@ (sub a 87)) (shim 'a' 'v'))
700+ ++ sov (cook |=(a/@ (sub a 87)) (shim 'a' 'v'))
703701
704702Examples
705703--------
@@ -713,7 +711,7 @@ Examples
713711
714712Parse base-64
715713
716−Parsing [`++rule`](). Parses a base-64 letter/symbol.
714+Parsing `++rule`. Parses a base-64 letter/symbol.
717715
718716Accepts
719717-------
@@ -725,8 +723,8 @@ Source
725723------
726724
727725 ++ sow ;~ pose
728− (cook |=(a=@ (sub a 87)) (shim 'a' 'z'))
729− (cook |=(a=@ (sub a 29)) (shim 'A' 'Z'))
726+ (cook |=(a/@ (sub a 87)) (shim 'a' 'z'))
727+ (cook |=(a/@ (sub a 29)) (shim 'A' 'Z'))
730728 (cold 62 (just '-'))
731729 (cold 63 (just '~'))
732730 ==
@@ -743,7 +741,7 @@ Examples
743741
744742Parse hex letter
745743
746−Parsing [`++rule`](). Parses a hexadecimal letter.
744+Parsing `++rule`. Parses a hexadecimal letter.
747745
748746Accepts
749747-------
@@ -754,7 +752,7 @@ Produces
754752Source
755753------
756754
757− ++ sox (cook |=(a=@ (sub a 87)) (shim 'a' 'f'))
755+ ++ sox (cook |=(a/@ (sub a 87)) (shim 'a' 'f'))
758756
759757Examples
760758--------
@@ -768,7 +766,7 @@ Examples
768766
769767Parse \<= 3 decimal
770768
771−Parsing [`++rule`](). Parses a decimal number of up to 3 digits without a
769+Parsing `++rule`. Parses a decimal number of up to 3 digits without a
772770leading zero.
773771
774772Accepts
@@ -801,7 +799,7 @@ Examples
801799
802800Leading phonetic byte
803801
804−Parsing [`++rule`](). Parses the leading phonetic byte, which represents a
802+Parsing `++rule`. Parses the leading phonetic byte, which represents a
805803syllable.
806804
807805Accepts
@@ -813,7 +811,7 @@ Produces
813811Source
814812------
815813
816− ++ tip (sear |=(a=@ (ins:po a)) til)
814+ ++ tip (sear |=(a/@ (ins:po a)) til)
817815
818816Examples
819817--------
@@ -829,7 +827,7 @@ Examples
829827
830828Trailing phonetic syllable
831829
832−Parsing [`++rule`](). Parses the trailing phonetic byte, which represents a
830+Parsing `++rule`. Parses the trailing phonetic byte, which represents a
833831syllable.
834832
835833Accepts
@@ -841,7 +839,7 @@ Produces
841839Source
842840------
843841
844− ++ tiq (sear |=(a=@ (ind:po a)) til)
842+ ++ tiq (sear |=(a/@ (ind:po a)) til)
845843
846844Examples
847845--------
@@ -857,7 +855,7 @@ Examples
857855
858856Parse 3 decimal digits
859857
860−Parsing [`++rule`](). Parses exactly three decimal digits.
858+Parsing `++rule`. Parses exactly three decimal digits.
861859
862860Accepts
863861-------
@@ -885,7 +883,7 @@ Examples
885883
886884Parse 3 lowercase
887885
888−Parsing [`++rule`](). Parses exactly three lowercase letters.
886+Parsing `++rule`. Parses exactly three lowercase letters.
889887
890888Accepts
891889-------
@@ -915,7 +913,7 @@ Examples
915913
916914Parse span characters
917915
918−Parsing rule. Parses characters from an atom of the span odor [`@ta`]().
916+Parsing rule. Parses characters from an atom of the span odor `@ta`.
919917
920918Accepts
921919-------
@@ -927,7 +925,7 @@ Source
927925------
928926
929927 ++ urs %+ cook
930− |=(a=tape (rap 3 ^-((list ,@) a)))
928+ |=(a/tape (rap 3 ^-((list @) a)))
931929 (star ;~(pose nud low hep dot sig cab))
932930
933931Examples
@@ -944,7 +942,7 @@ Examples
944942
945943Parse non-`_` span
946944
947−Parsing rule. Parses all characters of the span odor [`@ta`]() except
945+Parsing rule. Parses all characters of the span odor `@ta` except
948946for cab, `_`.
949947
950948Accepts
@@ -957,7 +955,7 @@ Source
957955------
958956
959957 ++ urt %+ cook
960− |=(a=tape (rap 3 ^-((list ,@) a)))
958+ |=(a/tape (rap 3 ^-((list @) a)))
961959 (star ;~(pose nud low hep dot sig))
962960
963961Examples
@@ -1034,12 +1032,13 @@ Accepts
10341032Produces
10351033--------
10361034
1037−`fel` is a [`rule`]().
1035+`fel` is a `rule`.
10381036
10391037Source
10401038------
10411039
1042− ++ ape |*(fel=_rule ;~(pose (cold 0 (just '0')) fel))
1040+ ++ ape |*(fel/rule ;~(pose (cold 0 (just '0')) fel))
1041+
10431042
10441043Examples
10451044--------
@@ -1078,7 +1077,7 @@ Examples
10781077
10791078Parse IPv6
10801079
1081−Parsing rule. Parses a [`@is`](), an IPv6 address.
1080+Parsing rule. Parses a `@is`, an IPv6 address.
10821081
10831082Accepts
10841083-------
@@ -1119,6 +1118,7 @@ Source
11191118
11201119 ++ dem (ape (bass 1.000 ;~(plug ted:ab (star ;~(pfix dog tid:ab)))))
11211120
1121+
11221122Examples
11231123--------
11241124
@@ -1190,7 +1190,7 @@ Examples
11901190
11911191Parse phonetic base
11921192
1193−Parsing rule. Parses an atom of odor [`@p`](), the phonetic base.
1193+Parsing rule. Parses an atom of odor `@p`, the phonetic base.
11941194
11951195Accepts
11961196-------
docs/system/hoon/library/src/4j/core/mu.md+12−11
@@ -2,7 +2,7 @@
22
33Core used to scramble 16-bit atoms
44
5−A [door]() that contains arms that are used to scramble two atoms, `top`
5+A door that contains arms that are used to scramble two atoms, `top`
66and `bot`. Used especially in the phonetic base to disguise the
77relationship between a destroyer and its cruiser.
88
@@ -12,15 +12,15 @@ Accepts
1212Produces
1313--------
1414
15−`bot` is an [atom]().
15+`bot` is an atom.
1616
17−`top` is an [atom]().
17+`top` is an atom.
1818
1919Source
2020------
2121
2222 ++ mu
23− |_ [top=@ bot=@]
23+ |_ [top/@ bot/@]
2424
2525Examples
2626--------
@@ -44,15 +44,16 @@ Accepts
4444Produces
4545--------
4646
47−`bot` is an [atom]().
47+`bot` is an atom.
4848
49−`top` is an [atom]().
49+`top` is an atom.
5050
5151Source
5252------
5353
5454 ++ zag [p=(end 4 1 (add top bot)) q=bot]
5555
56+
5657Examples
5758--------
5859
@@ -65,7 +66,7 @@ Examples
6566
6667Subtract bottom from top
6768
68−The inverse of [`++zag`](). Produces the cell of `top` and `bot` with
69+The inverse of `++zag`. Produces the cell of `top` and `bot` with
6970`top` unscrambled. The unscrambled `top` is the sum of the sample `top`
7071and the 16-bit complement of `bot`. Used to unscramble the name of the
7172destroyer.
@@ -76,9 +77,9 @@ Accepts
7677Produces
7778--------
7879
79−`bot` is an [atom]().
80+`bot` is an atom.
8081
81−`top` is an [atom]().
82+`top` is an atom.
8283
8384Source
8485------
@@ -106,9 +107,9 @@ Accepts
106107Produces
107108--------
108109
109−`bot` is an [atom]().
110+`bot` is an atom.
110111
111−`top` is an [atom]().
112+`top` is an atom.
112113
113114Source
114115------
docs/system/hoon/library/src/4j/core/ne.md+6−6
@@ -2,7 +2,7 @@
22
33Digit rendering engine
44
5−A [door]() containing arms that render digits at bases 10, 16, 32, and
5+A door containing arms that render digits at bases 10, 16, 32, and
6664.
77
88Accepts
@@ -11,13 +11,13 @@ Accepts
1111Produces
1212--------
1313
14−`tig` is an [`atom`]().
14+`tig` is an `atom`.
1515
1616Source
1717------
1818
1919 ++ ne
20− |_ tig=@
20+ |_ tig/@
2121
2222Examples
2323--------
@@ -39,7 +39,7 @@ Accepts
3939Produces
4040--------
4141
42−`tig` is an [`atom`]().
42+`tig` is an `atom`.
4343
4444Source
4545------
@@ -66,7 +66,7 @@ Accepts
6666Produces
6767--------
6868
69−`tig` is an [`atom`]().
69+`tig` is an `atom`.
7070
7171Source
7272------
@@ -124,7 +124,7 @@ Accepts
124124Produces
125125--------
126126
127−`tig` is an [`atom`]().
127+`tig` is an `atom`.
128128
129129Source
130130------
docs/system/hoon/library/src/4k/core/co.md+140−214
@@ -2,7 +2,7 @@
22
33Literal rendering engine
44
5−A [door]() that contains arms that operate on the sample coin `lot`.
5+A door that contains arms that operate on the sample coin `lot`.
66
77Accepts
88-------
@@ -10,27 +10,24 @@ Accepts
1010Produces
1111--------
1212
13−`lot` is a [`++coin`]().
13+`lot` is a `++coin`.
1414
1515Source
1616------
1717
18− ++ co
19− =< |_ lot=coin
18+ ++ co !.
19+ ~% %co ..co ~
20+ =< |_ lot/coin
21+
2022
2123Examples
2224--------
2325
24− ~zod/try=> ~(. co many/~[`ta/'mo' `ud/5])
25− < 3.dhd
26− [ [ %many
27− [%~ %ta @t]
28− [%~ %ud @ud]
29− %~
30− ]
31− <10.utz 3.zid [rex="" <414.hmb 100.xkc 1.ypj %164>]>
32− ]
33− >
26+ ~zod/try=> < 3.nta
27+ { lot/{$many {$~ $ta @t} {$~ $ud @ud} $~}
28+ <10.cfg 4.jjn {rep/"" <402.arm 110.jyx 1.ztu $151>}>
29+ }
30+ >
3431
3532------------------------------------------------------------------------
3633
@@ -38,7 +35,7 @@ Examples
3835
3936Prepend & render as tape
4037
41−Renders a coin `lot` as a [tape]() prepended to the sample tape `rom`.
38+Renders a coin `lot` as a tape prepended to the sample tape `rom`.
4239
4340Accepts
4441-------
@@ -46,14 +43,14 @@ Accepts
4643Produces
4744--------
4845
49−`rom` is a [`pe`]()
46+`rom` is a `pe`
5047
51−`lot` is a [`++coin`]().
48+`lot` is a `++coin`.
5249
5350Source
5451------
5552
56− ++ rear |=(rom=tape =>(.(rex rom) rend))
53+ ++ rear |=(rom/tape =>(.(rex rom) rend))
5754
5855Examples
5956--------
@@ -75,7 +72,7 @@ Accepts
7572Produces
7673--------
7774
78−`lot` is a [`++coin`]().
75+`lot` is a `++coin`.
7976
8077Source
8178------
@@ -104,216 +101,145 @@ Accepts
104101Produces
105102--------
106103
107−`lot` is a [`++coin`]().
104+`lot` is a `++coin`.
108105
109106Source
110107------
111108
112− ++ rend
113− ^- tape
114− ?: ?=(%blob -.lot)
115− ['~' '0' ((v-co 1) (jam p.lot))]
116− ?: ?=(%many -.lot)
117− :- '.'
118− |- ^- tape
119− ?~ p.lot
120− ['_' '_' rex]
121− ['_' (weld (trip (wack rent(lot i.p.lot))) $(p.lot t.p.lot))]
122− =+ [yed=(end 3 1 p.p.lot) hay=(cut 3 [1 1] p.p.lot)]
123− |- ^- tape
124− ?+ yed (z-co q.p.lot)
125− %c ['~' '-' (weld (rip 3 (wood (tuft q.p.lot))) rex)]
126− %d
127− ?+ hay (z-co q.p.lot)
128− %a
129− =+ yod=(yore q.p.lot)
130− => ^+(. .(rex ?~(f.t.yod rex ['.' (s-co f.t.yod)])))
131− => ^+ .
132− %= .
133− rex
134− ?: &(=(~ f.t.yod) =(0 h.t.yod) =(0 m.t.yod) =(0 s.t.yod))
135− rex
136− => .(rex ['.' (y-co s.t.yod)])
137− => .(rex ['.' (y-co m.t.yod)])
138− ['.' '.' (y-co h.t.yod)]
139− ==
140− => .(rex ['.' (a-co d.t.yod)])
141− => .(rex ['.' (a-co m.yod)])
142− => .(rex ?:(a.yod rex ['-' rex]))
143− ['~' (a-co y.yod)]
144− ::
145− %r
146− =+ yug=(yell q.p.lot)
147− => ^+(. .(rex ?~(f.yug rex ['.' (s-co f.yug)])))
148− :- '~'
149− ?: &(=(0 d.yug) =(0 m.yug) =(0 h.yug) =(0 s.yug))
150− ['.' 's' '0' rex]
151− => ^+(. ?:(=(0 s.yug) . .(rex ['.' 's' (a-co s.yug)])))
152− => ^+(. ?:(=(0 m.yug) . .(rex ['.' 'm' (a-co m.yug)])))
153− => ^+(. ?:(=(0 h.yug) . .(rex ['.' 'h' (a-co h.yug)])))
154− => ^+(. ?:(=(0 d.yug) . .(rex ['.' 'd' (a-co d.yug)])))
155− +.rex
156− ==
157− ::
158− %f
159− ?: =(& q.p.lot)
160− ['.' 'y' rex]
161− ?:(=(| q.p.lot) ['.' 'n' rex] (z-co q.p.lot))
162− ::
163− %n ['~' rex]
164− %i
165− ?+ hay (z-co q.p.lot)
166− %f ((ro-co [3 10 4] |=(a=@ ~(d ne a))) q.p.lot)
167− %s ((ro-co [4 16 8] |=(a=@ ~(x ne a))) q.p.lot)
168− ==
169− ::
170− %p
171− =+ dyx=(met 3 q.p.lot)
172− :- '~'
173− ?: (lte dyx 1)
174− (weld (trip (tod:po q.p.lot)) rex)
175− ?: =(2 dyx)
176− ;: weld
177− (trip (tos:po (end 3 1 q.p.lot)))
178− (trip (tod:po (rsh 3 1 q.p.lot)))
179− rex
180− ==
181− =+ [dyz=(met 5 q.p.lot) fin=|]
182− |- ^- tape
183− ?: =(0 dyz)
184− rex
185− %= $
186− fin &
187− dyz (dec dyz)
188− q.p.lot (rsh 5 1 q.p.lot)
189− rex
190− =+ syb=(wren:un (end 5 1 q.p.lot))
191− =+ cog=~(zig mu [(rsh 4 1 syb) (end 4 1 syb)])
192− ;: weld
193− (trip (tos:po (end 3 1 p.cog)))
194− (trip (tod:po (rsh 3 1 p.cog)))
195− `tape`['-' ~]
196− (trip (tos:po (end 3 1 q.cog)))
197− (trip (tod:po (rsh 3 1 q.cog)))
198− `tape`?:(fin ['-' ?:(=(1 (end 0 1 dyz)) ~ ['-' ~])] ~)
199− rex
109+ ++ rend
110+ ^- tape
111+ ?: ?=($blob -.lot)
112+ ['~' '0' ((v-co 1) (jam p.lot))]
113+ ?: ?=($many -.lot)
114+ :- '.'
115+ |- ^- tape
116+ ?~ p.lot
117+ ['_' '_' rep]
118+ ['_' (weld (trip (wack rent(lot i.p.lot))) $(p.lot t.p.lot))]
119+ =+ [yed=(end 3 1 p.p.lot) hay=(cut 3 [1 1] p.p.lot)]
120+ |- ^- tape
121+ ?+ yed (z-co q.p.lot)
122+ $c ['~' '-' (weld (rip 3 (wood (tuft q.p.lot))) rep)]
123+ $d
124+ ?+ hay (z-co q.p.lot)
125+ $a
126+ =+ yod=(yore q.p.lot)
127+ => ^+(. .(rep ?~(f.t.yod rep ['.' (s-co f.t.yod)])))
128+ => ^+ .
129+ %= .
130+ rep
131+ ?: &(=(~ f.t.yod) =(0 h.t.yod) =(0 m.t.yod) =(0 s.t.yod))
132+ rep
133+ => .(rep ['.' (y-co s.t.yod)])
134+ => .(rep ['.' (y-co m.t.yod)])
135+ ['.' '.' (y-co h.t.yod)]
200136 ==
201− ==
202− ::
203− %r
204− ?+ hay (z-co q.p.lot)
205− %d
206− =+ r=(rlyd q.p.lot)
207− ?~ e.r
208− ['.' '~' (r-co r)]
209− ['.' '~' u.e.r]
210− %h ['.' '~' '~' (r-co (rlyh q.p.lot))]
211− %q ['.' '~' '~' '~' (r-co (rlyq q.p.lot))]
212− %s ['.' (r-co (rlys q.p.lot))]
213− ==
214− ::
215− %u
216− =- (weld p.gam ?:(=(0 q.p.lot) `tape`['0' ~] q.gam))
217− ^= gam ^- [p=tape q=tape]
218− ?+ hay [~ ((ox-co [10 3] |=(a=@ ~(d ne a))) q.p.lot)]
219− %b [['0' 'b' ~] ((ox-co [2 4] |=(a=@ ~(d ne a))) q.p.lot)]
220− %i [['0' 'i' ~] ((d-co 1) q.p.lot)]
221− %x [['0' 'x' ~] ((ox-co [16 4] |=(a=@ ~(x ne a))) q.p.lot)]
222− %v [['0' 'v' ~] ((ox-co [32 5] |=(a=@ ~(x ne a))) q.p.lot)]
223− %w [['0' 'w' ~] ((ox-co [64 5] |=(a=@ ~(w ne a))) q.p.lot)]
224− ==
225− ::
226− %s
227− %+ weld
228− ?:((syn:si q.p.lot) "--" "-")
229− $(yed 'u', q.p.lot (abs:si q.p.lot))
230− ::
231− %t
232− ?: =('a' hay)
233− ?: =('s' (cut 3 [2 1] p.p.lot))
234−
235− (weld (rip 3 q.p.lot) rex)
236− ['~' '.' (weld (rip 3 q.p.lot) rex)]
237− ['~' '~' (weld (rip 3 (wood q.p.lot)) rex)]
238− ==
239− --
240− =+ rex=*tape
241− =< |%
242− ++ a-co |=(dat=@ ((d-co 1) dat))
243− ++ d-co |=(min=@ (em-co [10 min] |=([? b=@ c=tape] [~(d ne b) c])))
244− ++ r-co
245− |= [syn=? nub=@ der=@ ign=(unit tape) ne=?]
246− => .(rex ['.' (t-co ((d-co 1) der) ne)])
247− => .(rex ((d-co 1) nub))
248− ?:(syn rex ['-' rex])
249− ++ t-co |= [a=tape n=?] ^- tape
250− ?: n a
251− ?~ a ~|(%empty-frac !!) t.a
137+ => .(rep ['.' (a-co d.t.yod)])
138+ => .(rep ['.' (a-co m.yod)])
139+ => .(rep ?:(a.yod rep ['-' rep]))
140+ ['~' (a-co y.yod)]
252141 ::
253− ++ s-co
254− |= esc=(list ,@) ^- tape
255− ~| [%so-co esc]
256− ?~ esc
257− rex
258− :- '.'
259− =>(.(rex $(esc t.esc)) ((x-co 4) i.esc))
260−
142+ $r
143+ =+ yug=(yell q.p.lot)
144+ => ^+(. .(rep ?~(f.yug rep ['.' (s-co f.yug)])))
145+ :- '~'
146+ ?: &(=(0 d.yug) =(0 m.yug) =(0 h.yug) =(0 s.yug))
147+ ['s' '0' rep]
148+ => ^+(. ?:(=(0 s.yug) . .(rep ['.' 's' (a-co s.yug)])))
149+ => ^+(. ?:(=(0 m.yug) . .(rep ['.' 'm' (a-co m.yug)])))
150+ => ^+(. ?:(=(0 h.yug) . .(rep ['.' 'h' (a-co h.yug)])))
151+ => ^+(. ?:(=(0 d.yug) . .(rep ['.' 'd' (a-co d.yug)])))
152+ +.rep
153+ ==
261154 ::
262− ++ v-co |=(min=@ (em-co [32 min] |=([? b=@ c=tape] [~(v ne b) c])))
263− ++ w-co |=(min=@ (em-co [64 min] |=([? b=@ c=tape] [~(w ne b) c])))
264− ++ x-co |=(min=@ (em-co [16 min] |=([? b=@ c=tape] [~(x ne b) c])))
265− ++ y-co |=(dat=@ ((d-co 2) dat))
266− ++ z-co |=(dat=@ `tape`['0' 'x' ((x-co 1) dat)])
267− --
268− ~% %co +> ~
269− |%
270− ++ em-co
271− ~/ %emco
272− |= [[bas=@ min=@] [par=$+([? @ tape] tape)]]
273− |= hol=@
274− ^- tape
275− ?: &(=(0 hol) =(0 min))
276− rex
277− =+ [rad=(mod hol bas) dar=(div hol bas)]
278− %= $
279− min ?:(=(0 min) 0 (dec min))
280− hol dar
281− rex (par =(0 dar) rad rex)
155+ $f
156+ ?: =(& q.p.lot)
157+ ['.' 'y' rep]
158+ ?:(=(| q.p.lot) ['.' 'n' rep] (z-co q.p.lot))
159+ ::
160+ $n ['~' rep]
161+ $i
162+ ?+ hay (z-co q.p.lot)
163+ $f ((ro-co [3 10 4] |=(a/@ ~(d ne a))) q.p.lot)
164+ $s ((ro-co [4 16 8] |=(a/@ ~(x ne a))) q.p.lot)
165+ ==
166+ ::
167+ $p
168+ =+ dyx=(met 3 q.p.lot)
169+ :- '~'
170+ ?: (lte dyx 1)
171+ (weld (trip (tod:po q.p.lot)) rep)
172+ ?: =(2 dyx)
173+ ;: weld
174+ (trip (tos:po (end 3 1 q.p.lot)))
175+ (trip (tod:po (rsh 3 1 q.p.lot)))
176+ rep
177+ ==
178+ =+ [dyz=(met 5 q.p.lot) fin=| dub=&]
179+ |- ^- tape
180+ ?: =(0 dyz)
181+ rep
182+ %= $
183+ fin &
184+ dub !dub
185+ dyz (dec dyz)
186+ q.p.lot (rsh 5 1 q.p.lot)
187+ rep
188+ =+ syb=(wren:un (end 5 1 q.p.lot))
189+ =+ cog=~(zig mu [(rsh 4 1 syb) (end 4 1 syb)])
190+ ;: weld
191+ (trip (tos:po (end 3 1 p.cog)))
192+ (trip (tod:po (rsh 3 1 p.cog)))
193+ `tape`['-' ~]
194+ (trip (tos:po (end 3 1 q.cog)))
195+ (trip (tod:po (rsh 3 1 q.cog)))
196+ `tape`?.(fin ~ ['-' ?.(dub ~ ['-' ~])])
197+ rep
198+ ==
199+ ==
200+ ::
201+ $r
202+ ?+ hay (z-co q.p.lot)
203+ $d ['.' '~' (r-co (rlyd q.p.lot))]
204+ $h ['.' '~' '~' (r-co (rlyh q.p.lot))]
205+ $q ['.' '~' '~' '~' (r-co (rlyq q.p.lot))]
206+ $s ['.' (r-co (rlys q.p.lot))]
207+ ==
208+ ::
209+ $u
210+ ?: ?=($c hay)
211+ %+ welp ['0' 'c' (reap (pad:fa q.p.lot) '1')]
212+ (c-co (enc:fa q.p.lot))
213+ =- (weld p.gam ?:(=(0 q.p.lot) `tape`['0' ~] q.gam))
214+ ^= gam ^- {p/tape q/tape}
215+ ?+ hay [~ ((ox-co [10 3] |=(a/@ ~(d ne a))) q.p.lot)]
216+ $b [['0' 'b' ~] ((ox-co [2 4] |=(a/@ ~(d ne a))) q.p.lot)]
217+ $i [['0' 'i' ~] ((d-co 1) q.p.lot)]
218+ $x [['0' 'x' ~] ((ox-co [16 4] |=(a/@ ~(x ne a))) q.p.lot)]
219+ $v [['0' 'v' ~] ((ox-co [32 5] |=(a/@ ~(x ne a))) q.p.lot)]
220+ $w [['0' 'w' ~] ((ox-co [64 5] |=(a/@ ~(w ne a))) q.p.lot)]
221+ ==
222+ ::
223+ $s
224+ %+ weld
225+ ?:((syn:si q.p.lot) "--" "-")
226+ $(yed 'u', q.p.lot (abs:si q.p.lot))
227+ ::
228+ $t
229+ ?: =('a' hay)
230+ ?: =('s' (cut 3 [2 1] p.p.lot))
231+ (weld (rip 3 q.p.lot) rep)
232+ ['~' '.' (weld (rip 3 q.p.lot) rep)]
233+ ['~' '~' (weld (rip 3 (wood q.p.lot)) rep)]
282234 ==
283− ::
284− ++ ox-co
285− ~/ %oxco
286− |= [[bas=@ gop=@] dug=$+(@ @)]
287− %+ em-co
288− [|-(?:(=(0 gop) 1 (mul bas $(gop (dec gop))))) 0]
289− |= [top=? seg=@ res=tape]
290− %+ weld
291− ?:(top ~ `tape`['.' ~])
292− %. seg
293− %+ em-co(rex res)
294− [bas ?:(top 0 gop)]
295− |=([? b=@ c=tape] [(dug b) c])
296− ::
297− ++ ro-co
298− ~/ %roco
299− |= [[buz=@ bas=@ dop=@] dug=$+(@ @)]
300− |= hol=@
301− ^- tape
302− ?: =(0 dop)
303− rex
304− => .(rex $(dop (dec dop)))
305− :- '.'
306− %- (em-co [bas 1] |=([? b=@ c=tape] [(dug b) c]))
307− [(cut buz [(dec dop) 1] hol)]
308235 --
309− ::
310236
311237Examples
312238--------
313239
314240 ~zod/try=> ~(rend co ~ %ux 200)
315241 "0xc8"
316− ~zod/try=> ~(rend co %many ~[[%$ ux/200] [%$ p/40]])
242+ ~zod/try=> ~(rend co %many ~[[%$ ux+200] [%$ p+40]])
317243 "._0xc8_~~tem__"
318244 ~zod/try=> ~(rend co ~ %p 32.819)
319245 "~pillyt"
docs/system/hoon/library/src/4k/gate/iny.md+3−3
@@ -2,13 +2,13 @@
22
33Indentation block
44
5−Apply [`++rule`]() to indented block starting at current column number, omitting
5+Apply `++rule` to indented block starting at current column number, omitting
66the leading whitespace.
77
88Accepts
99-------
1010
11−`sef` is a [`++rule`]()
11+`sef` is a `++rule`
1212
1313Produces
1414--------
@@ -18,7 +18,7 @@ A `++rule`.
1818Source
1919------
2020
21− ++ iny |* sef=_rule :: indentation block
21+ ++ inde |* sef/rule :: indentation block
2222 |= nail ^+ (sef)
2323 =+ [har tap]=[p q]:+<
2424 =+ lev=(fil 3 (dec q.har) ' ')
docs/system/hoon/library/src/4k/gate/mes.md+1−1
@@ -8,7 +8,7 @@ Source
88------
99
1010 ++ mes %+ cook :: hexbyte
11− |=([a=@ b=@] (add (mul 16 a) b))
11+ |=({a/@ b/@} (add (mul 16 a) b))
1212 ;~(plug hit hit)
1313
1414Examples
docs/system/hoon/library/src/4k/gate/ven.md+2−2
@@ -7,10 +7,10 @@ Axis syntax parser
77Source
88------
99
10− ++ ven ;~ (comp |=([a=@ b=@] (peg a b))) :: +>- axis syntax
10+ ++ ven ;~ (comp |=({a/@ b/@} (peg a b))) :: +>- axis syntax
1111 bet
1212 =+ hom=`?`|
13− |= tub=nail
13+ |= tub/nail
1414 ^- (like axis)
1515 =+ vex=?:(hom (bet tub) (gul tub))
1616 ?~ q.vex
docs/system/hoon/library/src/4k/gate/vit.md+3−3
@@ -9,9 +9,9 @@ Source
99
1010 ++ vit :: base64 digit
1111 ;~ pose
12− (cook |=(a=@ (sub a 65)) (shim 'A' 'Z'))
13− (cook |=(a=@ (sub a 71)) (shim 'a' 'z'))
14− (cook |=(a=@ (add a 4)) (shim '0' '9'))
12+ (cook |=(a/@ (sub a 65)) (shim 'A' 'Z'))
13+ (cook |=(a/@ (sub a 71)) (shim 'a' 'z'))
14+ (cook |=(a/@ (add a 4)) (shim '0' '9'))
1515 (cold 62 (just '-'))
1616 (cold 63 (just '+'))
1717 ==
docs/system/hoon/library/src/4k/gate/vul.md+1−1
@@ -5,7 +5,7 @@ Comments to null
55Source
66------
77
8− ++ vul %- cold :- ~ :: comments
8+ ++ vul %+ cold ~ :: comments
99 ;~ plug col col
1010 (star prn)
1111 (just `@`10)
docs/system/hoon/library/src/4l/core/so.md+195−76
@@ -2,7 +2,7 @@
22
33Coin parser engine
44
5−Core containing arms that parse [`++coin`]s.
5+Core containing arms that parse `++coin`.
66
77Accepts
88-------
@@ -29,7 +29,7 @@ Examples
2929Parse odor-atom pair
3030
3131Parsing rule. Parses an unsigned integer of any permitted base,
32−producing a [`++dime`]().
32+producing a `++dime`.
3333
3434Accepts
3535-------
@@ -69,8 +69,8 @@ Examples
6969Parse `@da`, `@dr`, `@p`, `@t`
7070
7171Parsing rule. Parses any atom of any of the following odors after a
72−leading sig, `~` into a [`++dime`](): [`@da`](), [`@dr`](), [`@p`](),
73−and [`@t`](), producing a [`++dime`]().
72+leading sig, `~` into a `++dime`: `@da`, `@dr`, `@p`,
73+and `@t`, producing a `++dime`.
7474
7575Accepts
7676-------
@@ -82,12 +82,13 @@ Source
8282------
8383
8484 ++ crub
85+ ~+
8586 ;~ pose
8687 %+ cook
87− |=(det=date `dime`[%da (year det)])
88+ |=(det/date `dime`[%da (year det)])
8889 ;~ plug
8990 %+ cook
90− |=([a=@ b=?] [b a])
91+ |=({a/@ b/?} [b a])
9192 ;~(plug dim:ag ;~(pose (cold | hep) (easy &)))
9293 ;~(pfix dot dim:ag) :: month
9394 ;~(pfix dot dim:ag) :: day
@@ -106,16 +107,16 @@ Source
106107 ==
107108 ::
108109 %+ cook
109− |= [a=(list ,[p=?(%d %h %m %s) q=@]) b=(list ,@)]
110+ |= {a/(list {p/?($d $h $m $s) q/@}) b/(list @)}
110111 =+ rop=`tarp`[0 0 0 0 b]
111112 |- ^- dime
112113 ?~ a
113114 [%dr (yule rop)]
114115 ?- p.i.a
115− %d $(a t.a, d.rop (add q.i.a d.rop))
116− %h $(a t.a, h.rop (add q.i.a h.rop))
117− %m $(a t.a, m.rop (add q.i.a m.rop))
118− %s $(a t.a, s.rop (add q.i.a s.rop))
116+ $d $(a t.a, d.rop (add q.i.a d.rop))
117+ $h $(a t.a, h.rop (add q.i.a h.rop))
118+ $m $(a t.a, m.rop (add q.i.a m.rop))
119+ $s $(a t.a, s.rop (add q.i.a s.rop))
119120 ==
120121 ;~ plug
121122 %+ most
@@ -131,20 +132,122 @@ Source
131132 ::
132133 (stag %p fed:ag)
133134 ;~(pfix dot (stag %ta urs:ab))
134− ;~(pfix sig (stag %t (cook woad urs:ab)))
135− ;~(pfix hep (stag %c (cook turf (cook woad urs:ab))))
135+ ;~(pfix sig (stag %t urx:ab))
136+ ;~(pfix hep (stag %c (cook turf urx:ab)))
136137 ==
138+ ++ nuck
139+ ~/ %nuck |= a/nail %. a
140+ %+ knee *coin |. ~+
141+ %- stew
142+ ^. stet ^. limo
143+ :~ :- ['a' 'z'] (cook |=(a/@ta [%$ %tas a]) sym)
144+ :- ['0' '9'] (stag %$ bisk)
145+ :- '-' (stag %$ tash)
146+ :- '.' ;~(pfix dot perd)
147+ :- '~' ;~(pfix sig ;~(pose twid (easy [%$ %n 0])))
148+ ==
149+ ++ nusk
150+ ~+
151+ :(sear |=(a/@ta (rush a nuck)) wick urt:ab)
152+ ++ perd
153+ ~+
154+ ;~ pose
155+ (stag %$ zust)
156+ (stag %many (ifix [cab ;~(plug cab cab)] (more cab nusk)))
157+ ==
158+ ++ royl
159+ ~+
160+ =+ ^= moo
161+ |= a/tape
162+ :- (lent a)
163+ (scan a (bass 10 (plus sid:ab)))
164+ =+ ^= voy
165+ %+ cook royl-cell
166+ ;~ pose
167+ ;~ plug
168+ (easy %d)
169+ ;~ pose (cold | hep) (easy &) ==
170+ ;~ plug dim:ag
171+ ;~ pose
172+ ;~(pfix dot (cook moo (plus (shim '0' '9'))))
173+ (easy [0 0])
174+ ==
175+ ;~ pose
176+ ;~ pfix
177+ (just 'e')
178+ ;~(plug ;~(pose (cold | hep) (easy &)) dim:ag)
179+ ==
180+ (easy [& 0])
181+ ==
182+ ==
183+ ==
184+ ;~ plug
185+ (easy %i)
186+ ;~ sfix
187+ ;~ pose (cold | hep) (easy &) ==
188+ (jest 'inf')
189+ ==
190+ ==
191+ ;~ plug
192+ (easy %n)
193+ (cold ~ (jest 'nan'))
194+ ==
195+ ==
196+ ;~ pose
197+ (stag %rh (cook rylh ;~(pfix ;~(plug sig sig) voy)))
198+ (stag %rq (cook rylq ;~(pfix ;~(plug sig sig sig) voy)))
199+ (stag %rd (cook ryld ;~(pfix sig voy)))
200+ (stag %rs (cook ryls voy))
201+ ==
202+ ::
203+ ++ royl-cell
204+ |= rn
205+ ^- dn
206+ ?. ?=({$d *} +<) +<
207+ =+ ^= h
208+ (dif:si (new:si f.b i.b) (sun:si d.b))
209+ [%d a h (add (mul c.b (pow 10 d.b)) e.b)]
210+ ::
211+ ++ tash
212+ ~+
213+ =+ ^= neg
214+ |= {syn/? mol/dime} ^- dime
215+ ?> =('u' (end 3 1 p.mol))
216+ [(cat 3 's' (rsh 3 1 p.mol)) (new:si syn q.mol)]
217+ ;~ pfix hep
218+ ;~ pose
219+ (cook |=(a/dime (neg | a)) bisk)
220+ ;~(pfix hep (cook |=(a/dime (neg & a)) bisk))
221+ ==
222+ ==
223+ ::
224+ ++ twid
225+ ~+
226+ ;~ pose
227+ (cook |=(a/@ [%blob (cue a)]) ;~(pfix (just '0') vum:ag))
228+ (stag %$ crub)
229+ ==
230+ ::
231+ ++ zust
232+ ~+
233+ ;~ pose
234+ (stag %is bip:ag)
235+ (stag %if lip:ag)
236+ (stag %f ;~(pose (cold & (just 'y')) (cold | (just 'n'))))
237+ royl
238+ ==
239+ --
137240
138241Examples
139242--------
140243
141244 ~zod/try=> (scan "1926.5.12" crub:so)
142245 [p=~.da q=170.141.184.449.747.016.871.285.095.307.149.312.000]
143− ~zod/try=> (,[%da @da] (scan "1926.5.12" crub:so))
246+ ~zod/try=> ([%da @da] (scan "1926.5.12" crub:so))
144247 [%da ~1926.5.12]
145248 ~zod/try=> (scan "s10" crub:so)
146249 [p=~.dr q=184.467.440.737.095.516.160]
147− ~zod/try=> (,[%dr @dr] (scan "s10" crub:so))
250+ ~zod/try=> ([%dr @dr] (scan "s10" crub:so))
148251 [%dr ~s10]
149252 ~zod/try=> (scan "doznec" crub:so)
150253 [%p 256]
@@ -158,7 +261,7 @@ Examples
158261Top-level coin parser
159262
160263Parsing rule. Switches on the first character and applies the
161−corresponding [`++coin`]() parser.
264+corresponding `++coin` parser.
162265
163266Accepts
164267-------
@@ -169,16 +272,19 @@ Produces
169272Source
170273------
171274
172− ++ nuck
173− %+ knee *coin |. ~+
174− %- stew
175− ^. stet ^. limo
176− :~ :- ['a' 'z'] (cook |=(a=@ta [~ %tas a]) sym)
177− :- ['0' '9'] (stag ~ bisk)
178− :- '-' (stag ~ tash)
179− :- '.' ;~(pfix dot perd)
180− :- '~' ;~(pfix sig ;~(pose twid (easy [~ %n 0])))
181− ==
275+ ++ nuck
276+ ~/ %nuck |= a/nail %. a
277+ %+ knee *coin |. ~+
278+ %- stew
279+ ^. stet ^. limo
280+ :~ :- ['a' 'z'] (cook |=(a/@ta [%$ %tas a]) sym)
281+ :- ['0' '9'] (stag %$ bisk)
282+ :- '-' (stag %$ tash)
283+ :- '.' ;~(pfix dot perd)
284+ :- '~' ;~(pfix sig ;~(pose twid (easy [%$ %n 0])))
285+ ==
286+
287+
182288
183289Examples
184290--------
@@ -224,7 +330,7 @@ Source
224330------
225331
226332 ++ nusk
227− (sear |=(a=@ta (rush (wick a) nuck)) urt:ab)
333+ (sear |=(a/@ta (rush (wick a) nuck)) urt:ab)
228334
229335Examples
230336--------
@@ -235,7 +341,7 @@ Examples
235341 [1 ~.asd_a]
236342 ~zod/try=> (scan "~~.asd~-a" nusk:so)
237343 [% p=[p=~.ta q=418.212.246.369]]
238− ~zod/try=> (,[~ %ta @ta] (scan "~~.asd~-a" nusk:so))
344+ ~zod/try=> ([~ %ta @ta] (scan "~~.asd~-a" nusk:so))
239345 [~ %ta ~.asd_a]
240346
241347------------------------------------------------------------------------
@@ -280,7 +386,7 @@ Examples
280386
281387Parse dime float
282388
283−Parsing rule. Parses a number into a [`++dime`]() float.
389+Parsing rule. Parses a number into a `++dime` float.
284390
285391Accepts
286392-------
@@ -291,28 +397,51 @@ Produces
291397Source
292398------
293399
294− ++ royl
295− =+ ^= zer
296− (cook lent (star (just '0')))
297− =+ ^= voy
298− %+ cook royl-cell
299− ;~ plug
300− ;~(pose (cold | hep) (easy &))
301− ;~(plug dim:ag ;~(pose ;~(pfix dot ;~(plug zer dim:ag)) (easy [0 0])))
302− ;~ pose
303− ;~ pfix
304− (just 'e')
305− (cook some ;~(plug ;~(pose (cold | hep) (easy &)) dim:ag))
306− ==
307− (easy ~)
400+ ++ royl
401+ ~+
402+ =+ ^= moo
403+ |= a/tape
404+ :- (lent a)
405+ (scan a (bass 10 (plus sid:ab)))
406+ =+ ^= voy
407+ %+ cook royl-cell
408+ ;~ pose
409+ ;~ plug
410+ (easy %d)
411+ ;~ pose (cold | hep) (easy &) ==
412+ ;~ plug dim:ag
413+ ;~ pose
414+ ;~(pfix dot (cook moo (plus (shim '0' '9'))))
415+ (easy [0 0])
416+ ==
417+ ;~ pose
418+ ;~ pfix
419+ (just 'e')
420+ ;~(plug ;~(pose (cold | hep) (easy &)) dim:ag)
308421 ==
422+ (easy [& 0])
309423 ==
310− ;~ pose
311− (stag %rh (cook rylh ;~(pfix ;~(plug sig sig) voy)))
312− (stag %rq (cook rylq ;~(pfix ;~(plug sig sig sig) voy)))
313− (stag %rd (cook ryld ;~(pfix sig voy)))
314− (stag %rs (cook ryls voy)
424+ ==
425+ ==
426+ ;~ plug
427+ (easy %i)
428+ ;~ sfix
429+ ;~ pose (cold | hep) (easy &) ==
430+ (jest 'inf')
431+ ==
432+ ==
433+ ;~ plug
434+ (easy %n)
435+ (cold ~ (jest 'nan'))
315436 ==
437+ ==
438+ ;~ pose
439+ (stag %rh (cook rylh ;~(pfix ;~(plug sig sig) voy)))
440+ (stag %rq (cook rylq ;~(pfix ;~(plug sig sig sig) voy)))
441+ (stag %rd (cook ryld ;~(pfix sig voy)))
442+ (stag %rs (cook ryls voy))
443+ ==
444+ ::
316445
317446Examples
318447--------
@@ -330,6 +459,15 @@ XX still not fully functional
330459
331460Intermediate parsed float convereter
332461
462+ ++ royl-cell
463+ |= rn
464+ ^- dn
465+ ?. ?=({$d *} +<) +<
466+ =+ ^= h
467+ (dif:si (new:si f.b i.b) (sun:si d.b))
468+ [%d a h (add (mul c.b (pow 10 d.b)) e.b)]
469+ ::
470+
333471------------------------------------------------------------------------
334472
335473### `++tash`
@@ -339,46 +477,27 @@ Parse signed dime
339477Accepts
340478-------
341479
342−Accepts
343−-------
344−
345480Produces
346481--------
347482
348−Produces
349−--------
350−
351−Parsing rule. Parses a signed number into a [`++dime`]().
352−
353−Source
354−------
355−
356− ++ royl-cell
357− |= [a=? b=[c=@ d=@ e=@] f=(unit ,[h=? i=@])]
358− ^- [? @ @ @ (unit ,@s)]
359− ?~ f
360− [a c.b d.b e.b ~]
361− ?: h.u.f
362− [a c.b d.b e.b [~ (mul i.u.f 2)]]
363− [a c.b d.b e.b [~ (dec (mul i.u.f 2))]]
364−
365−Examples
366−--------
483+Parsing rule. Parses a signed number into a `++dime`.
367484
368485Source
369486------
370487
371488 ++ tash
489+ ~+
372490 =+ ^= neg
373− |= [syn=? mol=dime] ^- dime
491+ |= {syn/? mol/dime} ^- dime
374492 ?> =('u' (end 3 1 p.mol))
375493 [(cat 3 's' (rsh 3 1 p.mol)) (new:si syn q.mol)]
376494 ;~ pfix hep
377495 ;~ pose
378− (cook |=(a=dime (neg | a)) bisk)
379− ;~(pfix hep (cook |=(a=dime (neg & a)) bisk))
496+ (cook |=(a/dime (neg | a)) bisk)
497+ ;~(pfix hep (cook |=(a/dime (neg & a)) bisk))
380498 ==
381499 ==
500+ ::
382501
383502Examples
384503--------
@@ -411,7 +530,7 @@ Source
411530
412531 ++ twid
413532 ;~ pose
414− (cook |=(a=@ [%blob (cue a)]) ;~(pfix (just '0') vum:ag))
533+ (cook |=(a/@ [%blob (cue a)]) ;~(pfix (just '0') vum:ag))
415534 (stag ~ crub)
416535 ==
417536 ::
@@ -436,8 +555,8 @@ Examples
436555
437556Parse prefixed dimes from `@if`, `@f`, `@rd`
438557
439−Parsing rule. Parses an atom of either [`@if`]() (IP address), [`@f`]()
440−(loobean), or [`rf`]()(floating point) into a [`++dime`]().
558+Parsing rule. Parses an atom of either `@if` (IP address), `@f`
559+(loobean), or `rf`(floating point) into a `++dime`.
441560
442561Accepts
443562-------
docs/system/hoon/library/src/4m/gate/scot.md+2−2
@@ -10,12 +10,12 @@ Accepts
1010Produces
1111--------
1212
13−`mol` is a [`++dime`]().
13+`mol` is a `++dime`.
1414
1515Source
1616------
1717
18− ++ scot |=(mol=dime ~(rent co %$ mol))
18+ ++ scot |=(mol/dime ~(rent co %$ mol))
1919
2020Examples
2121--------
docs/system/hoon/library/src/4m/gate/scow.md+2−2
@@ -10,12 +10,12 @@ Accepts
1010Produces
1111--------
1212
13−`mol` is a [`++dime`]().
13+`mol` is a `++dime`.
1414
1515Source
1616------
1717
18− ++ scow |=(mol=dime ~(rend co %$ mol))
18+ ++ scow |=(mol/dime ~(rend co %$ mol))
1919
2020Examples
2121--------
docs/system/hoon/library/src/4m/gate/slat.md+8−8
@@ -2,7 +2,7 @@
22
33Curried slaw
44
5−Produces a [`gate`]() that parses a [`term`]() `txt` to an atom of the
5+Produces a `gate` that parses a `term` `txt` to an atom of the
66odor specified by `mod`.
77
88Accepts
@@ -11,25 +11,25 @@ Accepts
1111Produces
1212--------
1313
14−`mod` is a term, an atom of odor [`@tas`]().
14+`mod` is a term, an atom of odor `@tas`.
1515
16−`txt` is a span, an atom of odor [`@ta`]().
16+`txt` is a span, an atom of odor `@ta`.
1717
1818Source
1919------
2020
21− ++ slat |=(mod=@tas |=(txt=@ta (slaw mod txt)))
21+ ++ slat |=(mod/@tas |=(txt/@ta (slaw mod txt)))
2222
2323Examples
2424--------
2525
26− ~zod/try=> `(unit ,@p)`((slat %p) '~pillyt')
26+ ~zod/try=> `(unit @p)`((slat %p) '~pillyt')
2727 [~ ~pillyt]
28− ~zod/try=> `(unit ,@ux)`((slat %ux) '0x12')
28+ ~zod/try=> `(unit @ux)`((slat %ux) '0x12')
2929 [~ 0x12]
30− ~zod/try=> `(unit ,@if)`((slat %if) '.127.0.0.1')
30+ ~zod/try=> `(unit @if)`((slat %if) '.127.0.0.1')
3131 [~ .127.0.0.1]
32− ~zod/try=> `(unit ,@ta)`((slat %ta) '~.asd_a')
32+ ~zod/try=> `(unit @ta)`((slat %ta) '~.asd_a')
3333 [~ ~.asd_a
3434
3535
docs/system/hoon/library/src/4m/gate/slav.md+3−3
@@ -11,14 +11,14 @@ Accepts
1111Produces
1212--------
1313
14−`mod` is a term, an atom of odor [`@tas`]().
14+`mod` is a term, an atom of odor `@tas`.
1515
16−`txt` is a span, an atom of odor [`@ta`]().
16+`txt` is a span, an atom of odor `@ta`.
1717
1818Source
1919------
2020
21− ++ slav |=([mod=@tas txt=@ta] (need (slaw mod txt)))
21+ ++ slav |=([mod/@tas txt/@ta] (need (slaw mod txt)))
2222
2323Examples
2424--------
docs/system/hoon/library/src/4m/gate/slaw.md+15−14
@@ -10,38 +10,39 @@ Accepts
1010Produces
1111--------
1212
13−`mod` is a term, an atom of odor [`@tas`]().
13+`mod` is a term, an atom of odor `@tas`.
1414
15−`txt` is a span, an atom of odor [`@ta`]().
15+`txt` is a span, an atom of odor `@ta`.
1616
1717Source
1818------
1919
2020 ++ slaw
21− |= [mod=@tas txt=@ta]
22− ^- (unit ,@)
21+ ~/ %slaw
22+ |= {mod/@tas txt/@ta}
23+ ^- (unit @)
2324 =+ con=(slay txt)
24− ?.(&(?=([~ %$ @ @] con) =(p.p.u.con mod)) ~ [~ q.p.u.con])
25− ::
25+ ?.(&(?=({$~ $$ @ @} con) =(p.p.u.con mod)) ~ [~ q.p.u.con])
26+
2627
2728Examples
2829--------
2930
30− ~zod/try=> `(unit ,@p)`(slaw %p '~pillyt')
31+ ~zod/try=> `(unit @p)`(slaw %p '~pillyt')
3132 [~ ~pillyt]
32− ~zod/try=> `(unit ,@p)`(slaw %p '~pillam')
33+ ~zod/try=> `(unit @p)`(slaw %p '~pillam')
3334 ~
34− ~zod/try=> `(unit ,@ux)`(slaw %ux '0x12')
35+ ~zod/try=> `(unit @ux)`(slaw %ux '0x12')
3536 [~ 0x12]
36− ~zod/try=> `(unit ,@ux)`(slaw %ux '0b10')
37+ ~zod/try=> `(unit @ux)`(slaw %ux '0b10')
3738 ~
38− ~zod/try=> `(unit ,@if)`(slaw %if '.127.0.0.1')
39+ ~zod/try=> `(unit @if)`(slaw %if '.127.0.0.1')
3940 [~ .127.0.0.1]
40− ~zod/try=> `(unit ,@if)`(slaw %if '.fe80.0.0.202')
41+ ~zod/try=> `(unit @if)`(slaw %if '.fe80.0.0.202')
4142 ~
42− ~zod/try=> `(unit ,@ta)`(slaw %ta '~.asd_a')
43+ ~zod/try=> `(unit @ta)`(slaw %ta '~.asd_a')
4344 [~ ~.asd_a]
44− ~zod/try=> `(unit ,@ta)`(slaw %ta '~~asd-a')
45+ ~zod/try=> `(unit @ta)`(slaw %ta '~~asd-a')
4546 ~
4647
4748
docs/system/hoon/library/src/4m/gate/slay.md+13−9
@@ -2,7 +2,7 @@
22
33Parse span to coin
44
5−Parses a span `txt` to the unit of a [`++coin`]().
5+Parses a span `txt` to the unit of a `++coin`.
66
77Accepts
88-------
@@ -10,18 +10,22 @@ Accepts
1010Produces
1111--------
1212
13−`txt` is a [`@ta`]().
13+`txt` is a `@ta`.
1414
1515Source
1616------
1717
18− ++ slay
19− |= txt=@ta ^- (unit coin)
20− =+ vex=((full nuck:so) [[1 1] (trip txt)])
21− ?~ q.vex
22− ~
23− [~ p.u.q.vex]
24− ::
18+ ++ slay
19+ |= txt/@ta ^- (unit coin)
20+ =+ ^= vex
21+ ?: (gth 0x7fff.ffff txt) :: XX petty cache
22+ ~+ ((full nuck:so) [[1 1] (trip txt)])
23+ ((full nuck:so) [[1 1] (trip txt)])
24+ ?~ q.vex
25+ ~
26+ [~ p.u.q.vex]
27+ ::
28+
2529
2630Examples
2731--------
docs/system/hoon/library/src/4m/gate/smyt.md+7−7
@@ -2,7 +2,7 @@
22
33Render path as tank
44
5−Renders the path `bon` as a [`tank`](), which is used for
5+Renders the path `bon` as a `tank`, which is used for
66pretty-printing.
77
88Accepts
@@ -11,16 +11,16 @@ Accepts
1111Produces
1212--------
1313
14−`bon` is a [`++path`]().
14+`bon` is a `++path`.
1515
1616Source
1717------
1818
19− ++ smyt
20− |= bon=path ^- tank
21− :+ %rose [['/' ~] ['/' ~] ['/' ~]]
22− |- ^- (list tank)
23− (turn bon |=(a=@ [%leaf (rip 3 a)]))
19+ ++ smyt :: pretty print path
20+ |= bon/path ^- tank
21+ :+ %rose [['/' ~] ['/' ~] ~]
22+ (turn bon |=(a/@ [%leaf (trip a)]))
23+ ::
2424
2525Examples
2626--------
docs/system/hoon/library/src/4m/gate/spat.md+2−2
@@ -10,12 +10,12 @@ Accepts
1010Produces
1111--------
1212
13−`pax` is a [`path`]().
13+`pax` is a `path`.
1414
1515Source
1616------
1717
18− ++ spat |=(pax=path (crip (spud pax))) :: path to cord
18+ ++ spat |=(pax/path (crip (spud pax))) :: path to cord
1919
2020Examples
2121--------
docs/system/hoon/library/src/4m/gate/spud.md+3−3
@@ -2,7 +2,7 @@
22
33Render path as tape
44
5−Renders a path `pax` as [tape]().
5+Renders a path `pax` as tape.
66
77Accepts
88-------
@@ -10,12 +10,12 @@ Accepts
1010Produces
1111--------
1212
13−`pax` is a [`path`]().
13+`pax` is a `path`.
1414
1515Source
1616------
1717
18− ++ spud |=(pax=path ~(ram re (smyt pax))) :: path to tape
18+ ++ spud |=(pax/path ~(ram re (smyt pax))) :: path to tape
1919
2020Examples
2121--------
docs/system/hoon/library/src/4m/gate/stab.md+5−4
@@ -2,7 +2,7 @@
22
33Parse span to path
44
5−Parsing rule. Parses a span `zep` to a static [`++path`](/doc/hoon/library/1#++path).
5+Parsing rule. Parses a span `zep` to a static `++path`.
66
77Accepts
88-------
@@ -13,9 +13,10 @@ Produces
1313Source
1414------
1515
16− ++ stab :: parse span to path
17− |= zep=@ta ^- path
18− (rash zep ;~(pfix fas ;~(sfix (more fas urs:ab) fas)))
16+ ++ stab :: parse cord to path
17+ =+ fel=;~(pfix fas (more fas urs:ab))
18+ |=(zep/@t `path`(rash zep fel))
19+
1920
2021Examples
2122--------
docs/system/hoon/library/src/4n/gate/mack.md+7−6
@@ -2,14 +2,14 @@
22
33Nock subject to unit
44
5−Accepts a nock subject-formula cell and wraps it into a [`++unit`]().
5+Accepts a nock subject-formula cell and wraps it into a `++unit`.
66`fol` is pure nock, meaning that nock `11` operations result in a block,
77producing a `~`.
88
99Accepts
1010-------
1111
12−`sub` is a subject [noun]().
12+`sub` is a subject noun.
1313
1414`fol` is a formula noun, which is generally a `++nock`.
1515
@@ -22,12 +22,13 @@ Source
2222------
2323
2424 ++ mack
25− |= [sub=* fol=*]
25+ |= {sub/* fol/*}
2626 ^- (unit)
27− =+ ton=(mink [sub fol] |=(* ~))
28− ?.(?=([0 *] ton) ~ [~ p.ton])
27+ =+ ton=(mink [sub fol] |=({* *} ~))
28+ ?.(?=({$0 *} ton) ~ [~ p.ton])
2929 ::
3030
31+
3132Examples
3233--------
3334
@@ -39,7 +40,7 @@ Examples
3940 ~
4041 ~zod/try=> (mack [[[0 2] [1 3]] 4 4 4 4 0 5])
4142 [~ 6]
42− ~zod/try=> ;;((unit ,@tas) (mack [[1 %yes %no] 6 [0 2] [0 6] 0 7]))
43+ ~zod/try=> ;;((unit @tas) (mack [[1 %yes %no] 6 [0 2] [0 6] 0 7]))
4344 [~ %no]
4445
4546
docs/system/hoon/library/src/4n/gate/mink.md+44−42
@@ -2,19 +2,19 @@
22
33Mock interpreter
44
5−Bottom-level [mock]() (virtual nock) interpreter. Produces a
6−[`++tone`](), a nock computation result. If nock 11 is invoked, `sky`
7−computes on the subject and produces a [`++unit`]() result. An empty
5+Bottom-level mock (virtual nock) interpreter. Produces a
6+`++tone`, a nock computation result. If nock 11 is invoked, `sky`
7+computes on the subject and produces a `++unit` result. An empty
88result becomes a `%1` `++tone`, indicating a block.
99
1010Accepts
1111-------
1212
13−`sub` is the subject as a [noun]().
13+`sub` is the subject as a noun.
1414
1515`fol` is the formula as a noun.
1616
17−`sky` is an [`%iron`]() gate invoked with [nock operator 11]().
17+`sky` is an `%iron` gate invoked with nock operator 11.
1818
1919Produces
2020--------
@@ -26,98 +26,100 @@ Source
2626
2727 ++ mink
2828 ~/ %mink
29− |= [[sub=* fol=*] sky=$+(* (unit))]
30− =+ tax=*(list ,[@ta *])
29+ |= {{sub/* fol/*} gul/$-({* *} (unit (unit)))}
30+ =+ tax=*(list {@ta *})
3131 |- ^- tone
3232 ?@ fol
3333 [%2 tax]
3434 ?: ?=(^ -.fol)
3535 =+ hed=$(fol -.fol)
36− ?: ?=(%2 -.hed)
36+ ?: ?=($2 -.hed)
3737 hed
3838 =+ tal=$(fol +.fol)
3939 ?- -.tal
40− %0 ?-(-.hed %0 [%0 p.hed p.tal], %1 hed)
41− %1 ?-(-.hed %0 tal, %1 [%1 (weld p.hed p.tal)])
42− %2 tal
40+ $0 ?-(-.hed $0 [%0 p.hed p.tal], $1 hed)
41+ $1 ?-(-.hed $0 tal, $1 [%1 (weld p.hed p.tal)])
42+ $2 tal
4343 ==
4444 ?+ fol
4545 [%2 tax]
4646 ::
47− [0 b=@]
47+ {$0 b/@}
4848 ?: =(0 b.fol) [%2 tax]
4949 ?: =(1 b.fol) [%0 sub]
5050 ?: ?=(@ sub) [%2 tax]
5151 =+ [now=(cap b.fol) lat=(mas b.fol)]
5252 $(b.fol lat, sub ?:(=(2 now) -.sub +.sub))
5353 ::
54− [1 b=*]
54+ {$1 b/*}
5555 [%0 b.fol]
5656 ::
57− [2 b=[^ *]]
57+ {$2 b/{^ *}}
5858 =+ ben=$(fol b.fol)
59− ?. ?=(%0 -.ben) ben
59+ ?. ?=($0 -.ben) ben
6060 ?>(?=(^ p.ben) $(sub -.p.ben, fol +.p.ben))
6161 ::?>(?=(^ p.ben) $([sub fol] p.ben)
6262 ::
63− [3 b=*]
63+ {$3 b/*}
6464 =+ ben=$(fol b.fol)
65− ?. ?=(%0 -.ben) ben
65+ ?. ?=($0 -.ben) ben
6666 [%0 .?(p.ben)]
6767 ::
68− [4 b=*]
68+ {$4 b/*}
6969 =+ ben=$(fol b.fol)
70− ?. ?=(%0 -.ben) ben
70+ ?. ?=($0 -.ben) ben
7171 ?. ?=(@ p.ben) [%2 tax]
7272 [%0 .+(p.ben)]
7373 ::
74− [5 b=*]
74+ {$5 b/*}
7575 =+ ben=$(fol b.fol)
76− ?. ?=(%0 -.ben) ben
76+ ?. ?=($0 -.ben) ben
7777 ?. ?=(^ p.ben) [%2 tax]
7878 [%0 =(-.p.ben +.p.ben)]
7979 ::
80− [6 b=* c=* d=*]
80+ {$6 b/* c/* d/*}
8181 $(fol =>(fol [2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]))
8282 ::
83− [7 b=* c=*] $(fol =>(fol [2 b 1 c]))
84− [8 b=* c=*] $(fol =>(fol [7 [[0 1] b] c]))
85− [9 b=* c=*] $(fol =>(fol [7 c 0 b]))
86− [10 @ c=*] $(fol c.fol)
87− [10 [b=* c=*] d=*]
83+ {$7 b/* c/*} $(fol =>(fol [2 b 1 c]))
84+ {$8 b/* c/*} $(fol =>(fol [7 [[0 1] b] c]))
85+ {$9 b/* c/*} $(fol =>(fol [7 c 0 b]))
86+ {$10 @ c/*} $(fol c.fol)
87+ {$10 {b/* c/*} d/*}
8888 =+ ben=$(fol c.fol)
89− ?. ?=(%0 -.ben) ben
90− ?: ?=(?(%hunk %lose %mean %spot) b.fol)
89+ ?. ?=($0 -.ben) ben
90+ ?: ?=(?($hunk $hand $lose $mean $spot) b.fol)
9191 $(fol d.fol, tax [[b.fol p.ben] tax])
9292 $(fol d.fol)
9393 ::
94− [11 b=*]
95− =+ ben=$(fol b.fol)
96− ?. ?=(%0 -.ben) ben
97− =+ val=(sky p.ben)
98− ?~(val [%1 p.ben ~] [%0 u.val])
99− ::
94+ {$11 b/* c/*}
95+ =+ ref=$(fol b.fol)
96+ =+ ben=$(fol c.fol)
97+ ?. ?=($0 -.ref) ref
98+ ?. ?=($0 -.ben) ben
99+ =+ val=(gul p.ref p.ben)
100+ ?~(val [%1 p.ben ~] ?~(u.val [%2 [[%hunk (mush p.ben)] tax]] [%0 u.u.val]))
100101 ==
101102 ::
102103
104+
103105Examples
104106--------
105107
106− ~zod/try=> (mink [20 [4 0 1]] ,~)
108+ ~zod/try=> (mink [20 [4 0 1]] $~)
107109 [%0 p=21]
108− ~zod/try=> (mink [[90 5 3] [0 3]] ,~)
110+ ~zod/try=> (mink [[90 5 3] [0 3]] $~)
109111 [%0 p=[5 3]]
110− ~zod/try=> (mink 20^[4 0 1] ,~)
112+ ~zod/try=> (mink 20^[4 0 1] $~)
111113 [%0 p=21]
112− ~zod/try=> (mink [90 5 3]^[0 3] ,~)
114+ ~zod/try=> (mink [90 5 3]^[0 3] $~)
113115 [%0 p=[5 3]]
114− ~zod/try=> (mink [0]^[11 1 20] ,~)
116+ ~zod/try=> (mink [0]^[11 1 20] $~)
115117 [%1 p=~[20]]
116118 ~zod/try=> (mink [0]^[11 1 20] |=(a=* `[40 a]))
117119 [%0 p=[40 20]]
118− ~zod/try=> (mink [5]^[0 2] ,~)
120+ ~zod/try=> (mink [5]^[0 2] $~)
119121 [%2 p=~]
120− ~zod/try=> (mink [5]^[10 yelp/[0 1] 0 0] ,~)
122+ ~zod/try=> (mink [5]^[10 yelp/[0 1] 0 0] $~)
121123 [%2 p=~[[~.yelp 5]]]
122124
123125
docs/system/hoon/library/src/4n/gate/mock.md+7−6
@@ -2,19 +2,19 @@
22
33Compute formula on subject with hint
44
5−Produces a [`++toon`](), which is either a sucessful, blocked, or
5+Produces a `++toon`, which is either a sucessful, blocked, or
66crashed result. If nock 11 is invoked, `sky` computes on the subject and
7−produces a [`++unit`]() result. An empty result becomes a `%1` `++tune`,
7+produces a `++unit` result. An empty result becomes a `%1` `++tune`,
88indicating a block.
99
1010Accepts
1111-------
1212
13−`sub` is the subject as a [noun]().
13+`sub` is the subject as a noun.
1414
1515`fol` is the formula as a noun.
1616
17−`sky` is an [%iron]() gate invoked with [nock operator 11]().
17+`sky` is an %iron gate invoked with nock operator 11.
1818
1919Produces
2020--------
@@ -25,10 +25,11 @@ Source
2525------
2626
2727 ++ mock
28− |= [[sub=* fol=*] sky=$+(* (unit))]
29− (mook (mink [sub fol] sky))
28+ |= {{sub/* fol/*} gul/$-({* *} (unit (unit)))}
29+ (mook (mink [sub fol] gul))
3030 ::
3131
32+
3233Examples
3334--------
3435
docs/system/hoon/library/src/4n/gate/mong.md+13−13
@@ -2,17 +2,17 @@
22
33Slam gate with sample
44
5−Produces a [`++toon`]() computation result from slamming `gat` with
5+Produces a `++toon` computation result from slamming `gat` with
66`sam`, using `sky` to compute or block on nock 11 when applicable.
77
88Accepts
99-------
1010
11−`gat` is a [noun]() that is generally a [`gate`]().
11+`gat` is a noun that is generally a `gate`.
1212
13−`sam` is a [`sample`]() noun.
13+`sam` is a `sample` noun.
1414
15−`sky` is an [%iron]() gate invoked with [nock operator 11]().
15+`sky` is an %iron gate invoked with nock operator 11.
1616
1717Produces
1818--------
@@ -23,11 +23,11 @@ Source
2323------
2424
2525 ++ mong
26− |= [[gat=* sam=*] sky=$+(* (unit))]
26+ |= {{gat/* sam/*} gul/$-({* *} (unit (unit)))}
2727 ^- toon
2828 ?. &(?=(^ gat) ?=(^ +.gat))
2929 [%2 ~]
30− (mock [[-.gat [sam +>.gat]] -.gat] sky)
30+ (mock [[-.gat [sam +>.gat]] -.gat] gul)
3131 ::
3232
3333Examples
@@ -37,19 +37,19 @@ Examples
3737 [%0 p=20]
3838 ~zod/try=> (mong [|=(@ !!) ~] ,~)
3939 [%2 p=~]
40− ~zod/try=> (mong [|=(a=@ (add 20 a)) ~] ,~)
40+ ~zod/try=> (mong [|=(a/@ (add 20 a)) ~] ,~)
4141 [%0 p=20]
42− ~zod/try=> (mong [|=(a=[@ @] (add 20 -.a)) ~] ,~)
42+ ~zod/try=> (mong [|=(a/[@ @] (add 20 -.a)) ~] ,~)
4343 [%2 p=~]
44− ~zod/try=> (mong [|=(a=[@ @] (add 20 -.a)) [4 6]] ,~)
44+ ~zod/try=> (mong [|=(a/[@ @] (add 20 -.a)) [4 6]] ,~)
4545 [%0 p=24]
46− ~zod/try=> (mong [|=(a=@ .^(a)) ~] ,~)
46+ ~zod/try=> (mong [|=(a/@ .^(a)) ~] ,~)
4747 [%1 p=~[0]]
48− ~zod/try=> (mong [|=(a=@ .^(a)) ~] ,[~ %42])
48+ ~zod/try=> (mong [|=(a/@ .^(a)) ~] ,[~ %42])
4949 [%0 p=42]
50− ~zod/try=> (mong [|=(a=@ .^(a)) ~] |=(a=* [~ a 6]))
50+ ~zod/try=> (mong [|=(a/@ .^(a)) ~] |=(a/* [~ a 6]))
5151 [%0 p=[0 6]]
52− ~zod/try=> (mong [|=(a=@ .^(a)) 8] |=(a=* [~ a 6]))
52+ ~zod/try=> (mong [|=(a/@ .^(a)) 8] |=(a/* [~ a 6]))
5353 [%0 p=[8 6]]
5454
5555
docs/system/hoon/library/src/4n/gate/mook.md+22−33
@@ -2,67 +2,56 @@
22
33Intelligently render crash annotation
44
5−Converts a `%2` `++tone` nock stack trace to a list of [`++tank`]().
6−Each may be a tank, cord, [`++spot`](), or trapped tank.
5+Converts a `%2` `++tone` nock stack trace to a list of `++tank`.
6+Each may be a tank, cord, `++spot`, or trapped tank.
77
88Accepts
99-------
1010
11−`ton` is a [`++tone`]().
11+`ton` is a `++tone`.
1212
1313Produces
1414--------
1515
16−A [`++toon`]().
16+A `++toon`.
1717
1818Source
1919------
2020
2121 ++ mook
22− |= ton=tone
22+ |= ton/tone
2323 ^- toon
24− ?. ?=([2 *] ton) ton
24+ ?. ?=({$2 *} ton) ton
2525 :- %2
26+ :: =. p.ton (moop p.ton)
2627 =+ yel=(lent p.ton)
2728 =. p.ton
2829 ?. (gth yel 256) p.ton
2930 %+ weld
3031 (scag 128 p.ton)
31− ^- (list ,[@ta *])
32+ ^- (list {@ta *})
3233 :_ (slag (sub yel 128) p.ton)
3334 :- %lose
3435 %+ rap 3
35− ;: weld
36− "[skipped "
37− ~(rend co %$ %ud (sub yel 256))
38− " frames]"
39− ==
36+ "[skipped {(scow %ud (sub yel 256))} frames]"
4037 |- ^- (list tank)
4138 ?~ p.ton ~
42− =+ rex=$(p.ton t.p.ton)
43− ?+ -.i.p.ton rex
44− %hunk [(tank +.i.p.ton) rex]
45− %lose [[%leaf (rip 3 (,@ +.i.p.ton))] rex]
46− %mean :_ rex
47− ?@ +.i.p.ton [%leaf (rip 3 (,@ +.i.p.ton))]
39+ =+ rep=$(p.ton t.p.ton)
40+ ?+ -.i.p.ton rep
41+ $hunk [(tank +.i.p.ton) rep]
42+ $lose [[%leaf (rip 3 (@ +.i.p.ton))] rep]
43+ $hand [[%leaf (scow %p (mug +.i.p.ton))] rep]
44+ $mean :_ rep
45+ ?@ +.i.p.ton [%leaf (rip 3 (@ +.i.p.ton))]
4846 =+ mac=(mack +.i.p.ton +<.i.p.ton)
4947 ?~(mac [%leaf "####"] (tank u.mac))
50− %spot :_ rex
48+ $spot :_ rep
5149 =+ sot=(spot +.i.p.ton)
52− :- %leaf
53− ;: weld
54− ~(ram re (smyt p.sot))
55− ":<["
56− ~(rend co ~ %ud p.p.q.sot)
57− " "
58− ~(rend co ~ %ud q.p.q.sot)
59− "].["
60− ~(rend co ~ %ud p.q.q.sot)
61− " "
62− ~(rend co ~ %ud q.q.q.sot)
63− "]>"
64− ==
65− ==
50+ :+ %rose [":" ~ ~]
51+ :~ (smyt p.sot)
52+ => [ud=|=(a/@u (scow %ud a)) q.sot]
53+ leaf+"<[{(ud p.p)} {(ud q.p)}].[{(ud p.q)} {(ud q.q)}]>"
54+ == ==
6655 ::
6756
6857Examples
docs/system/hoon/library/src/4n/gate/mule.md+6−5
@@ -2,13 +2,13 @@
22
33Typed virtual
44
5−Kicks a [`++trap`](), producing its results or any errors that occur along
5+Kicks a `++trap`, producing its results or any errors that occur along
66the way. Used to lazily compute stack traces.
77
88Accepts
99-------
1010
11−`taq` is a [`++trap`](), generally producing a list of [`++tank`]()s.
11+`taq` is a `++trap`, generally producing a list of `++tank`s.
1212
1313Produces
1414--------
@@ -20,14 +20,15 @@ Source
2020
2121 ++ mule :: typed virtual
2222 ~/ %mule
23− |* taq=_|.(_*)
23+ |* taq/_|.(**)
2424 =+ mud=(mute taq)
2525 ?- -.mud
26− & [%& p=$:taq]
27− | [%| p=p.mud]
26+ $& [%& p=$:taq] :: XX transition
27+ $| [%| p=p.mud]
2828 ==
2929 ::
3030
31+
3132Examples
3233--------
3334
docs/system/hoon/library/src/4n/gate/mute.md+10−21
@@ -3,32 +3,32 @@
33Untyped virtual
44
55Kicks a `++trap`, producing its result as a noun or the tanks of any
6−error that occurs. Similar to [`++mule`](), but preserves no type
6+error that occurs. Similar to `++mule`, but preserves no type
77information.
88
99Accepts
1010-------
1111
12−`taq` is a [`++trap`](/doc/hoon/library/1#++trap).
13−
12+`taq` is a `++trap`.
1413Produces
1514--------
1615
17−Either a noun or a [`++list`]() of [`++tank`]().
16+Either a noun or a `++list` of `++tank`.
1817
1918Source
2019------
2120
2221 ++ mute :: untyped virtual
23− |= taq=_^?(|.(_*))
24− ^- (each ,* (list tank))
25− =+ ton=(mock [taq 9 2 0 1] |=(* ~))
22+ |= taq/_^?(|.(**))
23+ ^- (each * (list tank))
24+ =+ ton=(mock [taq 9 2 0 1] |=({* *} ~))
2625 ?- -.ton
27− %0 [%& p.ton]
28− %1 [%| (turn p.ton |=(a=* (smyt (path a))))]
29− %2 [%| p.ton]
26+ $0 [%& p.ton]
27+ $1 [%| (turn p.ton |=(a/* (smyt (path a))))]
28+ $2 [%| p.ton]
3029 ==
3130
31+
3232Examples
3333--------
3434
@@ -36,17 +36,6 @@ Examples
3636 [%.y p=[1.717.658.988 104 101 108 108 111 0]]
3737 ~zod/try=> (mute |.(!!))
3838 [%.n p=~]
39− ~zod/try=> (mute |.(.^(a//=pals/1)))
40− [ %.n
41− p
42− ~[
43− [ %rose
44− p=[p="/" q="/" r="/"]
45− q=[i=[%leaf p="a"] t=[i=[%leaf p="~zod"] t=[i=[%leaf p="pals"] t=[i=[%leaf p="1"] t=~]]]]
46− ]
47− ]
48− ]
49−
5039
5140
5241***
docs/system/hoon/library/src/5f/mold/mane.md+2−2
@@ -3,7 +3,7 @@
33XML name
44
55An XML name (tag name or attribute name) with an optional namespace. Parsed by
6−[`++name`]() within [`++poxa`](), rendered by [`++name`]() within `++poxo`.
6+`++name` within `++poxa`, rendered by `++name` within `++poxo`.
77
88Source
99------
@@ -13,7 +13,7 @@ Source
1313Examples
1414--------
1515
16−See also: [`++sail`]()
16+See also: `++sail`
1717
1818 ~zod/try=> *mane
1919 %$
docs/system/hoon/library/src/5f/mold/manx.md+3−3
@@ -2,17 +2,17 @@
22
33XML node.
44
5−Parsed by [`++apex`]() within [`++poxa`](), rendered by [`++poxo`]().
5+Parsed by `++apex` within `++poxa`, rendered by `++poxo`.
66
77Source
88------
99
10− ++ manx ,[g=marx c=marl] :: XML node
10+ ++ manx {g/marx c/marl} :: XML node
1111
1212Examples
1313--------
1414
15−See also: [`++sail`]() doc
15+See also: `++sail` doc
1616
1717
1818
docs/system/hoon/library/src/5f/mold/mars.md+3−2
@@ -2,12 +2,13 @@
22
33XML CDATA
44
5−Implicitly produced by [`++chrd`]() within [`++poxa`]()
5+Implicitly produced by `++chrd` within `++poxa`
66
77Source
88------
99
10− ++ mars ,[t=[n=%$ a=[i=[n=%$ v=tape] t=~]] c=~] :: XML cdata
10+ ++ mars {t/{n/$$ a/{i/{n/$$ v/tape} t/$~}} c/$~} :: XML cdata
11+
1112
1213Examples
1314--------
docs/system/hoon/library/src/5f/mold/mart.md+4−4
@@ -2,15 +2,15 @@
22
33List of XML attributes
44
5−Each `++mart` is a list of pairs of [`++mane`]() and
6−[`++tape`]().
5+Each `++mart` is a list of pairs of `++mane` and
6+`++tape`.
77
8−Parsed by [`++attr`]() within [`++poxa`](), rendered by `++attr` within [`++poxo`]()
8+Parsed by `++attr` within `++poxa`, rendered by `++attr` within `++poxo`
99
1010Source
1111------
1212
13− ++ mart (list ,[n=mane v=tape]) :: XML attributes
13+ ++ mart (list {n/mane v/tape}) :: XML attributes
1414
1515Examples
1616--------
docs/system/hoon/library/src/5f/mold/marx.md+2−2
@@ -3,12 +3,12 @@
33XML tag
44
55A `++marx` is a pair of a tag name, `++mane` and a list of attributes,
6−`++mart`. Parsed by [`++head`]() `++poxa`, rendered within `++poxo`.
6+`++mart`. Parsed by `++head` `++poxa`, rendered within `++poxo`.
77
88Source
99------
1010
11− ++ marx ,[n=mane a=mart] :: XML tag
11+ ++ marx {n/mane a/mart} :: XML tag
1212
1313Examples
1414--------
docs/system/hoon/library/src/5f/mold/ring.md+1−1
@@ -7,7 +7,7 @@ Used primarily in crypto.
77Source
88------
99
10− ++ ring ,@ :: private key
10+ ++ ring @ :: private key
1111
1212
1313
docs/system/hoon/library/src/5f/mold/time.md+2−2
@@ -7,12 +7,12 @@ The `@da` odor designates an absolute date atom.
77Source
88------
99
10− ++ time ,@da :: galactic time
10+ ++ time @da :: galactic time
1111
1212Examples
1313--------
1414
15−See also: [`++date`](), [odor reference]()
15+See also: `++date`, odor reference
1616
1717 ~zod/try=> `time`-<-
1818 ~2014.9.25..20.01.47..eeac