on master help sign in
henry/runes and master changes
commitd66c786d88268da4911f7e7d263bfba063d7c786 authorGalen Wolfe-Pauly <root@office-for.com> dateMon 8 Feb 2016, 14:11 (11 years ago) parentb3bdc854f7d97d
161 files changed+14657−4871
docs/dev/hoon.md+1−1 docs/dev/hoon/leap-in/3-app.md−55 docs/dev/hoon/leap-in/1-basic.md → docs/dev/hoon/leap-in/basic.md+17−20 docs/dev/hoon/leap-in/generators.md+177 docs/dev/hoon/leap-in/http.md+199 docs/dev/hoon/leap-in/marks.md+129 docs/dev/hoon/leap-in/2-network.md → docs/dev/hoon/leap-in/network.md+127−83 docs/dev/hoon/leap-in/state.md+107 docs/dev/hoon/leap-in/subscriptions.md+279 docs/dev/hoon/leap-in/web-apps.md+272 docs/dev/hoon/library/0.md+20−18 docs/dev/hoon/library/1.md+795−344 docs/dev/hoon/library/2a.md+306−78 docs/dev/hoon/library/2b.md+610−197 docs/dev/hoon/library/2c.md+1363−321 docs/dev/hoon/library/2da.md+258−61 docs/dev/hoon/library/2dc.md+149−36 docs/dev/hoon/library/2dd.md+51−8 docs/dev/hoon/library/2ea.md+77−15 docs/dev/hoon/library/2eb.md+40−10 docs/dev/hoon/library/2ec.md+358−87 docs/dev/hoon/library/2ed.md+191−65 docs/dev/hoon/library/2ee.md+166−56 docs/dev/hoon/library/2ef.md+241−46 docs/dev/hoon/library/2eg.md+63−12 docs/dev/hoon/library/2eh.md+187−32 docs/dev/hoon/library/2ei.md+75−19 docs/dev/hoon/library/2ej.md+316−64 docs/dev/hoon/library/2ek.md+115−13 docs/dev/hoon/library/2el.md+1128−136 docs/dev/hoon/library/2en.md+279−36 docs/dev/hoon/library/2eo.md+185−60 docs/dev/hoon/library/2ep.md+249−26 docs/dev/hoon/library/3bc.md+174−30 docs/dev/hoon/library/3bd.md+1384−269 docs/dev/hoon/library/3bf.md+218−91 docs/dev/hoon/library/3bg.md+787−305 docs/dev/hoon/library/3bh.md+102−9 docs/dev/hoon/library/3bi.md+2076 docs/dev/hoon/reference/cheat-sheet.md+532 docs/dev/hoon/runes/bc.md−49 docs/dev/hoon/runes/bc/bcbr.md+13−24 docs/dev/hoon/runes/bc/bccb.md+18−9 docs/dev/hoon/runes/bc/bccl.md+14−14 docs/dev/hoon/runes/bc/bccm.md−61 docs/dev/hoon/runes/bc/bccn.md+7−19 docs/dev/hoon/runes/bc/bckt.md−49 docs/dev/hoon/runes/bc/bcls.md+11−16 docs/dev/hoon/runes/bc/bcpm.md+8−17 docs/dev/hoon/runes/bc/bcpt.md−37 docs/dev/hoon/runes/bc/bctr.md+10−7 docs/dev/hoon/runes/bc/bcts.md+18−12 docs/dev/hoon/runes/bc/bcwt.md+9−15 docs/dev/hoon/runes/bc/bczp.md−40 docs/dev/hoon/runes/br.md−47 docs/dev/hoon/runes/br/brcb.md+14−33 docs/dev/hoon/runes/br/brcn.md+12−32 docs/dev/hoon/runes/br/brdt.md+8−21 docs/dev/hoon/runes/br/brfs.md+12−28 docs/dev/hoon/runes/br/brhp.md+7−23 docs/dev/hoon/runes/br/brkt.md+9−27 docs/dev/hoon/runes/br/brls.md+10−24 docs/dev/hoon/runes/br/brtr.md+11−26 docs/dev/hoon/runes/br/brts.md+9−20 docs/dev/hoon/runes/br/brwt.md+10−16 docs/dev/hoon/runes/cl.md−44 docs/dev/hoon/runes/cl/clcb.md+7−13 docs/dev/hoon/runes/cl/clfs.md+7−17 docs/dev/hoon/runes/cl/clhp.md+10−16 docs/dev/hoon/runes/cl/clkt.md+8−15 docs/dev/hoon/runes/cl/clls.md+7−14 docs/dev/hoon/runes/cl/clsg.md+8−10 docs/dev/hoon/runes/cl/cltr.md+9−10 docs/dev/hoon/runes/cn.md−41 docs/dev/hoon/runes/cn/cncb.md+23−23 docs/dev/hoon/runes/cn/cncl.md−55 docs/dev/hoon/runes/cn/cndt.md+10−19 docs/dev/hoon/runes/cn/cnhp.md+16−9 docs/dev/hoon/runes/cn/cnkt.md+7−24 docs/dev/hoon/runes/cn/cnls.md+9−16 docs/dev/hoon/runes/cn/cnsg.md+15−8 docs/dev/hoon/runes/cn/cntr.md+4−16 docs/dev/hoon/runes/cn/cnts.md+10−13 docs/dev/hoon/runes/cn/cnzy.md−40 docs/dev/hoon/runes/cn/cnzz.md−43 docs/dev/hoon/runes/dt.md−33 docs/dev/hoon/runes/dt/dtkt.md+9−14 docs/dev/hoon/runes/dt/dtls.md+7−7 docs/dev/hoon/runes/dt/dttr.md+8−15 docs/dev/hoon/runes/dt/dtts.md+9−15 docs/dev/hoon/runes/dt/dtwt.md+8−14 docs/dev/hoon/runes/dt/dtzz.md−5 docs/dev/hoon/runes/hx.md−19 docs/dev/hoon/runes/hx/hxgl.md+3−4 docs/dev/hoon/runes/kt.md−40 docs/dev/hoon/runes/kt/ktbr.md+10−25 docs/dev/hoon/runes/kt/ktdt.md+11−20 docs/dev/hoon/runes/kt/kthp.md+10−22 docs/dev/hoon/runes/kt/ktls.md+11−24 docs/dev/hoon/runes/kt/ktsg.md+10−16 docs/dev/hoon/runes/kt/ktts.md+7−6 docs/dev/hoon/runes/kt/ktwt.md+4−13 docs/dev/hoon/runes/sg.md−32 docs/dev/hoon/runes/sg/sgbc.md+6−12 docs/dev/hoon/runes/sg/sgbr.md+8−16 docs/dev/hoon/runes/sg/sgcb.md+8−13 docs/dev/hoon/runes/sg/sgcn.md+8−17 docs/dev/hoon/runes/sg/sgfs.md+8−14 docs/dev/hoon/runes/sg/sggl.md+5−10 docs/dev/hoon/runes/sg/sggr.md+6−11 docs/dev/hoon/runes/sg/sgls.md+7−13 docs/dev/hoon/runes/sg/sgpm.md+9−10 docs/dev/hoon/runes/sg/sgts.md+8−13 docs/dev/hoon/runes/sg/sgwt.md+10−15 docs/dev/hoon/runes/sg/sgzp.md+3−3 docs/dev/hoon/runes/sm/smcl.md+8−6 docs/dev/hoon/runes/sm/smcn.md+9−20 docs/dev/hoon/runes/sm/smdq.md+5−15 docs/dev/hoon/runes/sm/smhp.md+6−16 docs/dev/hoon/runes/sm/smls.md+3−13 docs/dev/hoon/runes/sm/smsg.md+5−10 docs/dev/hoon/runes/sm/smsm.md+5−10 docs/dev/hoon/runes/sm/smtr.md+7−18 docs/dev/hoon/runes/sm/smzz.md+6−11 docs/dev/hoon/runes/ts.md−49 docs/dev/hoon/runes/ts/tsbr.md+9−17 docs/dev/hoon/runes/ts/tscl.md+7−21 docs/dev/hoon/runes/ts/tsdt.md+7−10 docs/dev/hoon/runes/ts/tsgl.md+8−11 docs/dev/hoon/runes/ts/tsgr.md+4−15 docs/dev/hoon/runes/ts/tshp.md+9−16 docs/dev/hoon/runes/ts/tskt.md+11−10 docs/dev/hoon/runes/ts/tsls.md+7−16 docs/dev/hoon/runes/ts/tssg.md+5−9 docs/dev/hoon/runes/ts/tstr.md+7−10 docs/dev/hoon/runes/wt.md−39 docs/dev/hoon/runes/wt/wtbr.md+7−8 docs/dev/hoon/runes/wt/wtcl.md+7−23 docs/dev/hoon/runes/wt/wtdt.md+8−21 docs/dev/hoon/runes/wt/wtgl.md+7−19 docs/dev/hoon/runes/wt/wtgr.md+7−19 docs/dev/hoon/runes/wt/wthp.md+9−23 docs/dev/hoon/runes/wt/wthz.md+1−1 docs/dev/hoon/runes/wt/wtkt.md+7−15 docs/dev/hoon/runes/wt/wtls.md+10−21 docs/dev/hoon/runes/wt/wtpm.md+7−8 docs/dev/hoon/runes/wt/wtpt.md+7−13 docs/dev/hoon/runes/wt/wtsg.md+8−12 docs/dev/hoon/runes/wt/wtts.md+6−12 docs/dev/hoon/runes/wt/wttz.md+2−2 docs/dev/hoon/runes/wt/wtzp.md+7−7 docs/dev/hoon/runes/zp.md−23 docs/dev/hoon/runes/zp/zpcb.md+8−8 docs/dev/hoon/runes/zp/zpcm.md+9−14 docs/dev/hoon/runes/zp/zpfs.md+4−9 docs/dev/hoon/runes/zp/zpgr.md+9−14 docs/dev/hoon/runes/zp/zpsm.md+5−10 docs/dev/hoon/runes/zp/zpts.md+8−13 docs/dev/hoon/runes/zp/zpwt.md+5−15 docs/dev/hoon/runes/zp/zpzp.md+11−17 docs/user/clay.md+14−16
docs/dev/hoon.md+1−1
@@ -17,7 +17,7 @@ Hoon](hoon/principles).
1717
1818If you want to jump into building things right away and prefer to
1919learn from the top down, check out [Leap into
20−Hoon](hoon/leap-in/1-basic).
20+Hoon](hoon/leap-in/basic).
2121
2222Both of these are under active development.
2323
docs/dev/hoon/leap-in/3-app.mddeleted−55
@@ -1,55 +0,0 @@
1−---
2−hide: true
3−next: false
4−sort: 3
5−title: Advanced Applications
6−---
7−
8−XXX PLACEHOLDER
9−
10−But what is our app state, exactly? In Unix systems, application
11−state is just a block of memory, which you need to serialize to
12−disk if you want to keep it around for very long.
13−
14−In urbit, app state is a single (usually complex) value. In our
15−example, we don't have any special state, so we defined
16−`state=~`, meaning that our state is null. Of course, `state` is
17−just a name we're assigning to it, and you're free to use
18−whatever name you want.
19−
20−Since urbit is purely functional, we can't just implicitly "have"
21−and "change" our state. Rather, it's explicitly passed to us, in
22−the `|_ [bowl state=~]` line, and we produce the new state with
23−`+>.$` in the `[~ +>.$]` line.
24−
25−Two points you may be wondering about. Firstly, `bowl` is a set
26−of general global state that is managed by the system. It
27−includes things like `now` (current time), `our` (our urbit
28−identity), and `eny` (256 bits of guaranteed-fresh entropy). For
29−the full list of things in `++bowl`, search for `++ bowl` (note
30−the double space) in `/arvo/zuse.hoon`.
31−
32−> This is a very common technique in learning hoon. While some
33−> documentation exists, often the easiest way to learn about an
34−> identifier you see in code is to search in `/arvo/zuse.hoon`
35−> and `/arvo/hoon.hoon` for it. These are our two "standard
36−> libraries", and they're usually not hard to read. Since
37−> urbit's codebase is relatively small (those two files are less
38−> than 15000 lines of code combined, and besides the standard
39−> library they include the hoon parser and compiler, plus the
40−> /arvo microkernel), you can usually use the code and the
41−> comments as reference doc.
42−
43−Second point is that urbit needs no "serialize to disk" step.
44−Everything you produce in the app state is persistent across
45−calls to the app, restarts of the urbit, and even power failure.
46−If you want to write to the filesystem, you can, but it's not
47−needed for persistence. Urbit has transactional events, which
48−makes it an ACID operating system. Persistence is just another
49−one of those things you don't have to worry about when
50−programming in urbit.
51−
52−As fascinating as state is, we don't actually need any state to
53−accomplish our immediate goal, which is to get apps on two urbits
54−talking to each other. We'll discuss state more in a later
55−chapter.
docs/dev/hoon/leap-in/1-basic.md → docs/dev/hoon/leap-in/basic.mdrenamed+17−20
@@ -239,8 +239,7 @@ every argument.
239239> If you're familiar with Clojure, `|-` is `loop` and `$()` is
240240> recur.
241241
242−
243−## Excercises
242+**Exercises**:
244243
245244Please tweak your code to complete the following excercises.
246245
@@ -248,15 +247,15 @@ There are a few runes and some syntax that we have yet to cover that
248247you will need to complete the excercises below. For these, please
249248refer to our cheatsheat at the bottom.
250249
251−1. Read and understand `++five` line by line.
250+- Read and understand `++five` line by line.
252251
253−2. Change `++sum` to accept two variables, `a` and `b`. Pass `a`
254− to three and `b` to five. Then run the code with `a` set to
255− `1.000` and b set to `2.000`.
252+- Change `++sum` to accept two variables, `a` and `b`. Pass `a`
253+ to three and `b` to five. Then run the code with `a` set to
254+ `1.000` and b set to `2.000`.
256255
257−3. Check if this new result is under one thousand. If it is,
258− return the string 'result is less than one thousand'. If not,
259− return 'result is greater than or equal to one thousand'.
256+- Check if this new result is under one thousand. If it is,
257+ return the string 'result is less than one thousand'. If not,
258+ return 'result is greater than or equal to one thousand'.
260259
261260```
262261Review
@@ -383,20 +382,18 @@ don't throw away the subject (i.e. the standard library); rather,
383382we stack the new core on top of the old subject so that both are
384383accessible.
385384
386−## Exercises:
387−
388−4. Pass `++sum` its arguments (`2000` and `3000`) from the
389− commandline.
385+**Exercises**:
390386
391−5. Comment out all of the arms of the `|%`. Now add another arm
392− and call it `++add`, have it accept two arguments and procduce
393− 42 (regardless of input). Change the `=<` line to `[(add 5 7)
394− (^add 5 7)]`. Can you recognize what's happening?
387+- Pass `++sum` its arguments (`2000` and `3000`) from the
388+ commandline.
395389
396−6. Write fizbuzz:
390+- Comment out all of the arms of the `|%`. Now add another arm
391+ and call it `++add`, have it accept two arguments and procduce
392+ 42 (regardless of input). Change the `=<` line to `[(add 5 7)
393+ (^add 5 7)]`. Can you recognize what's happening?
397394
398− Write a program that prints the numbers from 1 to 100
399− (entered from the command line). But for multiples of three
395+- Write a program that prints the numbers from 1 to 100 (entered
396+ from the command line), except that for multiples of three
400397 print 'Fizz' instead of the number and for the multiples of
401398 five print 'Buzz'. For numbers which are multiples of both
402399 three and five print 'FizzBuzz'.
docs/dev/hoon/leap-in/generators.mdnew file+177
@@ -0,0 +1,177 @@
1+---
2+next: true
3+sort: 7
4+title: Using Generators with Apps
5+---
6+
7+Up until now we've poked apps directly. This requires the user
8+to specify the mark, and it requires the app to accept the
9+arguments in a way that's convenient for users to input. This is
10+the "plumbing" way to interact with apps. Generators are the
11+"porcelain" layer. This is why when you run a command like `+ls` or
12+`|merge`, there are no marks in sight.
13+
14+We've used generators before, back in [Basic
15+Operation](basic). At that point, we just used the generators
16+to produce values -- we didn't pipe their results into apps. In
17+the dojo cast, the role of a generator is to take a list of
18+arguments and produce a value, which is often, though not always,
19+piped into an app. Generators are pure, stateless functions, and
20+they cannot send moves.
21+
22+`+ls` and `+cat` are commonly-used generators that produce a directory
23+listing and print out a file, respectively. These are useful in
24+themselves, so we generally don't pipe the results into an app.
25+
26+Another generator is `+hood/merge`. Try running `+hood/merge`
27+with the normal arguments for `|merge`:
28+
29+```
30+~fintud-macrep:dojo> +hood/merge %home our %they
31+[syd=%home her=~fintud-macrep sud=%they gem=%auto]
32+~fintud-macrep:dojo> +hood/merge %home our %they, =gem %this
33+[syd=%home her=~fintud-macrep sud=%they gem=%auto]
34+```
35+
36+This didn't run any merge, it just constructed the command that,
37+if sent to `:hood`, would run it. Note first that, even though
38+it's not printed, this value has mark `kiln-merge`. Also, the
39+merge strategy `gem=%auto` was added automatically. Optional
40+arguments are straightforward with generators.
41+
42+In general, generators are prepended by either `+` or `|`. The
43+general form is `+generator`, but often generators are created
44+specifically to work with a single app, they're usually placed in
45+a subdirectory of gen and run with `|`. Thus, if `my-generator`
46+generator is made for use with `:my-app`, then `my-generator` is
47+put in `/gen/my-app/my-generator.hoon`, and can be run directly
48+with `+my-app/my-generator <args>`. If you want to pipe the
49+result into `:my-app`, then run `:my-app +my-app/my-generator
50+<args>`. Because this pattern is so common, this can be
51+abbreviated to `:my-app|my-generator <args>`. Because most
52+built-in commands are generators for the `:hood` app,
53+`:hood|generator <args>` can be shortened to `|generator <args>`.
54+
55+XXThe paragraph above is too long and confusing
56+
57+Let's write a generator for a modified version of `:pong` from
58+the chapter on [Network Messages](network). Recall that `:pong`
59+takes an urbit address, which is of mark `urbit`, and sends that
60+urbit the message `'howdy'`. First--without a generator--let's
61+make `:ping` that does the same, except that it lets the user
62+optionally specify the message as well.
63+
64+We'll need a new mark for our arguments. Let's call it
65+`ping-message`.
66+
67+> For app-specific marks, it's good style to prefix the name of
68+> the mark with the name of the app. Since many apps have
69+> several such marks, subdirectories in `/mar` are rendered as
70+> `-`, so that `ping-message` is written in
71+> (`/mar/ping/message.hoon`).
72+
73+```
74+|_ [to=@p message=@t]
75+++ grab
76+ |%
77+ ++ noun ,[@p @t]
78+ --
79+--
80+```
81+
82+The app can easily be modified to use this (`/ape/ping.hoon`):
83+
84+```
85+/? 314
86+|%
87+ ++ move ,[bone term wire *]
88+--
89+!:
90+|_ [bowl state=~]
91+::
92+++ poke-ping-message
93+ |= [to=@p message=@t]
94+ ^- [(list move) _+>.$]
95+ [[[ost %poke /sending [to dap] %atom message] ~] +>.$]
96+::
97+++ poke-atom
98+ |= arg=@
99+ ^- [(list move) _+>.$]
100+ ~& [%receiving (,@t arg)]
101+ [~ +>.$]
102+::
103+++ coup |=(* `+>)
104+--
105+```
106+
107+Now we can run this with:
108+
109+```
110+~fintud-macrep:dojo> |start %ping
111+>=
112+~fintud-macrep:dojo> :ping &ping-message [~sampel-sipnym 'heyya']
113+>=
114+```
115+
116+And on `~sampel-sipnym`, assuming it's running `:ping` as well,
117+we see `[%receiving 'heyya']`.
118+
119+This is an annoying way to invoke the app, though. The `[]` are
120+mandatory, and optional arguments are hard. Let's make a
121+generator, `+send` to make everything nicer. Since it's specific
122+to `:ping`, let's put it in `/gen/ping/send.hoon`:
123+
124+```
125+:- %say
126+|= [^ [[to=@p message=?(~ [text=@t ~])] ~]]
127+[%ping-message to ?~(message 'howdy' text.message)]
128+```
129+
130+A couple of new things here. Firstly, `message=?(~ [text=@t ~])`
131+should be read as "the message is either null or a pair of text
132+and null". Generator argument lists are always null-terminated,
133+which makes it convenient to accept lists in tail position (which
134+are particularly annoying without generators). `?(a b)` is the
135+irregular form of `$?(a b)`, which is a union type. Thus, `?(a
136+b)` means the type of anything that's in either `a` or `b`.
137+Thus, in our case, `?(~ [text=@t ~])` is either null or a pair of
138+text and null.
139+
140+Secondly, `?~(a b c)` is a rune which means "if the `a` is null,
141+do `b`, else `c`". It is roughly equivalent to `?:(=(~ a) b c)`.
142+
143+> `?~(a b c)` is actually equivalent to `?:=(?=(~ a) b c)`,
144+> which, although identical at run time, is subtly different at
145+> compile time. Specifically, using `?=` rather than `=` means
146+> that we're checking whether `a` is in the *type* of `~`, and so
147+> the compiler knows that in the `b` case `a` is null, and in the
148+> `c` case `a` is not null. Since `=` is purely a runtime value
149+> check with no type implications, the compiler doesn't gain any
150+> information.
151+>
152+> At any rate, this is the reason why we can refer to
153+> `text.message` in the `c` clause. The compiler knows that
154+> `message` is not null, so it must have `text` within it. If
155+> you used `?:(=(~ message) 'howdy' text.message)` the compiler
156+> would complain that it doesn't know whether `message` has
157+> `text` within it.
158+
159+This is run as follows:
160+
161+```
162+~fintud-macrep:dojo> :ping|send ~sampel-sipnym
163+>=
164+~fintud-macrep:dojo> :ping|send ~sampel-sipnym 'how do you do'
165+>=
166+```
167+
168+Which causes `~sampel-sipnym` to print `[%receiving 'howdy']` and
169+`[%receiving 'how do you do']`.
170+
171+**Exercises**:
172+
173+- Create a generator for `:sum` from [State](state) so that
174+ you can run `:sum|add 5` to add numbers to it.
175+
176+- Create a generator for `:click` from [Web Apps](web-apps) so
177+ that you can run `:click|poke` to poke it.
docs/dev/hoon/leap-in/http.mdnew file+199
@@ -0,0 +1,199 @@
1+---
2+next: false
3+sort: 8
4+title: HTTP Requests and Timers
5+---
6+
7+There's a variety of arvo services we haven't touched on yet.
8+Let's figure out how to make HTTP requests and set timers.
9+
10+Let's build an uptime-monitoring system. It'll ping a web
11+service periodically and print out an error when the response
12+code isn't 2xx. Here's `ape/up.hoon`:
13+
14+```
15+/? 314
16+|%
17+++ move ,[bone card]
18+++ card
19+ $% [%them wire (unit hiss)]
20+ [%wait wire @da]
21+ ==
22+--
23+|_ [hid=bowl on=_| in-progress=_| target=@t]
24+++ poke-cord
25+ |= url=@t
26+ ^- [(list move) _+>.$]
27+ ?: =('off' url)
28+ [~ +>.$(on |)]
29+ ?: =('on' url)
30+ :_ +>.$(on &, in-progress &)
31+ ?: |(on in-progress)
32+ ~
33+ [ost.hid %them /request ~ (need (epur target)) %get ~ ~]~
34+ [~ +>.$(target url)]
35+++ thou-request
36+ |= [wir=wire code=@ud headers=mess body=(unit octs)]
37+ ^- [(list move) _+>.$]
38+ ?: &((gte code 200) (lth code 300))
39+ ~& [%all-is-well code]
40+ :_ +>.$
41+ ?: on
42+ [ost.hid %wait /timer (add ~s10 now.hid)]~
43+ ~
44+ ~& [%we-have-a-problem code]
45+ ~& [%headers headers]
46+ ~& [%body body]
47+ :_ +>.$
48+ ?: on
49+ [ost.hid %wait /timer (add ~s10 now.hid)]~
50+ ~
51+++ wake-timer
52+ |= [wir=wire ~]
53+ ?: on
54+ :_ +>.$
55+ [ost.hid %them /request ~ (need (epur target)) %get ~ ~]~
56+ [~ +>.$(in-progress |)]
57+--
58+```
59+
60+There's some fancy stuff going on here. We'll go through it line by
61+line, though.
62+
63+Firstly, there's two kinds of cards we're sending to arvo. A
64+`%them` card makes an HTTP requrest out of a unit `hiss`.
65+
66+> Recall that `++unit` means "maybe". Formally, "`(unit a)` is
67+> either null or a pair of null and a value in `a`". Also recall
68+> that to pull a value out of a unit `(u.unit)`, you must first
69+> verify that the unit is not null (for example with `?~`).
70+
71+A `hiss` (all of the following terms are defined in `zuse`) is a
72+pair of a `purl` and a `moth`. A `purl` is a parsed url
73+structure, which can be created with `++epur`, which is a
74+function that takes a url as text and parses it into a `(unit
75+purl)`. Thus, the result is null if and only if the url is malformed.
76+
77+A `moth` is a treble of a `meth`, a `math`, and `(unit octs)`.
78+`meth` is the HTTP method, in this case `%get`. `math` is a map
79+of HTTP headers. The `(unit octs)` is a possible octet stream
80+representing the body. If it's null, then no body is sent (as in
81+this case).
82+
83+> An octect stream is a pair of the length in bytes of the data
84+> plus the data itself. You can use `++taco` takes text and
85+> turns it into an octet strem.
86+
87+When you send this request, you can expect a `%thou` with the
88+response, which we handle later on in `++thou-request`.
89+
90+For `%wait`, you just pass a [`@da`]() (absolute date), and arvo will
91+produce a `%wake` when the time comes.
92+
93+> A timer is guaranteed to not be triggered before the given
94+> time, but it's currently impossible to guarantee the timer will be
95+> triggered at exactly the requested time.
96+
97+Let's take a look at our state:
98+
99+```
100+|_ [hid=bowl on=_| in-progress=_| target=@t]
101+```
102+
103+We have three pieces of app-specific state. `target` is the url
104+we're monitoring. `on` and `in-progress` are booleans
105+representing, respectively, whether or not we're supposed to keep
106+monitoring and whether or not we're in the middle of a request.
107+
108+The type of booleans is usually written as `?`, which is a union
109+of `&` (true) and `|` false. This type defaults to `&` (true). In our
110+case, we want both of these to default to `|` (false). Because
111+of that, we use `_|` as the type. `_value` means "take the type
112+of `value`, but make the default value be `value`". Thus, our
113+type is still a boolean, just like `?`, but the default value is
114+`|` (false).
115+
116+> This is the same `_` used in `_+>.$`, which means "the same
117+> type as the value "+>.$". In other words, the same type as our
118+> current context and state.
119+
120+Let's take a look at `++poke-cord`. When we're poked with a
121+cord, we first check whether it's `'off'`. If so, we set `on` to
122+false.
123+
124+If not, we check whether it's `on`. If so, we set `on` and
125+`in-progress` to true. If it was already either on or in
126+progress, then we don't take any other immediate action. If it
127+was both off and not in progress, then we send an HTTP request.
128+This request follows the pattern in `++hiss` well. `(need (epur
129+target))` is the parsed url, `%get` is the HTTP method, `~`
130+means no extra headers, and another `~` means no body.
131+
132+> Note the `~` at the end of the move. This is a convenient
133+> shortcut for creating a list of a single element. It's part of
134+> a small family of such shortcuts. `~[a b c]` is `[a b c ~]`,
135+> `[a b c]~` is `[[a b c] ~]` and `\`[a b c]` is `[~ a b c]`.
136+> These may be mixed and matched to create various convoluted
137+> structures and emojis.
138+
139+If the argument is neither 'off' nor 'on', then we assume it's an
140+actual url, so we save it in `target`.
141+
142+When the HTTP response comes back, we handle it with
143+`++thou-request`, which, along with the wire the request was sent
144+on, takes the status code, the response headers, and the response
145+body.
146+
147+We check whether the status code is between 200 and 300. If so,
148+all is well, and we print a message saying so. We start the
149+timer for ten seconds after the present time.
150+
151+If we got a bad status code, then we print out the entire
152+response and start the timer again.
153+
154+After ten seconds, arvo will give us a `%wake` event, which will
155+be handled in `++wake-timer`. If we're still supposed to keep
156+monitoring, we send the same HTTP request as before. Otherwise,
157+we set `in-progress` to false.
158+
159+Let's try it out:
160+
161+```
162+~fintud-macrep:dojo> |start %up
163+>=
164+~fintud-macrep:dojo> :up &cord 'http://www.google.com'
165+>=
166+[%all-is-well 200]
167+[%all-is-well 200]
168+~fintud-macrep:dojo> :up &cord 'http://example.com'
169+>=
170+[%all-is-well 200]
171+~fintud-macrep:dojo> :up &cord 'http://google.com'
172+>=
173+[%we-have-a-problem 301]
174+[ %headers
175+ ~[
176+ [p='X-Frame-Options' q='SAMEORIGIN']
177+ [p='X-XSS-Protection' q='1; mode=block']
178+ [p='Content-Length' q='219']
179+ [p='Server' q='gws']
180+ [p='Cache-Control' q='public, max-age=2592000']
181+ [p='Expires' q='Sun, 10 Jan 2016 23:45:05 GMT']
182+ [p='Date' q='Fri, 11 Dec 2015 23:45:05 GMT']
183+ [p='Content-Type' q='text/html; charset=UTF-8']
184+ [p='Location' q='http://www.google.com/']
185+ ]
186+]
187+[ %body
188+ [ ~
189+ [ p=219
190+ q
191+ \/'<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">\0a<TITLE>301 Moved</TI\/
192+ TLE></HEAD><BODY>\0a<H1>301 Moved</H1>\0aThe document has moved\0a<A HREF="http://www.google.com/">her
193+ e</A>.\0d\0a</BODY></HTML>\0d\0a'
194+ \/ \/
195+ ]
196+ ]
197+]
198+~fintud-macrep:dojo> :up &cord 'off'
199+```
docs/dev/hoon/leap-in/marks.mdnew file+129
@@ -0,0 +1,129 @@
1+---
2+next: true
3+sort: 5
4+title: Marks
5+---
6+
7+We've used predefined marks already, but we haven't yet created
8+our own marks. Let's write a sample mark of our own, then chain
9+it together with some preexisting ones to have fun with type
10+conversions.
11+
12+Let's make a small "cord" mark. "Cord" is a name we use for `@t`
13+text, but there's no predefined mark for it. This is
14+`/mar/cord.hoon`:
15+
16+```
17+/? 314
18+|_ cod=@t
19+++ grab
20+ |%
21+ ++ atom |=(arg=@ `@t`(scot %ud arg))
22+ --
23+++ grow
24+ |%
25+ ++ md cod
26+ --
27+--
28+```
29+
30+Let's go through this line by line. `/? 314` is the required
31+version number, just like in apps. After that everything's in a
32+`|_`, which is a `|%` core, but with input arguments. In our
33+case, the argument is the marked data.
34+
35+There are three possible top-level arms in the `|_` core,
36+`++grab`, `++grow`, and `++grad`. `++grad` is used for revision
37+control, and it's covered elsewhere. `++grab` specifies
38+functions to convert from another mark to the current mark.
39+`++grow` specifies how to convert from the current mark to
40+another one.
41+
42+In our case, we only define one arm in `++grab`, namely `++atom`.
43+This allows us to convert any atom to a cord. `++scot` is a
44+standard library function in `hoon.hoon` which pretty-prints
45+atoms of various types. We want tot treat the atom as an
46+unsigned decimal number, so we give `%ud` and the given argument
47+to `++scot`. Thus, the form of an arm in `++grab` is
48+`|=(other-mark-type this-mark-value)`.
49+
50+In `++grow`, we just convert to the `md` mark, which is just a
51+`@t` internally, but it has fancy conversion functions to things
52+like html. `++md` isn't a function because the "argument" is the
53+`cod=@t` on the `|_` line. We just produce the new value
54+directly.
55+
56+Let's play around a bit with this mark. First, let's take a
57+marked atom and convert it to our new mark.
58+
59+```
60+~fintud-macrep:dojo> &atom 9
61+9
62+~fintud-macrep:dojo> &cord &atom 9
63+'9'
64+~fintud-macrep:dojo> &cord &atom &cord &atom 9
65+'57'
66+```
67+
68+ASCII 9 is 57. There's no requirement, implicit or otherwise,
69+that conversions back and forth between marks be inverses of each
70+other. These are semantic conversions, in that they refer to the
71+same concept. They're not isomorphisms.
72+
73+Let's play around a little more:
74+
75+```
76+~fintud-macrep:dojo> &md &cord &atom 17
77+'17'
78+~fintud-macrep:dojo> &hymn &md &cord &atom 17
79+[ [%html ~]
80+ [[%head ~] [[%title ~] [[%~. [%~. "Untitled"] ~] ~] ~] ~]
81+ [ [%body ~]
82+ [ i=[g=[n=%meta a=~[[n=%value v="{}"] [n=%name v="frontmatter"] [n=[%urb %front] v=""]]] c=~]
83+ t=[i=[g=[n=%p a=~] c=~[[g=[n=%$ a=~[[n=%$ v="17"]]] c=~]]] t=~]
84+ ]
85+ ]
86+ ~
87+]
88+```
89+
90+Ooh, that was exciting. If you squint at that, but it looks an
91+awful lot like html. Our value `17` is still in there, in the
92+body. `urb` is the mark we render most web pages to. It makes
93+sure you have a complete skeleton of a web page. Of course, by
94+the time this gets to the web page, it's plain html. Let's do
95+the final step in the conversion.
96+
97+```
98+~fintud-macrep:dojo> &mime &hymn &md &cord &atom 17
99+[ [%text %html ~]
100+ p=121
101+ q='<html><head><title>Untitled</title></head><body><meta value="{}" name="frontmatter" urb:front="" /><p>17</p></body></html>'
102+]
103+```
104+
105+This is a mime-typed octet stream with type `/text/html`, length
106+121 bytes, and our lowly number `17` rendered to a web page.
107+`cord` was just one step in the chain.
108+
109+Of course, arvo can infer some parts of this chain:
110+
111+```
112+~fintud-macrep:dojo> &cord 17
113+'17'
114+```
115+
116+Likewise, `md` is the only way to get from `cord` to `hymn`, so
117+that can be omitted. If we omit the `hymn`, though, we get:
118+
119+```
120+~fintud-macrep:dojo> &mime &cord 17
121+[[%text %x-markdown ~] p=1 q='7']
122+```
123+
124+Here, we converted straight from `cord` to `md` to `mime`. Arvo
125+decided that was the most straightforward conversion, but it
126+gives a different result than passing it through the `hymn`
127+mark.
128+
129+The minimal correct input, then, is `&mime &hymn &cord &atom 17`.
docs/dev/hoon/leap-in/2-network.md → docs/dev/hoon/leap-in/network.mdrenamed+127−83
@@ -4,14 +4,13 @@ sort: 2
44title: Network Messages
55---
66
7−Enough of pure hoonery. Let's get to the good stuff. Let's get
8−our planets to talk to each other.
7+Now we've learned enough hoon to do more interesting things.
8+Let's get our planets to talk to each other.
99
10−Of course, for talking to be of any use, we need someone
11−listening. What we've written up until now are just shell
10+All we've written up until now are just shell
1211commands that produce a value and then disappear. We need an
1312actual app to listen for messages from another planet. Let's
14−take a look at a very basic one.
13+take a look at a very basic app that does this.
1514
1615```
1716:: There is no love that is not an echo
@@ -29,10 +28,11 @@ take a look at a very basic one.
2928--
3029```
3130
31+
3232This is a very simple app that does only one thing. If you poke
33−it with a value it prints that out. You have to start the app,
34−then you can poke it from the command line with the following
35−commands:
33+it with a value, it prints that value out. To try this out, you
34+have to start the app, then you can poke it from the command line
35+with the following commands:
3636
3737```
3838~fintud-macrep:dojo> |start %echo
@@ -48,21 +48,25 @@ commands:
4848> There is currently a bug where the `%argument` lines are
4949> printed *above* the line you entered, so your output may not
5050> look exactly like this.
51+> `>=` means that a command was successfully received and
52+> executed.
5153
5254Most of the app code should be simple enough to guess its
5355function. The important part of this code is the definition of
5456`++poke-noun`.
5557
56−Once an app starts, it's always on in the background, and you
58+Once an app starts, it's always running in the background and you
5759interact with it by sending it messages. The most
5860straightforward way to do that is to poke it from the command
59−line. When you do that, `++poke-noun` is called from your app.
61+line, which we we did with `:echo 5` (`:[app-name]
62+[argument(s)]).
6063
61−In our case, `++poke-noun` takes an argument `arg` and prints it
64+In this case, `++poke-noun` takes an argument `arg` and prints it
6265out with `~&`. This is an unusual rune that formally "does
6366nothing", but the interpreter detects it and printfs the first
64−child. This is a slightly hacky way of printing to the console,
65−and we'll get to the correct way later on.
67+child, before executing the second as if the first didn't exist.
68+This is a slightly hacky way of printing to the console, but
69+we'll get to the correct way later on.
6670
6771But what does `++poke-noun` produce? Recall that `^-` casts to a
6872type. In this case, it's declaring that end result of the
@@ -70,10 +74,11 @@ function will be of type `[(list) _+>.$]`. But what does this
7074mean?
7175
7276The phrase to remember is "a list of moves and our state". Urbit
73−is a message passing system, so whenver we want to do something
74−that interacts with the rest of the system we send a message.
75−Thus, a move is arvo's equivalent of a syscall. The first
76−thing that `++poke-noun` produces is a list of messages, called
77+is a message passing system XX should we mention event
78+driven operating system XX, so whenever we want to do something that
79+interacts with the rest of the system we send a message. Thus, a
80+move is arvo's equivalent of a syscall. The first thing that
81+`++poke-noun` produces is a list of messages, called
7782"moves". In this case, we don't actually want the system to do
7883anything, so we produce the empty list, `~` (in the `[~ +>.$]`
7984line).
@@ -101,25 +106,28 @@ number, and then print out the square of that number.
101106```
102107
103108A few things have changed. Firstly, we no longer accept
104−arbitrary nouns because we can only square atoms. Thus, our
105−argument is now `arg=@`. Secondly, it's `++poke-atom` rather
106−than `++poke-noun`.
109+arbitrary nouns because we can only square atoms (integers, in
110+this case an unsigned one). Thus, our argument is now `arg=@`.
111+Secondly, it's `++poke-atom` rather than `++poke-noun`.
107112
108−Are there other `++poke`s? Definitely. In fact, `noun` and
113+Are there other `++poke`s? Yes. In fact, `noun` and
109114`atom` are just two of arbitrarily many "marks". A mark is
110115fundamentally a type definition, but accessible at the arvo
111116level. Each mark is defined in the `/mar` directory. Some marks
112117have conversion routines to other marks, and some have diff,
113118patch, and merge algorithms. None of these are required for a
114−mark to exist, though.
119+mark to exist, however.
115120
116−`noun` and `atom` are two of dozens of predefined marks, and the
121+`noun` and `atom` are two of dozens of predefined marks (that will
122+already be in your `/mar` directory), and the
117123user may add more at will. The type associated with `noun` is
118124`*`, and the type associated with `atom` is `@`.
119125
120−Data constructed on the command line is by default marked with
121−`noun`. In this case, the app is expecting an atom, so we have
122−to explicitly mark the data with `atom`. Try the following
126+When we poke an app from anywhere, we do so with a mark that
127+searches for the corresponding (`++poke-[mark]`) arm. Data
128+constructed on the command line is by default marked with `noun`.
129+In this case, the app is expecting an atom, so we have to
130+explicitly mark the data with `atom` using `&[mark]`. Try the following
123131commands:
124132
125133```
@@ -144,7 +152,7 @@ pipeline, so we'll be getting quite used to them.
144152 previous section).
145153
146154- One way of representing strings is with double quoted strings
147− called "tapes". The hoon type is `tape`, and there is a
155+ called "tapes". The hoon type is `++tape`, and there is a
148156 corresponding mark with the same name. Write an app that
149157 accepts a tape and prints out `(flop argument)`, where
150158 `argument` is the input. What does this do?
@@ -155,7 +163,7 @@ Let's write our first network message! Here's `/ape/pong.hoon`:
155163```
156164/? 314
157165|%
158− ++ move ,[bone term path *]
166+ ++ move ,[bone term wire *]
159167--
160168!:
161169|_ [bowl state=~]
@@ -184,9 +192,10 @@ Run it with these commands:
184192>=
185193```
186194
187−Replace `~sampel-sipnym` with another urbit. Don't forget to
188−start the `%pong` app on that urbit too. You should see, on the
189−foreign urbit, this output:
195+Replace `~sampel-sipnym` with another urbit. The easiest thing to
196+do is to start a [moon](), a sub-identity of your urbit. Don't
197+forget to start the `%pong` app on that urbit too. You should
198+see, on the foreign urbit, this output:
190199
191200```
192201[%receiving 'howdy']
@@ -194,14 +203,16 @@ foreign urbit, this output:
194203
195204Most of the code should be straightforward. In `++poke-atom`,
196205the only new thing is the expression `(,@t arg)`. As we already
197−know, `@t` is the type of "cord" text strings. `,` is an
198−operator that turns a type into a validator function -- that is,
199−a function whose domain is all nouns and range is the given type,
200−and which is identity when the domain is restricted to the given
201−type. In simpler terms, it's a function that coerces any value
202−to the given type. We call this `,@t` function on the argument.
203−This coerces the argument to text, so that we can print it out
204−prettily.
206+know, `@t` is the type of "cord" text strings. `,` is the
207+irregular short form of `$,`an operator that turns a type into a
208+validator function (called a "clam" in hoon) -- that is, a
209+function whose domain is all nouns and range is the given type.
210+In simpler terms, if a validator function is passed a value that
211+falls within its type, that value is produced. Otherwise, it
212+produces the default value (aka the "bunt") of its type. Here we call
213+this `,@t` function on the argument. This coerces the argument
214+to text, so that we can print it out prettily no matter what
215+we're passed.
205216
206217The more interesting part is in `++poke-urbit`. The `urbit` mark
207218is an urbit identity, and the hoon type associated with it is
@@ -214,68 +225,101 @@ want to send a message to another urbit. Thus, we produce a list
214225with one element:
215226
216227```
217−[ost %poke /sending [to %pong] %atom 'howdy']
228+[ost %poke /sending [to-urbit-address %pong] %atom 'howdy']
218229```
230+###Moves
219231
220232The general form of a move is
221233
222−`[bone term path *]`
234+ >-app/vane-specific part of move
235+`[bone term wire *]`
236+ -arvo part---->
237+ of move
238+
239+Or, in pseudo-code:
240+
241+`["cause" sys-call/action tack-new-layer-on-cause action-specific
242+information]`
243+
244+Let's walk through each of these elements step by step
245+
246+####Bones ("cause")
223247
224248If you look up `++bone` in `hoon.hoon`, you'll see that it's a
225249number (`@ud`), and that it's an opaque reference to a duct.
226250`++duct` in hoon.hoon is a list of `wire`s, where `wire` is an
227251alias for `path`. `++path` is a list of `span`s, which are ASCII
228252text. Thus, a duct is a list of paths, and a bone is an opaque
229−reference to that duct (in the same way that a Unix file
230−descriptor is an opaque reference to a file structure). Thus,
231−the center of all this is the concept of a "duct".
253+reference to it (in the same way that a Unix file
254+descriptor is an opaque reference to a file structure). Thus, to
255+truly understand bones, we must understand ducts.
256+
257+A duct is stack of causes, again, represented as paths, which are
258+called wires. At the bottom of every duct is a unix event, such
259+as a keystroke, network packet, file change, or timer event.
260+When arvo is given this event, it routes the event to appropriate
261+kernel module for handling.
232262
233−A duct is stack of causes, represented as paths. At the bottom
234−of every duct is a unix event, such as a keystroke, network
235−packet, file change, or timer event. When arvo is given this
236−event, it routes the event to appropriate kernel module for
237−handling.
263+XX[short explanation of the composition of arvo should be here.]
238264
239265Sometimes, the module can immediately handle the event and
240−produce any necessary results. Otherwise, it asks other kernel
241−modules or applications to do certain things, and produces the
242−result from that. When it sends a message to another kernel
243−module or application, it sends it "along" the duct it was given,
244−plus with a new path. Arvo pushes the new path onto the duct.
245−Now the duct has two entries, with the unix even on the bottom
246−and the kernel module that handled it next. This process can
247−continue indefinitely, adding more and more layers onto the duct.
248−When an entity produces a result, a layer is popped off the duct.
249−
250−In effect, a duct is an arvo-level call stack. The duct system
251−creates a structured message-passing system. It's worth noting
266+produce any necessary results. For example, when we poked the
267+`++poke-atom` arm above, we poked %gall, our application server,
268+which was able to respond to our poke directly. When the module
269+cannot service the request itself, it sends instructions to the other kernel
270+module or application to do a specified action, and produces the
271+result from that. Furthermore, when one module sends a message to another kernel
272+module or application, it also sends along the duct it was given
273+with its new wire tacked onto the end. Now the duct has two entries,
274+with the unix even on the bottom and the kernel module that
275+handled it next. This process can continue indefinitely, adding
276+more and more layers onto the duct. When an entity finally
277+produces a result, a layer is popped off the duct, and the result
278+is passed all the way back down.
279+
280+In effect, a duct is an arvo-level call stack. It's worth noting
252281that while in traditional call stacks a function call happens
253−synchronously and returns exactly once, in arvo multiple moves
254−can be sent at once, they are evaluated asynchronously, and each
282+synchronously and returns exactly once. In arvo, multiple moves
283+can be sent at once, are evaluated asynchronously, and each
255284one may be responded to zero or more times.
256285
257−Anyhow, the point is that whatever caused `++poke-urbit` to be
286+The point to take home is that whatever caused `++poke-urbit` to be
258287called is also the root cause for the network message we're
259−trying to send. Thus, we say to send the network message along
260−the given bone `ost`. Of course, we have to push a layer to the
261−duct. This layer can have any data we want in it, but we don't
262−need anything specific here, so we just use `/sending`. If we
263−were expecting a response (which we're not), it would come back
264−along the `/sending` path. It's a good idea for debugging
265−purposes to make the path human-readable, but it's not necessary.
266−
267−Looking back at the general form of a move, there is a `term`,
268−which in this case is `%poke`. This is the name of the
269−particular kind of move we're sending. If you think of a move as
270−a syscall (which you should), then this `term` is the name of the
271−syscall. Common ones include: `%poke`, to message an app;
272−`%warp`, to read from the filesystem; `%wait`, to set a timer;
273−and `%them`, to send an http request.
274−
275−The general form ends with `*` since each type of move takes
288+trying to send. Thus, we say to send the network message along the given bone
289+`ost`.
290+
291+#####Wire ('tack on new layer to duct')
292+
293+Of course, we have to push a new layer onto our duct
294+before passing it along (or responding to it directly) anywhere This
295+layer can have any data we want in it, but we don't need anything
296+specific here, so we just use the wire `/sending`
297+(`/elem1/elem2/elem n` is one syntax used to create `++path`s and
298+`++wire`s of n elements). If we were expecting a response (which
299+we're not), it would come back along the `/sending` wire, meaning
300+that the path `/sending` will be passed back to the response
301+handler as an argument. Although it's not required, it's
302+generally a good idea to make the wire human-readable for
303+bug-handling purposes.
304+
305+#####Term (sys-call)
306+
307+Looking back at the general form of a move, there is a
308+`term`--which is text composed lowercase ascii and `-`, and has
309+the sign of `@tas`-- which in this case is `%poke`. This is the
310+name of the particular kind of move we're sending. If you think
311+of a move as a syscall (which you should), then this `term` is
312+the name of the syscall. Common ones include: `%poke`, to
313+message an app; `%warp`, to read from the filesystem; `%wait`, to
314+set a timer; and `%them`, to send an http request.
315+
316+XXDescribe where they can find a list of these things.
317+
318+The general form ends with `*` (a noun) since each type of move takes
276319different data. In our case, a `%poke` move takes a target
277−(urbit and app) and marked data and pokes that app on that urbit
278−with that data. `[to %pong]` is the target urbit and app,
320+(urbit and app) and marked data and pokes the arm of the
321+corresponding mark on that app on that urbit
322+with that data. `[to-urbit-address %pong]` is the target urbit and app,
279323`%atom` is the mark`, and `'howdy'` is the data.
280324
281325When arvo receives a `%poke` move, it calls the appropriate
docs/dev/hoon/leap-in/state.mdnew file+107
@@ -0,0 +1,107 @@
1+---
2+next: true
3+sort: 3
4+title: State
5+---
6+
7+In the last section we built a few small apps that sent moves.
8+These apps were entirely stateless, however. Most useful apps
9+require some amount of state. Let's build a trivial stateful
10+app. It'll keep a running the sum of all the atoms we poke it with.
11+Here's `ape/sum.hoon`:
12+
13+```
14+/? 314
15+!:
16+|_ [bowl state=@]
17+++ poke-atom
18+ |= arg=@
19+ ^- [(list) _+>.$]
20+ ~& [%so-far (add state arg)]
21+ [~ +>.$(state (add state arg))]
22+--
23+```
24+
25+We can start it with `|start %sum`, and then run it:
26+
27+```
28+~fintud-macrep:dojo> :sum &atom 5
29+[%so-far 5]
30+>=
31+~fintud-macrep:dojo> :sum &atom 2
32+[%so-far 7]
33+>=
34+~fintud-macrep:dojo> :sum &atom 15
35+[%so-far 22]
36+>=
37+```
38+
39+We can see that app state is being saved, but when, where, and
40+how?
41+
42+The state is stored as the second thing in the `|_` line. In our
43+case, it's simply an atom named `state`. We change it by
44+producing as our state not with (as before) `+>.$` but `+>.$(state (add state
45+arg))`. We've seen all these parts before, but you might not
46+recognize them.
47+
48+Recall in the first chapter that we recursed with the expression
49+`$(b (add 3 b))`. This meant "produce `$` with `b` changed to
50+`(add 3 b)`. Similarly, `+>.$(state (add state arg))` means
51+"produce `+>.$` (i.e. our context, which contains our state) with
52+`state` changed to `(add state arg)`.
53+
54+At a high level, then, when we handle state, we do it explicitly.
55+It's passed in and produced explicitly. In Unix systems,
56+application state is just a block of memory, which you need to
57+serialize to disk if you want to keep it around for very long.
58+
59+In urbit, app state is a single (usually complex) value. In our
60+example, we have very simple state, so we defined `state=@`,
61+meaning that our state is an atom. Of course, `state` is just a
62+name we're assigning to it, and you're free to use whatever name
63+you want.
64+
65+Two points you may be wondering about. Firstly, `bowl` is a set
66+of general global state that is managed by the system. It
67+includes things like `now` (current time), `our` (our urbit
68+identity), and `eny` (256 bits of guaranteed-fresh entropy). For
69+the full list of things in `++bowl`, search for `++ bowl` (note
70+the double space) in `/arvo/zuse.hoon`.
71+
72+> This is a very common technique in learning hoon. While some
73+> documentation exists, often the easiest way to learn about an
74+> identifier you see in code is to search in `/arvo/zuse.hoon`
75+> and `/arvo/hoon.hoon` for it. These are our two "standard
76+> libraries", and they're usually not hard to read. Since
77+> urbit's codebase is relatively small (those two files are less
78+> than 15000 lines of code combined, and besides the standard
79+> library they include the hoon parser and compiler, plus the
80+> /arvo microkernel), you can usually use the code and the
81+> comments as reference doc.
82+
83+The second point is that urbit needs no "serialize to disk" step.
84+Everything you produce in the app state is persistent across
85+calls to the app, restarts of the urbit, and even power failure.
86+If you want to write to the filesystem, you can, but it's not
87+needed for persistence. Urbit has transactional events, which
88+makes it an [ACID operating system](). Thus, you don't have to
89+worry about persistence when programming in urbit or to ever go
90+through the hassle of having to set up and write to a database.
91+
92+**Exercises**:
93+
94+- Modify `:sum` to reset the counter when you poke it with zero.
95+
96+- Write an app that prints out the previous value you poked it
97+ with. Sample output:
98+
99+```
100+~fintud-macrep:dojo> :last 7
101+[%last 0]
102+>=
103+~fintud-macrep:dojo> :last [1 2 3]
104+[%last 7]
105+>=
106+~fintud-macrep:dojo> :last 'howdy'
107+[%last [1 2 3]]
docs/dev/hoon/leap-in/subscriptions.mdnew file+279
@@ -0,0 +1,279 @@
1+---
2+next: true
3+sort: 4
4+title: Subscriptions
5+---
6+
7+We've dealt fairly extensively with "poke" messages to an app,
8+but these are somewhat limited. A poke is a one-way message, but
9+more often we want to subscribe to updates from another app. You
10+could build a subscription model out of one-way pokes, but it's
11+such a common pattern that it's built into arvo.
12+
13+Let's take a look at two apps, `:source` and `:sink`. First,
14+`:source`:
15+
16+```
17+/? 314
18+!:
19+|%
20+++ move ,[bone %diff mark *]
21+--
22+|_ [hid=bowl state=~]
23+++ poke-noun
24+ |= arg=*
25+ ^- [(list move) _+>.$]
26+ :_ +>.$
27+ %+ turn (prey /the-path hid)
28+ |=([o=bone *] [o %diff %noun arg])
29+++ peer
30+ |= pax=path
31+ ^- [(list move) _+>.$]
32+ ~& [%subscribed-to pax=pax]
33+ [~ +>.$]
34+--
35+```
36+
37+And secondly, `:sink`:
38+
39+```
40+/? 314
41+|%
42+++ move ,[bone card]
43+++ card
44+ $% [%peer wire [@p term] path]
45+ [%pull wire [@p term] ~]
46+ ==
47+--
48+!:
49+|_ [bowl available=?]
50+++ poke-noun
51+ |= arg=*
52+ ^- [(list move) _+>.$]
53+ ?: &(=(%on arg) available)
54+ [[[ost %peer /subscribe [our %source] /the-path] ~] +>.$(available |)]
55+ ?: &(=(%off arg) !available)
56+ [[[ost %pull /subscribe [our %source] ~] ~] +>.$(available &)]
57+ ~& ?:(available %not-subscribed %subscribed)
58+ [~ +>.$]
59+++ diff-noun
60+ |= [wir=wire arg=*]
61+ ^- [(list move) _+>.$]
62+ ~& [%recieved-data arg]
63+ [~ +>.$]
64+++ reap
65+ |= [wir=wire error=(unit tang)]
66+ ^- [(list move) _+>.$]
67+ ?~ error
68+ ~& %successfully-subscribed
69+ [~ +>.$]
70+ ~& [%subscription-failed error]
71+ [~ +>.$]
72+--
73+```
74+
75+Cheat sheet:
76+
77+```
78+- `&` can either be the boolean true (along with `%.y`, `0`), or
79+ the irregular wide form of the `$&` rune, which computes the
80+ logical 'and' operation on its two children.
81+
82+- Similar to `&`,`|` is either the boolean false (along with `%.n` and `1`), or
83+ the irregular short for of `?|`, which computes the logical 'or' operation on
84+ its two children
85+
86+- `!` is the irregular wide form of `?!`, which computes the logical `not` on
87+ its child.
88+
89+- `?~` is basically an if-then-else statement that checks whether condition `p`
90+ is `~` (null). `?~` is slightly different to `?:(~ %tru %fal) in that it
91+ reduces to ?:($=(%type value) %tru %false). `$=` tests whether value `q`
92+ falls within type `p`. One thing to watch out for in hoon: if you do `?~`, it
93+ affects the type of the conditional value: XXexample
94+
95+- `:_` is just an inverted `:-`: all it does is accept children `p` and `q` and
96+ produce an inverted tuple of the two, `[q p]`.
97+
98+- `++bowl` is the type of our system state within our app. For example, it
99+ includes things like `our`, the ship name of the host, and `now`, the
100+ current time.
101+
102+- `$%` is a type constructor that defines a type composed of `n`
103+ types that it is passed. For example `$% @ * ^ ==` is the
104+ type of either `@`, `*`, or a cell `^`. XX this a union, right?
105+
106+- You may have noticed the separate `|%` above the application
107+ core `|_`. We usually put our types in another core on top of the
108+ application core. We can access these type from our `|_`
109+ because in hoon.hoon files, all cores are =>'ed (called) against
110+ each other. Thus the `|%` with the types is in the context of
111+ the `|_`, as it lies above it: hoon.hoon `=> |% w types =>
112+ |_`
113+
114+
115+
116+
117+```
118+
119+Here's some sample output of the two working together:
120+
121+```
122+~fintud-macrep:dojo> |start %source
123+>=
124+~fintud-macrep:dojo> |start %sink
125+>=
126+~fintud-macrep:dojo> :sink %on
127+[%subscribed-to pax=/the-path]
128+%successfully-subscribed]
129+>=
130+~fintud-macrep:dojo> :source 5
131+[%received-data 5]
132+>=
133+~fintud-macrep:dojo> :sink %off
134+>=
135+~fintud-macrep:dojo> :source 6
136+>=
137+~fintud-macrep:dojo> :sink %on
138+[%subscribed-to pax=/the-path]
139+%successfully-subscribed]
140+>=
141+~fintud-macrep:dojo> :source 7
142+[%received-data 7]
143+>=
144+```
145+
146+###:source
147+
148+Hopefully you can get a sense for what's happening here. When we
149+poke `:sink` with `%on`, `:sink` subscribes to `:source`, and so
150+whenever we poke `:source`, `:sink` gets the update and prints it
151+out. Then we unsubscribe by poking `:sink` with `%off`, and
152+`:sink` stops getting updates. We then resubscribe.
153+
154+There's a fair bit going on in this code, Let's look at
155+`:source` first.
156+
157+Our definition of `move` is fairly specific, since we're only
158+going to sending one kind of move. The `%diff` move is a
159+subscription update, and its content is marked data which gall
160+routes to our subscribers.
161+
162+This is a slightly different kind of move than we've dealt with
163+so far. It's producing a result rather than calling other code
164+(i.e. it's a return rather than a function call), so if you
165+recall the discussion of ducts, a layer gets popped off the duct
166+rather than added to it. This is why no wire is needed for the
167+move -- we won't receive anything in response to it.
168+
169+Anyways, there're two functions inside the `|_`. We already know
170+when `++poke-noun` is called. `++peer` is called when someone
171+tries to subscribe to our app. Of course, you don't just
172+subscribe to an app; you subscribe to a path on that app. This
173+path comes in as the argument to `++peer`.
174+
175+In our case, we don't care what path you subscribed on, and all
176+we do is print out that you subscribed. Arvo keeps track of your
177+subscriptions, so you don't have to. You can access your
178+subscribers by looking at `sup` in the bowl that's passed in.
179+`sup` is of type `(map bone ,[@p path])`, which associates bones
180+with the urbit who subscribed, and which path they subscribed on.
181+If you want to talk to your subscribers, send them messages along
182+their bone.
183+
184+`++poke-noun` spams the given arguement to all our subscribers.
185+There's a few things we haven't seen before. Firstly, `:_(a b)`
186+is the same as `[b a]`. It's just a convenient way of formatting
187+things when the first thing in a cell is much more complicated
188+than the second. Thus, we're producing our state unchanged.
189+
190+Our list of moves is the result of a call to `++turn`. `++turn`
191+is what many languages call "map" -- it runs a function on every
192+item in a list and collects the results in a list. The list is
193+`(prey /the-path hid)` and the function is the `|=` line right
194+after it.
195+
196+`++prey` is a standard library function defined in `zuse`. It
197+takes a path and a bowl and gives you a list of the subscribers
198+who are subscribed on a path that begins with the given path.
199+"Prey" is short for "prefix".
200+
201+Now we have the list of relevant subscribers. This a list of
202+triples, `[bone @p path]`, where the only thing we really need is
203+the bone because we don't care what urbit they are or what exact
204+path they subscribed on. Thus, our transformer function takes
205+`[o=bone *]` and produces `[o %diff %noun arg]`, which is a move
206+that means "tell bone `o` this subscription update: `[%noun
207+arg]`". This is fairly dense code, but what it's doing is
208+straightforward.
209+
210+###:sink
211+
212+`:source` should now make sense. `:sink` is a little longer,
213+but not much more complicated.
214+
215+In `:sink`, our definition of of `++move` is different. All
216+moves start with a `bone`, and we conventionally refer to the
217+second half as the "card", so that we can say a move is an action
218+that sends a card along a bone.
219+
220+We have two kinds of cards here: we `%peer` to start a
221+subscription, and we `%pull` to stop it. Both of these are
222+"forward" moves that may receive a response, so they need a wire
223+to tack onto the duct before they pass it on. They also need a
224+target, which is a pair of an urbit and an app name. Additionally, `%peer`
225+needs a path on that app to subscribe too. `%pull` doesn't need
226+this, because its semantics are to cancel any subscriptions
227+coming over this duct. If your bone and wire are the same as
228+when you subscribed, then the cancellation will happen correctly.
229+
230+The only state we need for `:sink` is a loobean to tell whether
231+we're already subscribed to `:source`. We use `available=?`,
232+where `?` is the sign of type boolean (similar to `*`, `@`) (which defaults to true).
233+
234+In `++poke-noun` we check our input to see both if it's `%on` and
235+we're available. If so, we produce the move to subscribe to
236+`:source`:
237+
238+```
239+[ost %peer /subscribe [our %source] /the-path]
240+```
241+
242+Also, we set available to false (`|`) with `+>.$(available |)`.
243+
244+Otherwise, if our input is `%off` and we're already subscribed
245+(i.e. `available` is false), then we unsubscribe from
246+`:source`:
247+
248+```
249+[ost %pull /subscribe [our %source] ~]
250+```
251+
252+It's important to send over the same bone and wire (`/subscribe`)
253+as the one we originally subscribed on.
254+
255+We also set `available` to true (`&`).
256+
257+If neither of these cases are true, then we just print out our
258+current subscription state and do nothing.
259+
260+`++diff-noun` is called when we get a `%diff` update along a
261+subscription with a mark of `noun`. `++diff-noun` is given the
262+wire that we originally passed with the `%peer` subscription
263+request along and the data we got back. In our case we just
264+print out the data.
265+
266+`++reap` is called when we receive an acknowledgment as to
267+whether the subscription was handled successfully. You can
268+remember that `++reap` is the counterpart to `++peer` as it's
269+almost spelled the same as 'peer' backwards. Similarly, `coup` is
270+similar to 'poke' backwards.
271+
272+Moving forward, `++reap` is given the wire we attempted to
273+subscribe over, possibly along with an error message in cases of
274+failure. `(unit type)` means "either `~` or `[~ type]`, which
275+means it's used like Haskell's "maybe" or C's nullability. If
276+`error` is `~`, then the subscription was successful, so we tell
277+that to the user. Otherwise, we print out the error message.
278+
279+Excercises XX
docs/dev/hoon/leap-in/web-apps.mdnew file+272
@@ -0,0 +1,272 @@
1+---
2+next: true
3+sort: 6
4+title: Web Apps
5+---
6+
7+We've done purely functional web pages as hook files, and we've
8+done command line apps, so now let's interact with an app over
9+the web. The fundamental concepts are no different than from the
10+command line -- you send "poke" messages to apps and subscribe to
11+data streams. The only difference is that you do it with
12+javascript.
13+
14+Let's create a small web app that counts the number of times you
15+poke it. There'll be a button to poke the app, and line of text
16+below it saying how many times the app has been poked. We can
17+update this by subscribing to that information from the app.
18+
19+Let's first write the app, `/ape/click.hoon`:
20+
21+```
22+/? 314
23+!:
24+|%
25+++ move ,[bone %diff %mark *]
26+--
27+!:
28+|_ [hid=bowl clicks=@]
29+++ poke-click
30+ |= click=%click
31+ ~& [%poked +(clicks)]
32+ :_ +>.$(clicks +(clicks))
33+ %+ turn (prey /the-path hid)
34+ |=([o=bone *] [o %diff %clicks +(clicks)])
35+++ peer-the-path
36+ |= pax=path
37+ [[[ost.hid %diff %clicks clicks] ~] +>.$]
38+--
39+```
40+
41+There's nothing really new here, except that we use a couple of
42+new marks, `click` and `clicks`. When we get poked with a
43+`click`, we increment the variable `clicks` in our state and tell
44+all our subcribers the new value. When someone subscribes to us
45+on the path `/the-path`, we immediately give them the current
46+number of clicks.
47+
48+Let's take a look at the new marks. Here's `/mar/click.hoon`:
49+
50+```
51+|_ click=%click
52+++ grab
53+ |%
54+ ++ noun |=(* %click)
55+ ++ json
56+ |= jon=^json
57+ ?> =('click' (need (so:jo jon)))
58+ %click
59+ --
60+--
61+```
62+
63+The mark `click` has hoon type `%click`, which means the only
64+valid value is `%click`. We can convert from `noun` by just
65+producing `%click`.
66+
67+We also convert from json by parsing a json string with `so:jo`,
68+asserting the parsing succeeded with `need`, and asserting the
69+result was 'click' with `?>`, which asserts that its first child
70+is true.
71+
72+> Note the argument to `++json`is `jon=^json`. Why `^json`?
73+> `++json` shadows the type definition, so if we want to refer to
74+> the type, we have to prepend a `^`. This extends to multiple
75+> levels: `^^^foo` means "not the innermost `foo`, nor the next
76+> innermost, nor the next innermost, but the next innermost".
77+
78+> `++jo` in `zuse` is a useful library for parsing complex json
79+> into hoon structures. In this case, the `:` between `so` and
80+> `jo` means 'inside of', because `so` is an arm contained within
81+> the core `jo`. Our case is actually simple enough that the
82+> `?>` line could have been `?> =([%s 'click'] jon)`.
83+
84+We can test this mark from the command line:
85+
86+```
87+~fintud-macrep:dojo> &click %click
88+%click
89+~fintud-macrep:dojo> &click &json [%s 'click']
90+%click
91+~fintud-macrep:dojo> &click &json &mime [/text/json (taco '"click"')]
92+%click
93+~fintud-macrep:dojo> &click &json &mime [/text/json (taco '"clickety"')]
94+/~fintud-macrep/home/0/mar/click:<[7 5].[8 11]>
95+ford: casting %json to %click
96+ford: cast %click
97+```
98+
99+And `/mar/clicks.hoon`:
100+
101+```
102+|_ clicks=@
103+++ grow
104+ |%
105+ ++ json
106+ (joba %clicks (jone clicks))
107+ --
108+--
109+```
110+
111+`clicks` is just an atom. We convert to json by creating an
112+object with a single field "clicks" with our value.
113+
114+> Be sure to checkout section 3bD, JSON and XML, in zuse.hoon
115+> `++joba` is just a function that takes a key-value pair and
116+> produces a JSON object with one element.
117+
118+```
119+~fintud-macrep:dojo> &json &clicks 6
120+[%o p={[p='clicks' q=[%n p=~.^]]}]
121+~fintud-macrep:dojo> &mime &json &clicks 6
122+[[%text %json ~] p=12 q='{"clicks":6}']
123+```
124+
125+Now that we know the marks involved, take another look at the app
126+above. Everything should be pretty straightforward. Let's poke
127+the app from the command line.
128+
129+```
130+~fintud-macrep:dojo> |start %click
131+>=
132+~fintud-macrep:dojo> :click &click %click
133+[%poked 1]
134+>=
135+~fintud-macrep:dojo> :click &click %click
136+[%poked 2]
137+>=
138+```
139+
140+**Exercise**:
141+
142+- Modify `:sink` from the subcriptions chapter to listen to
143+ `:click` and print out the subscription updates on the command
144+ line.
145+
146+That's all that's needed for the back end. The front end is just
147+some "sail" html and javascript. Here's `/pub/click/hymn.hook`:
148+
149+```
150+;html
151+ ;head
152+ ;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js");
153+ ;script(type "text/javascript", src "/~~/~/at/home/lib/urb.js");
154+ ;title: Clickety!
155+ ==
156+ ;body
157+ ;div#cont
158+ ;input#go(type "button", value "Poke!");
159+ ;div#err(class "disabled");
160+ ;div#clicks;
161+ ==
162+ ;script(type "text/javascript", src "click/main.js");
163+ ==
164+==
165+```
166+
167+You should recognize the sail syntax from an earlier chapter.
168+Aside from jquery, we also include `urb.js`, which is a framework
169+for interacting with urbit.
170+
171+We have a button labeled "Poke!" and a div with id `clicks` where
172+we'll put the number of clicks. We also include a small
173+javascript file where the client-side application logic can be
174+found. It's in `/pub/click/main.js`:
175+
176+```
177+$(function() {
178+ var clicks, $go, $clicks, $err
179+
180+ $go = $('#go')
181+ $clicks = $('#clicks')
182+ $err = $('#err')
183+
184+ window.urb.appl = "click"
185+
186+ $go.on("click",
187+ function() {
188+ window.urb.send(
189+ "click", {mark: "click"}
190+ ,function(err,res) {
191+ if(err)
192+ return $err.text("There was an error. Sorry!")
193+ if(res.data !== undefined &&
194+ res.data.ok !== undefined &&
195+ res.data.ok !== true)
196+ $err.text(res.data.res)
197+ else
198+ console.log("poke succeeded");
199+ })
200+ })
201+
202+ window.urb.bind('/the-path',
203+ function(err,dat) {
204+ clicks = dat.data.clicks
205+ $clicks.text(clicks)
206+ }
207+ )
208+})
209+```
210+
211+We first set the default application to "click". A page can, of
212+course, talk to multiple apps by specifying on each message which
213+app to talk to.
214+
215+We set up two event handlers. When we click the button, we run
216+`window.urb.send`, which sends a poke to an app. The arguments
217+are data, parameters, and callback. The data is the specific
218+data to send. The parameters are all optional, but here's a list
219+of the available ones:
220+
221+- `ship`: target urbit. Defaults to `window.urb.ship`, which
222+ defaults to the urbit which served the page.
223+- `appl`: target app. Defaults to `window.urb.appl`, which
224+ defaults to null.
225+- `mark`: mark of the data. Defaults to `window.urb.send.mark`,
226+ which defaults to "json".
227+- `wire`: wire of the poke. Defaults to `/`.
228+
229+In our case, we specify only that the mark is "click".
230+
231+The callback funciton is called when we receive an
232+acknowledgment. If there was an error, we put it in the `err`
233+div that we defined above. Otherwise, we printf to the console a
234+message saying the poke succeeded. A common pattern is to gray
235+out a button when you click it and only reenable it when you get
236+the positive acknowledgment.
237+
238+We also call `window.urb.bind`, which subscribes to a data stream
239+on an app. It also takes three arguments: path, parameters, and
240+callback. The path is the path on the app to subscribe to. The
241+parameters are all optional (inded, we omit them entirely here),
242+but are similar to those for `send`:
243+
244+- `ship`: target urbit. Defaults to `window.urb.ship`, which
245+ defaults to the urbit which served the page.
246+- `appl`: target app. Defaults to `window.urb.appl`, which
247+ defaults to null.
248+- `mark`: mark of expected data. Data of other marks is
249+ converted to this mark on the server before coming to the web
250+ front end. Defaults to `window.urb.bind.mark`, which defaults
251+ to "json".
252+- `wire`: wire of the subscription. Defaults to the given path.
253+
254+The callback function here just updates the data in the `clicks`
255+div. A truly robust app would intelligently handle errors, of
256+course.
257+
258+This app can be tested from the web by going to
259+`/~~/home/pub/click` on your server. Usually, this is
260+`ship-name.urbit.org/~~/home/pub/click`.
261+
262+Note that the app doesn't have anything web-specific in itself.
263+As far as it knows, it's just receiving pokes and subscriptions.
264+The javascript is fairly pure as well, sending and receiving json
265+everywhere. The marks are the translation layer, and they're the
266+only things that need to know how the hoon types map to json.
267+
268+**Exercise**:
269+
270+- Open the app in multiple tabs, click the button, and verify
271+ that all the tabs stay in sink. Poke it manually from the
272+ command line and verify the tabs are updated as well.
docs/dev/hoon/library/0.md+20−18
@@ -3,14 +3,11 @@ volume 0, Kelvin Versioning.
33
44### `++hoon`
55
6− ++ hoon %164 :: version stub
7−
8−Declares the current Hoon version number in degrees Kelvin.
6+Hoon version number Kelvin
97
10−When normal people release normal software, they count by fractions, and
11−they count up. Thus, they can keep extending and revising their systems
12−incrementally. This is generally considered a good thing. It generally
13−is.
8+Traditional software versioning schema use fractions, and count up. Thus, they
9+can keep extending and revising their systems incrementally. This is generally
10+considered a good thing, and it generally is.
1411
1512In some cases, however, specifications needs to be permanently frozen.
1613This requirement is generally found in the context of standards. Some
@@ -21,17 +18,22 @@ have the same ethertype). Moreover, many standards render themselves
2118incompatible in practice through excessive enthusiasm for extensibility.
2219They may not be perma-frozen, but they probably should be.
2320
24−The true, Martian way to perma-freeze a system is what I call Kelvin
25−versioning. In Kelvin versioning, releases count down by integer degrees
26−Kelvin. At absolute zero, the system can no longer be changed. At 1K,
27−one more modification is possible. And so on. For instance, Nock is at
28−5K. It might change, though it probably won't. Nouns themselves are at
29−0K - it is impossible to imagine changing anything about their three
30−sentence definition.
21+As urbit is designed to be a standard, we devised a versioning scheme that will
22+allow it to eventually be frozen: Kelvin versioning. In Kelvin versioning,
23+releases count down by integer degrees Kelvin. At absolute zero, the system can
24+no longer be changed. At 1K, one more modification is possible. And so on. For
25+instance, Nock is at 5K. It might change, though it probably won't. Nouns
26+themselves are at 0K - it is impossible to imagine changing anything about
27+their three sentence definition.
28+
29+Source
30+------
31+
32+ ++ hoon %164 :: version stub
3133
32−------------------------------------------------------------------------
34+Examples
35+--------
3336
34− ~zod/try=> stub
35− 164
37+ ~zod/try=> hoon
38+ %163
3639
37−------------------------------------------------------------------------
docs/dev/hoon/library/1.md+795−344
@@ -5,11 +5,15 @@ volume 1, Hoon Structures
55
66### `++abel`
77
8− ++ abel typo :: original sin: type
9−
108Biblical names in hoon are primarily aliases for the compiler.
119
12−See also: `++typo`
10+Source
11+------
12+
13+ ++ abel typo :: original sin: type
14+
15+Examples
16+--------
1317
1418 ~zod/try=> *abel
1519 %void
@@ -18,12 +22,18 @@ See also: `++typo`
1822
1923### `++axis`
2024
21− ++ axis ,@ :: tree address
25+Nock axis
26+
27+A Nock axis inside a [noun](). After the leading 1, in binary, a `1` signfies
28+right and `0` left.
2229
23−A Nock axis inside a noun. After the leading 1, in binary, a 1 signfies
24−right and 0 left.
30+Source
31+------
2532
26−See also: `++clue`, `++limb`, `++slot`, `++peg`, and Section 2fC
33+ ++ axis ,@ :: tree address
34+
35+Examples
36+--------
2737
2838 ~zod/try=> *axis
2939 0
@@ -34,24 +44,22 @@ See also: `++clue`, `++limb`, `++slot`, `++peg`, and Section 2fC
3444 ~zod/try=> `axis`0b110
3545 6
3646
37−------------------------------------------------------------------------
38−
39−### `++also`
47+-----------------------------------------------------------------------
4048
41− ++ also ,[p=term q=wing r=type] :: alias
49+### `++base`
4250
43−XX unused?
51+Base type
4452
45−------------------------------------------------------------------------
53+A base type that [noun]()s are built from. A `++base` is either a noun, cell, boolean or
54+null labelled with an [odor]().
4655
47−### `++base`
56+Source
57+------
4858
4959 ++ base ?([%atom p=odor] %noun %cell %bean %null) :: axils, @ * ^ ? ~
5060
51−A base type that nouns are built from. Either a noun, a cell, loobean or
52−null labelled with an odor.
53−
54−See also: `++tile`, `++twig`
61+Examples
62+--------
5563
5664 ~zod/try=> *base
5765 %null
@@ -68,10 +76,17 @@ See also: `++tile`, `++twig`
6876
6977### `++bean`
7078
79+Boolean
80+
81+`0`, `&`, or `%.y` are true, and `1`, `|`, and `%.n` are false.
82+
83+Source
84+------
85+
7186 ++ bean ,? :: 0=&=yes, 1=|=no
7287
73−The Urbit version of a boolean, which we call a loobean. 0 or & is
74−"yes", 1 or | is "no".
88+Examples
89+--------
7590
7691 ~zod/try=> *bean
7792 %.y
@@ -85,11 +100,17 @@ The Urbit version of a boolean, which we call a loobean. 0 or & is
85100
86101### `++beer`
87102
88− ++ beer $|(@ [~ p=twig]) :: simple embed
103+Tape builder
104+
105+Used to build [tape]()s internally.
89106
90−Used to build tapes internally.
107+Source
108+------
91109
92−See also: `++phax`, `++scat`, section 2fD
110+ ++ beer $|(@ [~ p=twig]) :: simple embed
111+
112+Examples
113+--------
93114
94115 ~zod/try=> `beer`'as'
95116 29.537
@@ -100,6 +121,13 @@ See also: `++phax`, `++scat`, section 2fD
100121
101122### `++beet`
102123
124+XML interpolation cases
125+
126+Used internally.
127+
128+Source
129+------
130+
103131 ++ beet $| @ :: advanced embed
104132 $% [%a p=twig] :: take tape
105133 [%b p=twig] :: take manx
@@ -108,19 +136,22 @@ See also: `++phax`, `++scat`, section 2fD
108136 [%e p=twig q=(list tuna)] :: element literal
109137 == ::
110138
111−Cases for XML interpolation. Used internally.
112−
113−See also: `++sail`, section 2fD
114−
115139------------------------------------------------------------------------
116140
117141### `++bloq`
118142
119− ++ bloq ,@ :: blockclass
143+Blocksize
120144
121145Atom representing a blocksize, by convention expressed as a power of 2.
122146
123−See also: section 2cA
147+
148+Source
149+------
150+
151+ ++ bloq ,@ :: blockclass
152+
153+Examples
154+--------
124155
125156 ~zod/try=> :: ++met measures how many bloqs long an atom is
126157 ~zod/try=> (met 3 256)
@@ -131,11 +162,17 @@ See also: section 2cA
131162
132163### `++calf`
133164
134− ++ calf ,[p=(map ,@ud wine) q=wine] ::
165+Cyclical backreferences
135166
136167Encodes cyclical backreferences in types. Used in pretty printing.
137168
138−See also: `++wine`, `++dole`, `++doge`, `++dish`, section 2fC
169+Source
170+------
171+
172+ ++ calf ,[p=(map ,@ud wine) q=wine] ::
173+
174+Examples
175+--------
139176
140177 ~zod/try=> `calf`[~ %atom %ta]
141178 [p={} q=[%atom p=%ta]]
@@ -152,51 +189,66 @@ See also: `++wine`, `++dole`, `++doge`, `++dish`, section 2fC
152189
153190### `++char`
154191
155− ++ char ,@tD :: UTF-8 byte
192+Char
156193
157−A single character. Odor `@tD` designates a single Unicode byte. All
158−parsers consume `++tape` (a list of `++char`).
194+A single character. [odor]() [`@tD`]() designates a single unicode byte. All
195+parsers consume [`++tape`]()s, which are lists of `++char`.
159196
160−See also: `++tape`, `++lust`, `++just`, `++mask`, chapter 2f
161197
162− ~zod/try=> *char
163− ~~
198+Source
199+------
164200
165− ~zod/try=> (char 97)
166− ~~a
201+ ++ char ,@tD :: UTF-8 byte
202+
203+Examples
204+--------
205+
206+ ~zod/try=> *char
207+ ''
208+ ~zod/try> (char 97)
209+ 'a'
167210
168211------------------------------------------------------------------------
169212
170213### `++chub`
171214
215+Attach jets
216+
217+Used by the compiler (implicitly by `%sgcn`) to attach jets.
218+
219+Source
220+------
221+
172222 ++ chub :: registered battery
173223 $: p=(pair chum tyre) :: definition
174224 q=* :: battery
175225 r=(unit (pair axis chub)) :: parent
176226 == ::
177227
178−Used by the compiler (implicitly by `%sgcn`) to attach jets.
179−
180−See also: Section 2fB.
181−
182228------------------------------------------------------------------------
183229
184230### `++chum`
185231
232+Jet hint information
233+
234+Jet hint information that must be present in the body of a `~/` or `~%`
235+rune. A `++chum` can optionally contain a kelvin version, jet vendor,
236+and "{major}.{minor}" version number.
237+
238+Source
239+------
240+
186241 ++ chum $? lef=term :: jet name
187242 [std=term kel=@] :: kelvin version
188243 [ven=term pro=term kel=@] :: vendor and product
189244 [ven=term pro=term ver=@ kel=@] :: all of the above
190245 == ::
191246
192−Jet hint information that must be present in the body of a \~/ or \~%
193−rune. A `++chum` can optionally contain a kelvin version, jet vendor,
194−and major.minor version number.
247+Examples
248+--------
195249
196250XX there's a ++chum in zuse that's politely causing this not to work
197251
198−See also: `++twig`, `++clue`
199−
200252 ~zod/try=> `chum`'hi'
201253 lef=%hi
202254
@@ -207,43 +259,53 @@ See also: `++twig`, `++clue`
207259
208260### `++clue`
209261
210− ++ clue ,[p=axis q=chum r=tyre] :: battery definition
262+Attach jet
211263
212264Used by compiler to attach jets.
213265
214−XX implementation does not currenlty match docs
266+Source
267+------
215268
216−See also: section 2fB
269+ ++ clue ,[p=axis q=chum r=tyre] :: battery definition
270+
271+XX implementation does not currenlty match docs
217272
218273------------------------------------------------------------------------
219274
220275### `++coil`
221276
277+Tuple of core information
278+
279+Variance `p`, subject type `q`, and `q`: optional compiled nock, and arms. Used as an
280+intermediate step within Section 2fB. Converted by `++core` to %core type.
281+
282+Source
283+------
284+
222285 ++ coil $: p=?(%gold %iron %lead %zinc) :: core type
223286 q=type ::
224287 r=[p=?(~ ^) q=(map term foot)] ::
225288 == ::
226289
227−Core information tuple: variance, subject type, optional compiled nock,
228−and arms. Used as an intermediate step within Section 2fB. Converted by
229−`++core` to %core type.
230−
231−See also: `++core`, Section 2fB
232−
233290------------------------------------------------------------------------
234291
235292### `++coin`
236293
294+Noun literal syntax cases
295+
296+Noun literal syntax cases: atoms, jammed nouns, and nestable tuples.
297+Parsed and printed using [`++so`]() and [`++co`]() cores.
298+
299+Source
300+------
301+
237302 ++ coin $% [%$ p=dime] ::
238303 [%blob p=*] ::
239304 [%many p=(list coin)] ::
240305 == ::
241306
242−Noun literal syntax cases: atoms, jammed nouns, and nestable tuples.
243−Parsed and printed using `++so` and `++co` cores in Section 2eL
244−respectively.
245−
246−See also: `++so`, `++co`, Section 2eL, `++dime`
307+Examples
308+--------
247309
248310 ~zod/try=> `coin`(need (slay '~s1'))
249311 [%$ p=[p=~.dr q=18.446.744.073.709.551.616]]
@@ -266,17 +328,23 @@ See also: `++so`, `++co`, Section 2eL, `++dime`
266328
267329### `++cord`
268330
331+UTF-8 text
332+
333+One of Hoon's two string types (the other being [`++tape`]()). A cord is an
334+atom of UTF-8 text. [`++trip`]() and [`++crip`]() convert between cord and
335+`++tape`.
336+
337+Source
338+------
339+
269340 ++ cord ,@t :: text atom (UTF-8)
270341
271−One of Hoon's two string types (the other being `++tape`). A cord is an
272−atom of UTF-8 text. `++trip` and `++crip` convert between cord and
273−`++tape`
342+Examples
343+--------
274344
275−Odor `@t` designates a Unicode atom, little-endian: the first character
345+Odor [`@t`]() designates a Unicode atom, little-endian: the first character
276346in the text is the low byte.
277347
278−See also: `++trip`, `++crip`, Section 2eJ
279−
280348 ~zod/try=> `@ux`'foobar'
281349 0x7261.626f.6f66
282350
@@ -289,13 +357,20 @@ See also: `++trip`, `++crip`, Section 2eJ
289357
290358### `++date`
291359
292− ++ date ,[[a=? y=@ud] m=@ud t=tarp] :: parsed date
360+Point in time
293361
294−A point in time. A loobean designating AD or BC, a year atom, a month
295−atom, and a `++tarp`, which is a day atom and a time.
362+A boolean designating AD or BC, a year atom, a month
363+atom, and a [`++tarp`](), which is a day atom and a time.
296364
297−See also: `++year`, `++yore`, Section 2cH, `++stud`, `++dust`, Section
298−3bc
365+Source
366+------
367+
368+ ++ date ,[[a=? y=@ud] m=@ud t=tarp] :: parsed date
369+
370+Examples
371+--------
372+
373+See also: [`++year`](), [`++yore`]() [`++stud`](), [`++dust`]()
299374
300375 ~zod/try=> `date`(yore ~2014.6.6..21.09.15..0a16)
301376 [[a=%.y y=2.014] m=6 t=[d=6 h=21 m=9 s=15 f=~[0xa16]]]
@@ -304,40 +379,39 @@ See also: `++year`, `++yore`, Section 2cH, `++stud`, `++dust`, Section
304379
305380### `++dime`
306381
307− ++ dime ,[p=@ta q=@] ::
382+Odor-atom pair
308383
309−Odor-atom pair, used in `++coin`.
384+Used in [`++coin`](). Convenience methods [`++scot`]() and [`++scow`]() (in
385+Section 2eL) print dimes as [`++cord`]() and [`++tape`](), respectively.
386+[`++slat`](), [`++slav`](), and [`++slaw`]() are used to parse atoms of
387+specific [odor]()s.
310388
311−Convenience methods `++scot` and `++scow` (in Section 2eL) print dimes
312−as cords/tapes, `++slat`, `++slav`, and `++slaw` are used to parse atoms
313−of specific odor.
389+Source
390+------
314391
315−See also: `++so`, `++co`, Section 2eL, `++coin`
392+ ++ dime ,[p=@ta q=@] ::
393+
394+Examples
395+--------
316396
317397 ~zod/try=> +>:(slay '0x123')
318398 p=[p=~.ux q=291]
319399
320400------------------------------------------------------------------------
321401
322−### `++dram`
323−
324− ++ dram $% [| p=(map ,@tas dram)] :: simple unix dir
325− [& p=@ud q=@] ::
326− == ::
327−
328−The structure of a unix filesystem tree. A `++dram` is one of two cases:
329−`|` a directory - a map of names to deeper tree structures, `&` a file -
330−a numbered atom of data.
402+### `++each`
331403
332−XX Unused
404+Mold of fork between two
333405
334−------------------------------------------------------------------------
406+[mold]() generator: produces a dicriminated [fork]() between two types.
335407
336−### `++each`
408+Source
409+------
337410
338− ++ each |*([a=$+(* *) b=$+(* *)] $%([& p=a] [| p=b])) :: either a or b
411+ ++ each |*([a=$+(* *) b=$+(* *)] $%([& p=a] [| p=b])) :: either a or b
339412
340−Tile generator: produces a discriminated fork between two types.
413+Examples
414+--------
341415
342416 ~zod/try=> :type; *(each cord time)
343417 [%.y p='']
@@ -347,11 +421,19 @@ Tile generator: produces a discriminated fork between two types.
347421
348422### `++edge`
349423
350− ++ edge ,[p=hair q=(unit ,[p=* q=nail])] :: parsing output
424+Parsing location metadata
425+
426+Optional result `p` and parsing continuation `q`.
427+
428+Source
429+------
430+
431+ ++ edge ,[p=hair q=(unit ,[p=* q=nail])] :: parsing output
351432
352−Parsing location metadata: optional result and parsing continuation.
433+Examples
434+--------
353435
354−See also: Section 2eD, `++rule`
436+See also: Section 2eD, [`++rule`]()
355437
356438 ~zod/try=> *edge
357439 [p=[p=0 q=0] q=~]
@@ -362,15 +444,23 @@ See also: Section 2eD, `++rule`
362444
363445### `++foot`
364446
447+Cases of arms by variance model.
448+
449+`%ash` arms are [`dry`]() and [geometric]().
450+
451+Source
452+------
453+
365454 ++ foot $% [%ash p=twig] :: dry arm, geometric
366455 [%elm p=twig] :: wet arm, generic
367456 [%oak ~] :: XX not used
368457 [%yew p=(map term foot)] :: XX not used
369458 == ::
370459
371−Cases of arms by variance model.
460+Examples
461+--------
372462
373−See also: `++ap`, `++ut`, Section 2fB, Section 2fC
463+See also: [`++ap`](), [`++ut`]()
374464
375465 ~zod/try=> *foot
376466 [%yew p={}]
@@ -388,12 +478,21 @@ See also: `++ap`, `++ut`, Section 2fB, Section 2fC
388478
389479### `++gate`
390480
391− ++ gate $+(* *) :: general gate
481+Function
392482
393−An core with one arm, `$`, which transforms a sample noun into a product
394−noun. If used dryly as a type, subject must have a sample type of `*`.
483+A core with one arm, `$`--the empty name--which transforms a sample noun into a product
484+noun. If used [dryly]() as a type, the [subject]() must have a sample type of [`*`]().
395485
396−See also: `++lift`, `++cork`, Core Language Doc
486+
487+Source
488+------
489+
490+ ++ gate $+(* *) :: general gate
491+
492+Examples
493+--------
494+
495+See also: [`++lift`](), [`++cork`]()
397496
398497 ~zod/try=> *gate
399498 <1|mws [* <101.jzo 1.ypj %164>]>
@@ -409,11 +508,17 @@ See also: `++lift`, `++cork`, Core Language Doc
409508
410509### `++hair`
411510
412− ++ hair ,[p=@ud q=@ud] :: parsing trace
511+Parsing line and column
512+
513+A pair of two [`@ud`]() used in parsing indicating line and column number.
413514
414−A pair of two `@ud` used in parsing indicating line and column number.
515+Source
516+------
415517
416−See also: `++last`, Section 2eB
518+ ++ hair ,[p=@ud q=@ud] :: parsing trace
519+
520+Examples
521+--------
417522
418523 ~zod/try=> *hair
419524 [p=0 q=0]
@@ -429,20 +534,20 @@ See also: `++last`, Section 2eB
429534
430535### `++like`
431536
432− ++ like |* a=_,* :: generic edge
433− |= b=_`*`[(hair) ~] ::
434− :- p=(hair -.b) ::
435− ^= q ::
537+Mold generator for an edge
538+
539+`++like` generates an `++edge` with a parsed result set to a specific type.
540+
541+Source
542+------
543+
544+ ++ like |* a=_,* :: generic edge
436545 ?@ +.b ~ ::
437546 :- ~ ::
438547 u=[p=(a +>-.b) q=[p=(hair -.b) q=(tape +.b)]] ::
439548
440−Tile generator for an `++edge`. `++like` generates an `++edge` with a
441−parsed result set to a specific type.
442−
443−See also: `++easy`, `++just`/`++jest`, `++knee`, `++mask`, `++shim`,
444−`++stir`, `++stun`, Section 2eC
445−
549+Examples
550+--------
446551 ~zod/try=> *(like char)
447552 [p=[p=0 q=0] q=~]
448553
@@ -476,13 +581,16 @@ See also: section 2fC-2fD
476581
477582### `++line`
478583
479− ++ line ,[p=[%leaf p=odor q=@] q=tile] :: %kelp case
480−
481584XX move to `++ut`
482585
483−Dicriminated union unionee XX
586+Source
587+------
588+
589+ ++ line ,[p=[%leaf p=odor q=@] q=tile] :: %kelp case
590+
484591
485−Used in compilation and grammar, section 2fC-2fD
592+Examples
593+--------
486594
487595 ~zod/try=> (ream '$%([1 a] [%2 b])')
488596 [ %bccm
@@ -503,13 +611,21 @@ Used in compilation and grammar, section 2fC-2fD
503611
504612### `++list`
505613
506− ++ list |* a=_,* :: null-term list
507− $|(~ [i=a t=(list a)]) ::
614+List
508615
509−Tile generator. `++list` generates a tile of a null-terminated list of
616+[mold]() generator. `++list` generates a mold of a null-termanated list of a
510617homogenous type.
511618
512−See also: `++turn`, `++snag`, section 2bB.
619+
620+Source
621+------
622+
623+ ++ list |* a=_,* :: null-term list
624+
625+Examples
626+--------
627+
628+See also: [`++turn`](), [`++snag`]()
513629
514630 ~zod/try=> *(list)
515631 ~
@@ -522,22 +638,33 @@ See also: `++turn`, `++snag`, section 2bB.
522638
523639### `++lone`
524640
525− ++ lone |*(a=$+(* *) ,p=a) :: just one thing
641+Tile generator. `++lone` puts face of `p` on something.
526642
527643XX unused
528644
529−Tile generator. `++lone` puts face of `p` on something.
645+Source
646+------
647+
648+ ++ lone |*(a=$+(* *) ,p=a) :: just one thing
530649
531650------------------------------------------------------------------------
532651
533652### `++mane`
534653
535− ++ mane $|(@tas [@tas @tas]) :: XML name/space
654+XML name
655+
656+An XML name (tag name or attribute name) with an optional namespace. Parsed by
657+[`++name`]() within [`++poxa`](), rendered by [`++name`]() within `++poxo`.
658+
659+Source
660+------
536661
537−An XML name (tag name or attribute name) with an optional namespace.
538−Parsed by `++name`:poxa, rendered by `++name`:poxo.
662+ ++ mane $|(@tas [@tas @tas]) :: XML name/space
539663
540−See also: `++sail` doc, Section 3bD
664+Examples
665+--------
666+
667+See also: [`++sail`]()
541668
542669 ~zod/try=> *mane
543670 %$
@@ -551,61 +678,88 @@ See also: `++sail` doc, Section 3bD
551678
552679### `++manx`
553680
554− ++ manx ,[g=marx c=marl] :: XML node
555−
556681XML node.
557682
558−Parsed by `++apex`:poxa, rendered by `++poxo`, section 3bD
683+Parsed by [`++apex`]() within [`++poxa`](), rendered by [`++poxo`]().
684+
685+Source
686+------
687+
688+ ++ manx ,[g=marx c=marl] :: XML node
689+
690+Examples
691+--------
559692
560−See also: `++sail` doc, Section 3bD
693+See also: [`++sail`]() doc
561694
562695------------------------------------------------------------------------
563696
564697### `++marl`
565698
566− ++ marl (list manx) :: XML node list
699+List of XML nodes
567700
568−List of XML nodes.
701+A list of [`++manx`]().
569702
570−Parsed within `++apex`:poxa, rendered by `++many`:poxo, section 3bD
703+Source
704+------
705+
706+ ++ marl (list manx) :: XML node list
707+
708+Examples
709+--------
571710
572−See also: `++sail` doc
573711
574712------------------------------------------------------------------------
575713
576714### `++mars`
577715
578− ++ mars ,[t=[n=%$ a=[i=[n=%$ v=tape] t=~]] c=~] :: XML cdata
716+XML CDATA
717+
718+Implicitly produced by [`++chrd`]() within [`++poxa`]()
579719
580−XML CDATA. Implicitly produced by `++chrd`:poxa
720+Source
721+------
581722
582−See also: `++sail` doc
723+ ++ mars ,[t=[n=%$ a=[i=[n=%$ v=tape] t=~]] c=~] :: XML cdata
724+
725+Examples
726+--------
583727
584728------------------------------------------------------------------------
585729
586730### `++mart`
587731
588− ++ mart (list ,[n=mane v=tape]) :: XML attributes
732+List of XML attributes
589733
590−List of XML attributes. Each `++mart` is a list of pairs of `++mane` and
591−`++tape`.
734+Each `++mart` is a list of pairs of [`++mane`]() and
735+[`++tape`]().
736+
737+Parsed by [`++attr`]() within [`++poxa`](), rendered by `++attr` within [`++poxo`]()
592738
593−Parsed by `++attr`:poxa, rendered by `++attr`:poxo, section 3bD
739+Source
740+------
594741
595−See also: `++sail` doc
742+ ++ mart (list ,[n=mane v=tape]) :: XML attributes
743+
744+Examples
745+--------
596746
597747------------------------------------------------------------------------
598748
599749### `++marx`
600750
601− ++ marx ,[n=mane a=mart] :: XML tag
751+XML tag
602752
603−XML tag. A `++marx` is a pair of a tag name, `++mane` and a list of
604−attributes, `++mart`.
753+A `++marx` is a pair of a tag name, `++mane` and a list of attributes,
754+`++mart`. Parsed by [`++head`]() `++poxa`, rendered within `++poxo`.
605755
606−Parsed by `++head`:poxa, rendered within `++poxo`, section 3bD
756+Source
757+------
607758
608−See also: `++sail` doc
759+ ++ marx ,[n=mane a=mart] :: XML tag
760+
761+Examples
762+--------
609763
610764------------------------------------------------------------------------
611765
@@ -615,7 +769,7 @@ See also: `++sail` doc
615769
616770XX move to `++ut`
617771
618−See also: `++coil`
772+See also: [`++coil`]()
619773
620774------------------------------------------------------------------------
621775
@@ -644,13 +798,21 @@ Used nowhere XX
644798
645799### `++odor`
646800
647− ++ odor ,@ta :: atom format
801+'type' of atom
648802
649−By convetion, a short name for a category of atom. `++odor` is
650−circularly defined, `@ta` being the `++odor` of the ASCII subset
803+By convention, a short name for a category of atom. `++odor` is
804+circularly defined, with [`@ta`]() being the `++odor` of the ASCII subset
651805commonly used in urbit.
652806
653−See also: `++base`, odor reference
807+Source
808+------
809+
810+ ++ odor ,@ta :: atom format
811+
812+Examples
813+--------
814+
815+See also: [`++base`](), [odor reference]()
654816
655817 ~zod/try=> `odor`%ux
656818 ~.ux
@@ -659,12 +821,20 @@ See also: `++base`, odor reference
659821
660822### `++tarp`
661823
662− ++ tarp ,[d=@ud h=@ud m=@ud s=@ud f=(list ,@ux)] :: parsed time
824+Day through second
825+
826+The remaining part of a [`++date`](): day, hour, minute, second and a list
827+of [`@ux`]() for precision.
828+
829+Source
830+------
831+
832+ @ud h=@ud m=@ud s=@ud f=(list ,@ux)] :: parsed time
663833
664−The remaining part of a `++date`: day, hour, minute, second and a list
665−of `@ux` for precision.
834+Examples
835+--------
666836
667−See also: `++date`, `++yell`/`++yule`, Section 2cH
837+See also: [`++date`](), [`++yell`[]()/`++yule`]()
668838
669839 ~zod/try=> -<-
670840 ~2014.9.20..00.43.33..b52a
@@ -679,11 +849,19 @@ See also: `++date`, `++yell`/`++yule`, Section 2cH
679849
680850### `++time`
681851
682− ++ time ,@da :: galactic time
852+Absolute date
683853
684854The `@da` odor designates an absolute date atom.
685855
686−See also: `++date`, odor reference
856+Source
857+------
858+
859+ ++ time ,@da :: galactic time
860+
861+Examples
862+--------
863+
864+See also: [`++date`](), [odor reference]()
687865
688866 ~zod/try=> `time`-<-
689867 ~2014.9.25..20.01.47..eeac
@@ -695,11 +873,18 @@ See also: `++date`, odor reference
695873
696874### `++tree`
697875
698− ++ tree |* a=_,* :: binary tree
699− $|(~ [n=a l=(tree a) r=(tree a)]) ::
876+Tree mold generator
877+
878+A `++tree` can be empty, or contain a node of a type and
879+left/right sub `++tree` of the same type. Pretty-printed with `{}`.
880+
881+Source
882+------
700883
701−Tile generator. A `++tree` can be empty, or contain a node of a type and
702−left/right sub `++tree`s of the same type. Pretty-printed with `{}`.
884+ ++ tree |* a=_,* :: binary tree
885+
886+Examples
887+--------
703888
704889 ~zod/try=> `(tree ,[@ tape])`[[1 "hi"] [[2 "bye"] ~ ~] ~]
705890 {[2 "bye"] [1 "hi"]}
@@ -708,12 +893,17 @@ left/right sub `++tree`s of the same type. Pretty-printed with `{}`.
708893
709894### `++nail`
710895
711− ++ nail ,[p=hair q=tape] :: parsing input
896+Location, remainder of parsed text
897+
898+Indicates parsing position `p`, and remaining text to be parsed `q`.
899+
900+Source
901+------
712902
713−Location in parsed text, and remainder of it. Indicates parsing position
714−and remaining text to be parsed.
903+ ++ nail ,[p=hair q=tape] :: parsing input
715904
716−See also: `++roll`
905+Examples
906+--------
717907
718908 ~zod/try=> +<:;~(plug cab cab)
719909 c=tub=[p=[p=0 q=0] q=""]
@@ -731,9 +921,19 @@ Used nowhere XX
731921
732922### `++pair`
733923
734− ++ pair |*([a=$+(* *) b=$+(* *)] ,[p=a q=b]) :: just a pair
924+Mold of pair of types
925+
926+[mold]() generator. Produces a tuple of two of the types passed in.
927+
735928
736−Tile generator. Produces a tuple of two of the types passed in.
929+Source
930+------
931+
932+ ++ pair |*([a=$+(* *) b=$+(* *)] ,[p=a q=b]) :: just a pair
933+
934+
935+Examples
936+--------
737937
738938 ~zod/try=> *(pair bean cord)
739939 [p=%.y q='']
@@ -742,21 +942,32 @@ Tile generator. Produces a tuple of two of the types passed in.
742942
743943### `++pass`
744944
745− ++ pass ,@ :: public key
945+Atom alias
946+
947+Used primarily in crypto.
746948
747−Atom alias. Used primarily in crypto.
949+Source
950+------
748951
749−See also: `++acru`, `++crua`, `++crub`
952+ ++ pass ,@ :: public key
750953
751954------------------------------------------------------------------------
752955
753956### `++path`
754957
755− ++ path (list span) :: filesys location
958+Filesystem path
756959
757−A filesystem path. A `++path` is a list of `++span`, `@ta`. Used in
960+A `++path` is a list of [`++span`]()s aka [`@ta`](). Used in
758961`%clay` and `%eyre` extensively.
759962
963+Source
964+------
965+
966+ ++ path (list span) :: filesys location
967+
968+Examples
969+--------
970+
760971 ~zod/try=> `path`"abc"
761972 /a/b/c
762973
@@ -764,10 +975,18 @@ A filesystem path. A `++path` is a list of `++span`, `@ta`. Used in
764975
765976### `++pint`
766977
767− ++ pint ,[p=[p=@ q=@] q=[p=@ q=@]] :: line/column range
978+Parsing range
979+
980+Mostly used for stacktraces. A `++pint` is a pair of
981+[`++hair`](), indicating from `p` to `q`.
982+
983+Source
984+------
768985
769−A parsing range, mostly used for stacktraces. A `++pint` is a pair of
770−hairs indicating from - to.
986+ ++ pint ,[p=[p=@ q=@] q=[p=@ q=@]] :: line/column range
987+
988+Examples
989+--------
771990
772991 ~zod/try=> !:(!!)
773992 ! /~zod/try/~2014.9.20..01.22.04..52e3/:<[1 4].[1 6]>
@@ -779,11 +998,17 @@ hairs indicating from - to.
779998
780999### `++pole`
7811000
782− ++ pole |* a=_,* :: nameless list
783− $|(~ [a (pole a)]) ::
1001+Faceless list
1002+
1003+A [`++list`]() without the [face]()s `i` and `t`.
1004+
1005+Source
1006+------
7841007
785−A `++list` without the faces. A `++pole` is a null-terminated tuple
786−without the `i=` and `t=`.
1008+ ++ pole |* a=_,* :: nameless list
1009+
1010+Examples
1011+--------
7871012
7881013 ~zod/try=> `(pole char)`"asdf"
7891014 [~~a [~~s [~~d [~~f ~]]]]
@@ -792,6 +1017,13 @@ without the `i=` and `t=`.
7921017
7931018### `++port`
7941019
1020+XX move to `++ut`
1021+
1022+Type and location of core-shaped thing? XX Compiler Internals
1023+
1024+Source
1025+------
1026+
7951027 ++ port $: p=axis ::
7961028 $= q ::
7971029 $% [%& p=type] ::
@@ -799,9 +1031,8 @@ without the `i=` and `t=`.
7991031 == ::
8001032 == ::
8011033
802−XX move to `++ut`
803−
804−Type and location of core-shaped thing? XX Compiler Internals
1034+Examples
1035+--------
8051036
8061037 ~zod/try=> *port
8071038 [p=0 q=[%.y p=%void]]
@@ -810,6 +1041,13 @@ Type and location of core-shaped thing? XX Compiler Internals
8101041
8111042### `++post`
8121043
1044+XX move to `++ut`
1045+
1046+Type and location of possibly core-shaped thing? XX Compiler Internals
1047+
1048+Source
1049+------
1050+
8131051 ++ post $: p=axis ::
8141052 $= q ::
8151053 $% [0 p=type] ::
@@ -818,9 +1056,8 @@ Type and location of core-shaped thing? XX Compiler Internals
8181056 == ::
8191057 == ::
8201058
821−XX move to `++ut`
822−
823−Type and location of possibly core-shaped thing? XX Compiler Internals
1059+Examples
1060+--------
8241061
8251062 ~zod/try=> *post
8261063 [p=0 q=[%0 p=%void]]
@@ -829,11 +1066,6 @@ Type and location of possibly core-shaped thing? XX Compiler Internals
8291066
8301067### `++prop`
8311068
832− ++ prop $: p=axis ::
833− $= q ::
834− [p=?(~ axis) q=(list ,[p=type q=foot])] ::
835− == ::
836−
8371069XX move to `++ut`
8381070
8391071Verified core-shaped thing? XX Compiler Internals
@@ -845,10 +1077,17 @@ Verified core-shaped thing? XX Compiler Internals
8451077
8461078### `++qual`
8471079
848− ++ qual |* [a=$+(* *) b=$+(* *) c=$+(* *) d=$+(* *)] :: just a quadruple
849− ,[p=a q=b r=c s=d] ::
1080+Mold of 4 type tuple
1081+
1082+A `++qual` is a tuple of four of the types passed in.
1083+
1084+Source
1085+------
8501086
851−Tile generator. A `++qual` is a tuple of four of the types passed in..
1087+ ++ qual |* [a=$+(* *) b=$+(* *) c=$+(* *) d=$+(* *)] :: just a quadruple
1088+
1089+Examples
1090+--------
8521091
8531092 ~zod/try=> *(qual date time tape cord)
8541093 [p=[[a=%.y y=0] m=0 t=[d=0 h=0 m=0 s=0 f=~]] q=~292277024401-.1.1 r="" s='']
@@ -857,10 +1096,14 @@ Tile generator. A `++qual` is a tuple of four of the types passed in..
8571096
8581097### `++rege`
8591098
860− ++ rege $| ?(%dote %ende %sart %empt %boun %bout) :: parsed regex
861− $% [%lite p=char] :: literal
862− [%pair p=rege q=rege] :: ordering
863− [%capt p=rege q=@u] :: capture group
1099+Regex caases
1100+
1101+`++rege` defines the cases of a regular expression.
1102+
1103+Source
1104+------
1105+
1106+ ++ rege $| ?(%dote %ende %sart %empt %boun %bout) :: parsed regex
8641107 [%brac p=@] :: p is 256 bitmask
8651108 [%eith p=rege q=rege] :: either
8661109 [%mant p=rege] :: greedy 0 or more
@@ -874,9 +1117,10 @@ Tile generator. A `++qual` is a tuple of four of the types passed in..
8741117 [%binl p=rege q=@u] :: min q lazy
8751118 == ::
8761119
877−Regular expressions. `++rege` defines the cases of a regex.
1120+Examples
1121+--------
8781122
879−See also: `++rexp`, `++repg`, `++pars`
1123+See also: [`++rexp`](), [`++repg`](), [`++pars`]()
8801124
8811125 ~zod/try=> (pars "[a-z]")
8821126 [~ [%brac p=10.633.823.807.823.001.954.701.781.295.154.855.936]]
@@ -887,22 +1131,32 @@ See also: `++rexp`, `++repg`, `++pars`
8871131
8881132### `++ring`
8891133
890− ++ ring ,@ :: private key
1134+Atom alias
1135+
1136+Used primarily in crypto.
8911137
892−Atom alias, used primarily in crypto.
1138+Source
1139+------
8931140
894−See also: `++acru`, `++crua`, `++crub`.
1141+ ++ ring ,@ :: private key
8951142
8961143------------------------------------------------------------------------
8971144
8981145### `++rule`
8991146
900− ++ rule |=(tub=nail `edge`[p.tub ~ ~ tub]) :: parsing rule
1147+Parsing rule
9011148
902−Parsing rule. `++rule` is an empty parsing rule, but it is used to check
1149+`++rule` is an empty parsing rule, but it is used to check
9031150that parsing rules match this with `_`.
9041151
905−See also: `++cold`, Section 2eC
1152+
1153+Source
1154+------
1155+
1156+ ++ rule |=(tub=nail `edge`[p.tub ~ ~ tub]) :: parsing rule
1157+
1158+Examples
1159+--------
9061160
9071161 ~zod/try=> *rule
9081162 [p=[p=0 q=0] q=[~ [p=0 q=[p=[p=0 q=0] q=""]]]]
@@ -918,13 +1172,19 @@ See also: `++cold`, Section 2eC
9181172
9191173### `++span`
9201174
921− ++ span ,@ta :: text-atom (ASCII)
1175+ASCII atom
9221176
9231177A restricted text atom for canonical atom syntaxes. The prefix is `~.`.
9241178There are no escape sequences except `~~`, which means `~`, and `~-`,
9251179which means `_`. `-` and `.` encode themselves. No other characters
9261180besides numbers and lowercase letters are permitted.
9271181
1182+Source
1183+------
1184+
1185+ ++ span ,@ta :: text-atom (ASCII)
1186+Examples
1187+--------
9281188 ~zod/try=> *span
9291189 ~.
9301190
@@ -943,11 +1203,17 @@ besides numbers and lowercase letters are permitted.
9431203
9441204### `++spot`
9451205
946− ++ spot ,[p=path q=pint] :: range in file
1206+Stack trace line
1207+
1208+A [`++spot`]() is what we print after crashing.
9471209
948−Stack trace line. A `++spot` is what we print after crashing.
1210+Source
1211+------
9491212
950−See also: `++pint`
1213+ ++ spot ,[p=path q=pint] :: range in file
1214+
1215+Examples
1216+--------
9511217
9521218 ~zod/try=> :into /=main=/bin/fail/hoon '!: !!'
9531219 + /~zod/main/359/bin/fail/hoon
@@ -967,20 +1233,29 @@ Unused XX
9671233
9681234### `++tank`
9691235
1236+Pretty-printing structure.
1237+
1238+A `++tank` is one of three cases: a `%leaf`
1239+is simply a string; a `%palm` is XX need more information; and a `%rose` is a
1240+list of `++tank` delimted by the strings in `p`.
1241+
1242+
1243+Source
1244+------
1245+
9701246 ++ tank $% [%leaf p=tape] :: printing formats
971− $: %palm ::
1247+ $: %palm :: backstep list
9721248 p=[p=tape q=tape r=tape s=tape] ::
9731249 q=(list tank) ::
9741250 == ::
975− $: %rose :: delimeted list
1251+ $: %rose :: flat list
9761252 p=[p=tape q=tape r=tape] :: mid open close
9771253 q=(list tank) ::
9781254 == ::
979− ==
1255+ ==
9801256
981−Pretty-printing structure. A `++tank` is one of three cases. A `%leaf`
982−is just a string. A `%palm` is XX need more information. A `%rose` is a
983−list of `++tank` delimted by the strings in `p`.
1257+Examples
1258+--------
9841259
9851260 ~zod/try=> >(bex 20) (bex 19)<
9861261 [%rose p=[p=" " q="[" r="]"] q=~[[%leaf p="1.048.576"] [%leaf p="524.288"]]]
@@ -998,11 +1273,19 @@ list of `++tank` delimted by the strings in `p`.
9981273
9991274### `++tape`
10001275
1001− ++ tape (list char) :: like a string
1276+List of chars
10021277
1003−One of Hoon's two string types, the other being `++cord`. A tape is a
1278+One of Hoon's two string types, the other being [`++cord`](). A tape is a
10041279list of chars.
10051280
1281+Source
1282+------
1283+
1284+ ++ tape (list char) :: like a string
1285+
1286+Examples
1287+--------
1288+
10061289 ~zod/try=> `(list ,char)`"foobar"
10071290 "foobar"
10081291 ~zod/try=> `(list ,@)`"foobar"
@@ -1012,13 +1295,22 @@ list of chars.
10121295
10131296### `++term`
10141297
1015− ++ term ,@tas :: Hoon ASCII subset
1298+Hoon constants
10161299
1017−A restricted text atom for Hoon constants. The only characters permitted
1018−are lowercase ASCII, - except as the first or last character, and 0-9
1019−except as the first character. The syntax for `@tas` is the text itself,
1020−always preceded by `%`. This means a term is always cubical. The empty
1021−`@tas` has a special syntax, `$`:
1300+A restricted text atom for Hoon constants. The only characters permitted are
1301+lowercase ASCII, `-`, and `0-9`, the latter two of which can neither be the first or last
1302+character. The syntax for [`@tas`]() is the text itself, always preceded by `%`.
1303+This means a term is always [cubical](). The empty `@tas` has a special syntax,
1304+`$`.
1305+
1306+
1307+Source
1308+------
1309+
1310+ ++ term ,@tas :: Hoon ASCII subset
1311+
1312+Examples
1313+--------
10221314
10231315 ~zod/try=> *term
10241316 %$
@@ -1032,13 +1324,16 @@ always preceded by `%`. This means a term is always cubical. The empty
10321324
10331325### `++tiki`
10341326
1035− ++ tiki :: test case
1036− $% [& p=(unit term) q=wing] :: simple wing
1037− [| p=(unit term) q=twig] :: named wing
1038− == ::
1039−
10401327XX move to `++ut`
10411328
1329+Source
1330+------
1331+
1332+ ++ tiki :: test case
1333+
1334+Examples
1335+--------
1336+
10421337A `++wing` or `++twig`.
10431338
10441339 ~zod/try=> (ream '=+ a=4 ?-(a @ ~)')
@@ -1062,25 +1357,24 @@ A `++wing` or `++twig`.
10621357
10631358------------------------------------------------------------------------
10641359
1065−### `++tile`
1360+### `++toga`
10661361
1067−See the Tile section of the Hoon Reference.
1362+Tree of faces
10681363
1069−------------------------------------------------------------------------
1364+A [face](), or tree of faces. A `++toga` is applied to anything assigned
1365+using [`^=`]().
10701366
1071−### `++toga`
1367+XX move to `++ut` and rune doc (for \^= examples)
10721368
1073− ++ toga :: face control
1074− $| p=term :: two togas
1075− $% [0 ~] :: no toga
1076− [1 p=term q=toga] :: deep toga
1369+Source
1370+------
1371+
1372+ ++ toga :: face control
10771373 [2 p=toga q=toga] :: cell toga
10781374 == ::
10791375
1080−XX move to `++ut` and rune doc (for \^= examples)
1081−
1082−A face, or tree of faces. A `++toga` is applied to anything assigned
1083−using `^=`.
1376+Examples
1377+--------
10841378
10851379 ~zod/try=> a=1
10861380 a=1
@@ -1106,9 +1400,17 @@ using `^=`.
11061400
11071401### `++trap`
11081402
1109− ++ trap ,_|.(_*) :: makes perfect sense
1403+Core with one arm `$`
1404+
1405+A trap is a core with one arm `++$`. Used when XX
1406+
1407+Source
1408+------
11101409
1111−A trap is a core with one arm `++$`.
1410+ ++ trap ,_|.(_*) :: makes perfect sense
1411+
1412+Examples
1413+--------
11121414
11131415See also: `|.`
11141416
@@ -1123,10 +1425,17 @@ See also: `|.`
11231425
11241426### `++trel`
11251427
1126− ++ trel |* [a=$+(* *) b=$+(* *) c=$+(* *)] :: just a triple
1127− ,[p=a q=b r=c] ::
1428+Mold of three types
1429+
1430+[`++mold`]() of the tuple of the three types passed in.
11281431
1129−Tile generator. `++trel` is a tuple of three of the types passed in.
1432+Source
1433+------
1434+
1435+ ++ trel |* [a=$+(* *) b=$+(* *) c=$+(* *)] :: just a triple
1436+
1437+Examples
1438+--------
11301439
11311440 ~zod/try=> *(trel ,@ud ,@t ,@s)
11321441 [p=0 q='' r=--0]
@@ -1135,39 +1444,53 @@ Tile generator. `++trel` is a tuple of three of the types passed in.
11351444
11361445### `++tuna`
11371446
1138− ++ tuna :: tagflow
1139− $% [%a p=twig] :: plain text
1140− [%b p=twig] :: single tag
1141− [%c p=twig] :: simple list
1447+XML template tree
1448+
1449+An XML template tree.
1450+
1451+Source
1452+------
1453+
1454+ ++ tuna :: tagflow
11421455 [%d p=twig] :: dynamic list
11431456 [%e p=twig q=(list tuna)] :: element
11441457 [%f p=(list tuna)] :: subflow
11451458 == ::
11461459
1147−An XML template tree.
1460+Examples
1461+--------
11481462
11491463Leaf %a contains plain-text, %b an empty tag, %c a static list, %d a
11501464dynamic list, %e a full node element containing a twig and a list of
11511465tuna, and %f is a empty node.
11521466
1153−See also: `++sail`
1467+See also: [`++sail`]()
11541468
11551469------------------------------------------------------------------------
11561470
11571471### `++twig`
11581472
1473+Expression
1474+
1475+An expression, or AST.
1476+
11591477See Twig section of Hoon reference
11601478
11611479------------------------------------------------------------------------
11621480
11631481### `++tine`
11641482
1165− ++ tine (list ,[p=tile q=twig]) ::
1483+Switch statement cases
11661484
1167−Switch statement cases. In `?-`, for example, your list of cases is a
1168−`++tine`.
1485+In [`?-`](), for example, your list of cases is a `++tine`.
11691486
1170−See also: `++twig`
1487+Source
1488+------
1489+
1490+ ++ tine (list ,[p=tile q=twig]) ::
1491+
1492+Examples
1493+--------
11711494
11721495 ~zod/try=> (ream '?-(!! @ |, ^ &)')
11731496 [ %wthz
@@ -1188,12 +1511,18 @@ See also: `++twig`
11881511
11891512### `++tusk`
11901513
1191− ++ tusk (list twig) ::
1514+List of expressions
11921515
1193−Variable-arity expression list. In `:*`, for example, your contents are
1516+List of [`++twig`]()s. In [`:*`](), for example, your contents is
11941517a `++tusk`.
11951518
1196−See also: `++twig`
1519+Source
1520+------
1521+
1522+ ++ tusk (list twig) ::
1523+
1524+Examples
1525+--------
11971526
11981527 ~zod/try=> (ream '[1 2 3]')
11991528 [%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
@@ -1204,21 +1533,33 @@ See also: `++twig`
12041533
12051534### `++tyre`
12061535
1207− ++ tyre (list ,[p=term q=twig]) ::
1536+List, term to twig
12081537
1209−Associative list of term to twig, used in jet hint processing.
1538+Associative list of [++term]() [`++twig`](), used in [jet]() hint processing.
12101539
1211−See also: `++twig`
1540+Source
1541+------
1542+
1543+ ++ tyre (list ,[p=term q=twig]) ::
12121544
12131545------------------------------------------------------------------------
12141546
12151547### `++tyke`
12161548
1217− ++ tyke (list (unit twig)) ::
1549+List of 'maybe' twigs
1550+
1551+List of [`++unit`]() [`++twig`](), or gaps left to be inferred, in [`++path`]()
1552+parsing. When you use a path such as `/=main=/pub/src/doc` the path is in fact
1553+a `++tyke`, where the `=` are inferred from your current path.
1554+
12181555
1219−List of twigs, or gaps left to be inferred, in path parsing. When you
1220−use a path such as `/=main=/pub/src/doc` the path is in fact a `++tyke`,
1221−where the `=` are inferred from your current path.
1556+Source
1557+------
1558+
1559+ ++ tyke (list (unit twig)) ::
1560+
1561+Examples
1562+--------
12221563
12231564 ~zod/try=> (scan "/==as=" porc:vast)
12241565 [0 ~[~ ~ [~ [%dtzy p=%tas q=29.537]] ~]]
@@ -1229,12 +1570,18 @@ where the `=` are inferred from your current path.
12291570
12301571### `++tram`
12311572
1232− ++ tram (list ,[p=wing q=twig]) ::
1573+List of changes
12331574
1234−List of changes by location in context. When using `%=`, for example,
1575+List of changes by location in context. When using [`%=`](), for example,
12351576the list of changes is a `++tram`.
12361577
1237−See also: `++twig`
1578+Source
1579+------
1580+
1581+ ++ tram (list ,[p=wing q=twig]) ::
1582+
1583+Examples
1584+--------
12381585
12391586 ~zod/try=> (ream '$(a 1, b 2)')
12401587 [ %cnts
@@ -1248,10 +1595,13 @@ See also: `++twig`
12481595
12491596### `++nock`
12501597
1251− ++ nock $& [p=nock q=nock] :: autocons
1252− $% [%0 p=@] :: axis select
1253− [%1 p=*] :: constant
1254− [%2 p=nock q=nock] :: compose
1598+Virtual machine. See [Nock doc]().
1599+
1600+
1601+Source
1602+------
1603+
1604+ ++ nock $& [p=nock q=nock] :: autocons
12551605 [%3 p=nock] :: cell test
12561606 [%4 p=nock] :: increment
12571607 [%5 p=nock q=nock] :: equality test
@@ -1263,7 +1613,8 @@ See also: `++twig`
12631613 [%11 p=nock] :: grab data from sky
12641614 == ::
12651615
1266−See Nock doc
1616+Examples
1617+--------
12671618
12681619 ~zod/try=> !=([+(.) 20 -<])
12691620 [[4 0 1] [1 20] 0 4]
@@ -1274,13 +1625,17 @@ See Nock doc
12741625
12751626### `++tone`
12761627
1277− ++ tone $% [%0 p=*] :: success
1278− [%1 p=(list)] :: blocks
1279− [%2 p=(list ,[@ta *])] :: error ~_s
1280− == ::
1628+Intermediate Nock computation result
1629+
1630+Similar to [`++toon`](), but stack trace is not yet rendered.
12811631
1282−Intermediate Nock computation result. Similar to `++toon`, but stack
1283−trace is not yet rendered.
1632+Source
1633+------
1634+
1635+ ++ tone $% [%0 p=*] :: success
1636+
1637+Examples
1638+--------
12841639
12851640 ~zod/try=> (mink [[20 21] 0 3] ,~)
12861641 [%0 p=21]
@@ -1316,14 +1671,18 @@ trace is not yet rendered.
13161671
13171672### `++toon`
13181673
1319− ++ toon $% [%0 p=*] :: success
1320− [%1 p=(list)] :: blocks
1321− [%2 p=(list tank)] :: stack trace
1322− == ::
1674+Nock computation result
1675+
1676+Either success (`%0`), a block with list of requests blocked on (`%1`), or
1677+failure with stack trace (`%2`).
1678+
1679+Source
1680+------
13231681
1324−Nock computation result. Either success (`%0`), a block with list of
1325−requests blocked on (`%1`), or failure with stack trace (`%2`).
1682+ ++ toon $% [%0 p=*] :: success
13261683
1684+Examples
1685+--------
13271686 ~zod/try=> (mock [[20 21] 0 3] ,~)
13281687 [%0 p=21]
13291688
@@ -1339,22 +1698,31 @@ requests blocked on (`%1`), or failure with stack trace (`%2`).
13391698
13401699### `++tune`
13411700
1342− ++ tune $% [%0 p=vase] ::
1343− [%1 p=(list)] ::
1344− [%2 p=(list ,[@ta *])] ::
1345− == ::
13461701
1347−XX Unused
1702+Source
1703+------
1704+
1705+ ++ tune $% [%0 p=vase] ::
13481706
1707+Examples
1708+--------
13491709Probably typed `tone`?
13501710
13511711------------------------------------------------------------------------
13521712
13531713### `++twin`
13541714
1355− ++ twin ,[p=term q=wing r=axis s=type] :: alias info
1715+Aliasing
1716+
1717+Used in `%bull` within [`++type`]() to typecheck aliased faces.
1718+
1719+Source
1720+------
1721+
1722+ ++ twin ,[p=term q=wing r=axis s=type] :: alias info
13561723
1357−Aliasing. Used in `%bull` `++type` to typecheck aliased faces.
1724+Examples
1725+--------
13581726
13591727 ~zod/try=> (~(busk ut %cell %noun [%atom %ud]) %fal [%& 3]~)
13601728 [ %bull
@@ -1376,24 +1744,32 @@ See Type section of Hoon reference
13761744
13771745### `++typo`
13781746
1379− ++ typo type :: old type
1747+Pointer for `++type`
13801748
1381−Pointer for `++type`. `++typo` preserves the previous `++type` in your
1749+Pointer for [`++type`](). `++typo` preserves the previous `++type` in your
13821750context when upating.
13831751
1752+Source
1753+------
1754+
1755+ ++ typo type :: old type
1756+
1757+Examples
1758+--------
1759+
13841760See also: `++seem`, `++vise`, `++type`
13851761
13861762------------------------------------------------------------------------
13871763
13881764### `++udal`
13891765
1390− ++ udal :: atomic change (%b)
1391− $: p=@ud :: blockwidth
1392− q=(list ,[p=@ud q=(unit ,[p=@ q=@])]) :: indels
1393− == ::
1766+Source
1767+------
13941768
1395−XX Unused
1769+ ++ udal :: atomic change (%b)
13961770
1771+Examples
1772+--------
13971773------------------------------------------------------------------------
13981774
13991775### `++udon`
@@ -1439,13 +1815,21 @@ See `%clay` doc
14391815
14401816### `++unit`
14411817
1442− ++ unit |* a=_,* :: maybe
1443− $|(~ [~ u=a]) ::
1818+Maybe
14441819
1445−Tile generator. A `++unit` is either `~` or `[~ u=a]` where `a` is the
1820+[mold]() generator. A `++unit` is either `~` or `[~ u=a]` where `a` is the
14461821type that was passed in.
14471822
1448−See also: `++bind`, Section 2bA
1823+
1824+Source
1825+------
1826+
1827+ ++ unit |* a=_,* :: maybe
1828+
1829+Examples
1830+--------
1831+
1832+See also: [`++bind`]()
14491833
14501834 ~zod/try=> :type; *(unit time)
14511835 ~
@@ -1478,11 +1862,17 @@ See `%clay` doc
14781862
14791863### `++vase`
14801864
1481− ++ vase ,[p=type q=*] :: type-value pair
1482−
14831865Typed data. A `++vase` is used wherever typed data is explicitly worked
14841866with.
14851867
1868+
1869+Source
1870+------
1871+
1872+ ++ vase ,[p=type q=*] :: type-value pair
1873+
1874+Examples
1875+--------
14861876See `%arvo` doc
14871877
14881878 ~zod/try=> `vase`!>(~)
@@ -1492,22 +1882,39 @@ See `%arvo` doc
14921882
14931883### `++vise`
14941884
1495− ++ vise ,[p=typo q=*] :: old vase
1885+Convert during reboot
14961886
14971887Used to convert from previously-typed data during reboot.
14981888
1499−See `++typo`, `++seer`
1889+Source
1890+------
1891+
1892+ ++ vise ,[p=typo q=*] :: old vase
1893+
1894+Examples
1895+--------
1896+
1897+See also: [`++typo`](), [`++seer`]()
15001898
15011899------------------------------------------------------------------------
15021900
15031901### `++wall`
15041902
1505− ++ wall (list tape) :: text lines (no \n)
1903+List of lines
15061904
1507−A list of lines. A `++wall` is used instead of a single `++tape` with
1905+
1906+A `++wall` is used instead of a single [`++tape`]() with
15081907`\n`.
15091908
1510−See also: `++wash`
1909+Source
1910+------
1911+
1912+ ++ wall (list tape) :: text lines (no \n)
1913+
1914+Examples
1915+--------
1916+
1917+See also: [`++wash`]()
15111918
15121919 ~zod/try=> `wall`(wash [0 20] leaf/<(bex 256)>)
15131920 <<
@@ -1527,10 +1934,10 @@ See also: `++wash`
15271934
15281935 ++ wain (list cord) :: text lines (no \n)
15291936
1530−A list of lines. A `++wain` is used instead of a single `++cord` with
1937+A list of lines. A `++wain` is used instead of a single [`++cord`]() with
15311938`\n`.
15321939
1533−See also: `++lore`, `++role`
1940+See also: [`++lore`](), [`++role`]()
15341941
15351942 ~zod/try=> `wain`/som/del/rok
15361943 <|som del rok|>
@@ -1574,10 +1981,14 @@ See also: `++twig`
15741981
15751982### `++wine`
15761983
1577− ++ wine $| ?(%noun %path %tank %void %wall %wool %yarn)
1578− $% [%atom p=term] ::
1579− [%core p=(list ,@ta) q=wine] ::
1580− [%face p=term q=wine] ::
1984+Printable type
1985+
1986+Used for pretty printing.
1987+
1988+Source
1989+------
1990+
1991+ ++ wine $| ?(%noun %path %tank %void %wall %wool %yarn)
15811992 [%list p=term q=wine] ::
15821993 [%pear p=term q=@] ::
15831994 [%pick p=(list wine)] ::
@@ -1587,9 +1998,10 @@ See also: `++twig`
15871998 [%unit p=term q=wine] ::
15881999 == ::
15892000
1590−Printable type. `++wine` is used for pretty printing.
2001+Examples
2002+--------
15912003
1592−See also: `++calf`
2004+See also: [`++calf`]()
15932005
15942006 ~zod/try=> ~(dole ut p:!>(*@tas))
15952007 [p={} q=[%atom p=%tas]]
@@ -1656,17 +2068,19 @@ See also: `++calf`
16562068
16572069### `++wonk`
16582070
1659− ++ wonk |*(veq=edge ?~(q.veq !! p.u.q.veq)) ::
1660− :: ::
1661− :: ::
1662−
16632071XX Not a model?
16642072
1665− ++ wonk |*(veq=edge ?~(q.veq !! p.u.q.veq)) ::
1666−
16672073Pull result out of a `++edge`, or crash if there's no result.
16682074
1669−See also: `++edge`, Section 2eC
2075+Source
2076+------
2077+
2078+ ++ wonk |*(veq=edge ?~(q.veq !! p.u.q.veq)) ::
2079+
2080+Examples
2081+--------
2082+
2083+See also: [`++edge`]()
16702084
16712085 ~zod/try=> (wide:vast [1 1] "(add 2 2)")
16722086 [ p=[p=1 q=10]
@@ -1684,13 +2098,21 @@ See also: `++edge`, Section 2eC
16842098
16852099### `++map`
16862100
1687− ++ map |* [a=_,* b=_,*] :: associative tree
1688− $|(~ [n=[p=a q=b] l=(map a b) r=(map a b)]) ::
2101+Map
2102+
2103+[mold]() generator. A `++map` is a [treap](http://en.wikipedia.org/wiki/Treap) of
2104+key, value pairs.
2105+
2106+
2107+Source
2108+------
2109+
2110+ ++ map |* [a=_,* b=_,*] :: associative tree
16892111
1690−Tile generator. A `++map` is a
1691−[treap](http://en.wikipedia.org/wiki/Treap) of key, value pairs.
2112+Examples
2113+--------
16922114
1693−See also: `++by`
2115+See also: [`++by`]()
16942116
16952117 ~zod/try=> :type; *(map ,@t ,@u)
16962118 {}
@@ -1702,13 +2124,21 @@ See also: `++by`
17022124
17032125### `++qeu`
17042126
2127+Queue
2128+
2129+[mold]() generator. An ordered [treap](http://en.wikipedia.org/wiki/Treap) of
2130+items.
2131+
2132+Source
2133+------
2134+
17052135 ++ qeu |* a=_,* :: queue
17062136 $|(~ [n=a l=(qeu a) r=(qeu a)]) ::
17072137
1708−Tile generator. A `++qeu` is an ordered
1709−[treap](http://en.wikipedia.org/wiki/Treap) of items.
2138+See also: [`++to`]()
17102139
1711−See also: `++to`
2140+Examples
2141+--------
17122142
17132143 ~zod/try=> (qeu time)
17142144 <1.qyo [* <1.sxx [a=<1.ebd [* <101.jzo 1.ypj %164>]> <101.jzo 1.ypj %164>]>]>
@@ -1719,13 +2149,21 @@ See also: `++to`
17192149
17202150### `++set`
17212151
2152+Set
2153+
2154+[mold]() generator. A `++set` is a
2155+[treap](http://en.wikipedia.org/wiki/Treap) with unique values.
2156+
2157+Source
2158+------
2159+
17222160 ++ set |* a=_,* :: set
17232161 $|(~ [n=a l=(set a) r=(set a)]) ::
17242162
1725−Tile generator. A `++set` is a
1726−[treap](http://en.wikipedia.org/wiki/Treap) with unique values.
2163+Examples
2164+--------
17272165
1728−See also: `++in`
2166+See also: [`++in`]()
17292167
17302168 ~zod/try=> (sa "abc")
17312169 {~~a ~~c ~~b}
@@ -1738,11 +2176,18 @@ See also: `++in`
17382176
17392177### `++jar`
17402178
2179+
2180+Tile generator. A [`++jar`]() is a [`++map`]() of [`++list`]().
2181+
2182+Source
2183+------
2184+
17412185 ++ jar |*([a=_,* b=_,*] (map a (list b))) :: map of lists
17422186
1743−Tile generator. A `++jar` is a `++map` of `++list`.
2187+Examples
2188+--------
17442189
1745−See also: `++ja`, `++by`, `++map`, `++list`
2190+See also: [`++ja`](), [`++by`](), [`++map`](), [`++list`]()
17462191
17472192 ~zod/try=> =a (limo [1 2 ~])
17482193 ~zod/try=> a
@@ -1762,10 +2207,16 @@ See also: `++ja`, `++by`, `++map`, `++list`
17622207
17632208### `++jug`
17642209
2210+
2211+[mold]() generator. A `++jug` is a [`++map`]() of [`++set`]()s.
2212+
2213+Source
2214+------
2215+
17652216 ++ jug |*([a=_,* b=_,*] (map a (set b))) :: map of sets
17662217
1767−Tile generator. Similar to `++jar`, but with `++set`. A `++jug` is a
1768−`++map` of `++set`.
2218+Examples
2219+--------
17692220
17702221See also: `++ju`, `++by`, `++map`, `++set`
17712222
docs/dev/hoon/library/2a.md+306−78
@@ -1,23 +1,36 @@
1−chapter 2a, basic unsigned math
2−===============================
1+2a - basic unsigned math
2+========================
33
44### `++add`
55
66Add
77
8+Produces the sum of `a` and `b`.
9+
10+Accepts
11+-------
12+
13+`a` is an [atom]().
14+
15+`b` is an atom.
16+
17+Produces
18+--------
19+
20+An atom.
21+
22+Source
23+------
24+
825 ++ add :: add
926 ~/ %add
1027 |= [a=@ b=@]
1128 ^- @
1229 ?: =(0 a) b
1330 $(a (dec a), b +(b))
14− ::
15−
16−Produces the sum of `a` and `b` as an atom.
17−
18−`a` is an [atom]().
1931
20−`b` is an [atom]().
32+Examples
33+--------
2134
2235 ~zod/try=> (add 2 2)
2336 4
@@ -32,6 +45,23 @@ Produces the sum of `a` and `b` as an atom.
3245
3346Tree head
3447
48+Tests whether an `a` is in the head or tail of a [noun](). Produces the
49+[cube]() `%2` if it is within the head, or the cube `%3` if it is
50+within the tail.
51+
52+Accepts
53+-------
54+
55+`a` is an atom.
56+
57+Produces
58+--------
59+
60+A [cube]().
61+
62+Source
63+------
64+
3565 ++ cap :: tree head
3666 ~/ %cap
3767 |= a=@
@@ -44,11 +74,8 @@ Tree head
4474 ==
4575 ::
4676
47−Tests whether an `a` is in the head or tail of a noun. Produces the
48−[cube]() `%2` if it is within the head, or the [cube]() `%3` if is is
49−within the tail.
50−
51−`a` is an [atom]().
77+Examples
78+--------
5279
5380 ~zod/try=> (cap 4)
5481 %2
@@ -63,6 +90,21 @@ within the tail.
6390
6491Decrement
6592
93+Decrements `a` by `1`.
94+
95+Accepts
96+-------
97+
98+`a` is an [atom]().
99+
100+Produces
101+--------
102+
103+An atom.
104+
105+Source
106+------
107+
66108 ++ dec :: decrement
67109 ~/ %dec
68110 |= a=@
@@ -74,9 +116,8 @@ Decrement
74116 $(b +(b))
75117 ::
76118
77−Produces `a-1` as an atom.
78−
79−`a` is an [atom]().
119+Examples
120+--------
80121
81122 ~zod/try=> (dec 7)
82123 6
@@ -90,6 +131,23 @@ Produces `a-1` as an atom.
90131
91132Divide
92133
134+Computes `a` divided by `b`.
135+
136+Accepts
137+-------
138+
139+`a` is an [atom]().
140+
141+`b` is an [atom]().
142+
143+Produces
144+--------
145+
146+An atom.
147+
148+Source
149+------
150+
93151 ++ div :: divide
94152 ~/ %div
95153 |= [a=@ b=@]
@@ -102,11 +160,8 @@ Divide
102160 $(a (sub a b), c +(c))
103161 ::
104162
105−Computes `a` divided by `b`, producing an atom.
106−
107−`a` is an [atom]().
108−
109−`b` is an [atom]().
163+Examples
164+--------
110165
111166 ~zod/try=> (div 4 2)
112167 2
@@ -121,6 +176,21 @@ Computes `a` divided by `b`, producing an atom.
121176
122177Factorial
123178
179+Computes the factorial of `a`.
180+
181+Accepts
182+-------
183+
184+`a` is an [atom]().
185+
186+Produces
187+--------
188+
189+An atom.
190+
191+Source
192+------
193+
124194 ++ fac :: factorial
125195 ~/ %fac
126196 |= a=@
@@ -129,9 +199,8 @@ Factorial
129199 (mul a $(a (dec a)))
130200 ::
131201
132−Computes the factorial of `a`, producing an atom.
133−
134−`a` is an [atom]().
202+Examples
203+--------
135204
136205 ~zod/try=> (fac 3)
137206 6
@@ -146,6 +215,23 @@ Computes the factorial of `a`, producing an atom.
146215
147216Greater-than/equal
148217
218+Tests whether `a` is greater than a number `b`.
219+
220+Accepts
221+-------
222+
223+`a` is an [atom]().
224+
225+`b` is an atom.
226+
227+Produces
228+--------
229+
230+A boolean.
231+
232+Source
233+------
234+
149235 ++ gte :: greater-equal
150236 ~/ %gte
151237 |= [a=@ b=@]
@@ -153,11 +239,8 @@ Greater-than/equal
153239 !(lth a b)
154240 ::
155241
156−Tests whether `a` is greater than a number `b`, producing a loobean.
157−
158−`a` is an [atom]().
159−
160−`b` is an [atom]().
242+Examples
243+--------
161244
162245 ~zod/try=> (gte 100 10)
163246 %.y
@@ -172,6 +255,23 @@ Tests whether `a` is greater than a number `b`, producing a loobean.
172255
173256Greater-than
174257
258+Tests whether `a` is greater than `b`.
259+
260+Accepts
261+-------
262+
263+`a` is an [atom]().
264+
265+`b` is an atom.
266+
267+Produces
268+--------
269+
270+A boolean.
271+
272+Source
273+------
274+
175275 ++ gth :: greater-than
176276 ~/ %gth
177277 |= [a=@ b=@]
@@ -179,11 +279,8 @@ Greater-than
179279 !(lte a b)
180280 ::
181281
182−Tests whether `a` is greater than `b`, producing a loobean.
183−
184−`a` is an [atom]().
185−
186−`b` is an [atom]().
282+Examples
283+--------
187284
188285 ~zod/try=> (gth 'd' 'c')
189286 %.y
@@ -196,17 +293,31 @@ Tests whether `a` is greater than `b`, producing a loobean.
196293
197294Less-than/equal
198295
296+Tests whether `a` is less than or equal to `b`.
297+
298+Accepts
299+-------
300+
301+`a` is an [atom]().
302+
303+`b` is an atom.
304+
305+Produces
306+--------
307+
308+A boolean.
309+
310+Source
311+------
312+
199313 ++ lte :: less-equal
200314 ~/ %lte
201315 |= [a=@ b=@]
202316 |(=(a b) (lth a b))
203317 ::
204318
205−Tests whether `a` is less than or equal to `b`, producing a loobean.
206−
207−`a` is an [atom]().
208−
209−`b` is an [atom]().
319+Examples
320+--------
210321
211322 ~zod/try=> (lte 4 5)
212323 %.y
@@ -223,6 +334,23 @@ Tests whether `a` is less than or equal to `b`, producing a loobean.
223334
224335Less-than
225336
337+Tests whether `a` is less than `b`.
338+
339+Accepts
340+-------
341+
342+`a` is an [atom]().
343+
344+`b` is an atom.
345+
346+Produces
347+--------
348+
349+A boolean.
350+
351+Source
352+------
353+
226354 ++ lth :: less-than
227355 ~/ %lth
228356 |= [a=@ b=@]
@@ -235,11 +363,8 @@ Less-than
235363 == == ==
236364 ::
237365
238−Tests whether `a` is less than `b`, producing a loobean.
239−
240−`a` is an [atom]().
241−
242−`b` is an [atom]().
366+Examples
367+--------
243368
244369 ~zod/try=> (lth 4 5)
245370 %.y
@@ -254,7 +379,22 @@ Tests whether `a` is less than `b`, producing a loobean.
254379
255380### `++mas`
256381
257−Axis within head/tail
382+Axis within head/tail?
383+
384+Computes the axis of `a` within either the head or tail of a noun (depends whether `a` lies within the the head or tail).
385+
386+Accepts
387+-------
388+
389+`a` is an [atom]().
390+
391+Produces
392+--------
393+
394+An atom.
395+
396+Source
397+------
258398
259399 ++ mas :: tree body
260400 ~/ %mas
@@ -268,9 +408,8 @@ Axis within head/tail
268408 ==
269409 ::
270410
271−Computes the axis of `a` within the head or the tail, producing an atom.
272−
273−`a` is an [atom]().
411+Examples
412+--------
274413
275414 ~zod/try=> (mas 3)
276415 1
@@ -285,12 +424,29 @@ Computes the axis of `a` within the head or the tail, producing an atom.
285424 ~zod/try=> (mas 1)
286425 ! exit
287426
288−------------------------------------------------------------------------
427+-----------------------------------------------------------------------
289428
290429### `++max`
291430
292431Maximum
293432
433+Computes the greater of `a` and `b`.
434+
435+Accepts
436+-------
437+
438+`a` is an [atom]().
439+
440+`b` is an atom.
441+
442+Produces
443+--------
444+
445+An atom.
446+
447+Source
448+------
449+
294450 ++ max :: maximum
295451 ~/ %max
296452 |= [a=@ b=@]
@@ -299,11 +455,8 @@ Maximum
299455 b
300456 ::
301457
302−Computes the maximum of `a` and `b`, producing an atom.
303−
304−`a` is an [atom]().
305−
306−`b` is an [atom]().
458+Examples
459+--------
307460
308461 ~zod/try=> (max 10 100)
309462 100
@@ -318,6 +471,23 @@ Computes the maximum of `a` and `b`, producing an atom.
318471
319472Minimum
320473
474+Computes the lesser of `a` and `b`.
475+
476+Accepts
477+-------
478+
479+`a` is an [atom]().
480+
481+`b` is an atom.
482+
483+Produces
484+--------
485+
486+An atom.
487+
488+Source
489+------
490+
321491 ++ min :: minimum
322492 ~/ %min
323493 |= [a=@ b=@]
@@ -326,11 +496,8 @@ Minimum
326496 b
327497 ::
328498
329−Computes the minimum of `a` and `b`, producing an atom.
330−
331−`a` is an [atom]().
332−
333−`b` is an [atom]().
499+Examples
500+--------
334501
335502 ~zod/try=> (min 10 100)
336503 10
@@ -345,6 +512,23 @@ Computes the minimum of `a` and `b`, producing an atom.
345512
346513Modulus
347514
515+Computes the remainder of dividing `a` by `b`.
516+
517+Accepts
518+-------
519+
520+`a` is an [atom]().
521+
522+`b` is an atom.
523+
524+Produces
525+--------
526+
527+An atom.
528+
529+Source
530+------
531+
348532 ++ mod :: remainder
349533 ~/ %mod
350534 |= [a=@ b=@]
@@ -353,11 +537,13 @@ Modulus
353537 (sub a (mul b (div a b)))
354538 ::
355539
356−Computes the remainder of dividing `a` by `b`, producing an atom.
357−
358−`a` is an [atom]().
540+Examples
541+--------
359542
360−`b` is an [atom]().
543+ ~zod/try=> (mod 5 2)
544+ 1
545+ ~zod/try=> (mod 5 5)
546+ 0
361547
362548------------------------------------------------------------------------
363549
@@ -365,6 +551,23 @@ Computes the remainder of dividing `a` by `b`, producing an atom.
365551
366552Multiply
367553
554+Multiplies `a` by `b`.
555+
556+Accepts
557+-------
558+
559+`a` is an [atom]().
560+
561+`b` is an atom.
562+
563+Produces
564+--------
565+
566+An atom.
567+
568+Source
569+------
570+
368571 ++ mul :: multiply
369572 ~/ %mul
370573 |= [a=@ b=@]
@@ -375,11 +578,8 @@ Multiply
375578 $(a (dec a), c (add b c))
376579 ::
377580
378−Multiplies `a` by `b`, producing an atom.
379−
380−`a` is an [atom]().
381−
382−`b` is an [atom]().
581+Examples
582+--------
383583
384584 ~zod/try=> (mul 3 4)
385585 12
@@ -392,6 +592,23 @@ Multiplies `a` by `b`, producing an atom.
392592
393593Axis within axis
394594
595+Computes the axis of `b` within axis `a`.
596+
597+Accepts
598+-------
599+
600+`a` is an [atom]().
601+
602+`b` is an atom.
603+
604+Produces
605+--------
606+
607+An atom.
608+
609+Source
610+------
611+
395612 ++ peg :: tree connect
396613 ~/ %peg
397614 |= [a=@ b=@]
@@ -404,11 +621,8 @@ Axis within axis
404621 ==
405622 ::
406623
407−Computes the axis of `b` within axis `a`, producing an atom.
408−
409−`a` is an [atom]().
410−
411−`b` is an [atom]().
624+Examples
625+--------
412626
413627 ~zod/try=> (peg 4 1)
414628 4
@@ -423,6 +637,23 @@ Computes the axis of `b` within axis `a`, producing an atom.
423637
424638Subtract
425639
640+Subtracts `b` from `a`.
641+
642+Accepts
643+-------
644+
645+`a` is an [atom]().
646+
647+`b` is an [atom]().
648+
649+Produces
650+--------
651+
652+An atom.
653+
654+Source
655+------
656+
426657 ++ sub :: subtract
427658 ~/ %sub
428659 |= [a=@ b=@]
@@ -431,11 +662,8 @@ Subtract
431662 ?: =(0 b) a
432663 $(a (dec a), b (dec b))
433664
434−Subtracts `b` from `a`, producing an atom.
435−
436−`a` is an [atom]().
437−
438−`b` is an [atom]().
665+Examples
666+--------
439667
440668 ~zod/try=> (sub 10 5)
441669 5
docs/dev/hoon/library/2b.md+610−197
@@ -8,17 +8,31 @@ Section 2bA, units
88
99Unit as argument
1010
11+Applies a function `b` that produces a unit to the unwrapped value of [++unit]()
12+`a` (`u.a`). If `a` is empty, `~` is produced.
13+
14+Accepts
15+-------
16+
17+`a` is a unit.
18+
19+`b` is a function that accepts a noun and produces a unit.
20+
21+Produces
22+--------
23+
24+A unit.
25+
26+Source
27+------
28+
1129 ++ biff :: apply
1230 |* [a=(unit) b=$+(* (unit))]
1331 ?~ a ~
1432 (b u.a)
1533
16−Applies a gate that produces a unit, `b`, to the value (`u.a`) of a unit
17−`a`. If `a` is empty, `~` is produced.
18−
19−`a` is a [unit]().
20−
21−`b` is a [gate]() that accepts a noun and produces a unit.
34+Examples
35+--------
2236
2337 ~zod/try=> (biff (some 5) |=(a=@ (some (add a 2))))
2438 [~ u=7]
@@ -29,19 +43,34 @@ Applies a gate that produces a unit, `b`, to the value (`u.a`) of a unit
2943
3044### `++bind`
3145
32−Bind
46+Non-unit function to unit, producing unit
47+
48+Applies a function `b` to the value (`u.a`) of a [++unit]() `a`, producing
49+a unit. Used when you want a function that does not accept or produce a
50+unit to both accept and produce a unit.
51+
52+Accepts
53+-------
54+
55+`a` is a unit.
56+
57+`b` is a function.
58+
59+Produces
60+--------
61+
62+A unit.
63+
64+Source
65+------
3366
3467 ++ bind :: argue
3568 |* [a=(unit) b=gate]
3669 ?~ a ~
3770 [~ u=(b u.a)]
3871
39−Applies a function `b` to the value (`u.a`) of a unit `a`, producing a
40−unit.
41−
42−`a` is a [unit]()
43−
44−`b` is a [gate]().
72+Examples
73+--------
4574
4675 ~zod/try=> (bind ((unit ,@) [~ 97]) ,@t)
4776 [~ `a`]
@@ -55,18 +84,32 @@ unit.
5584
5685Replace null
5786
87+Replaces an empty [++unit]() `b` with the product of a called [trap]()
88+`a`. If the unit is not empty, then the original unit is produced.
89+
90+Accepts
91+-------
92+
93+`a` is a trap.
94+
95+`b` is a unit.
96+
97+Produces
98+--------
99+
100+Either the product of `a` or the value inside of unit `b`.
101+
102+Source
103+------
104+
58105 ++ bond :: replace
59106 |* a=trap
60107 |* b=(unit)
61108 ?~ b $:a
62109 u.b
63110
64−Replaces an empty unit `b` with the product of a kicked trap `a`. If the
65−unit is not empty, then the original unit is produced.
66−
67−`a` is a [trap]().
68−
69−`b` is a [unit]().
111+Examples
112+--------
70113
71114 ~zod/try=> (bex 10)
72115 1.024
@@ -79,7 +122,26 @@ unit is not empty, then the original unit is produced.
79122
80123### `++both`
81124
82−Group unit values
125+Group unit values into pair
126+
127+Produces `~` if either `a` or `b` are empty. Otherwise, produces a
128+[++unit]() whose value is a cell of the values of two input units `a` and
129+`b`.
130+
131+Accepts
132+-------
133+
134+`a` is a unit.
135+
136+`b` is a unit.
137+
138+Produces
139+--------
140+
141+A unit of the two initial values.
142+
143+Source
144+------
83145
84146 ++ both :: all the above
85147 |* [a=(unit) b=(unit)]
@@ -87,12 +149,8 @@ Group unit values
87149 ?~ b ~
88150 [~ u=[u.a u.b]]
89151
90−Produces a unit whose value is a cell of the values of two input units
91−`a` and `b`. If either of the two units are empty, `~` is produced.
92−
93−`a` is a [unit]().
94−
95−`b` is a [unit]().
152+Examples
153+--------
96154
97155 ~zod/try=> (both (some 1) (some %b))
98156 [~ u=[1 %b]]
@@ -103,7 +161,27 @@ Produces a unit whose value is a cell of the values of two input units
103161
104162### `++clap`
105163
106−Apply gate to two units
164+Apply function to two units
165+
166+Applies a binary function `c`--which does not usually accept or produce a [`++unit`]()--
167+to the values of two units, `a` and `b`, producing a unit.
168+
169+Accepts
170+-------
171+
172+`a` is a unit.
173+
174+`b` is a unit.
175+
176+`c` is a function that performs a binary operation.
177+
178+Produces
179+--------
180+
181+A unit.
182+
183+Source
184+------
107185
108186 ++ clap :: combine
109187 |* [a=(unit) b=(unit) c=_|=(^ +<-)]
@@ -111,14 +189,8 @@ Apply gate to two units
111189 ?~ b a
112190 [~ u=(c u.a u.b)]
113191
114−Applies a binary operation `c` which produces a unit to the values of
115−two units `a` and `b`.
116−
117−`a` is a [unit]().
118−
119−`b` is a [unit]().
120−
121−`c` is a [gate]() that performs a binary operation.
192+Examples
193+--------
122194
123195 ~zod/try=> =u ((unit ,@t) [~ 'a'])
124196 ~zod/try=> =v ((unit ,@t) [~ 'b'])
@@ -135,16 +207,30 @@ two units `a` and `b`.
135207
136208### `++drop`
137209
138−Unit list
210+Unit to list
211+
212+Makes a [++list]() of the unwrapped value (`u.a`) of a [`++unit`]() `a`.
213+
214+Accepts
215+-------
216+
217+`a` is a unit.
218+
219+Produces
220+--------
221+
222+A list.
223+
224+Source
225+------
139226
140227 ++ drop :: enlist
141228 |* a=(unit)
142229 ?~ a ~
143230 [i=u.a t=~]
144231
145−Produces a [list]() of the value from a unit `a`.
146−
147−`a` is a [unit]().
232+Examples
233+--------
148234
149235 ~zod/try=> =a ((unit ,@) [~ 97])
150236 ~zod/try=> (drop a)
@@ -157,18 +243,31 @@ Produces a [list]() of the value from a unit `a`.
157243
158244### `++fall`
159245
160−Default unit
246+Give unit a default value
247+
248+Produces a default value `b` for a [`++unit`]() `a` in cases where `a` is null.
249+
250+Accepts
251+-------
252+
253+`a` is a unit.
254+
255+`b` is a [noun]() that's used as the default value.
256+
257+Produces
258+--------
259+
260+Either a noun `b` or the unwrapped value of unit `a`.
261+
262+Source
263+------
161264
162265 ++ fall :: default
163266 |* [a=(unit) b=*]
164267 ?~(a b u.a)
165268
166−Produces a default value `b` for a unit `a` in cases where the unit is
167−null.
168−
169−`a` is a [unit]().
170−
171−`b` is a [noun]() used as the default value.
269+Examples
270+--------
172271
173272 ~zod/try=> (fall ~ `a`)
174273 `a`
@@ -179,20 +278,34 @@ null.
179278
180279### `++lift`
181280
182−Fmap
281+Curried bind
282+
283+Accepts a [`++gate`]() `a` and produces a function that accepts [`++unit`]()
284+`b` to which it applies `a`. Used when you want a function that does not accept
285+or produce a unit to both accept and produce a unit.
286+
287+Accepts
288+-------
289+
290+`a` is a gate.
291+
292+`b` is a unit.
293+
294+Produces
295+--------
296+
297+A unit.
298+
299+Source
300+------
183301
184302 ++ lift :: lift gate (fmap)
185303 |* a=gate :: flipped
186304 |* b=(unit) :: curried
187305 (bind b a) :: bind
188306
189−Similar to `fmap` in Haskell: accepts a gate `a` that accepts and
190−produces an unwrapped value, passes it the value of a unit `b`, and then
191−produces a unit value.
192−
193−`a` is a [gate]().
194−
195−`b` is a [unit]().
307+Examples
308+--------
196309
197310 ~zod/try=> ((lift dec) `(unit ,@)`~)
198311 ~
@@ -205,21 +318,35 @@ produces a unit value.
205318
206319Choose
207320
208− ++ mate :: choose
209− |* [a=(unit) b=(unit)]
210− ?~ b a
211− ?~ a b
212− ?.(=(u.a u.b) ~|('mate' !!) a)
213−
214321Accepts two units `a` and `b` whose values are expected to be
215322equivalent. If either is empty, then the value of the other is produced.
216323If neither are empty, it asserts that both values are the same and
217324produces that value. If the assertion fails, `++mate` crashes with
218325`'mate'` in the stack trace.
219326
220−`a` is a [unit]().
327+Accepts
328+-------
329+
330+`a` is a unit.
331+
332+`b` is a unit.
221333
222−`b` is a [unit]().
334+Produces
335+--------
336+
337+A unit or crash.
338+
339+Source
340+------
341+
342+++ mate :: choose
343+ |* [a=(unit) b=(unit)]
344+ ?~ b a
345+ ?~ a b
346+ ?.(=(u.a u.b) ~|('mate' !!) a)
347+
348+Examples
349+--------
223350
224351 ~zod/try=> =a ((unit ,@) [~ 97])
225352 ~zod/try=> =b ((unit ,@) [~ 97])
@@ -239,16 +366,30 @@ produces that value. If the assertion fails, `++mate` crashes with
239366
240367### `++need`
241368
242−Unwrap
369+Unwrap unit
370+
371+Retrieve the value from a [`++unit`]() and crash if the unit is null.
372+
373+Accepts
374+-------
375+
376+`a` is a unit.
377+
378+Produces
379+--------
380+
381+Either the unwrapped value of `a` (`u.a`), or crash.
382+
383+Source
384+------
243385
244386 ++ need :: demand
245387 |* a=(unit)
246388 ?~ a !!
247389 u.a
248390
249−Retrieve the value from a unit and crash if the unit is null.
250−
251−`a` is a [unit]().
391+Examples
392+--------
252393
253394 ~zod/try=> =a ((unit ,[@t @t]) [~ ['a' 'b']])
254395 ~zod/try=> (need a)
@@ -264,15 +405,29 @@ Retrieve the value from a unit and crash if the unit is null.
264405
265406### `++some`
266407
267−Unify
408+Wrap value in a unit
409+
410+Takes any atom `a` and produces a [`++unit`]() with the value set to `a`.
411+
412+Accepts
413+-------
414+
415+`a` is a [noun]().
416+
417+Produces
418+--------
419+
420+A unit.
421+
422+Source
423+------
268424
269425 ++ some :: lift (pure)
270426 |* a=*
271427 [~ u=a]
272428
273−Takes any atom `a` and produces a unit with the value set to `a`.
274−
275−`a` is a [noun]().
429+Examples
430+--------
276431
277432 ~zod/try=> (some [`a` `b`])
278433 [~ u=[`a` `b`]]
@@ -284,9 +439,24 @@ Takes any atom `a` and produces a unit with the value set to `a`.
284439section 2bB, lists
285440------------------
286441
442+Reverse
443+
287444### `++flop`
288445
289−Reverse
446+Produces the list `a` in reverse order.
447+
448+Accepts
449+-------
450+
451+`a` is a list.
452+
453+Produces
454+--------
455+
456+A list.
457+
458+Source
459+------
290460
291461 ++ flop :: reverse
292462 ~/ %flop
@@ -298,20 +468,34 @@ Reverse
298468 ?~ a b
299469 $(a t.a, b [i.a b])
300470
301−Produces the list `a` in reverse order.
302471
303−`a` is a [list]().
472+Examples
473+--------
304474
305475 ~zod/try=> =a (limo [1 2 3 ~])
306476 ~zod/try=> (flop a)
307477 ~[3 2 1]
308478
309−------------------------------------------------------------------------
310−
311479### `++homo`
312480
313481Homogenize
314482
483+Produces a [`++list`]() whose type is a fork of all the contained types in the
484+list `a`. Used when you want to make all the types of the elements of a list the same.
485+
486+Accepts
487+-------
488+
489+`a` is a list.
490+
491+Produces
492+--------
493+
494+a list.
495+
496+Source
497+------
498+
315499 ++ homo :: homogenize
316500 |* a=(list)
317501 ^+ =< $
@@ -319,10 +503,8 @@ Homogenize
319503 --
320504 a
321505
322−Produces a list whose type is a fork of all the contained types in the
323−list `a`.
324−
325−`a` is a [list]().
506+Examples
507+--------
326508
327509 ~zod/try=> lyst
328510 [i=1 t=[i=97 t=[i=2 t=[i=98 t=[i=[~ u=10] t=~]]]]]
@@ -334,12 +516,25 @@ list `a`.
334516 ~zod/try=> (homo a)
335517 ~[1 2 3]
336518
337−------------------------------------------------------------------------
338−
339519### `++limo`
340520
341521List Constructor
342522
523+Turns a null-terminated tuple into a [`++list`]().
524+
525+Accepts
526+-------
527+
528+`a` is a null-terminated tuple.
529+
530+Produces
531+--------
532+
533+A list
534+
535+Source
536+------
537+
343538 ++ limo :: listify
344539 |* a=*
345540 ^+ =< $
@@ -347,19 +542,33 @@ List Constructor
347542 --
348543 a
349544
350−Turns a null-terminated tuple into a list.
351−
352−`a` is a null-terminated tuple.
545+Examples
546+--------
353547
354548 ~zod/try=> (limo [1 2 3 ~])
355549 [i=1 t=[i=2 t=[i=3 t=~]]]
356550
357−------------------------------------------------------------------------
551+----------------------------------------------------------------------
358552
359553### `++lent`
360554
361555List length
362556
557+Produces the length of any [`++list`]() `a` as an atom.
558+
559+Accepts
560+-------
561+
562+`a` is a list.
563+
564+Produces
565+--------
566+
567+an atom.
568+
569+Source
570+------
571+
363572 ++ lent :: length
364573 ~/ %lent
365574 |= a=(list)
@@ -369,9 +578,8 @@ List length
369578 ?~ a b
370579 $(a t.a, b +(b))
371580
372−Produces the length of any list `a` as an atom.
373−
374−`a` is a [list]().
581+Examples
582+--------
375583
376584 ~zod/try=> (lent (limo [1 2 3 4 ~]))
377585 4
@@ -382,7 +590,22 @@ Produces the length of any list `a` as an atom.
382590
383591### `++levy`
384592
385−"and" to list
593+Logical "and" on list
594+
595+Computes the Boolean logical "and" on the results of [gate]() `b` applied to each individual element in [`++list`]() `a`.
596+
597+Accepts
598+-------
599+
600+`a` is a list.
601+
602+`b` is a gate.
603+
604+Produces
605+--------
606+
607+Source
608+------
386609
387610 ++ levy
388611 ~/ %levy :: all of
@@ -392,12 +615,8 @@ Produces the length of any list `a` as an atom.
392615 ?. (b i.a) |
393616 $(a t.a)
394617
395−Produces the Boolean "and" of the result of every element in list `a`
396−passed to gate `b`.
397−
398−`a` is a [list]().
399−
400−`b` is a [gate]().
618+Examples
619+--------
401620
402621 ~zod/try=> =a |=(a=@ (lte a 1))
403622 ~zod/try=> (levy (limo [0 1 2 1 ~]) a)
@@ -410,7 +629,7 @@ passed to gate `b`.
410629
411630### `++lien`
412631
413−"or" to list
632+Logical "or" on list
414633
415634 ++ lien :: some of
416635 ~/ %lien
@@ -420,12 +639,11 @@ passed to gate `b`.
420639 ?: (b i.a) &
421640 $(a t.a)
422641
423−Produces the Boolean "or" of the result of every element in list `a`
424−passed to gate `b`.
642+Computes the Boolean logical "or" on the results of applying [gate]() `b` to every element of [`++list`]() `a`.
425643
426−`a` is a [list]().
644+`a` is a list.
427645
428−`b` is a [gate]().
646+`b` is a gate.
429647
430648 ~zod/try=> =a |=(a=@ (gte a 1))
431649 ~zod/try=> (lien (limo [0 1 2 1 ~]) a)
@@ -440,6 +658,25 @@ passed to gate `b`.
440658
441659Maybe transform
442660
661+Passes each member of [`++list`]() `a` to [gate]() `b`, which must produce a
662+[`++unit`](). Produces a new list with all the results that do not produce
663+`~`.
664+
665+Accepts
666+-------
667+
668+`a` is a [list]().
669+
670+`b` is a [gate]() that produces a [unit]().
671+
672+Produces
673+--------
674+
675+A unit.
676+
677+Source
678+------
679+
443680 ++ murn :: maybe transform
444681 |* [a=(list) b=$+(* (unit))]
445682 |-
@@ -449,34 +686,42 @@ Maybe transform
449686 $(a t.a)
450687 [i=u.c t=$(a t.a)]
451688
452−Passes each member of list `a` to gate `b`, which must produce a unit.
453−Produces a new list with all the results that do not produce `~`.
454−
455−`a` is a [list]().
456−
457−`b` is a [gate]() that produces a [unit]().
689+Examples
690+--------
458691
459692 ~zod/try=> =a |=(a=@ ?.((gte a 2) ~ (some (add a 10))))
460693 ~zod/try=> (murn (limo [0 1 2 3 ~]) a)
461694 [i=12 t=[i=13 t=~]]
462695
463−------------------------------------------------------------------------
696+-------------------------------------------------------------
464697
465698### `++reap`
466699
467700Replicate
468701
702+Replicate: produces a [`++list`]() containing `a` copies of `b`.
703+
704+Accepts
705+-------
706+
707+`b` is a [noun]()
708+
709+Produces
710+--------
711+
712+A list.
713+
714+Source
715+------
716+
469717 ++ reap :: replicate
470718 |* [a=@ b=*]
471719 |- ^- (list ,_b)
472720 ?~ a ~
473721 [b $(a (dec a))]
474722
475−Replicate: produces a list containing `a` copies of `b`.
476−
477−`a` is an [atom]()
478−
479−`b` is a [noun]()
723+Examples
724+--------
480725
481726 ~zod/try=> (reap 20 %a)
482727 ~[%a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a]
@@ -491,6 +736,23 @@ Replicate: produces a list containing `a` copies of `b`.
491736
492737Right fold
493738
739+Right fold: moves right to left across a [`++list`]() `a`, recursively slamming
740+a binary [gate]() `b` with an element from `a` and an accumulator, producing
741+the final value of the accumulator.
742+
743+Accepts
744+-------
745+
746+`b` is a binary gate.
747+
748+Produces
749+--------
750+
751+The accumulator, which is a [noun]().
752+
753+Source
754+------
755+
494756 ++ reel :: right fold
495757 ~/ %reel
496758 |* [a=(list) b=_|=([* *] +<+)]
@@ -499,13 +761,8 @@ Right fold
499761 +<+.b
500762 (b i.a $(a t.a))
501763
502−Right fold: moves right to left across a list `a`, recursively slamming
503−a binary gate `b` with an element from `a` and an accumulator, producing
504−the final value of the accumulator.
505−
506−`a` is a [list]().
507−
508−`b` is a binary [gate]().
764+Examples
765+--------
509766
510767 ~zod/try=> =sum =|([p=@ q=@] |.((add p q)))
511768 ~zod/try=> (reel (limo [1 2 3 4 5 ~]) sum)
@@ -523,6 +780,23 @@ the final value of the accumulator.
523780
524781Left fold
525782
783+Left fold: moves left to right across a list `a`, recursively slamming a
784+binary [gate]() `b` with an element from the [`++list`]() and an accumulator,
785+producing the final value of the accumulator.
786+
787+Accepts
788+-------
789+
790+`b` is a binary [gate]().
791+
792+Produces
793+--------
794+
795+The accumulator, which is a [noun]().
796+
797+Source
798+------
799+
526800 ++ roll :: left fold
527801 ~/ %roll
528802 |* [a=(list) b=_|=([* *] +<+)]
@@ -531,13 +805,8 @@ Left fold
531805 +<+.b
532806 $(a t.a, b b(+<+ (b i.a +<+.b)))
533807
534−Left fold: moves left to right across a list `a`, recursively slamming a
535−binary gate `b` with an element from the list and an accumulator,
536−producing the final value of the accumulator.
537−
538−`a` is a [list]().
539−
540−`b` is a binary [gate]().
808+Examples
809+--------
541810
542811 ~zod/try=> =sum =|([p=@ q=@] |.((add p q)))
543812 ~zod/try=> (roll (limo [1 2 3 4 5 ~]) sum)
@@ -555,6 +824,22 @@ producing the final value of the accumulator.
555824
556825Separate
557826
827+Seperates a [`++list`]() `a` into two lists - Those elements of `a` who produce
828+true when slammed to [gate]() `b` and those who produce `%.n`.
829+
830+Accepts
831+-------
832+
833+`b` is a gate that accepts one argument and produces a loobean.
834+
835+Produces
836+--------
837+
838+A cell of two lists.
839+
840+Source
841+------
842+
558843 ++ skid :: separate
559844 |* [a=(list) b=$+(* ?)]
560845 |- ^+ [p=a q=a]
@@ -562,12 +847,9 @@ Separate
562847 =+ c=$(a t.a)
563848 ?:((b i.a) [[i.a p.c] q.c] [p.c [i.a q.c]])
564849
565−Seperates a list `a` into two lists - Those elements of `a` who produce
566−true when slammed to gate `b` and those who produce `%.n`.
567850
568−`a` is a [list]().
569−
570−`b` is a [gate]() that accepts one argument and produces a loobean.
851+Examples
852+--------
571853
572854 ~zod/try=> =a |=(a=@ (gth a 1))
573855 ~zod/try=> (skid (limo [0 1 2 3 ~]) a)
@@ -579,22 +861,32 @@ true when slammed to gate `b` and those who produce `%.n`.
579861
580862Suffix
581863
582− ++ skim :: only
583− ~/ %skim
584− |* [a=(list) b=_|=(p=* .?(p))]
585− |-
586− ^+ a
587− ?~ a ~
588− ?:((b i.a) [i.a $(a t.a)] $(a t.a))
589−
590864Cycles through the members of a list `a`, passing them to a gate `b` and
591865producing a list of all of the members that produce `%.y`. Inverse of
592866`++skip`.
593867
594−`a` is a [list]().
868+Accepts
869+-------
595870
596871`b` is a [gate]() that accepts one argument and produces a loobean.
597872
873+Produces
874+--------
875+
876+Source
877+------
878+
879+++ skim :: only
880+ ~/ %skim
881+ |* [a=(list) b=_|=(p=* .?(p))]
882+ |-
883+ ^+ a`
884+ ?~ a ~
885+ ?:((b i.a) [i.a $(a t.a)] $(a t.a))
886+
887+Examples
888+--------
889+
598890 ~zod/try=> =a |=(a=@ (gth a 1))
599891 ~zod/try=> (skim (limo [0 1 2 3 ~]) a)
600892 [i=2 t=[i=3 t=~]]
@@ -605,6 +897,23 @@ producing a list of all of the members that produce `%.y`. Inverse of
605897
606898Except
607899
900+Cycles through the members of [`++list`]() `a`, passing them to a [gate]() `b`.
901+Produces a list of all of the members that produce `%.n`. Inverse of
902+`++skim`.
903+
904+Accepts
905+-------
906+
907+`b` is a [gate]() that accepts one argument and produces a loobean.
908+
909+Produces
910+--------
911+
912+A list of the same type as `a`.
913+
914+Source
915+------
916+
608917 ++ skip :: except
609918 ~/ %skip
610919 |* [a=(list) b=_|=(p=* .?(p))]
@@ -613,13 +922,8 @@ Except
613922 ?~ a ~
614923 ?:((b i.a) $(a t.a) [i.a $(a t.a)])
615924
616−Cycles through the members of a list `a`, passing them to a gate `b` and
617−producing a list of all of the members that produce `%.n`. Inverse of
618−`++skim`.
619−
620−`a` is a [list]().
621−
622−`b` is a [gate]() that accepts one argument and produces a loobean.
925+Examples
926+--------
623927
624928 ~zod/try=> =a |=(a=@ (gth a 1))
625929 ~zod/try=> (skip (limo [0 1 2 3 ~]) a)
@@ -631,6 +935,22 @@ producing a list of all of the members that produce `%.n`. Inverse of
631935
632936Prefix
633937
938+Accepts an atom `a` and [list]() `b`, producing the first `a` elements of
939+the front of the list.
940+
941+Accepts
942+-------
943+
944+`b` is a list.
945+
946+Produces
947+--------
948+
949+A list of the same type as `b`.
950+
951+Source
952+------
953+
634954 ++ scag :: prefix
635955 ~/ %scag
636956 |* [a=@ b=(list)]
@@ -638,12 +958,8 @@ Prefix
638958 ?: |(?=(~ b) =(0 a)) ~
639959 [i.b $(b t.b, a (dec a))]
640960
641−Accepts an atom `a` and list `b`, producing the first `a` elements of
642−the front of the list.
643−
644−`a` is an [atom]().
645−
646−`b` is a [list]().
961+Examples
962+--------
647963
648964 ~zod/try=> (scag 2 (limo [0 1 2 3 ~]))
649965 [i=0 t=[i=1 t=~]]
@@ -656,6 +972,22 @@ the front of the list.
656972
657973Suffix
658974
975+Accepts an atom `a` and list `b`, producing the remaining elements from
976+`b` starting at `a`.
977+
978+Accepts
979+-------
980+
981+`b` is a [list]().
982+
983+Produces
984+--------
985+
986+A list of the same type as `b`.
987+
988+Source
989+------
990+
659991 ++ slag :: suffix
660992 ~/ %slag
661993 |* [a=@ b=(list)]
@@ -664,12 +996,8 @@ Suffix
664996 ?~ b ~
665997 $(b t.b, a (dec a))
666998
667−Accepts an atom `a` and list `b`, producing the remaining elements from
668−`b` starting at `a`.
669−
670−`a` is an [atom]().
671−
672−`b` is a [list]().
999+Examples
1000+--------
6731001
6741002 ~zod/try=> (slag 2 (limo [1 2 3 4 ~]))
6751003 [i=3 t=[i=4 t=~]]
@@ -682,6 +1010,22 @@ Accepts an atom `a` and list `b`, producing the remaining elements from
6821010
6831011Index
6841012
1013+Accepts an atom `a` and a [`++list`]() `b`, producing the element at the index
1014+of `a`and failing if the list is null. Lists are 0-indexed.
1015+
1016+Accepts
1017+-------
1018+
1019+`b` is a [list]().
1020+
1021+Produces
1022+--------
1023+
1024+Produces an element of `b`, or crashes if no element exists at that index.
1025+
1026+Source
1027+------
1028+
6851029 ++ snag :: index
6861030 ~/ %snag
6871031 |* [a=@ b=(list)]
@@ -691,12 +1035,8 @@ Index
6911035 ?: =(0 a) i.b
6921036 $(b t.b, a (dec a))
6931037
694−Accepts an atom `a` and a list `b`, producing the element at the index
695−of `a`and failing if the list is null. Lists are 0-indexed.
696−
697−`a` is an [atom]().
698−
699−`b` is a [list]().
1038+Examples
1039+--------
7001040
7011041 ~zod/try=> (snag 2 "asdf")
7021042 ~~d
@@ -709,6 +1049,23 @@ of `a`and failing if the list is null. Lists are 0-indexed.
7091049
7101050Quicksort
7111051
1052+Quicksort: accepts a [`++list`]() `a` and a [gate]() `b` which accepts two nouns and
1053+produces a loobean. `++sort` then produces a list of the elements of `a`,
1054+sorted according to `b`.
1055+
1056+Accepts
1057+-------
1058+
1059+`b` is a gate that ccepts two nouns and produces a boolean.
1060+
1061+Produces
1062+--------
1063+
1064+A list
1065+
1066+Source
1067+------
1068+
7121069 ++ sort :: quicksort
7131070 ~/ %sort
7141071 |* [a=(list) b=$+([* *] ?)]
@@ -720,13 +1077,8 @@ Quicksort
7201077 ^+ t.a
7211078 [i.a $(a (skim t.a |=(c=_i.a !(b c i.a))))]
7221079
723−Quicksort: accepts a list `a` and a gate `b` which accepts two nouns and
724−produces a loobean. `++sort` then produces a list of the elements of `a`
725−sorted according to `b`.
726−
727−`a` is an [atom]().
728−
729−`b` is a [gate]() which accepts two nouns and produces a loobean.
1080+Examples
1081+--------
7301082
7311083 ~zod/try=> =a =|([p=@ q=@] |.((gth p q)))
7321084 ~zod/try=> (sort (limo [0 1 2 3 ~]) a)
@@ -738,17 +1090,29 @@ sorted according to `b`.
7381090
7391091Infix
7401092
741− ++ swag :: infix
742− |* [[a=@ b=@] c=(list)]
743− (scag b (slag a c))
744−
745−Similar to `substr` in JavaScript: extracts a string infix, beginning at
1093+Similar to `substr` in Javascript: extracts a string infix, beginning at
7461094inclusive index `a`, producing `b` number of characters.
7471095
748−`a` and `b` are [atom]()s.
1096+Accepts
1097+-------
7491098
7501099`c` is a [list]().
7511100
1101+Produces
1102+--------
1103+
1104+A list of the same type as `c`.
1105+
1106+Source
1107+------
1108+
1109+ ++ swag :: infix
1110+ |* [[a=@ b=@] c=(list)]
1111+ (scag b (slag a c))
1112+
1113+Examples
1114+--------
1115+
7521116 ~zod/try=> (swag [2 5] "roly poly")
7531117 "ly po"
7541118 ~zod/try=> (swag [2 2] (limo [1 2 3 4 ~]))
@@ -760,6 +1124,22 @@ inclusive index `a`, producing `b` number of characters.
7601124
7611125Gate to list
7621126
1127+Accepts a [`++list`]() `a` and a [gate]() `b`. Produces a list with the gate applied
1128+to each element of the original list.
1129+
1130+Accepts
1131+-------
1132+
1133+`b` is a gate.
1134+
1135+Produces
1136+--------
1137+
1138+A list.
1139+
1140+Source
1141+------
1142+
7631143 ++ turn :: transform
7641144 ~/ %turn
7651145 |* [a=(list) b=_,*]
@@ -767,12 +1147,8 @@ Gate to list
7671147 ?~ a ~
7681148 [i=(b i.a) t=$(a t.a)]
7691149
770−Accepts a list `a` and a gate `b`. Produces a list with the gate applied
771−to each element of the original list.
772−
773−`a` is a [list]().
774−
775−`b` is a [gate]().
1150+Examples
1151+--------
7761152
7771153 ~zod/try=> (turn (limo [104 111 111 110 ~]) ,@t)
7781154 <|h o o n|>
@@ -786,6 +1162,16 @@ to each element of the original list.
7861162
7871163Concatenate
7881164
1165+Concatenate two [`++list`]()s `a` and `b`.
1166+
1167+Accepts
1168+-------
1169+
1170+`a` and `b` are [list]()s.
1171+
1172+Source
1173+------
1174+
7891175 ++ weld :: concatenate
7901176 ~/ %weld
7911177 |* [a=(list) b=(list)]
@@ -794,9 +1180,8 @@ Concatenate
7941180 ?~ a b
7951181 [i.a $(a t.a)]
7961182
797−Concatenate two lists `a` and `b`.
798−
799−`a` and `b` are [list]()s.
1183+Examples
1184+--------
8001185
8011186 ~zod/try=> (weld "urb" "it")
8021187 ~[~~u ~~r ~~b ~~i ~~t]
@@ -809,6 +1194,24 @@ Concatenate two lists `a` and `b`.
8091194
8101195Perfect weld
8111196
1197+Concatenate two [`++list`]()s `a` and `b` without losing their type information
1198+to homogenization.
1199+
1200+Accepts
1201+-------
1202+
1203+`a` is a list.
1204+
1205+`b` is a list.
1206+
1207+Produces
1208+--------
1209+
1210+A list.
1211+
1212+Source
1213+------
1214+
8121215 ++ welp :: perfect weld
8131216 =| [* *]
8141217 |%
@@ -818,10 +1221,8 @@ Perfect weld
8181221 +<-(+ $(+<- +<->))
8191222 --
8201223
821−Concatenate two lists `a` and `b` without losing their type information
822−to homogenization.
823−
824−`a` and `b` are [list]()s.
1224+Examples
1225+--------
8251226
8261227 ~zod/try=> (welp "foo" "bar")
8271228 "foobar"
@@ -885,6 +1286,22 @@ individually.
8851286
8861287Cons
8871288
1289+Turns a [`++list`]() of lists into a single list by promoting the elements of
1290+each sublist into the higher.
1291+
1292+Accepts
1293+-------
1294+
1295+A list of lists.
1296+
1297+Produces
1298+--------
1299+
1300+A list.
1301+
1302+Source
1303+------
1304+
8881305 ++ zing :: promote
8891306 =| *
8901307 |%
@@ -894,14 +1311,10 @@ Cons
8941311 (welp +<- $(+< +<+))
8951312 --
8961313
897−Turns a list of lists into a single list by promoting the elements of
898−each sublist into the higher.
899−
900−Accepts a [list]() of lists.
1314+Examples
1315+--------
9011316
9021317 ~zod/try=> (zing (limo [(limo ['a' 'b' 'c' ~]) (limo ['e' 'f' 'g' ~]) (limo ['h' 'i' 'j' ~]) ~]))
9031318 ~['a' 'b' 'c' 'e' 'f' 'g' 'h' 'i' 'j']
9041319 ~zod/try=> (zing (limo [(limo [1 'a' 2 'b' ~]) (limo [3 'c' 4 'd' ~]) ~]))
9051320 ~[1 97 2 98 3 99 4 100]
906−
907−------------------------------------------------------------------------
docs/dev/hoon/library/2c.md+1363−321
@@ -8,6 +8,21 @@ section 2cA, bit surgery
88
99Binary exponent
1010
11+Computes the result of `2^a`, producing an [atom]().
12+
13+Accepts
14+-------
15+
16+`a` is an atom.
17+
18+Produces
19+--------
20+
21+An atom.
22+
23+Source
24+------
25+
1126 ++ bex :: binary exponent
1227 ~/ %bex
1328 |= a=@
@@ -15,9 +30,8 @@ Binary exponent
1530 ?: =(0 a) 1
1631 (mul 2 $(a (dec a)))
1732
18−Computes the result of `2^a`, producing an atom.
19−
20−`a` is an [atom](atom).
33+Examples
34+--------
2135
2236 ~zod/try=> (bex 4)
2337 16
@@ -32,15 +46,29 @@ Computes the result of `2^a`, producing an atom.
3246
3347Binary logarithm
3448
49+Computes the base-2 logarithm of `a`, producing an [atom]().
50+
51+Accepts
52+-------
53+
54+`a` is an atom.
55+
56+Produces
57+--------
58+
59+An atom.
60+
61+Source
62+------
63+
3564 ++ xeb :: binary logarithm
3665 :: ~/ %xeb
3766 |= a=@
3867 ^- @
3968 (met 0 a)
4069
41−Computes the base-2 logarithm of `a`, producing an atom.
42−
43−`a` is an [atom](atom).
70+Examples
71+--------
4472
4573 ~zod/try=> (xeb 31)
4674 5
@@ -61,6 +89,25 @@ Computes the base-2 logarithm of `a`, producing an atom.
6189
6290Assemble
6391
92+Produces an [atom]() from a list `b` of length-value pairs `p` and `q`,
93+where `p` is the length in bloqs of size `a`, and `q` is an atomic
94+value.
95+
96+Accepts
97+-------
98+
99+`a` is a block size (see [`++bloq`]()).
100+
101+`b` is a [`++list`]() of length value pairs, `p` and `q`.
102+
103+Produces
104+--------
105+
106+An atom.
107+
108+Source
109+------
110+
64111 ++ can :: assemble
65112 ~/ %can
66113 |= [a=bloq b=(list ,[p=@ q=@])]
@@ -68,13 +115,8 @@ Assemble
68115 ?~ b 0
69116 (mix (end a p.i.b q.i.b) (lsh a p.i.b $(b t.b)))
70117
71−Produces an atom from a list `b` of length-value pairs `p` and `q`,
72−where `p` is the length in bloqs of size `a`, and `q` is an atomic
73−value.
74−
75−`a` is a block size (see [++bloq]()).
76−
77−`b` is a [list](list) of length value pairs, `p` and `q`.
118+Examples
119+--------
78120
79121 ~zod/try=> `@ub`(can 3 ~[[1 1]])
80122 0b1
@@ -95,19 +137,33 @@ value.
95137
96138Concatenate
97139
140+Concatenates two [atom]()s, `b` and `c`, according to bloq size `a`, producing an
141+atom.
142+
143+Accepts
144+-------
145+
146+`a` is a block size (see [`++bloq`]()).
147+
148+`b` is an atom.
149+
150+`c` is an atom.
151+
152+Produces
153+--------
154+
155+An atom.
156+
157+Source
158+------
159+
98160 ++ cat :: concatenate
99161 ~/ %cat
100162 |= [a=bloq b=@ c=@]
101163 (add (lsh a (met a b) c) b)
102164
103−Concatenates two atoms, `b` and `c`, using bloq size `a`, producing an
104−atom.
105−
106−`a` is a block size (see [++bloq]()).
107−
108−`b` is an [atom]().
109−
110−`c` is an [atom]().
165+Examples
166+--------
111167
112168 ~zod/try=> `@ub`(cat 3 1 0)
113169 0b1
@@ -134,19 +190,32 @@ atom.
134190
135191Slice
136192
137− ++ cut :: slice
138− ~/ %cut
139− |= [a=bloq [b=@ c=@] d=@]
140− (end a c (rsh a b d))
141−
142193Slices `c` blocks of size `a` that are `b` blocks from the end of `d`.
143−Produces an atom.
194+
195+Accepts
196+-------
144197
145198`a` is a block size (see [++bloq]()).
146199
147200`b` is an [atom]().
148201
149−`c` is an [atom]().
202+`c` is an atom.
203+
204+Produces
205+--------
206+
207+An atom.
208+
209+Source
210+------
211+
212+ ++ cut :: slice
213+ ~/ %cut
214+ |= [a=bloq [b=@ c=@] d=@]
215+ (end a c (rsh a b d))
216+
217+Examples
218+--------
150219
151220 ~zod/try=> (cut 0 [1 1] 2)
152221 1
@@ -171,19 +240,34 @@ Produces an atom.
171240
172241Tail
173242
174− ++ end :: tail
175− ~/ %end
176− |= [a=bloq b=@ c=@]
177− (mod c (bex (mul (bex a) b)))
243+Produces an [atom]() by taking the last `b` blocks of size `a` from `c`.
178244
179−Produces an atom by taking the last `b` blocks of size `a` from `c`.
245+Accepts
246+-------
180247
181−`a` is a block size (see [++bloq]()).
248+`a` is a block size (see [`++bloq`]()).
182249
183−`b` is an [atom]().
250+`b` is an atom.
184251
185252`c` is an [atom]().
186253
254+Produces
255+--------
256+
257+An atom.
258+
259+
260+Source
261+------
262+
263+ ++ end :: tail
264+ ~/ %end
265+ |= [a=bloq b=@ c=@]
266+ (mod c (bex (mul (bex a) b)))
267+
268+Examples
269+--------
270+
187271 ~zod/try=> `@ub`12
188272 0b1100
189273 ~zod/try=> `@ub`(end 0 3 12)
@@ -207,6 +291,25 @@ Produces an atom by taking the last `b` blocks of size `a` from `c`.
207291
208292Fill bloqstream
209293
294+Produces an [atom]() by repeating `c` for `b` blocks of size `a`.
295+
296+Accepts
297+-------
298+
299+`a` is a block size (see [`++bloq`]()).
300+
301+`b` is an atom.
302+
303+`c` is an [atom]().
304+
305+Produces
306+--------
307+
308+An atom.
309+
310+Source
311+------
312+
210313 ++ fil :: fill bloqstream
211314 |= [a=bloq b=@ c=@]
212315 =+ n=0
@@ -216,13 +319,8 @@ Fill bloqstream
216319 (rsh a 1 d)
217320 $(d (add c (lsh a 1 d)), n +(n))
218321
219−Produces an atom by repeating `c` for `b` blocks of size `a`.
220−
221−`a` is a block size (see [++bloq]()).
222−
223−`b` is an [atom]().
224−
225−`c` is an [atom]().
322+Examples
323+--------
226324
227325 ~zod/try=> `@t`(fil 3 5 %a)
228326 'aaaaa'
@@ -239,18 +337,32 @@ Produces an atom by repeating `c` for `b` blocks of size `a`.
239337
240338Left-shift
241339
340+Produces an [atom]() by left-shifting `c` by `b` blocks of size `a`.
341+
342+Accepts
343+-------
344+
345+`a` is a block size (see [`++bloq`]()).
346+
347+`b` is an atom.
348+
349+`c` is an atom.
350+
351+Produces
352+--------
353+
354+An atom.
355+
356+Source
357+------
358+
242359 ++ lsh :: left-shift
243360 ~/ %lsh
244361 |= [a=bloq b=@ c=@]
245362 (mul (bex (mul (bex a) b)) c)
246363
247−Produces an atom by left-shifting `c` by `b` blocks of size `a`.
248−
249−`a` is a block size (see [++bloq]()).
250−
251−`b` is an [atom]().
252−
253−`c` is an [atom]().
364+Examples
365+--------
254366
255367 ~zod/try=> `@ub`1
256368 0b1
@@ -267,10 +379,19 @@ Produces an atom by left-shifting `c` by `b` blocks of size `a`.
267379
268380------------------------------------------------------------------------
269381
270−### `++met`
382+### `++me
271383
272384Measure
273385
386+Computes the number of blocks of size `a` in `b`, producing an [atom]().
387+
388+`a` is a block size (see [`++bloq`]()).
389+
390+`b` is an atom.
391+
392+Source
393+------
394+
274395 ++ met :: measure
275396 ~/ %met
276397 |= [a=bloq b=@]
@@ -280,11 +401,8 @@ Measure
280401 ?: =(0 b) c
281402 $(b (rsh a 1 b), c +(c))
282403
283−Computes the number of blocks of size `a` in `b`, producing an atom.
284−
285−`a` is a block size (see [++bloq]()).
286−
287−`b` is an [atom]().
404+Examples
405+--------
288406
289407 ~zod/try=> (met 0 1)
290408 1
@@ -303,6 +421,23 @@ Computes the number of blocks of size `a` in `b`, producing an atom.
303421
304422Assemble non-zero
305423
424+Concatenates a list of [atom]()s `b` using blocksize `a`, producing an atom.
425+
426+Accepts
427+-------
428+
429+`a` is a block size (see [`++bloq`]()).
430+
431+`b` is a [`++list`]() of [atom]()s.
432+
433+Produces
434+--------
435+
436+An atom.
437+
438+Source
439+------
440+
306441 ++ rap :: assemble nonzero
307442 ~/ %rap
308443 |= [a=bloq b=(list ,@)]
@@ -310,11 +445,8 @@ Assemble non-zero
310445 ?~ b 0
311446 (cat a i.b $(b t.b))
312447
313−Concatenate a list of atoms `b` using blocksize `a`, producing an atom.
314−
315−`a` is a block size (see [++bloq]()).
316−
317−`b` is a [list]() of [atoms]().
448+Examples
449+--------
318450
319451 ~zod/try=> `@ub`(rap 2 (limo [1 2 3 4 ~]))
320452 0b100.0011.0010.0001
@@ -331,6 +463,23 @@ Concatenate a list of atoms `b` using blocksize `a`, producing an atom.
331463
332464Assemble single
333465
466+Produces an [atom]() by assembling a list of atoms `b` using block size `a`.
467+
468+Accepts
469+-------
470+
471+`a` is a block size (see [`++bloq`]()).
472+
473+`b` is a list of atoms.
474+
475+Produces
476+--------
477+
478+An atom.
479+
480+Source
481+------
482+
334483 ++ rep :: assemble single
335484 ~/ %rep
336485 |= [a=bloq b=(list ,@)]
@@ -340,11 +489,8 @@ Assemble single
340489 ?~ b 0
341490 (con (lsh a c (end a 1 i.b)) $(c +(c), b t.b))
342491
343−Produces an atom by assembling a list of atoms `b` using block size `a`.
344−
345−`a` is a block size (see [++bloq]()).
346−
347−`b` is a list of [atoms]().
492+Examples
493+--------
348494
349495 ~zod/try=> `@ub`(rep 2 (limo [1 2 3 4 ~]))
350496 0b100.0011.0010.0001
@@ -367,6 +513,23 @@ Produces an atom by assembling a list of atoms `b` using block size `a`.
367513
368514Disassemble
369515
516+Produces a list of [atom]()s from the bits of `b` using block size `a`.
517+
518+Accepts
519+-------
520+
521+`a` is a block size (see [`++bloq`]()).
522+
523+`b` is an atom.
524+
525+Produces
526+--------
527+
528+A list of atoms.
529+
530+Source
531+------
532+
370533 ++ rip :: disassemble
371534 ~/ %rip
372535 |= [a=bloq b=@]
@@ -374,11 +537,8 @@ Disassemble
374537 ?: =(0 b) ~
375538 [(end a 1 b) $(b (rsh a 1 b))]
376539
377−Produces a list of atoms from the bits of `b` using block size `a`.
378−
379−`a` is a block size (see [++bloq]()).
380−
381−`b` is an [atom]().
540+Examples
541+--------
382542
383543 ~zod/try=> `@ub`155
384544 0b1001.1011
@@ -403,18 +563,32 @@ Produces a list of atoms from the bits of `b` using block size `a`.
403563
404564Right-shift
405565
566+Right-shifts `c` by `b` blocks of size `a`, producing an [atom]().
567+
568+Accepts
569+-------
570+
571+`a` is a block size (see [`++bloq`]()).
572+
573+`b` is an atom.
574+
575+`c` is an atom.
576+
577+Produces
578+--------
579+
580+An atom.
581+
582+Source
583+------
584+
406585 ++ rsh :: right-shift
407586 ~/ %rsh
408587 |= [a=bloq b=@ c=@]
409588 (div c (bex (mul (bex a) b)))
410589
411−Right-shifts `c` by `b` blocks of size `a`, producing an atom.
412−
413−`a` is a block size (see [++bloq]()).
414−
415−`b` is an [atom]().
416−
417−`c` is an [atom]().
590+Examples
591+--------
418592
419593 ~zod/try=> `@ub`145
420594 0b1001.0001
@@ -445,14 +619,29 @@ Right-shifts `c` by `b` blocks of size `a`, producing an atom.
445619
446620Reverse block order
447621
448− ++ swap |=([a=bloq b=@] (rep a (flop (rip a b)))) :: reverse bloq order
449−
450−Switches little ending to big and vice versa: produces an atom by
622+Switches little endian to big and vice versa: produces an [atom]() by
451623reversing the block order of `b` using block size `a`.
452624
453−`a` is a block size (see [++bloq]()).
454625
455−`b` is an [atom]()
626+Accepts
627+-------
628+
629+`a` is a block size (see [`++bloq`]()).
630+
631+`b` is an atom.
632+
633+Produces
634+--------
635+
636+An atom
637+
638+Source
639+------
640+
641+ ++ swap |=([a=bloq b=@] (rep a (flop (rip a b)))) :: reverse bloq order
642+
643+Examples
644+--------
456645
457646 ~zod/try=> `@ub`24
458647 0b1.1000
@@ -474,6 +663,24 @@ section 2cB, bit logic
474663
475664Binary OR
476665
666+Computes the bit-wise logical OR of two [atom]()s, `a` and `b`, producing an
667+atom.
668+
669+Accepts
670+-------
671+
672+`a` is an atom
673+
674+`b` is an atom
675+
676+Produces
677+--------
678+
679+An atom.
680+
681+Source
682+------
683+
477684 ++ con :: binary or
478685 ~/ %con
479686 |= [a=@ b=@]
@@ -491,12 +698,8 @@ Binary OR
491698 ==
492699 ==
493700
494−Computes the bit-wise logical OR of two atoms, `a` and `b`, producing an
495−atom.
496−
497−`a` is an [atom]()
498−
499−`b` is an [atom]()
701+Examples
702+--------
500703
501704 ~zod/try=> (con 0b0 0b1)
502705 1
@@ -517,6 +720,24 @@ atom.
517720
518721Binary AND
519722
723+Computes the bit-wise logical AND of two [atom]()s `a` and `b`, producing an
724+atom.
725+
726+Accepts
727+-------
728+
729+`a` is an atom.
730+
731+`b` is an atom.
732+
733+Produces
734+--------
735+
736+An atom.
737+
738+Source
739+------
740+
520741 ++ dis :: binary and
521742 ~/ %dis
522743 |= [a=@ b=@]
@@ -534,12 +755,8 @@ Binary AND
534755 ==
535756 ==
536757
537−Computes the bit-wise logical AND of two atoms `a` and `b`, producing an
538−atom.
539−
540−`a` is an [atom]()
541−
542−`b` is an [atom]()
758+Examples
759+--------
543760
544761 ~zod/try=> `@ub`9
545762 0b1001
@@ -564,6 +781,23 @@ atom.
564781
565782Binary XOR
566783
784+Produces the bit-wise logical XOR of `a` and `b`, producing an [atom]().
785+
786+Accepts
787+-------
788+
789+`a` is an atom
790+
791+`b` is an atom
792+
793+Produces
794+--------
795+
796+An atom.
797+
798+Source
799+------
800+
567801 ++ mix :: binary xor
568802 ~/ %mix
569803 |= [a=@ b=@]
@@ -578,11 +812,8 @@ Binary XOR
578812 d (add d (lsh 0 c =((end 0 1 a) (end 0 1 b))))
579813 ==
580814
581−Produces the bit-wise logical XOR of `a` and `b`, producing an atom.
582−
583−`a` is an [atom]()
584−
585−`b` is an [atom]()
815+Examples
816+--------
586817
587818 ~zod/try=> `@ub`2
588819 0b10
@@ -603,17 +834,31 @@ Produces the bit-wise logical XOR of `a` and `b`, producing an atom.
603834
604835Binary NOT
605836
606− ++ not |= [a=bloq b=@ c=@] :: binary not (sized)
607− (mix c (dec (bex (mul b (bex a)))))
608−
609837Computes the bit-wise logical NOT of the bottom `b` blocks of size `a`
610838of `c`.
611839
612−`a` is a block size (see [++bloq]()).
840+Accepts
841+-------
842+
843+`a` is a block size (see [`++bloq`]()).
613844
614845`b` is an [atom]().
615846
616−`c` is an [atom]().
847+`c` is an atom.
848+
849+Produces
850+--------
851+
852+An atom.
853+
854+Source
855+------
856+
857+ ++ not |= [a=bloq b=@ c=@] :: binary not (sized)
858+ (mix c (dec (bex (mul b (bex a)))))
859+
860+Examples
861+--------
617862
618863 ~zod/try=> `@ub`24
619864 0b1.1000
@@ -637,6 +882,25 @@ section 2cC, noun orders
637882
638883Alphabetic order
639884
885+Computes whether `a` and `b` are in alphabetical order, producing a
886+boolean.
887+
888+Accepts
889+-------
890+
891+`a` is a [noun]().
892+
893+`b` is a noun.
894+
895+Produces
896+--------
897+
898+A boolean atom.
899+
900+
901+Source
902+------
903+
640904 ++ aor :: alphabetic-order
641905 ~/ %aor
642906 |= [a=* b=*]
@@ -654,12 +918,8 @@ Alphabetic order
654918 $(a (rsh 3 1 a), b (rsh 3 1 b))
655919 (lth c d)
656920
657−Computes whether `a` and `b` are in alphabetical order, producing a
658−loobean.
659−
660−`a` is a [noun]().
661−
662−`b` is a [noun]().
921+Examples
922+--------
663923
664924 ~zod/try=> (aor 'a' 'b')
665925 %.y
@@ -684,6 +944,24 @@ loobean.
684944
685945Numeric order
686946
947+Computes whether `a` and `b` are in ascending numeric order, producing a
948+boolean.
949+
950+Accepts
951+-------
952+
953+`a` is a [noun]().
954+
955+`b` is a noun.
956+
957+Produces
958+--------
959+
960+A boolean atom.
961+
962+Source
963+------
964+
687965 ++ dor :: d-order
688966 ~/ %dor
689967 |= [a=* b=*]
@@ -697,12 +975,8 @@ Numeric order
697975 ?. ?=(@ b) &
698976 (lth a b)
699977
700−Computes whether `a` and `b` are in ascending numeric order, producing a
701−loobean.
702−
703−`a` is a [noun]().
704−
705−`b` is a [noun]().
978+Examples
979+--------
706980
707981 ~zod/try=> (dor 1 2)
708982 %.y
@@ -723,6 +997,23 @@ loobean.
723997
724998Hash order
725999
1000+XX revisit
1001+
1002+Accepts
1003+-------
1004+
1005+`a` is a [noun]().
1006+
1007+`b` is a noun.
1008+
1009+Produces
1010+--------
1011+
1012+A boolean [atom]().
1013+
1014+Source
1015+------
1016+
7261017 ++ gor :: g-order
7271018 ~/ %gor
7281019 |= [a=* b=*]
@@ -732,7 +1023,8 @@ Hash order
7321023 (dor a b)
7331024 (lth c d)
7341025
735−XX revisit
1026+Examples
1027+--------
7361028
7371029 ~zod/try=> (gor 'd' 'c')
7381030 %.y
@@ -762,6 +1054,26 @@ XX revisit
7621054
7631055Hash order
7641056
1057+XX revisit
1058+
1059+Recursive hash comparator gate.
1060+
1061+Accepts
1062+-------
1063+
1064+`a` is a [noun]().
1065+
1066+`b` is a noun.
1067+
1068+Produces
1069+--------
1070+
1071+A boolean [atom]().
1072+
1073+
1074+Source
1075+------
1076+
7651077 ++ hor :: h-order
7661078 ~/ %hor
7671079 |= [a=* b=*]
@@ -774,9 +1086,8 @@ Hash order
7741086 (gor +.a +.b)
7751087 (gor -.a -.b)
7761088
777−XX revisit
778−
779−Recursive hash comparator gate.
1089+Examples
1090+--------
7801091
7811092 ~zod/try=> (hor . 1)
7821093 %.n
@@ -791,6 +1102,23 @@ Recursive hash comparator gate.
7911102
7921103### `++vor`
7931104
1105+Double hash comparator gate.
1106+
1107+XX revisit
1108+
1109+Accepts
1110+-------
1111+
1112+`a` is a [noun]()
1113+
1114+`b` is a noun
1115+
1116+Produces
1117+-------
1118+
1119+Source
1120+------
1121+
7941122 ++ vor :: v-order
7951123 ~/ %vor
7961124 |= [a=* b=*]
@@ -800,9 +1128,8 @@ Recursive hash comparator gate.
8001128 (dor a b)
8011129 (lth c d)
8021130
803−XX revisit
804−
805−Double hash comparator gate.
1131+Examples
1132+--------
8061133
8071134 ~zod/try=> (vor 'f' 'g')
8081135 %.y
@@ -816,13 +1143,28 @@ section 2cD, insecure hashing
8161143
8171144### `++fnv`
8181145
819− ++ fnv |=(a=@ (end 5 1 (mul 16.777.619 a))) :: FNV scrambler
820−
8211146Hashes an atom with the 32-bit FNV non-cryptographic hash algorithm.
8221147Multiplies `a` by the prime number 16,777,619 and then takes the block
823−of size 5 off the product's end, producing atom.
1148+of size 5 off the product's end, producing an [atom]().
8241149
825−`a` is an [atom]().
1150+Accepts
1151+-------
1152+
1153+`a` is an atom.
1154+
1155+Produces
1156+--------
1157+
1158+An atom.
1159+
1160+
1161+Source
1162+------
1163+
1164+ ++ fnv |=(a=@ (end 5 1 (mul 16.777.619 a))) :: FNV scrambler
1165+
1166+Examples
1167+--------
8261168
8271169 ~zod/try=> (fnv 10.000)
8281170 272.465.456
@@ -835,6 +1177,17 @@ of size 5 off the product's end, producing atom.
8351177
8361178### `++mum`
8371179
1180+XX document
1181+
1182+Accepts
1183+-------
1184+
1185+Produces
1186+--------
1187+
1188+Source
1189+------
1190+
8381191 ++ mum :: mug with murmur3
8391192 ~/ %mum
8401193 |= a=*
@@ -876,7 +1229,8 @@ of size 5 off the product's end, producing atom.
8761229 --
8771230 ::
8781231
879−XX document
1232+Examples
1233+--------
8801234
8811235 ~zod/try=> (mum 10.000)
8821236 1.232.632.901
@@ -891,6 +1245,22 @@ XX document
8911245
8921246### `++mug`
8931247
1248+Hashes `a` with the 31-bit nonzero FNV-1a non-cryptographic hash
1249+algorithm, producing an [atom]().
1250+
1251+Accepts
1252+-------
1253+
1254+A is a [noun]().
1255+
1256+Produces
1257+--------
1258+
1259+An atom.
1260+
1261+Source
1262+------
1263+
8941264 ++ mug :: 31bit nonzero FNV1a
8951265 ~/ %mug
8961266 |= a=*
@@ -912,8 +1282,8 @@ XX document
9121282 ^$(b +(b))
9131283 $(c (fnv (mix c (cut 3 [d 1] a))), d +(d))
9141284
915−Hashes `a` with the 31-bit nonzero FNV-1a non-cryptographic hash
916−algorithm, producing an atom.
1285+Examples
1286+--------
9171287
9181288 ~zod/try=> (mug 10.000)
9191289 178.152.889
@@ -931,43 +1301,43 @@ section 2cE, phonetic base
9311301
9321302### `++po`
9331303
934− ++ po
935− ~/ %po
936− =+ :- ^= sis :: prefix syllables
937− 'dozmarbinwansamlitsighidfidlissogdirwacsabwissib\
938− /rigsoldopmodfoglidhopdardorlorhodfolrintogsilmir\
939− /holpaslacrovlivdalsatlibtabhanticpidtorbolfosdot\
940− /losdilforpilramtirwintadbicdifrocwidbisdasmidlop\
941− /rilnardapmolsanlocnovsitnidtipsicropwitnatpanmin\
942− /ritpodmottamtolsavposnapnopsomfinfonbanporworsip\
943− /ronnorbotwicsocwatdolmagpicdavbidbaltimtasmallig\
944− /sivtagpadsaldivdactansidfabtarmonranniswolmispal\
945− /lasdismaprabtobrollatlonnodnavfignomnibpagsopral\
946− /bilhaddocridmocpacravripfaltodtiltinhapmicfanpat\
947− /taclabmogsimsonpinlomrictapfirhasbosbatpochactid\
948− /havsaplindibhosdabbitbarracparloddosbortochilmac\
949− /tomdigfilfasmithobharmighinradmashalraglagfadtop\
950− /mophabnilnosmilfopfamdatnoldinhatnacrisfotribhoc\
951− /nimlarfitwalrapsarnalmoslandondanladdovrivbacpol\
952− /laptalpitnambonrostonfodponsovnocsorlavmatmipfap'
953− ^= dex :: suffix syllables
954− 'zodnecbudwessevpersutletfulpensytdurwepserwylsun\
955− /rypsyxdyrnuphebpeglupdepdysputlughecryttyvsydnex\
956− /lunmeplutseppesdelsulpedtemledtulmetwenbynhexfeb\
957− /pyldulhetmevruttylwydtepbesdexsefwycburderneppur\
958− /rysrebdennutsubpetrulsynregtydsupsemwynrecmegnet\
959− /secmulnymtevwebsummutnyxrextebfushepbenmuswyxsym\
960− /selrucdecwexsyrwetdylmynmesdetbetbeltuxtugmyrpel\
961− /syptermebsetdutdegtexsurfeltudnuxruxrenwytnubmed\
962− /lytdusnebrumtynseglyxpunresredfunrevrefmectedrus\
963− /bexlebduxrynnumpyxrygryxfeptyrtustyclegnemfermer\
964− /tenlusnussyltecmexpubrymtucfyllepdebbermughuttun\
965− /bylsudpemdevlurdefbusbeprunmelpexdytbyttyplevmyl\
966− /wedducfurfexnulluclennerlexrupnedlecrydlydfenwel\
967− /nydhusrelrudneshesfetdesretdunlernyrsebhulryllud\
968− /remlysfynwerrycsugnysnyllyndyndemluxfedsedbecmun\
969− /lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes'
970− |%
1304+++ po
1305+ ~/ %po
1306+ =+ :- ^= sis :: prefix syllables
1307+ 'dozmarbinwansamlitsighidfidlissogdirwacsabwissib\
1308+ /rigsoldopmodfoglidhopdardorlorhodfolrintogsilmir\
1309+ /holpaslacrovlivdalsatlibtabhanticpidtorbolfosdot\
1310+ /losdilforpilramtirwintadbicdifrocwidbisdasmidlop\
1311+ /rilnardapmolsanlocnovsitnidtipsicropwitnatpanmin\
1312+ /ritpodmottamtolsavposnapnopsomfinfonbanporworsip\
1313+ /ronnorbotwicsocwatdolmagpicdavbidbaltimtasmallig\
1314+ /sivtagpadsaldivdactansidfabtarmonranniswolmispal\
1315+ /lasdismaprabtobrollatlonnodnavfignomnibpagsopral\
1316+ /bilhaddocridmocpacravripfaltodtiltinhapmicfanpat\
1317+ /taclabmogsimsonpinlomrictapfirhasbosbatpochactid\
1318+ /havsaplindibhosdabbitbarracparloddosbortochilmac\
1319+ /tomdigfilfasmithobharmighinradmashalraglagfadtop\
1320+ /mophabnilnosmilfopfamdatnoldinhatnacrisfotribhoc\
1321+ /nimlarfitwalrapsarnalmoslandondanladdovrivbacpol\
1322+ /laptalpitnambonrostonfodponsovnocsorlavmatmipfap'
1323+ ^= dex :: suffix syllables
1324+ 'zodnecbudwessevpersutletfulpensytdurwepserwylsun\
1325+ /rypsyxdyrnuphebpeglupdepdysputlughecryttyvsydnex\
1326+ /lunmeplutseppesdelsulpedtemledtulmetwenbynhexfeb\
1327+ /pyldulhetmevruttylwydtepbesdexsefwycburderneppur\
1328+ /rysrebdennutsubpetrulsynregtydsupsemwynrecmegnet\
1329+ /secmulnymtevwebsummutnyxrextebfushepbenmuswyxsym\
1330+ /selrucdecwexsyrwetdylmynmesdetbetbeltuxtugmyrpel\
1331+ /syptermebsetdutdegtexsurfeltudnuxruxrenwytnubmed\
1332+ /lytdusnebrumtynseglyxpunresredfunrevrefmectedrus\
1333+ /bexlebduxrynnumpyxrygryxfeptyrtustyclegnemfermer\
1334+ /tenlusnussyltecmexpubrymtucfyllepdebbermughuttun\
1335+ /bylsudpemdevlurdefbusbeprunmelpexdytbyttyplevmyl\
1336+ /wedducfurfexnulluclennerlexrupnedlecrydlydfenwel\
1337+ /nydhusrelrudneshesfetdesretdunlernyrsebhulryllud\
1338+ /remlysfynwerrycsugnysnyllyndyndemluxfedsedbecmun\
1339+ /lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes'
1340+ |%
9711341
9721342Provides the phonetic syllables and name generators for the Urbit naming
9731343system. The two faces, `sis` and `dex` are available to the arms
@@ -979,15 +1349,29 @@ contained in this section.
9791349
9801350Parse prefix
9811351
1352+Produces the byte of the right-hand syllable `a`.
1353+
1354+Accepts
1355+-------
1356+
1357+`a` is an [atom]().
1358+
1359+Produces
1360+--------
1361+
1362+A [`++unit`]() of an atom.
1363+
1364+Source
1365+------
1366+
9821367 ++ ind ~/ %ind :: parse prefix
9831368 |= a=@
9841369 =+ b=0
9851370 |- ^- (unit ,@)
9861371 ?:(=(256 b) ~ ?:(=(a (tod b)) [~ b] $(b +(b))))
9871372
988−Produces the byte of the right-hand syllable `a`.
989−
990−`a` is an [atom]().
1373+Examples
1374+--------
9911375
9921376 ~zod/try=> (ind:po 'zod')
9931377 [~ 0]
@@ -1002,15 +1386,28 @@ Produces the byte of the right-hand syllable `a`.
10021386
10031387Parse suffix
10041388
1389+Produces the byte of the left-hand phonetic syllable `b`.
1390+
1391+Accepts
1392+-------
1393+
1394+`a` is an [atom]().
1395+
1396+Produces
1397+--------
1398+A [`++unit`]() of an atom.
1399+
1400+Source
1401+------
1402+
10051403 ++ ins ~/ %ins :: parse suffix
10061404 |= a=@
10071405 =+ b=0
10081406 |- ^- (unit ,@)
10091407 ?:(=(256 b) ~ ?:(=(a (tos b)) [~ b] $(b +(b))))
10101408
1011−Produces the byte of the left-hand phonetic syllable `b`.
1012−
1013−`a` is an [atom]().
1409+Examples
1410+--------
10141411
10151412 ~zod/try=> (ins:po 'mar')
10161413 [~ 1]
@@ -1027,13 +1424,28 @@ Produces the byte of the left-hand phonetic syllable `b`.
10271424
10281425Fetch prefix
10291426
1427+Produces the phonetic prefix syllable from index `a` within `dex` as an
1428+[atom]().
1429+
1430+Accepts
1431+-------
1432+
1433+`a` is an atom
1434+
1435+Produces
1436+--------
1437+
1438+An atom.
1439+
1440+
1441+Source
1442+------
1443+
10301444 ++ tod ~/ %tod :: fetch prefix
10311445 |=(a=@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] dex)))
10321446
1033−Produces the phonetic prefix syllable from index `a` within `dex` as an
1034−atom.
1035−
1036−`a` is an [atom]()
1447+Examples
1448+--------
10371449
10381450 ~zod/try=> `@t`(tod:po 1)
10391451 'nec'
@@ -1054,11 +1466,27 @@ atom.
10541466
10551467Fetch suffix
10561468
1469+Produces the phonetic prefix syllable from index `a` within `sis` as an
1470+[atom]().
1471+
1472+Accepts
1473+-------
1474+
1475+`a` is an atom.
1476+
1477+Produces
1478+--------
1479+
1480+An atom.
1481+
1482+Source
1483+------
1484+
10571485 ++ tos ~/ %tos :: fetch suffix
10581486 |=(a=@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] sis)))
10591487
1060−Produces the phonetic prefix syllable from index `a` within `sis` as an
1061−atom.
1488+Examples
1489+--------
10621490
10631491 ~zod/try=> `@t`(tos:po 0)
10641492 'doz'
@@ -1079,17 +1507,33 @@ section 2cF, signed and modular ints
10791507 ++ si !: :: signed integer
10801508 |%
10811509
1082−Container for the signed integer functions.
1510+Container core for the signed integer functions.
10831511
10841512------------------------------------------------------------------------
10851513
10861514### `++abs`
10871515
1088− ++ abs |=(a=@s (add (end 0 1 a) (rsh 0 1 a))) :: absolute value
1516+Absolute value
10891517
10901518Produces the absolute value of a signed integer.
10911519
1092−`a` is a signed integer, `@s`.
1520+Accepts
1521+-------
1522+
1523+`a` is a signed integer, [`@s`]().
1524+
1525+Produces
1526+--------
1527+
1528+An [atom]().
1529+
1530+Source
1531+------
1532+
1533+ ++ abs |=(a=@s (add (end 0 1 a) (rsh 0 1 a))) :: absolute value
1534+
1535+Examples
1536+--------
10931537
10941538 ~zod/try=> (abs:si -2)
10951539 2
@@ -1102,15 +1546,32 @@ Produces the absolute value of a signed integer.
11021546
11031547### `++dif`
11041548
1105− ++ dif |= [a=@s b=@s] :: subtraction
1106− (sum a (new !(syn b) (abs b)))
1549+Difference
11071550
11081551Produces the difference between two signed integers `b` and `c`.
11091552
1110−`a` is a signed integer, `@s`.
1553+Accepts
1554+-------
1555+
1556+`a` is a signed integer, [`@s`]().
11111557
11121558`b` is a signed integer, `@s`.
11131559
1560+Produces
1561+--------
1562+
1563+A [`@s`]().
1564+
1565+
1566+Source
1567+------
1568+
1569+ ++ dif |= [a=@s b=@s] :: subtraction
1570+ (sum a (new !(syn b) (abs b)))
1571+
1572+Examples
1573+--------
1574+
11141575 ~zod/try=> (dif:si --10 -7)
11151576 --17
11161577 ~zod/try=> (dif:si --10 --7)
@@ -1124,15 +1585,31 @@ Produces the difference between two signed integers `b` and `c`.
11241585
11251586### `++dul`
11261587
1127− ++ dul |= [a=@s b=@] :: modulus
1128− =+(c=(old a) ?:(-.c (mod +.c b) (sub b +.c)))
1588+Modulus
11291589
11301590Produces the modulus of two signed integers.
11311591
1592+Accepts
1593+-------
1594+
11321595`a` is a signed integer, `@s`.
11331596
11341597`b` is an [atom]().
11351598
1599+Produces
1600+--------
1601+
1602+An atom.
1603+
1604+Source
1605+------
1606+
1607+ ++ dul |= [a=@s b=@] :: modulus
1608+ =+(c=(old a) ?:(-.c (mod +.c b) (sub b +.c)))
1609+
1610+Examples
1611+--------
1612+
11361613 ~zod/try=> (dul:si --9 3)
11371614 0
11381615 ~zod/try=> (dul:si --9 4)
@@ -1148,15 +1625,31 @@ Produces the modulus of two signed integers.
11481625
11491626### `++fra`
11501627
1151− ++ fra |= [a=@s b=@s] :: divide
1152− (new =(0 (mix (syn a) (syn b))) (div (abs a) (abs b)))
1628+Divide
11531629
11541630Produces the quotient of two signed integers.
11551631
1156−`a` is a signed integer, `@s`.
1632+Accepts
1633+-------
1634+
1635+`a` is a signed integer, [`@s`].
11571636
11581637`b` is a signed integer, `@s`.
11591638
1639+Produces
1640+--------
1641+
1642+An [atom]().
1643+
1644+Source
1645+------
1646+
1647+ ++ fra |= [a=@s b=@s] :: divide
1648+ (new =(0 (mix (syn a) (syn b))) (div (abs a) (abs b)))
1649+
1650+Examples
1651+--------
1652+
11601653 ~zod/try=> (fra:si --10 -2)
11611654 -5
11621655 ~zod/try=> (fra:si -20 -5)
@@ -1166,14 +1659,30 @@ Produces the quotient of two signed integers.
11661659
11671660### `++new`
11681661
1169− ++ new |= [a=? b=@] :: [sign value] to @s
1170− `@s`?:(a (mul 2 b) ?:(=(0 b) 0 +((mul 2 (dec b)))))
1662+Signed integer
11711663
1172−Produces a signed integer from a loobean sign value `a` and an atom `b`.
1664+Produces a signed integer from a loobean sign value `a` and an [atom]() `b`.
1665+
1666+Accepts
1667+-------
11731668
11741669`a` is a loobean.
11751670
1176−`b` is an [atom]().
1671+`b` is an atom.
1672+
1673+Produces
1674+--------
1675+
1676+A [`@s`]()
1677+
1678+Source
1679+------
1680+
1681+ ++ new |= [a=? b=@] :: [sign value] to @s
1682+ `@s`?:(a (mul 2 b) ?:(=(0 b) 0 +((mul 2 (dec b)))))
1683+
1684+Examples
1685+--------
11771686
11781687 ~zod/try=> (new:si [& 10])
11791688 --10
@@ -1186,11 +1695,27 @@ Produces a signed integer from a loobean sign value `a` and an atom `b`.
11861695
11871696### `++old`
11881697
1189− ++ old |=(a=@s [(syn a) (abs a)]) :: [sign value]
1698+[sign value]
11901699
11911700Produces the cell `[sign value]` representations of a signed integer.
11921701
1193−`a` is a signed integer, `@s`.
1702+Accepts
1703+-------
1704+
1705+`a` is a [`@s`]().
1706+
1707+Produces
1708+--------
1709+
1710+A cell of a boolean and an [atom]().
1711+
1712+Source
1713+------
1714+
1715+ ++ old |=(a=@s [(syn a) (abs a)]) :: [sign value]
1716+
1717+Examples
1718+--------
11941719
11951720 ~zod/try=> (old:si 7)
11961721 ! type-fail
@@ -1208,14 +1733,30 @@ Produces the cell `[sign value]` representations of a signed integer.
12081733
12091734### `++pro`
12101735
1211− ++ pro |= [a=@s b=@s] :: multiplication
1212− (new =(0 (mix (syn a) (syn b))) (mul (abs a) (abs b)))
1736+Multiply
12131737
12141738Produces the product of two signed integers.
12151739
1216−`a` is a signed integer, `@s`.
1740+Accepts
1741+-------
12171742
1218−`b` is a signed integer, `@s`.
1743+`a` is a [`@s`]().
1744+
1745+`b` is a `@s`.
1746+
1747+Produces
1748+--------
1749+
1750+A `@s`.
1751+
1752+Source
1753+------
1754+
1755+ ++ pro |= [a=@s b=@s] :: multiplication
1756+ (new =(0 (mix (syn a) (syn b))) (mul (abs a) (abs b)))
1757+
1758+Examples
1759+--------
12191760
12201761 ~zod/try=> (pro:si -4 --2)
12211762 -8
@@ -1230,13 +1771,29 @@ Produces the product of two signed integers.
12301771
12311772### `++rem`
12321773
1233− ++ rem |=([a=@s b=@s] (dif a (pro b (fra a b)))) :: remainder
1774+Remainder
12341775
12351776Produces the remainder from a division of two signed integers.
12361777
1237−`a` is a signed integer, `@s`.
1778+Accepts
1779+-------
12381780
1239−`b` is a signed integer, `@s`.
1781+`a` is a [`@s`]().
1782+
1783+`b` is a `@s`.
1784+
1785+Produces
1786+--------
1787+
1788+A `@sd`.
1789+
1790+Source
1791+------
1792+
1793+ ++ rem |=([a=@s b=@s] (dif a (pro b (fra a b)))) :: remainder
1794+
1795+Examples
1796+--------
12401797
12411798 ~zod/try=> (rem:si -10 -4)
12421799 -2
@@ -1253,6 +1810,25 @@ Produces the remainder from a division of two signed integers.
12531810
12541811### `++sum`
12551812
1813+Add
1814+
1815+Sum two signed integers.
1816+
1817+Accepts
1818+-------
1819+
1820+`b` is a [`@s`]().
1821+
1822+`c` is a signed integer `@s`.
1823+
1824+Produces
1825+--------
1826+
1827+A `@s`.
1828+
1829+Source
1830+------
1831+
12561832 ++ sum |= [a=@s b=@s] :: addition
12571833 ~| %si-sum
12581834 =+ [c=(old a) d=(old b)]
@@ -1268,11 +1844,8 @@ Produces the remainder from a division of two signed integers.
12681844 (new & (sub +.d +.c))
12691845 (new | (add +.c +.d))
12701846
1271−Sum two signed integers.
1272−
1273−`b` is a signed integer, `@s`.
1274−
1275−`c` is a signed integer, `@s`.
1847+Examples
1848+--------
12761849
12771850 ~zod/try=> (sum:si --10 --10)
12781851 --20
@@ -1287,14 +1860,30 @@ Sum two signed integers.
12871860
12881861### `++sun`
12891862
1290− ++ sun |=(a=@u (mul 2 a)) :: @u to @s
1863+Signed from unsigned
12911864
12921865Produces a signed integer from an unsigned integer.
12931866
1294−Note that the result must be manually cast to some @s odor to be
1867+Note that the result must be manually cast to some [`@s`]() odor to be
12951868inferred as an unsigned integer in the type system.
12961869
1297−`a` is an unsigned integer, `@u`.
1870+Accepts
1871+-------
1872+
1873+`a` is a [`@u`]().
1874+
1875+Produces
1876+--------
1877+
1878+A [`@s`]().
1879+
1880+Source
1881+------
1882+
1883+ ++ sun |=(a=@u (mul 2 a)) :: @u to @s
1884+
1885+Examples
1886+--------
12981887
12991888 ~zod/try=> `@s`10
13001889 --5
@@ -1311,11 +1900,27 @@ inferred as an unsigned integer in the type system.
13111900
13121901### `++syn`
13131902
1314− ++ syn |=(a=@s =(0 (end 0 1 a))) :: sign test
1903+Sign
13151904
1316−Produce the sign of a signed integer, `&` being posiitve, `|` negative.
1905+Produce the sign of a signed integer, where `&` is posiitve, and `|` is negative.
13171906
1318−`a` is a signed integer, `@s`.
1907+Accepts
1908+-------
1909+
1910+`a` is a [`@s`]().
1911+
1912+Produces
1913+--------
1914+
1915+A boolean.
1916+
1917+Source
1918+------
1919+
1920+ ++ syn |=(a=@s =(0 (end 0 1 a))) :: sign test
1921+
1922+Examples
1923+--------
13191924
13201925 ~zod/try=> (syn:si -2)
13211926 %.n
@@ -1328,6 +1933,25 @@ Produce the sign of a signed integer, `&` being posiitve, `|` negative.
13281933
13291934### `++cmp`
13301935
1936+Compare
1937+
1938+Compare two signed integers.
1939+
1940+Accepts
1941+-------
1942+
1943+`b` is a [`@s`]().
1944+
1945+`c` is a `@s`.
1946+
1947+Produces
1948+--------
1949+
1950+A `@s`.
1951+
1952+Source
1953+------
1954+
13311955 ++ cmp |= [a=@s b=@s] :: compare
13321956 ^- @s
13331957 ?: =(a b)
@@ -1344,11 +1968,8 @@ Produce the sign of a signed integer, `&` being posiitve, `|` negative.
13441968 -1
13451969 --1
13461970
1347−Compare two signed integers.
1348−
1349−`b` is a signed integer, `@s`.
1350−
1351−`c` is a signed integer, `@s`.
1971+Examples
1972+--------
13521973
13531974 ~zod/try=> (cmp:si --10 --10)
13541975 --0
@@ -1359,18 +1980,49 @@ Compare two signed integers.
13591980 ~zod/try=> (cmp:si -10 --7)
13601981 -1
13611982
1362−------------------------------------------------------------------------
13631983
1364−### `++dif`
1984+### `++fe` :: modulo bloq
13651985
1366− ++ dif |=([b=@ c=@] (sit (sub (add out (sit b)) (sit c))))
1986+Modulo bloq
1987+
1988+Core containing XX
1989+
1990+Accepts
1991+-------
1992+
1993+`a` is a [`++bloq`]().
1994+
1995+Source
1996+------
1997+
1998+ |_ a=bloq
1999+
2000+### `++dif`
13672001
1368−Produces the difference between two atoms in the modular basis
2002+Produces the difference between two [atom]()s in the modular basis
13692003representation.
13702004
1371−`b` is an [atom]().
2005+Accepts
2006+-------
13722007
1373−`c` is an [atom]().
2008+`a` is a [`++bloq`]().
2009+
2010+`b` is an atom.
2011+
2012+`c` is an atom.
2013+
2014+Produces
2015+--------
2016+
2017+A [`@s`]()
2018+
2019+Source
2020+------
2021+
2022+ ++ dif |=([b=@ c=@] (sit (sub (add out (sit b)) (sit c))))
2023+
2024+Examples
2025+--------
13742026
13752027 ~zod/try=> (~(dif fe 3) 63 64)
13762028 255
@@ -1393,11 +2045,28 @@ representation.
13932045
13942046### `++inv`
13952047
1396− ++ inv |=(b=@ (sub (dec out) (sit b)))
2048+Invert mod field
13972049
13982050Inverts the order of the modular field.
13992051
1400−`b` is an [atom]().
2052+Accepts
2053+-------
2054+
2055+`b` is a [`++bloq`]().
2056+
2057+Produces
2058+--------
2059+
2060+An atom.
2061+
2062+
2063+Source
2064+------
2065+
2066+ ++ inv |=(b=@ (sub (dec out) (sit b)))
2067+
2068+Examples
2069+--------
14012070
14022071 ~zod/try=> (~(inv fe 3) 255)
14032072 0
@@ -1416,18 +2085,34 @@ Inverts the order of the modular field.
14162085
14172086### `++net`
14182087
1419− ++ net |= b=@ ^- @
1420− => .(b (sit b))
1421− ?: (lte a 3)
2088+Reverse bytes
2089+
2090+Revereses bytes within block.
2091+
2092+Accepts
2093+-------
2094+
2095+`b` is a [`++bloq`]().
2096+
2097+Produces
2098+--------
2099+
2100+An atom.=
2101+
2102+Source
2103+------
2104+
2105+ ++ net |= b=@ ^- @
2106+ => .(b (sit b))
2107+ ?: (lte a 3)
14222108 b
14232109 =+ c=(dec a)
14242110 %+ con
14252111 (lsh c 1 $(a c, b (cut c [0 1] b)))
14262112 $(a c, b (cut c [1 1] b))
14272113
1428−Reverse bytes within block.
1429−
1430−`b` is an [atom]().
2114+Examples
2115+--------
14312116
14322117 ~zod/try=> (~(net fe 3) 64)
14332118 64
@@ -1480,10 +2165,28 @@ Reverse bytes within block.
14802165
14812166### `++out`
14822167
1483− ++ out (bex (bex a))
2168+Max integer value
14842169
14852170The maximum integer value that the current block can store.
14862171
2172+Accepts
2173+-------
2174+
2175+A [`++bloq`]().
2176+
2177+Produces
2178+--------
2179+
2180+An [atom]().
2181+
2182+Source
2183+------
2184+
2185+ ++ out (bex (bex a))
2186+
2187+Examples
2188+--------
2189+
14872190 ~zod/try=> ~(out fe 0)
14882191 2
14892192 ~zod/try=> ~(out fe 1)
@@ -1507,19 +2210,37 @@ The maximum integer value that the current block can store.
15072210
15082211### `++rol`
15092212
2213+Roll left
2214+
2215+Roll `d` to the left by `c` `b`-sized blocks.
2216+
2217+Accepts
2218+-------
2219+
2220+`a` is a [`++bloq`]().
2221+
2222+`b` is a `++bloq`.
2223+
2224+`c` is an atom.
2225+
2226+`d` is an atom.
2227+
2228+Produces
2229+--------
2230+
2231+An atom.
2232+
2233+Source
2234+------
2235+
15102236 ++ rol |= [b=bloq c=@ d=@] ^- @ :: roll left
15112237 =+ e=(sit d)
15122238 =+ f=(bex (sub a b))
15132239 =+ g=(mod c f)
15142240 (sit (con (lsh b g e) (rsh b (sub f g) e)))
15152241
1516−Roll `d` to the left by `c` `b`-sized blocks.
1517−
1518−`b` is a block size (see [++bloq]()).
1519−
1520−`c` is an [atom]().
1521−
1522−`d` is an [atom]().
2242+Examples
2243+--------
15232244
15242245 ~zod/try=> `@ux`(~(rol fe 6) 4 3 0xabac.dedf.1213)
15252246 0x1213.0000.abac.dedf
@@ -1536,19 +2257,37 @@ Roll `d` to the left by `c` `b`-sized blocks.
15362257
15372258### `++ror`
15382259
1539− ++ ror |= [b=bloq c=@ d=@] ^- @ :: roll right
1540− =+ e=(sit d)
1541− =+ f=(bex (sub a b))
1542− =+ g=(mod c f)
1543− (sit (con (rsh b g e) (lsh b (sub f g) e)))
2260+Roll right
15442261
15452262Roll `d` to the right by `c` `b`-sized blocks.
15462263
1547−`b` is a block size (see [++bloq]()).
2264+Accepts
2265+-------
2266+
2267+`a` is a [`++bloq`]().
2268+
2269+`b` is a `++bloq`.
15482270
15492271`c` is an [atom]().
15502272
1551−`d` is an [atom]().
2273+`d` is an atom.
2274+
2275+Produces
2276+--------
2277+
2278+An atom.
2279+
2280+Source
2281+------
2282+
2283+ ++ ror |= [b=bloq c=@ d=@] ^- @ :: roll right
2284+ =+ e=(sit d)
2285+ =+ f=(bex (sub a b))
2286+ =+ g=(mod c f)
2287+ (sit (con (rsh b g e) (lsh b (sub f g) e)))
2288+
2289+Examples
2290+--------
15522291
15532292 ~zod/try=> `@ux`(~(ror fe 6) 4 1 0xabac.dedf.1213)
15542293 0x1213.0000.abac.dedf
@@ -1567,13 +2306,31 @@ Roll `d` to the right by `c` `b`-sized blocks.
15672306
15682307### `++sum`
15692308
1570− ++ sum |=([b=@ c=@] (sit (add b c))) :: wrapping add
2309+Sum
15712310
15722311Sum two numbers in this modular field.
15732312
2313+Accepts
2314+-------
2315+
2316+`a` is a [`++bloq`]().
2317+
15742318`b` is an [atom]().
15752319
1576−`c` is an [atom]().
2320+`c` is an atom.
2321+
2322+Produces
2323+--------
2324+
2325+An atom.
2326+
2327+Source
2328+------
2329+
2330+ ++ sum |=([b=@ c=@] (sit (add b c))) :: wrapping add
2331+
2332+Examples
2333+--------
15772334
15782335 ~zod/try=> (~(sum fe 3) 10 250)
15792336 4
@@ -1590,15 +2347,31 @@ Sum two numbers in this modular field.
15902347 ~zod/try=> (~(sum fe 4) 10.000 100.000)
15912348 44.464
15922349
1593−------------------------------------------------------------------------
1594−
15952350### `++sit`
15962351
1597− ++ sit |=(b=@ (end a 1 b)) :: enforce modulo
2352+Atom in mod block representation
15982353
1599−Produce an atom in the current modular block representation.
2354+Produce an [atom]() in the current modular block representation.
16002355
1601−`b` is an [atom]().
2356+Accepts
2357+-------
2358+
2359+`a` is a [`++bloq`]().
2360+
2361+`b` is an atom.
2362+
2363+Produces
2364+--------
2365+
2366+An atom.
2367+
2368+Source
2369+------
2370+
2371+ ++ sit |=(b=@ (end a 1 b)) :: enforce modulo
2372+
2373+Examples
2374+--------
16022375
16032376 ~zod/try=> (~(sit fe 3) 255)
16042377 255
@@ -1641,6 +2414,22 @@ format. We use this for many of our examples.
16412414
16422415### `++year`
16432416
2417+Accept a parsed date of form `[[a=? y=@ud] m=@ud t=tarp]` and produce
2418+its `@d`representation.
2419+
2420+Accepts
2421+-------
2422+
2423+`det` is a [`++date`]()
2424+
2425+Produces
2426+--------
2427+
2428+A [`@d`]().
2429+
2430+Source
2431+------
2432+
16442433 ++ year :: date to @d
16452434 |= det=date
16462435 ^- @d
@@ -1651,10 +2440,8 @@ format. We use this for many of our examples.
16512440 =+ day=(yawn yer m.det d.t.det)
16522441 (yule day h.t.det m.t.det s.t.det f.t.det)
16532442
1654−Accept a parsed date of form `[[a=? y=@ud] m=@ud t=tarp]` and produce
1655−its `@d`representation.
1656−
1657−`det` is a [`++date`]()
2443+Examples
2444+--------
16582445
16592446 ~zod/try=> (year [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=4 s=57 f=~[0xd940]]])
16602447 0x8000000d227df4e9d940000000000000
@@ -1663,6 +2450,21 @@ its `@d`representation.
16632450
16642451### `++yore`
16652452
2453+Produces a `++date` from a `@d`
2454+
2455+Accepts
2456+-------
2457+
2458+`now` is a `@d`.
2459+
2460+Produces
2461+--------
2462+
2463+A [`++date`]().
2464+
2465+Source
2466+------
2467+
16662468 ++ yore :: @d to date
16672469 |= now=@d
16682470 ^- date
@@ -1673,19 +2475,23 @@ its `@d`representation.
16732475 [a=| y=+((sub 292.277.024.400 y.ger))]
16742476 [m.ger d.ger h.rip m.rip s.rip f.rip]
16752477
1676−Produces a `++date` from a `@d`
1677−
1678−`now` is a `@d`.
2478+Examples
2479+--------
16792480
16802481 ~zod/try=> (yore -<-)
16812482 [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=17 s=1 f=~[0x700d]]]
16822483 ~zod/try=> (yore -<-)
16832484 [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=28 s=53 f=~[0x7b82]]]
16842485
1685−------------------------------------------------------------------------
1686−
16872486### `++yell`
16882487
2488+Produce a parsed daily time format from an atomic date.
2489+
2490+`now` is a `@d`.
2491+
2492+Source
2493+------
2494+
16892495 ++ yell :: tarp from @d
16902496 |= now=@d
16912497 ^- tarp
@@ -1705,9 +2511,8 @@ Produces a `++date` from a `@d`
17052511 => .(sec (mod sec mit:yo))
17062512 [day hor mit sec fan]
17072513
1708−Produce a parsed daily time format from an atomic date.
1709−
1710−`now` is a `@d`.
2514+Examples
2515+--------
17112516
17122517 ~zod/try=> (yell ~2014.3.20..05.42.53..7456)
17132518 [d=106.751.991.820.094 h=5 m=42 s=53 f=~[0x7456]]
@@ -1720,6 +2525,24 @@ Produce a parsed daily time format from an atomic date.
17202525
17212526### `++yule`
17222527
2528+Daily time to time atom
2529+
2530+Accept a [`++tarp`](/doc/hoon/library/1#++tarp), a parsed daily time, and produces a time atom,
2531+`@d`.
2532+
2533+Accepts
2534+-------
2535+
2536+`rip` is a [`++tarp`](/doc/hoon/library/1#++tarp).
2537+
2538+Produces
2539+--------
2540+
2541+A [`@d`]().
2542+
2543+Source
2544+------
2545+
17232546 ++ yule :: time atom
17242547 |= rip=tarp
17252548 ^- @d
@@ -1737,10 +2560,8 @@ Produce a parsed daily time format from an atomic date.
17372560 (add (lsh 4 muc i.f.rip) $(f.rip t.f.rip))
17382561 (con (lsh 6 1 sec) fac)
17392562
1740−Accept a [`++tarp`](/doc/hoon/library/1#++tarp), a parsed daily time, and produces a time atom,
1741−`@d`.
1742−
1743−`rip` is a [`++tarp`](/doc/hoon/library/1#++tarp).
2563+Examples
2564+--------
17442565
17452566 ~zod/try=> =murica (yell ~1776.7.4)
17462567 ~zod/try=> murica
@@ -1760,6 +2581,23 @@ Accept a [`++tarp`](/doc/hoon/library/1#++tarp), a parsed daily time, and produc
17602581
17612582### `++yall`
17622583
2584+Time since beginning of time
2585+
2586+Produce the date tuple of `[y=@ud m=@ud d=@ud]` of the year, month, and
2587+day from a number of days from the beginning of time.
2588+
2589+Accepts
2590+-------
2591+
2592+`day` is a [`@ud`]()
2593+
2594+Produces
2595+--------
2596+
2597+
2598+Source
2599+------
2600+
17632601 ++ yall :: day # to day of year
17642602 |= day=@ud
17652603 ^- [y=@ud m=@ud d=@ud]
@@ -1784,10 +2622,8 @@ Accept a [`++tarp`](/doc/hoon/library/1#++tarp), a parsed daily time, and produc
17842622 [yer +(mot) +(day)]
17852623 $(mot +(mot), day (sub day zis))
17862624
1787−Produce the date tuple of `[y=@ud m=@ud d=@ud]` of the year, month, and
1788−day from a number of days from the beginning of time.
1789−
1790−`day` is an unsigned decimal, `@ud`.
2625+Examples
2626+--------
17912627
17922628 ~zod/try=> (yall 198)
17932629 [y=0 m=7 d=17]
@@ -1800,6 +2636,28 @@ day from a number of days from the beginning of time.
18002636
18012637### `++yawn`
18022638
2639+Days since beginning of time
2640+
2641+Inverse of `yall`, computes number of days A.D. from y/m/d date as the
2642+tuple `[yer=@ud mot=@ud day=@ud]`.
2643+
2644+Accepts
2645+-------
2646+
2647+`yer` is an unsigned decimal, `@ud`.
2648+
2649+`mon` is an unsigned decimal, `@ud`.
2650+
2651+`day` is an unsigned decimal, `@ud`.
2652+
2653+Produces
2654+--------
2655+
2656+A [`@ud`]().
2657+
2658+Source
2659+------
2660+
18032661 ++ yawn :: days since Jesus
18042662 |= [yer=@ud mot=@ud day=@ud]
18052663 ^- @ud
@@ -1825,14 +2683,8 @@ day from a number of days from the beginning of time.
18252683 $(yer nec, day (add day ?:((yelp nec) 36.525 36.524)))
18262684 (add day (mul (div yer 400) (add 1 (mul 4 36.524))))
18272685
1828−Inverse of `yall`, computes number of days A.D. from y/m/d date as the
1829−tuple `[yer=@ud mot=@ud day=@ud]`.
1830−
1831−`yer` is an unsigned decimal, `@ud`.
1832−
1833−`mon` is an unsigned decimal, `@ud`.
1834−
1835−`day` is an unsigned decimal, `@ud`.
2686+Examples
2687+--------
18362688
18372689 ~zod/try=> (yawn 2.014 8 4)
18382690 735.814
@@ -1845,15 +2697,31 @@ tuple `[yer=@ud mot=@ud day=@ud]`.
18452697
18462698### `++yelp`
18472699
1848− ++ yelp :: leap year
1849− |= yer=@ud ^- ?
1850− &(=(0 (mod yer 4)) |(!=(0 (mod yer 100)) =(0 (mod yer 400))))
2700+Leap-week?
18512701
18522702Determines whether a year contains an ISO 8601 leap week. Produces a
18532703loobean.
18542704
2705+Accepts
2706+-------
2707+
18552708`yer` is an unsigned decimal, `@ud`.
18562709
2710+Produces
2711+--------
2712+
2713+A boolean.
2714+
2715+Source
2716+------
2717+
2718+ ++ yelp :: leap year
2719+ |= yer=@ud ^- ?
2720+ &(=(0 (mod yer 4)) |(!=(0 (mod yer 100)) =(0 (mod yer 400))))
2721+
2722+Examples
2723+--------
2724+
18572725 ~zod/try=> (yelp 2.014)
18582726 %.n
18592727 ~zod/try=> (yelp 2.008)
@@ -1867,19 +2735,29 @@ loobean.
18672735
18682736### `++yo`
18692737
1870− ++ yo :: time constants
2738+ ++ yo :: time constants core
18712739
1872−
18732740Useful constants for interacting with earth time.
18742741
18752742### `++cet`
18762743
1877− |% ++ cet 36.524 :: (add 24 (mul 100 365))
1878−
18792744Days in a century. Derived by multiplying the number of days in a year
18802745(365) by the number of years in a century (100), then adding the number
18812746days from leap years in a century (24).
18822747
2748+Produces
2749+--------
2750+
2751+An [atom]().
2752+
2753+Source
2754+------
2755+
2756+ |% ++ cet 36.524 :: (add 24 (mul 100 365))
2757+
2758+Examples
2759+--------
2760+
18832761 ~zod/try=> cet:yo
18842762 36.524
18852763 ~zod/try=> (add 365 cet:yo)
@@ -1891,9 +2769,20 @@ days from leap years in a century (24).
18912769
18922770### `++day`
18932771
2772+Number of seconds in a day.
2773+
2774+Produces
2775+--------
2776+
2777+An [atom]().
2778+
2779+Source
2780+------
2781+
18942782 ++ day 86.400 :: (mul 24 hor)
18952783
1896−Number of seconds in a day.
2784+Examples
2785+--------
18972786
18982787 ~zod/try=> day:yo
18992788 86.400
@@ -1904,19 +2793,44 @@ Number of seconds in a day.
19042793
19052794### `++era`
19062795
2796+XX Revisit
2797+
2798+Produces
2799+--------
2800+
2801+An [atom]().
2802+
2803+Source
2804+------
2805+
19072806 ++ era 146.097 :: (add 1 (mul 4 cet))
19082807
1909−XX Revisit
2808+Examples
2809+--------
2810+
19102811
19112812------------------------------------------------------------------------
19122813
19132814### `++hor`
19142815
1915− ++ hor 3.600 :: (mul 60 mit)
2816+Seconds in hour
19162817
19172818The number of seconds in an hour. Derived by multiplying the number of
19182819seconds in a minute by the minutes in an hour.
19192820
2821+Produces
2822+--------
2823+
2824+An [atom]().
2825+
2826+Source
2827+------
2828+
2829+ ++ hor 3.600 :: (mul 60 mit)
2830+
2831+Examples
2832+--------
2833+
19202834 ~zod/try=> hor:yo
19212835 3.600
19222836 ~zod/try=> (div hor:yo 60)
@@ -1926,9 +2840,20 @@ seconds in a minute by the minutes in an hour.
19262840
19272841### `++jes`
19282842
2843+XX Revisit
2844+
2845+Produces
2846+--------
2847+
2848+An atom.
2849+
2850+Source
2851+------
2852+
19292853 ++ jes 106.751.991.084.417 :: (mul 730.692.561 era)
19302854
1931−XX Revisit
2855+Examples
2856+--------
19322857
19332858 ~zod/try=> jes:yo
19342859 106.751.991.084.417
@@ -1937,10 +2862,23 @@ XX Revisit
19372862
19382863### `++mit`
19392864
1940− ++ mit 60
2865+Seconds in minute
19412866
19422867The number of seconds in a minute.
19432868
2869+Produces
2870+--------
2871+
2872+An [atom]().
2873+
2874+Source
2875+------
2876+
2877+ ++ mit 60
2878+
2879+Examples
2880+--------
2881+
19442882 ~zod/try=> mit:yo
19452883 60
19462884
@@ -1948,12 +2886,25 @@ The number of seconds in a minute.
19482886
19492887### `++moh`
19502888
1951− ++ moh `(list ,@ud)`[31 28 31 30 31 30 31 31 30 31 30 31 ~]
2889+Days in month
19522890
19532891The days in each month of the Gregorian common year. A list of unsigned
19542892decimal atoms (Either 28, 30, or 31) denoting the number of days in the
19552893month at the year at that index.
19562894
2895+Produces
2896+--------
2897+
2898+A [`++list`]() of [`@ud`]()
2899+
2900+Source
2901+------
2902+
2903+ ++ moh `(list ,@ud)`[31 28 31 30 31 30 31 31 30 31 30 31 ~]
2904+
2905+Examples
2906+--------
2907+
19572908 ~zod/try=> moh:yo
19582909 ~[31 28 31 30 31 30 31 31 30 31 30 31]
19592910 ~zod/try=> (snag 4 moh:yo)
@@ -1963,12 +2914,25 @@ month at the year at that index.
19632914
19642915### `++moy`
19652916
1966− ++ moy `(list ,@ud)`[31 29 31 30 31 30 31 31 30 31 30 31 ~]
2917+Moh with leapyear
19672918
19682919The days in each month of the Gregorian leap-year. A list of unsigned
19692920decimal atoms (Either 29,30, or 31) denoting the number of days in the
19702921month at the leap-year at that index.
19712922
2923+Examples
2924+--------
2925+
2926+A [`++list`]() of [`@ud`]()
2927+
2928+Source
2929+------
2930+
2931+ ++ moy `(list ,@ud)`[31 29 31 30 31 30 31 31 30 31 30 31 ~]
2932+
2933+Examples
2934+--------
2935+
19722936 ~zod/try=> moy:yo
19732937 ~[31 29 31 30 31 30 31 31 30 31 30 31]
19742938 ~zod/try=> (snag 1 moy:yo)
@@ -1978,11 +2942,24 @@ month at the leap-year at that index.
19782942
19792943### `++qad`
19802944
1981− ++ qad 126.144.001 :: (add 1 (mul 4 yer))
2945+Seconds in 4 years
19822946
19832947The number of seconds in four years. Derived by adding one second to the
19842948number of seconds in four years.
19852949
2950+Produces
2951+--------
2952+
2953+An [atom]().
2954+
2955+Source
2956+------
2957+
2958+ ++ qad 126.144.001 :: (add 1 (mul 4 yer))
2959+
2960+Examples
2961+--------
2962+
19862963 ~zod/try=> qad:yo
19872964 126.144.001
19882965
@@ -1990,11 +2967,24 @@ number of seconds in four years.
19902967
19912968### `++yer`
19922969
1993− ++ yer 31.536.000 :: (mul 365 day)
2970+Seconds in year
19942971
19952972The number of seconds in a year. Derived by multiplying the number of
19962973seconds in a day by 365.
19972974
2975+Produces
2976+--------
2977+
2978+An [atom]().
2979+
2980+Source
2981+------
2982+
2983+ ++ yer 31.536.000 :: (mul 365 day)
2984+
2985+Examples
2986+--------
2987+
19982988 ~zod/try=> yer:yo
19992989 31.536.000
20002990
@@ -2005,16 +2995,30 @@ section 2cI, almost macros
20052995
20062996### `++cury`
20072997
2998+Curry a gate, binding the head of its sample
2999+
3000+Accepts
3001+-------
3002+
3003+`a` is a [gate]().
3004+
3005+`b` is a [noun]().
3006+
3007+Produces
3008+--------
3009+
3010+A [gate]().
3011+
3012+Source
3013+------
3014+
20083015 ++ cury
20093016 |* [a=_|=(^ _*) b=*]
20103017 |* c=_+<+.a
20113018 (a b c)
20123019
2013−Curry a gate, binding the head of its sample
2014−
2015−`a` is a [gate]().
2016−
2017−`b` is a noun.
3020+Examples
3021+--------
20183022
20193023 ~zod/try=> =mol (cury add 2)
20203024 ~zod/try=> (mol 4)
@@ -2026,16 +3030,31 @@ Curry a gate, binding the head of its sample
20263030
20273031### `++curr`
20283032
3033+Right curry
3034+
3035+Right curry a gate, binding the tail of its sample
3036+
3037+Accepts
3038+-------
3039+
3040+`a` is a [gate]().
3041+
3042+`c` is a [noun]().
3043+
3044+Produces
3045+--------
3046+
3047+
3048+Source
3049+------
3050+
20293051 ++ curr
20303052 |* [a=_|=(^ _*) c=*]
20313053 |* b=_+<+.a
20323054 (a b c)
20333055
2034−Right curry a gate, binding the tail of its sample
2035−
2036−`a` is a gate.
2037−
2038−`c` is a noun.
3056+Examples
3057+--------
20393058
20403059 ~zod/try=> =tep (curr scan sym)
20413060 ~zod/try=> `@t`(tep "asd")
@@ -2046,15 +3065,20 @@ Right curry a gate, binding the tail of its sample
20463065------------------------------------------------------------------------
20473066
20483067### `++cork`
2049−
2050− ++ cork |*([a=_,* b=gate] (corl b a)) :: compose forward
2051−
20523068Build `f` such that `(f x) .= (b (a x))`.
20533069
20543070`a` is a noun.
20553071
20563072`b` is a gate.
20573073
3074+Source
3075+------
3076+
3077+ ++ cork |*([a=_,* b=gate] (corl b a)) :: compose forward
3078+
3079+Examples
3080+--------
3081+
20583082 ~zod/try=> (:(cork dec dec dec) 20)
20593083 17
20603084 ~zod/try=> =mal (mo (limo a/15 b/23 ~))
@@ -2067,11 +3091,6 @@ Build `f` such that `(f x) .= (b (a x))`.
20673091
20683092### `++corl`
20693093
2070− ++ corl :: compose backwards
2071− |* [a=gate b=_,*]
2072− |= c=_+<.b
2073− (a (b c))
2074−
20753094Gate compose
20763095
20773096XX Revisit
@@ -2080,6 +3099,17 @@ XX Revisit
20803099
20813100`b` is a noun.
20823101
3102+Source
3103+------
3104+
3105+ ++ corl :: compose backwards
3106+ |* [a=gate b=_,*]
3107+ |= c=_+<.b
3108+ (a (b c))
3109+
3110+Examples
3111+--------
3112+
20833113 ~zod/try=> ((corl (lift bex) (slat %ud)) '2')
20843114 [~ 4]
20853115
@@ -2087,6 +3117,12 @@ XX Revisit
20873117
20883118### `++hard`
20893119
3120+Demands that a specific type be produced, crashing the program is it is
3121+not.
3122+
3123+Source
3124+------
3125+
20903126 ++ hard
20913127 |* han=$+(* *)
20923128 |= fud=* ^- han
@@ -2094,8 +3130,8 @@ XX Revisit
20943130 =+ gol=(han fud)
20953131 ?>(=(gol fud) gol)
20963132
2097−Demands that a specific type be produced, crashing the program is it is
2098−not.
3133+Examples
3134+--------
20993135
21003136 ~zod/try=> ((hard (list)) (limo [1 2 3 ~]))
21013137 ~[1 2 3]
@@ -2111,14 +3147,20 @@ not.
21113147
21123148### `++soft`
21133149
3150+Politely requests a specific type to be produced, producing null if it
3151+is not.
3152+
3153+Source
3154+------
3155+
21143156 ++ soft
21153157 |* han=$+(* *)
21163158 |= fud=* ^- (unit han)
21173159 =+ gol=(han fud)
21183160 ?.(=(gol fud) ~ [~ gol])
21193161
2120−Politely requests a specific type to be produced, producing null if it
2121−is not.
3162+Examples
3163+--------
21223164
21233165 ~zod/try=> ((soft ,%4) (add 2 2))
21243166 [~ %4]
docs/dev/hoon/library/2da.md+258−61
@@ -5,6 +5,21 @@ section 2dA, sets
55
66Set verification
77
8+Produces a boolean indicating whether `a` is a [`++set`]() or not.
9+
10+Accepts
11+-------
12+
13+`a` is a [tree]().
14+
15+Produces
16+--------
17+
18+A boolean.
19+
20+Source
21+------
22+
823 ++ apt :: set invariant
924 |= a=(tree)
1025 ?~ a
@@ -14,9 +29,8 @@ Set verification
1429 ==
1530 ::
1631
17−Produces a loobean indicating whether `a` is a set or not.
18−
19−`a` is a [tree]().
32+Examples
33+--------
2034
2135 ~zod/try=> =b (sa `(list ,@t)`['john' 'bonita' 'daniel' 'madeleine' ~])
2236 ~zod/try=> (apt b)
@@ -33,21 +47,48 @@ Produces a loobean indicating whether `a` is a set or not.
3347
3448Set operations
3549
50+Core whose [arm]()s contain a variety of functions that operate on [`++set`]()s. Its [sample]() accepts the input [`++set`]() to be manipulated.
51+
52+Accepts
53+-------
54+
55+A `++set`.
56+
57+Source
58+------
59+
3660 ++ in :: set engine
3761 ~/ %in
3862 |/ a=(set)
3963
40−Input arm.
64+Examples
65+--------
4166
4267 ~zod/try=> ~(. in (sa "asd"))
4368 <13.evb [nlr(^$1{@tD $1}) <414.fvk 101.jzo 1.ypj %164>]>
4469
45−`a` is a [set]()
46−
4770### `+-all:in`
4871
4972Logical AND
5073
74+Computes the logical AND on every element in `a` slammed with `b`,
75+producing a boolean.
76+
77+Accepts
78+-------
79+
80+`a` is a [`++set`]().
81+
82+`b` is a [wet]() [gate]() that accepts a [noun]() and produces a boolean.
83+
84+Produces
85+--------
86+
87+A boolean.
88+
89+Source
90+------
91+
5192 +- all :: logical AND
5293 ~/ %all
5394 |* b=$+(* ?)
@@ -57,12 +98,8 @@ Logical AND
5798 ?&((b n.a) $(a l.a) $(a r.a))
5899 ::
59100
60−Computes the logical AND on every element in `a` slammed with `b`,
61−producing a loobean.
62−
63−`a` is a [set]().
64−
65−`b` is a [wet gate]() that accepts a noun and produces a loobean.
101+Examples
102+--------
66103
67104 ~zod/try=> =b (sa `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
68105 ~zod/try=> (~(all in b) |=(a=* ?@(+.a & |)))
@@ -77,6 +114,23 @@ producing a loobean.
77114
78115Logical OR
79116
117+Computes the logical OR on every element of `a` slammed with `b`.
118+
119+Accepts
120+-------
121+
122+`a` is a [`++set`]().
123+
124+`b` is a [gate]() that accepts a noun and produces a boolean.
125+
126+Produces
127+--------
128+
129+A boolean.
130+
131+Source
132+------
133+
80134 +- any :: logical OR
81135 ~/ %any
82136 |* b=$+(* ?)
@@ -86,11 +140,8 @@ Logical OR
86140 ?|((b n.a) $(a l.a) $(a r.a))
87141 ::
88142
89−Computes the logical OR on every element of `a` slammed with `b`.
90−
91−`a` is a [set]().
92−
93−`b` is a [gate]() that accepts a noun and produces a loobean.
143+Examples
144+--------
94145
95146 ~zod/try=> =b (sa `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
96147 ~zod/try=> (~(any in b) |=(a=* ?@(+.a & |)))
@@ -105,6 +156,23 @@ Computes the logical OR on every element of `a` slammed with `b`.
105156
106157Remove noun
107158
159+Removes `b` from the [`++set`]() `a`.
160+
161+Accepts
162+-------
163+
164+`a` is a set.
165+
166+`b` is a [noun]().
167+
168+Produces
169+--------
170+
171+A set.
172+
173+Source
174+------
175+
108176 +- del :: b without any a
109177 ~/ %del
110178 |* b=*
@@ -123,11 +191,9 @@ Remove noun
123191 [n.r.a $(r.a l.r.a) r.r.a]
124192 ::
125193
126−Removes `b` from the set `a`.
127194
128−`a` is a [set]().
129−
130−`b` is a [noun]().
195+Examples
196+--------
131197
132198 ~zod/try=> =b (sa `(list ,@t)`['a' 'b' 'c' ~])
133199 ~zod/try=> (~(del in b) 'a')
@@ -144,6 +210,23 @@ Removes `b` from the set `a`.
144210
145211Axis a in b
146212
213+Produce the axis of `b` within `a`.
214+
215+Accepts
216+-------
217+
218+`a` is a [`++set`]().
219+
220+`b` is a [noun]().
221+
222+Produces
223+--------
224+
225+The [`++unit`]() of an atom.
226+
227+Source
228+------
229+
147230 +- dig :: axis of a in b
148231 |= b=*
149232 =+ c=1
@@ -155,11 +238,9 @@ Axis a in b
155238 $(a r.a, c (peg c 7))
156239 ::
157240
158−Produce the axis of `b` within `a`.
159−
160−`a` is a [set]().
161241
162−`b` is a [noun]().
242+Examples
243+--------
163244
164245 ~zod/try=> =a (sa `(list ,@)`[1 2 3 4 5 6 7 ~])
165246 ~zod/try=> a
@@ -179,6 +260,23 @@ Produce the axis of `b` within `a`.
179260
180261Concatenate
181262
263+Insert the elements of a [`++list`]() `b` into a [`++set`]() `a`.
264+
265+Accepts
266+-------
267+
268+`a` is a set.
269+
270+`b` is a list.
271+
272+Produces
273+--------
274+
275+A `++set`.
276+
277+Source
278+------
279+
182280 +- gas :: concatenate
183281 ~/ %gas
184282 |= b=(list ,_?>(?=(^ a) n.a))
@@ -188,11 +286,9 @@ Concatenate
188286 $(b t.b, a (put(+< a) i.b))
189287 ::
190288
191−Insert the elements of a list `b` into a set `a`.
192−
193−`a` is a [set]().
194289
195−`b` is a [list]().
290+Examples
291+--------
196292
197293 ~zod/try=> b
198294 {'bonita' 'madeleine' 'rudolf' 'john'}
@@ -207,6 +303,23 @@ Insert the elements of a list `b` into a set `a`.
207303
208304b in a?
209305
306+Checks if `b` is an element of `a`, producing a boolean.
307+
308+Accepts
309+-------
310+
311+`a` is a [`++set`]().
312+
313+`b` is a [noun]().
314+
315+Produces
316+--------
317+
318+A boolean.
319+
320+Source
321+------
322+
210323 +- has :: b exists in a check
211324 ~/ %has
212325 |* b=*
@@ -220,11 +333,9 @@ b in a?
220333 $(a r.a)
221334 ::
222335
223−Checks if `b` is an element of `a`, producing a loobean.
224336
225−`a` is a [set]().
226−
227−`b` is a [noun]().
337+Examples
338+--------
228339
229340 ~zod/try=> =a (~(gas in `(set ,@t)`~) `(list ,@t)`[`a` `b` `c` ~])
230341 ~zod/try=> (~(has in a) `a`)
@@ -238,6 +349,24 @@ Checks if `b` is an element of `a`, producing a loobean.
238349
239350Intersection
240351
352+Produces a set of the intersection between two [`++set`]()s of the same type,
353+`a` and `b`.
354+
355+Accepts
356+-------
357+
358+`a` is a set.
359+
360+`b` is a set.
361+
362+Produces
363+--------
364+
365+A [`++set`]().
366+
367+Source
368+------
369+
241370 +- int :: intersection
242371 ~/ %int
243372 |* b=_a
@@ -254,12 +383,9 @@ Intersection
254383 %- uni(+< $(a l.a, b [n.b l.b ~])) $(b r.b)
255384 %- uni(+< $(a r.a, b [n.b ~ r.b])) $(b l.b)
256385
257−Produces a set of the intersection between two sets of the same type,
258−`a` and `b`.
259−
260−`a` is a [set]().
261386
262−`b` is a [set]().
387+Examples
388+--------
263389
264390 ~zod/try=> (~(int in (sa "ac")) (sa "ha"))
265391 {~~a}
@@ -276,6 +402,23 @@ Produces a set of the intersection between two sets of the same type,
276402
277403Put b in a
278404
405+Add an element `b` to the [`++set`]() `a`.
406+
407+Accepts
408+-------
409+
410+`a` is a set.
411+
412+`b` is a [noun]().
413+
414+Produces
415+--------
416+
417+A [`++set`]().
418+
419+Source
420+------
421+
279422 +- put :: puts b in a
280423 ~/ %put
281424 |* b=*
@@ -297,11 +440,9 @@ Put b in a
297440 [n.c [n.a l.a l.c] r.c]
298441 ::
299442
300−Add an element `b` to the set `a`.
301−
302−`a` is a [set]().
303443
304−`b` is a [noun]().
444+Examples
445+--------
305446
306447 ~zod/try=> =a (~(gas in `(set ,@t)`~) `(list ,@t)`[`a` `b` `c` ~])
307448 ~zod/try=> =b (~(put in a) `d`)
@@ -316,6 +457,25 @@ Add an element `b` to the set `a`.
316457
317458Accumulate
318459
460+Accumulate the elements of `a` using a [gate]() `c` and an accumulator `b`.
461+
462+Accepts
463+--------
464+
465+`a` is a [`++set`]().
466+
467+`b` is a [noun]().
468+
469+`c` is a gate.
470+
471+Produces
472+--------
473+
474+A noun.
475+
476+Source
477+------
478+
319479 +- rep :: replace by tile
320480 |* [b=* c=_,*]
321481 |-
@@ -323,13 +483,9 @@ Accumulate
323483 $(a r.a, b $(a l.a, b (c n.a b)))
324484 ::
325485
326−Accumulate the elements of `a` using a gate `c` and an accumulator `b`.
327−
328−`a` is a [set]().
329−
330−`b` is a [noun]() that accepts a noun and produces a loobean.
331486
332−`c` is a [gate]().
487+Examples
488+--------
333489
334490 ~zod/try=> =a (~(gas in *(set ,@)) [1 2 3 ~])
335491 ~zod/try=> a
@@ -343,6 +499,21 @@ Accumulate the elements of `a` using a gate `c` and an accumulator `b`.
343499
344500Set to list
345501
502+Flattens the [`++set`]() `a` into a [`++list`]().
503+
504+Accepts
505+-------
506+
507+`a` is an set.
508+
509+Produces
510+--------
511+
512+A list.
513+
514+Source
515+------
516+
346517 +- tap :: list tiles a set
347518 ~/ %tap
348519 |= b=(list ,_?>(?=(^ a) n.a))
@@ -352,13 +523,9 @@ Set to list
352523 $(a r.a, b [n.a $(a l.a)])
353524 ::
354525
355−Flatten the set `a` into a list.
356−
357−`a` is an [set]().
358−
359−`a` is a [set]().
360526
361−`b` is a [list]().
527+Examples
528+--------
362529
363530 ~zod/try=> =s (sa `(list ,@t)`['a' 'b' 'c' 'd' 'e' ~])
364531 ~zod/try=> s
@@ -376,6 +543,24 @@ Flatten the set `a` into a list.
376543
377544Union
378545
546+Produces a set of the union between two [`++set`]()s of the same type, `a` and
547+`b`.
548+
549+Accepts
550+-------
551+
552+`a` is a set.
553+
554+`b` is a set.
555+
556+Produces
557+--------
558+
559+A set.
560+
561+Source
562+------
563+
379564 +- uni :: union
380565 ~/ %uni
381566 |* b=_a
@@ -396,12 +581,9 @@ Union
396581 $(b [n.b $(b l.b, a [n.a l.a ~]) r.b], a r.a)
397582 $(b [n.b l.b $(b r.b, a [n.a ~ r.a])], a l.a)
398583
399−Produces a set of the union between two sets of the same type, `a` and
400−`b`.
401−
402−`a` is a [set]().
403584
404−`b` is a [set]().
585+Examples
586+--------
405587
406588 ~zod/try=> (~(uni in (sa "ac")) (sa "ha"))
407589 {~~a ~~c ~~h}
@@ -418,13 +600,28 @@ Produces a set of the union between two sets of the same type, `a` and
418600
419601Set size
420602
603+Produce the number of elements in [`++set`]() `a` as an atom.
604+
605+Accepts
606+-------
607+
608+`a` is an set.
609+
610+Produces
611+--------
612+
613+An atom.
614+
615+Source
616+------
617+
421618 +- wyt :: size of set
422619 |- ^- @
423620 ?~(a 0 +((add $(a l.a) $(a r.a))))
424621
425−Produce the number of elements in set `a` as an atom.
426622
427−`a` is an [set]().
623+Examples
624+--------
428625
429626 ~zod/try=> =a (~(put in (~(put in (sa)) 'a')) 'b')
430627 ~zod/try=> ~(wyt in a)
docs/dev/hoon/library/2dc.md+149−36
@@ -3,20 +3,41 @@ section 2dC, queues
33
44### `++to`
55
6−Queue engine
7−
8− ++ to :: queue engine
9− |/ a=(qeu)
6+Queue operations
107
118Container arm for queue operation arms. The contained arms inherit its
129[sample]() `++qeu` `a`.
1310
11+Accepts
12+-------
13+
1414`a` is a queue, [++qeu]().
1515
16+Source
17+------
18+
19+ ++ to :: queue engine
20+ |/ a=(qeu)
21+
1622### `+-bal:to`
1723
1824Balance
1925
26+Vertically rebalances queue `a`.
27+
28+Accepts
29+-------
30+
31+`a` is a [queue]().
32+
33+Produces
34+--------
35+
36+A [queue]().
37+
38+Source
39+------
40+
2041 +- bal
2142 |- ^+ a
2243 ?~ a ~
@@ -27,9 +48,8 @@ Balance
2748 a
2849 ::
2950
30−Vertically rebalances queue `a`.
31−
32−`a` is a [queue]().
51+Examples
52+--------
3353
3454 ~zod/try=> `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~]
3555 {"a" "b" "c" "d" "e" "f" "g"}
@@ -46,15 +66,29 @@ Vertically rebalances queue `a`.
4666
4767Maximum Depth
4868
69+Produces the maximum depth of leaves (r.a and l.a) in queue `a`.
70+
71+Accepts
72+-------
73+
74+`a` is a [queue]().
75+
76+Produces
77+--------
78+
79+An atom.
80+
81+Source
82+------
83+
4984 +- dep :: max depth of queue
5085 |- ^- @
5186 ?~ a 0
5287 +((max $(a l.a) $(a r.a)))
5388 ::
5489
55−Produces the maximum depth of leaves (r.a and l.a) in queue `a`.
56−
57−`a` is a [queue]().
90+Examples
91+--------
5892
5993 ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 5 6 7 ~])
6094 ~zod/try=> ~(dep to a)
@@ -76,18 +110,32 @@ Produces the maximum depth of leaves (r.a and l.a) in queue `a`.
76110
77111Push list
78112
79− +- gas :: insert list to queue
80− |= b=(list ,_?>(?=(^ a) n.a))
81− |- ^+ a
82− ?~(b a $(b t.b, a (put(+< a) i.b)))
83− ::
113+Push all elements of [`++list`]() `b` into the [`++queue`]().
84114
85−Push all elements of list `b` into the queue.
115+Accepts
116+-------
86117
87−`a` is a [queue]().
118+`a` is a queue.
88119
89120`b` is a list.
90121
122+Produces
123+--------
124+
125+A queue.
126+
127+Source
128+------
129+
130+ +- gas :: insert list to queue
131+ |= b=(list ,_?>(?=(^ a) n.a))
132+ |- ^+ a
133+ ?~(b a $(b t.b, a (put(+< a) i.b)))
134+ ::
135+
136+Examples
137+--------
138+
91139 ~zod/try=> (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 ~])
92140 {3 2 1}
93141 ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 ~])
@@ -101,6 +149,21 @@ Push all elements of list `b` into the queue.
101149
102150Pop
103151
152+Produces the head and tail [`++queue`]() of `a`.
153+
154+Accepts
155+-------
156+
157+`a` is a queue.
158+
159+Produces
160+--------
161+
162+The last element in `a` along with the rest of queue `a`.
163+
164+Source
165+------
166+
104167 +- get :: head-tail pair
105168 |- ^+ [p=?>(?=(^ a) n.a) q=a]
106169 ?~ a
@@ -114,9 +177,8 @@ Pop
114177 [n.q.b [n.a l.a l.q.b] r.q.b]
115178 ::
116179
117−Produces the head and tail queue of `a`.
118−
119−`a` is a [queue]().
180+Examples
181+--------
120182
121183 ~zod/try=> =s (~(gas to *(qeu ,@)) `(list ,@)`~[1 2 3])
122184 ~zod/try=> ~(get to s)
@@ -128,7 +190,22 @@ Produces the head and tail queue of `a`.
128190
129191### `+-nap:to`
130192
131−Remove last in
193+Remove last element
194+
195+Removes the head of [`++queue`]() `a`, producing the resulting queue.
196+
197+Accepts
198+-------
199+
200+`a` is a [queue]().
201+
202+Produces
203+--------
204+
205+A queue.
206+
207+Source
208+------
132209
133210 +- nap :: removes head
134211 ?> ?=(^ a)
@@ -137,9 +214,8 @@ Remove last in
137214 bal(+< ^+(a [p.b q.b r.a]))
138215 ::
139216
140−Removes the head of queue `a`, producing the resulting queue.
141−
142−`a` is a [queue]().
217+Examples
218+--------
143219
144220 ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 5 6 ~])
145221 ~zod/try=> -.a
@@ -158,6 +234,24 @@ Removes the head of queue `a`, producing the resulting queue.
158234
159235Insert
160236
237+Accept any [noun]() `b` and adds to [`++queue`]() `a` as the head, producing the
238+resulting queue.
239+
240+Accepts
241+-------
242+
243+`a` is a [queue]().
244+
245+`b` is any noun.
246+
247+Produces
248+--------
249+
250+A queue.
251+
252+Source
253+------
254+
161255 +- put :: insert new tail
162256 |* b=*
163257 |- ^+ a
@@ -166,12 +260,8 @@ Insert
166260 bal(+< a(l $(a l.a)))
167261 ::
168262
169−Accept any noun `b` and adds to queue `a` as the head, producing the
170−resulting queue.
171−
172−`a` is a [queue]().
173−
174−`b` is any noun.
263+Examples
264+--------
175265
176266 ~zod/try=> (~(gas to `(qeu ,@)`~) `(list ,@)`[3 1 2 4 5 6 ~])
177267 ~zod/try=> (~(put to a) 7)
@@ -183,6 +273,16 @@ resulting queue.
183273
184274Queue to list
185275
276+Produces [`++queue`]() `a` as a [`++list`]() from front to back.
277+
278+Accepts
279+-------
280+
281+`a` is a [queue]().
282+
283+Source
284+------
285+
186286 +- tap :: queue to list
187287 |= b=(list ,_?>(?=(^ a) n.a))
188288 ^+ b
@@ -191,9 +291,8 @@ Queue to list
191291 $(a r.a, b [n.a $(a l.a)])
192292 ::
193293
194−Produces queue `a` as a list from front to back.
195−
196−`a` is a [queue]().
294+Examples
295+--------
197296
198297 ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[3 1 2 4 5 6 ~])
199298 ~zod/try=> `*`a
@@ -205,14 +304,28 @@ Produces queue `a` as a list from front to back.
205304
206305### `+-top:to`
207306
307+Produces the head of [`++queue`]() `a` as a [`++unit`]() (an empty queue has no head).
308+
309+Accepts
310+-------
311+
312+`a` is a [queue]().
313+
314+Produces
315+--------
316+
317+A unit.
318+
319+Source
320+------
321+
208322 +- top :: produces head
209323 |- ^- (unit ,_?>(?=(^ a) n.a))
210324 ?~ a ~
211325 ?~(r.a [~ n.a] $(a r.a))
212326
213−Produces the head of queue `a` as a unit (an empty queue has no head).
214−
215−`a` is a [queue]().
327+Examples
328+--------
216329
217330 ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 5 6 ~])
218331 ~zod/try=> ~(top to a)
docs/dev/hoon/library/2dd.md+51−8
@@ -5,6 +5,21 @@ section 2dD, casual containers
55
66Map from list
77
8+Produces a map of key-value pairs from the left-right cell pairs of list
9+
10+Accepts
11+-------
12+
13+`a` is a [`++list`]().
14+
15+Produces
16+--------
17+
18+A [`++map]()
19+
20+Source
21+------
22+
823 ++ mo :: map from list
924 |* a=(list)
1025 => .(a `_(homo a)`a)
@@ -13,10 +28,8 @@ Map from list
1328 (~(gas by b) a)
1429 ::
1530
16−Produces a map of key-value pairs from the left-right cell pairs of list
17−`a`.
18−
19−`a` is a [list]().
31+Examples
32+--------
2033
2134 ~zod/try=> (mo `(list ,[@t *])`[[`a` 1] [`b` 2] ~])
2235 {[p=`a` q=1] [p=`b` q=2]}
@@ -27,6 +40,21 @@ Produces a map of key-value pairs from the left-right cell pairs of list
2740
2841Set from list
2942
43+Produces a set of the elements in list `a`.
44+
45+Accepts
46+-------
47+
48+`a` is a [list]().
49+
50+Produces
51+--------
52+
53+A [`++set`]().
54+
55+Source
56+------
57+
3058 ++ sa :: set from list
3159 |* a=(list)
3260 => .(a `_(homo a)`a)
@@ -34,9 +62,9 @@ Set from list
3462 (~(gas in b) a)
3563 ::
3664
37−Produces a set of the elements in list `a`.
3865
39−`a` is a [list]().
66+Examples
67+--------
4068
4169 ~zod/try=> (sa `(list ,@)`[1 2 3 4 5 ~])
4270 {5 4 1 3 2}
@@ -49,15 +77,30 @@ Produces a set of the elements in list `a`.
4977
5078Queue from list
5179
80+Produces a queue from list `a`.
81+
82+Accepts
83+-------
84+
85+`a` is a [list]().
86+
87+Produces
88+--------
89+
90+A [`++que`]().
91+
92+Source
93+------
94+
5295 ++ qu :: queue from list
5396 |* a=(list)
5497 => .(a `_(homo a)`a)
5598 =+ b=*(qeu ,_?>(?=(^ a) i.a))
5699 (~(gas to b) a)
57100
58−Produces a queue from list `a`.
59101
60−`a` is a [list]().
102+Examples
103+--------
61104
62105 ~zod/try=> (qu `(list ,@ud)`~[1 2 3 5])
63106 {5 3 2 1}
docs/dev/hoon/library/2ea.md+77−15
@@ -5,6 +5,21 @@ section 2eA, packing
55
66Unpack atom to noun
77
8+Produces a noun unpacked from atom `a`. The inverse of jam.
9+
10+Accepts
11+-------
12+
13+`a` is an [atom]().
14+
15+Produces
16+--------
17+
18+A [`++noun`]().
19+
20+Source
21+------
22+
823 ++ cue :: unpack atom to noun
924 ~/ %cue
1025 |= a=@
@@ -26,9 +41,9 @@ Unpack atom to noun
2641 [(add 2 p.d) (need (~(get by m) q.d)) m]
2742 ::
2843
29−Produces a noun unpacked from atom `a`. The inverse of jam.
3044
31−`a` is an [atom]().
45+Examples
46+--------
3247
3348 ~zod/try=> (cue 12)
3449 1
@@ -43,6 +58,23 @@ Produces a noun unpacked from atom `a`. The inverse of jam.
4358
4459### `++jam`
4560
61+Unpack noun to atom
62+
63+Produces an atom unpacked from noun `a`. The inverse of cue.
64+
65+Accepts
66+-------
67+
68+`a` is a [noun]().
69+
70+Produces
71+--------
72+
73+An atom.
74+
75+Source
76+------
77+
4678 ++ jam :: pack
4779 ~/ %jam
4880 |= a=*
@@ -68,9 +100,9 @@ Produces a noun unpacked from atom `a`. The inverse of jam.
68100 [(add 2 p.d) (mix 3 (lsh 0 2 q.d)) m]
69101 ::
70102
71−Produces an atom unpacked from noun `a`. The inverse of cue.
72103
73−`a` is a [noun]().
104+Examples
105+--------
74106
75107 ~zod/try=> (jam 1)
76108 12
@@ -87,6 +119,23 @@ Produces an atom unpacked from noun `a`. The inverse of cue.
87119
88120Length-encode
89121
122+Produces a cell whose tail `q` is atom `a` with a bit representation of
123+its length prepended to it (as the least significant bits). The head `p`
124+is the length of `q` in bits.
125+
126+Accepts
127+-------
128+
129+`a` is an atom.
130+
131+Produces
132+--------
133+
134+A cell of two atoms, `p` and `q`.
135+
136+Source
137+------
138+
90139 ++ mat :: length-encode
91140 ~/ %mat
92141 |= a=@
@@ -98,11 +147,9 @@ Length-encode
98147 :- (add (add c c) b)
99148 (cat 0 (bex c) (mix (end 0 (dec c) b) (lsh 0 (dec c) a)))
100149
101−Produces a cell whose tail `q` is atom `a` with a bit representation of
102−its length prepended to it (as the least significant bits). The head `p`
103−is the length of `q` in bits.
104150
105−`a` is an atom.
151+Examples
152+--------
106153
107154 ~zod/try=> (mat 0xaaa)
108155 [p=20 q=699.024]
@@ -127,6 +174,26 @@ is the length of `q` in bits.
127174
128175Length-decode
129176
177+The inverse of `++mat`. Accepts a cell of index `a` and a bitstring `b`
178+and produces the cell whose tail `q` is the decoded atom at index `a`
179+and whose head is the length of the encoded atom `q`, by which the
180+offset `a` is advanced. Only used internally as a helper cue.
181+
182+Accepts
183+-------
184+
185+`a` is an atom.
186+
187+`b` is a bitstring as an atom.
188+
189+Produces
190+--------
191+
192+A cell of two atoms, `p` and `q`.
193+
194+Source
195+------
196+
130197 ++ rub :: length-decode
131198 ~/ %rub
132199 |= [a=@ b=@]
@@ -143,14 +210,9 @@ Length-decode
143210 =+ e=(add (bex (dec c)) (cut 0 [d (dec c)] b))
144211 [(add (add c c) e) (cut 0 [(add d (dec c)) e] b)]
145212
146−The inverse of `++mat`. Accepts a cell of index `a` and a bitstring `b`
147−and produces the cell whose tail `q` is the decoded atom at index `a`
148−and whose head is the length of the encoded atom `q`, by which the
149−offset `a` is advanced. Only used internally as a helper cue.
150213
151−`a` is an atom.
152−
153−`b` is a bitstring as an atom.
214+Examples
215+--------
154216
155217 ~zod/try=> `@ub`(jam 0xaaa)
156218 0b1.0101.0101.0101.0010.0000
docs/dev/hoon/library/2eb.md+40−10
@@ -5,6 +5,24 @@ section 2eB, parsing (tracing)
55
66Farther trace
77
8+Compares two line-column pairs, called [`++hair`]()s, `zyc` and `naz`, producing whichever
9+is further along.
10+
11+Accepts
12+-------
13+
14+`naz` is a [hair]().
15+
16+`zyc` is a [hair]().
17+
18+Produces
19+--------
20+
21+a `++hair`.
22+
23+Source
24+------
25+
826 ++ last |= [zyc=hair naz=hair] :: farther trace
927 ^- hair
1028 ?: =(p.zyc p.naz)
@@ -12,12 +30,9 @@ Farther trace
1230 ?:((gth p.zyc p.naz) zyc naz)
1331 ::
1432
15−Compares two line-column pairs, `zyc` and `naz`, and produces whichever
16−[hair]() is farther along.
1733
18−`zyc` is a [hair]().
19−
20−`naz` is a [hair]().
34+Examples
35+--------
2136
2237 ~zod/try=> (last [1 1] [1 2])
2338 [p=1 q=2]
@@ -34,16 +49,31 @@ Compares two line-column pairs, `zyc` and `naz`, and produces whichever
3449
3550Detect newline
3651
52+Advances the [`++hair`]() `naz` by a row if the [`++char`]() `weq` is a newline, or by a
53+column if `weq` is any other character.
54+
55+Accepts
56+-------
57+
58+`weq` is a char.
59+
60+`naz` is a hair.
61+
62+Produces
63+--------
64+
65+A hair.
66+
67+Source
68+------
69+
3770 ++ lust |= [weq=char naz=hair] :: detect newline
3871 ^- hair
3972 ?:(=(10 weq) [+(p.naz) 1] [p.naz +(q.naz)])
4073
41−Advances the hair `naz` by a row if the char `weq` is a newline, or by a
42−column if `weq` is any other character.
4374
44−`weq` is a [char]().
45−
46−`naz` is a [hair]().
75+Examples
76+--------
4777
4878 ~zod/try=> (lust `a` [1 1])
4979 [p=1 q=2]
docs/dev/hoon/library/2ec.md+358−87
@@ -5,6 +5,24 @@ section 2eC, parsing (custom rules)
55
66Replace with constant
77
8+Parser modifier. Accepts a [`++rule`]() `sef` and produces a parser that
9+produces a constant `cus`, assuming `sef` is successful.
10+
11+Accepts
12+-------
13+
14+`cus` is a constant [noun]().
15+
16+`sef` is a `++rule`.
17+
18+Produces
19+--------
20+
21+An [`++edge`]().
22+
23+Source
24+------
25+
826 ++ cold :: replace w/ constant
927 ~/ %cold
1028 |* [cus=* sef=_rule]
@@ -16,12 +34,8 @@ Replace with constant
1634 [p=p.vex q=[~ u=[p=cus q=q.u.q.vex]]]
1735 ::
1836
19−Parser modifier. Accepts a rule `sef` and produces a parser that
20−produces a constant `cus`, if `sef` is successful.
21−
22−`cus` is a constant [noun]().
23−
24−`sef` is a [`++rule`]().
37+Examples
38+--------
2539
2640 ~zod/try=> ((cold %foo (just 'a')) [[1 1] "abc"])
2741 [p=[p=1 q=2] q=[~ u=[p=%foo q=[p=[p=1 q=2] q="bc"]]]]
@@ -34,6 +48,24 @@ produces a constant `cus`, if `sef` is successful.
3448
3549Apply gate
3650
51+Parser modifier. Produces a parser that takes a (successful) result of a
52+[`++rule`]() `sef` and slams it through `poq`.
53+
54+Accepts
55+-------
56+
57+`poq` is a [gate]().
58+
59+`sef` is a [`++rule`]().
60+
61+Produces
62+--------
63+
64+An [`++rule`]().
65+
66+Source
67+------
68+
3769 ++ cook :: apply gate
3870 ~/ %cook
3971 |* [poq=_,* sef=_rule]
@@ -45,12 +77,8 @@ Apply gate
4577 [p=p.vex q=[~ u=[p=(poq p.u.q.vex) q=q.u.q.vex]]]
4678 ::
4779
48−Parser modifier. Produces a parser that takes a (successful) result of a
49−rule `sef` and slams it through `poq`.
50−
51−`poq` is a [gate]().
52−
53−`sef` is a [`++rule`]().
80+Examples
81+--------
5482
5583 ~zod/try=> ((cook ,@ud (just 'a')) [[1 1] "abc"])
5684 [p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]]
@@ -67,6 +95,22 @@ rule `sef` and slams it through `poq`.
6795
6896Always parse
6997
98+Parser generator. Produces a parser that succeeds with given [noun]() `huf`
99+without consuming any text.
100+
101+Accepts
102+-------
103+
104+`huf` is a noun.
105+
106+Produces
107+--------
108+
109+A [`++rule`]().
110+
111+Source
112+------
113+
70114 ++ easy :: always parse
71115 ~/ %easy
72116 |* huf=*
@@ -76,8 +120,8 @@ Always parse
76120 [p=p.tub q=[~ u=[p=huf q=tub]]]
77121 ::
78122
79−Parser generator. Produces a parser that succeeds with given noun `huf`
80−without consuming any text.
123+Examples
124+--------
81125
82126 ~zod/try=> ((easy %foo) [[1 1] "abc"])
83127 [p=[p=1 q=1] q=[~ [p=%foo q=[p=[p=1 q=1] q="abc"]]]]
@@ -92,13 +136,27 @@ without consuming any text.
92136
93137Never parse
94138
95− ++ fail |=(tub=nail [p=p.tub q=~]) :: never parse
96−
97−Produces an [edge]() at the same text position ([hair]()) with a failing
139+Produces an [`++edge`]() at the same text position ([`++hair`]()) with a failing
98140result (`q=~`).
99141
142+Accepts
143+-------
144+
100145`tub` is a [`++nail`]().
101146
147+Produces
148+--------
149+
150+An `++edge`.
151+
152+Source
153+------
154+
155+ ++ fail |=(tub=nail [p=p.tub q=~]) :: never parse
156+
157+Examples
158+--------
159+
102160 ~zod/try=> (fail [[1 1] "abc"])
103161 [p=[p=1 q=1] q=~]
104162 ~zod/try=> (fail [[p=1.337 q=70] "Parse me, please?"])
@@ -110,6 +168,22 @@ result (`q=~`).
110168
111169Parse to end
112170
171+Parser modifier. Accepts a [`++rule`]() `sef`, and produces a parser that succeeds only
172+when the of `tub` is fully consumed using `sef`.
173+
174+Accepts
175+-------
176+
177+`sef` is a [`++rule`]().
178+
179+Produces
180+--------
181+
182+A `++rule`.
183+
184+Source
185+------
186+
113187 ++ full :: parse to end
114188 |* sef=_rule
115189 |= tub=nail
@@ -117,10 +191,8 @@ Parse to end
117191 ?~(q.vex vex ?:(=(~ q.q.u.q.vex) vex [p=p.vex q=~]))
118192 ::
119193
120−Accepts a [`++nail`](), `tub`, and produces a parser that succeeds only
121−when a `tub` success consumes the remainder of the [tape]().
122−
123−`sef` is a [`++rule`]().
194+Examples
195+--------
124196
125197 ~zod/try=> ((full (just 'a')) [[1 1] "ab"])
126198 [p=[p=1 q=2] q=~]
@@ -135,17 +207,31 @@ when a `tub` success consumes the remainder of the [tape]().
135207
136208Add to tape
137209
210+Parser modifier: prepend text to [`++tape`]() before applying parser.
211+
212+Accepts
213+-------
214+
215+`pre` is a `++tape`
216+
217+`sef` is a [`++rule`]()
218+
219+Produces
220+--------
221+
222+A `++rule`.
223+
224+Source
225+------
226+
138227 ++ funk :: add to tape first
139228 |* [pre=tape sef=_rule]
140229 |= tub=nail
141230 (sef p.tub (weld pre q.tub))
142231 ::
143232
144−Parser modifier: prepend text to tape before applying parser.
145−
146−`pre` is a [`++tape`]()
147−
148−`sef` is a [`++rule`]()
233+Examples
234+--------
149235
150236 ~zod/try=> ((funk "abc prefix-" (jest 'abc')) [[1 1] "to be parsed"])
151237 [p=[p=1 q=4] q=[~ [p='abc' q=[p=[p=1 q=4] q=" prefix-to be parsed"]]]]
@@ -158,6 +244,25 @@ Parser modifier: prepend text to tape before applying parser.
158244
159245Place-based apply
160246
247+Parser modifier. Similar to [`++cook`]() in that it produces a parser that takes a
248+(successful) result of `sef` and slams it through `hez`. `hez` accepts a
249+[`++pint`]() `a` and a [noun]() `b`, which is what the parser parsed.
250+
251+Accepts
252+-------
253+
254+`hez` is a [gate]().
255+
256+`sef` is a [`++rule`]()
257+
258+Produces
259+--------
260+
261+A `++rule`.
262+
263+Source
264+------
265+
161266 ++ here :: place-based apply
162267 ~/ %here
163268 |* [hez=_|=([a=pint b=*] [a b]) sef=_rule]
@@ -169,13 +274,8 @@ Place-based apply
169274 [p=p.vex q=[~ u=[p=(hez [p.tub p.q.u.q.vex] p.u.q.vex) q=q.u.q.vex]]]
170275 ::
171276
172−Parser modifier. Similar to [`++cook`](), produces a parser that takes a
173−(successful) result of `sef` and slams it through `hez`. `hez` accepts a
174−[`++pint`]() `a` and a noun `b`, which is what the parser parsed.
175−
176−`hez` is a [gate]().
177−
178−`sef` is a [`++rule`]()
277+Examples
278+--------
179279
180280 ~zod/try=> (scan "abc" (star alf))
181281 "abc"
@@ -190,6 +290,22 @@ Parser modifier. Similar to [`++cook`](), produces a parser that takes a
190290
191291Indentation block
192292
293+Apply [`++rule`]() to indented block starting at current column number, omitting
294+the leading whitespace.
295+
296+Accepts
297+-------
298+
299+`sef` is a [`++rule`]()
300+
301+Produces
302+--------
303+
304+A `++rule`.
305+
306+Source
307+------
308+
193309 ++ inde |* sef=_rule :: indentation block
194310 |= nail ^+ (sef)
195311 =+ [har tap]=[p q]:+<
@@ -210,10 +326,8 @@ Indentation block
210326 (welp [`@t`10 (trip lev)] $(res +.res))
211327 ::
212328
213−Apply rule to indented block starting at current column number, omitting
214−the leading whitespace.
215−
216−`sef` is a [`++rule`]()
329+Examples
330+--------
217331
218332 ~zod/try=> (scan "abc" (inde (star ;~(pose prn (just `@`10)))))
219333 "abc"
@@ -235,6 +349,21 @@ the leading whitespace.
235349
236350Match a cord
237351
352+Match and consume a cord.
353+
354+Accepts
355+-------
356+
357+`daf` is a [`@t`]().
358+
359+Produces
360+--------
361+
362+An [`++edge`]().
363+
364+Source
365+------
366+
238367 ++ jest :: match a cord
239368 |= daf=@t
240369 |= tub=nail
@@ -247,9 +376,8 @@ Match a cord
247376 $(p.tub (lust i.q.tub p.tub), q.tub t.q.tub, daf (rsh 3 1 daf))
248377 ::
249378
250−Match and consume a cord.
251−
252−`daf` is a `@t`
379+Examples
380+--------
253381
254382 ~zod/try=> ((jest 'abc') [[1 1] "abc"])
255383 [p=[p=1 q=4] q=[~ [p='abc' q=[p=[p=1 q=4] q=""]]]]
@@ -270,6 +398,21 @@ Match and consume a cord.
270398
271399Match a char
272400
401+Match and consume a single character.
402+
403+Accepts
404+-------
405+
406+`daf` is a [`++char`]()
407+
408+Produces
409+--------
410+
411+A [`++rule`]().
412+
413+Source
414+------
415+
273416 ++ just :: XX redundant, jest
274417 ~/ %just :: match a char
275418 |= daf=char
@@ -283,9 +426,9 @@ Match a char
283426 (next tub)
284427 ::
285428
286−Match and consume a single character.
287429
288−`daf` is a [`++char`]()
430+Examples
431+--------
289432
290433 ~zod/try=> ((just 'a') [[1 1] "abc"])
291434 [p=[p=1 q=2] q=[~ [p=~~a q=[p=[p=1 q=2] q="bc"]]]]
@@ -304,6 +447,24 @@ Match and consume a single character.
304447
305448Recursive parsers
306449
450+Used for recursive parsers, which would otherwise be infinite when
451+compiled.
452+
453+Accepts
454+-------
455+
456+`gar` is a noun.
457+
458+`sef` is a [gate]() that accepts a [`++rule`]()
459+
460+Produces
461+--------
462+
463+A [`++rule`]().
464+
465+Source
466+------
467+
307468 ++ knee :: callbacks
308469 |* [gar=* sef=_|.(rule)]
309470 |= tub=nail
@@ -311,12 +472,8 @@ Recursive parsers
311472 ((sef) tub)
312473 ::
313474
314−Used for recursive parsers, which would otherwise be infinite when
315−compiled.
316−
317−`gar` is a noun.
318−
319−`sef` is a [gate]() that accepts a [`++rule`]()
475+Examples
476+--------
320477
321478 ~zod/try=> |-(;~(plug prn ;~(pose $ (easy ~))))
322479 ! rest-loop
@@ -345,6 +502,22 @@ compiled.
345502
346503Match char
347504
505+Parser generator. Matches the next character if it is in a list of
506+characters.
507+
508+Accepts
509+-------
510+
511+`bud` is a list of [`++char`]()
512+
513+Produces
514+--------
515+
516+A [`++rule`]().
517+
518+Source
519+------
520+
348521 ++ mask :: match char in set
349522 ~/ %mask
350523 |= bud=(list char)
@@ -358,10 +531,8 @@ Match char
358531 (next tub)
359532 ::
360533
361−Parser generator. Matches the next character if it is in a list of
362−characters.
363−
364−`bud` is a list of [`++char`]()
534+Examples
535+--------
365536
366537 ~zod/try=> (scan "a" (mask "cba"))
367538 ~~a
@@ -378,6 +549,21 @@ characters.
378549
379550Consume char
380551
552+Consume any character, producing it as a result.
553+
554+Accepts
555+-------
556+
557+`tub` is a [`++nail`]()
558+
559+Produces
560+--------
561+
562+An [`++edge`]().
563+
564+Source
565+------
566+
381567 ++ next :: consume a char
382568 |= tub=nail
383569 ^- (like char)
@@ -387,9 +573,8 @@ Consume char
387573 [zac [~ i.q.tub [zac t.q.tub]]]
388574 ::
389575
390−Consume any character, producing it as a result.
391−
392−`tub` is a [`++nail`]()
576+Examples
577+--------
393578
394579 ~zod/try=> (next [[1 1] "ebc"])
395580 [p=[p=1 q=2] q=[~ [p=~~e q=[p=[p=1 q=2] q="bc"]]]]
@@ -402,6 +587,22 @@ Consume any character, producing it as a result.
402587
403588Conditional `++cook`
404589
590+Conditional [`++cook`](). Slams the result through a gate that produces
591+a unit; if that unit is empty, fail.
592+
593+Accepts
594+-------
595+
596+`tub` is a [`++nail`](/doc/hoon/library/1#++nail)
597+
598+Produces
599+--------
600+
601+A [`++rule`]().
602+
603+Source
604+------
605+
405606 ++ sear :: conditional cook
406607 |* [pyq=_|=(* *(unit)) sef=_rule]
407608 |= tub=nail
@@ -414,10 +615,8 @@ Conditional `++cook`
414615 [p=p.vex q=[~ u=[p=u.gey q=q.u.q.vex]]]
415616 ::
416617
417−Conditional [`++cook`](). Slams the result through a gate that produces
418−a unit; if that unit is empty, fail.
419−
420−`tub` is a [`++nail`](/doc/hoon/library/1#++nail)
618+Examples
619+--------
421620
422621 ~zod/try=> ((sear |=(a=* ?@(a (some a) ~)) (just `a`)) [[1 1] "abc"])
423622 [p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]]
@@ -430,6 +629,23 @@ a unit; if that unit is empty, fail.
430629
431630Char in range
432631
632+Match characters ([`++char`]()) within a range.
633+
634+Accepts
635+-------
636+
637+`les` is an atom.
638+
639+`mos` is an atom.
640+
641+Produces
642+--------
643+
644+A [`++rule`]().
645+
646+Source
647+------
648+
433649 ++ shim :: match char in range
434650 ~/ %shim
435651 |= [les=@ mos=@]
@@ -443,9 +659,8 @@ Char in range
443659 (next tub)
444660 ::
445661
446−Match characters within a range.
447−
448−`les` and `mos` are atoms, `@`.
662+Examples
663+--------
449664
450665 ~zod/try=> ((shim 'a' 'z') [[1 1] "abc"])
451666 [p=[p=1 q=2] q=[~ [p=~~a q=[p=[p=1 q=2] q="bc"]]]]
@@ -460,6 +675,23 @@ Match characters within a range.
460675
461676Add label
462677
678+Add a label to an edge parsed by a rule.
679+
680+Accepts
681+-------
682+
683+`gob` is a noun.
684+
685+`sef` is a rule.
686+
687+Produces
688+--------
689+
690+A [`++rule`]().
691+
692+Source
693+------
694+
463695 ++ stag :: add a label
464696 ~/ %stag
465697 |* [gob=* sef=_rule]
@@ -471,11 +703,8 @@ Add label
471703 [p=p.vex q=[~ u=[p=[gob p.u.q.vex] q=q.u.q.vex]]]
472704 ::
473705
474−Add a label to an edge parsed by a rule.
475−
476−`gob` is a noun.
477−
478−`sef` is a rule.
706+Examples
707+--------
479708
480709 ~zod/try=> ((stag %foo (just 'a')) [[1 1] "abc"])
481710 [p=[p=1 q=2] q=[~ u=[p=[%foo ~~a] q=[p=[p=1 q=2] q="bc"]]]]
@@ -490,6 +719,21 @@ Add a label to an edge parsed by a rule.
490719
491720Add faces
492721
722+Add faces `[p q]` to range-parser pairs in a list.
723+
724+Accepts
725+-------
726+
727+`leh` is a list of range-parsers.
728+
729+Produces
730+--------
731+
732+
733+
734+Source
735+------
736+
493737 ++ stet
494738 |* leh=(list ,[?(@ [@ @]) _rule])
495739 |-
@@ -498,9 +742,8 @@ Add faces
498742 [i=[p=-.i.leh q=+.i.leh] t=$(leh t.leh)]
499743 ::
500744
501−Add `[p q]` faces to range-parser pairs in a list.
502−
503−`leh` is a list of range-parsers.
745+Examples
746+--------
504747
505748 ~zod/try=> (stet (limo [[5 (just 'a')] [1 (jest 'abc')] [[1 1] (shim 0 200)]
506749 [[1 10] (cold %foo (just 'a'))]~]))
@@ -572,9 +815,9 @@ Switch by first
572815 $(hel r.hel)
573816 ::
574817
575−Parser generator. From an associative list of characters or character
576−ranges to rules, construct a map, and parse tapes only with rules
577−associated with a range the tape's first character falls in.
818+Parser generator. From an associative [`++list`]() of characters or character
819+ranges to [`++rule`]()s, construct a [`++map`](), and parse [`++tape`]()s only
820+with `++rules` associated with a range that the `++tape`'s first character falls in.
578821
579822------------------------------------------------------------------------
580823
@@ -582,7 +825,27 @@ associated with a range the tape's first character falls in.
582825
583826Parse repeatedly
584827
585− ++ stir :: parse repeatedly
828+Parse with [`++rule`]() as many times as possible, and fold over results with a
829+binary gate.
830+
831+Accepts
832+-------
833+
834+`rud` is a noun.
835+
836+`raq` is a gate that takes two nouns and produces a cell.
837+
838+`fel` is a rule.
839+
840+Produces
841+--------
842+
843+A rule.
844+
845+Source
846+------
847+
848+++ stir :: parse repeatedly
586849 ~/ %stir
587850 |* [rud=* raq=_|*([a=* b=*] [a b]) fel=_rule]
588851 ~/ %fun
@@ -596,14 +859,8 @@ Parse repeatedly
596859 [(last p.vex p.wag) [~ (raq p.u.q.vex p.u.q.wag) q.u.q.wag]]
597860 ::
598861
599−Parse with rule as many times as possible, and fold over results with a
600−binary gate.
601−
602−`rud` is a noun.
603−
604−`raq` is a gate that takes two nouns and produces a cell.
605−
606−`fel` is a rule.
862+Examples
863+--------
607864
608865 ~zod/try=> (scan "abc" (stir *@ add prn))
609866 294
@@ -616,6 +873,23 @@ binary gate.
616873
617874Parse several times
618875
876+Parse bounded number of times.
877+
878+Accepts
879+-------
880+
881+`[les=@ mos=@]` is a cell of atoms indicating the bounds.
882+
883+`fel` is a [`++rule`]().
884+
885+Produces
886+--------
887+
888+A [`++rule`]().
889+
890+Source
891+------
892+
619893 ++ stun :: parse several times
620894 |* [[les=@ mos=@] fel=_rule]
621895 |= tub=nail
@@ -636,11 +910,8 @@ Parse several times
636910 wag
637911 [p.wag [~ [p.u.q.vex p.u.q.wag] q.u.q.wag]]
638912
639−Parse bounded number of times.
640−
641−`[les=@ mos=@]` is a cell of atoms indicating the bounds.
642−
643−`fel` is a rule.
913+Examples
914+--------
644915
645916 ~zod/try=> ((stun [5 10] prn) [1 1] "aquickbrownfoxran")
646917 [p=[p=1 q=11] q=[~ [p="aquickbrow" q=[p=[p=1 q=11] q="nfoxran"]]]]
docs/dev/hoon/library/2ed.md+191−65
@@ -5,6 +5,29 @@ section 2eD
55
66Conditional composer
77
8+Parsing composer: connects the [`++edge`]() `vex` with the subsequent [`++rule`]() `sab`
9+as an optional suffix, using [gate]() `raq` to compose or reject its
10+result. If there is no suffix, or if the suffix fails to be composed
11+with the current result, the current result is produced. Used to map a
12+group of rules to a specified output.
13+
14+Accepts
15+-------
16+
17+`raq` is a [gate]().
18+
19+`sab` is a [rule]().
20+
21+`vex` is an [edge]().
22+
23+Produces
24+--------
25+
26+A [`++rule`]().
27+
28+Source
29+------
30+
831 ++ bend :: conditional comp
932 ~/ %bend
1033 |* raq=_|*([a=* b=*] [~ u=[a b]])
@@ -22,17 +45,8 @@ Conditional composer
2245 [p=yur q=[~ u=[p=u.vux q=q.u.q.yit]]]
2346 ::
2447
25−Parsing composer: connects the edge `vex` with the subsequent rule `sab`
26−as an optional suffix, using the gate `raq` to compose or reject its
27−result. If there is no suffix, or if the suffix fails to be composed
28−with the current result, the current result is produced. Used to map a
29−group of rules to a specified output.
30−
31−`raq` is a [gate]().
32−
33−`sab` is a [rule]().
34−
35−`vex` is an [edge]().
48+Examples
49+--------
3650
3751 ~zod/try=> (;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qs")
3852 [p=[p=1 q=3] q=[~ u=[p=~~q q=[p=[p=1 q=2] q="s"]]]]
@@ -54,6 +68,28 @@ group of rules to a specified output.
5468
5569Arbitrary compose
5670
71+Parsing composer: connects the [`++edge`]() `vex` with a following [`++rule`]() `sab`,
72+combining the contents of `vex` with the result of `sab` using a binary
73+[gate]() `raq`. Used to fold over the results of several `++rules`.
74+
75+Accepts
76+-------
77+
78+`raq` is a gate that accepts a cell of two [nouns](), `a` and `b`, and
79+produces a cell of two nouns.
80+
81+`sab` is a rule.
82+
83+`vex` is an edge.
84+
85+Produces
86+--------
87+
88+A [`++rule`]().
89+
90+Source
91+------
92+
5793 ++ comp
5894 ~/ %comp
5995 |* raq=_|*([a=* b=*] [a b]) :: arbitrary compose
@@ -68,16 +104,8 @@ Arbitrary compose
68104 [p=yur q=[~ u=[p=(raq p.u.q.vex p.u.q.yit) q=q.u.q.yit]]]
69105 ::
70106
71−Parsing composer: connects the edge `vex` with a following rule `sab`,
72−combining the contents of `vex` with the result of `sab` using a binary
73−gate `raq`. Used to fold over the results of several rules.
74−
75−`raq` is a [gate]() that accepts a cell of two nouns, `a` and `b`, and
76−produces a cell of two nouns.
77−
78−`sab` is a [rule]().
79−
80−`vex` is an [edge]().
107+Examples
108+--------
81109
82110 ~zod/try=> (scan "123" ;~((comp |=([a=@u b=@u] (add a b))) dit dit dit))
83111 6
@@ -91,6 +119,27 @@ produces a cell of two nouns.
91119
92120Skip delimiter
93121
122+Parsing composer: connects an [`++edge`]() `vex` with a following [`++rule`]() `sab` by
123+parsing the `++rule` `bus` (the delimiting symbol) and throwing out the
124+result.
125+
126+Accepts
127+-------
128+
129+`bus` is a `++rule`.
130+
131+`sab` is a `++rule`.
132+
133+`vex` is an `++edge`.
134+
135+Produces
136+--------
137+
138+
139+
140+Source
141+------
142+
94143 ++ glue :: add rule
95144 ~/ %glue
96145 |* bus=_rule
@@ -99,15 +148,8 @@ Skip delimiter
99148 (plug vex ;~(pfix bus sab))
100149 ::
101150
102−Parsing composer: connects an edge `vex` with a following rule `sab` by
103−parsing the rule `bus` (the delimiting symbol) and throwing out the
104−result.
105−
106−`bus` is a [rule]().
107−
108−`sab` is a [rule]().
109−
110−`vex` is an [edge]().
151+Examples
152+--------
111153
112154 ~zod/try=> (scan "200|mal|bon" ;~((glue bar) dem sym sym))
113155 [q=200 7.102.829 7.237.474]
@@ -124,6 +166,24 @@ result.
124166
125167Parse unless
126168
169+Parsing composer: if an [`++edge`]() `vex` reflects a success, fail. Otherwise,
170+connect `vex` with the following [`++rule`]().
171+
172+Accepts
173+-------
174+
175+`sab` is a `++rule`.
176+
177+`vex` is an `++edge`.
178+
179+Produces
180+--------
181+
182+
183+
184+Source
185+------
186+
127187 ++ less :: no first and second
128188 |* [vex=edge sab=_rule]
129189 ?~ q.vex
@@ -132,12 +192,8 @@ Parse unless
132192 vex(q ~)
133193 ::
134194
135−Parsing composer: if an edge `vex` reflects a success, fail. Otherwise,
136−connect `vex` with the following rule.
137−
138−`sab` is a [rule]().
139−
140−`vex` is an [edge]().
195+Examples
196+--------
141197
142198 ~zod/try=> (scan "sas-/lo" (star ;~(less lus bar prn)))
143199 "sas-/lo"
@@ -154,15 +210,29 @@ connect `vex` with the following rule.
154210
155211Discard first rule
156212
213+Parsing composer: connects an [`++edge`]() `vex` with two subsequent [`++rule`]()s,
214+ignoring the result of the first and producing the result of the second.
215+
216+Accepts
217+-------
218+
219+`vex` is an [edge]().
220+
221+Produces
222+--------
223+
224+
225+
226+Source
227+------
228+
157229 ++ pfix :: discard first rule
158230 ~/ %pfix
159231 (comp |*([a=* b=*] b))
160232 ::
161233
162−Parsing composer: connects an [edge]() `vex` with two subsequent rules,
163−ignoring the result of the first and producing the result of the second.
164−
165−`vex` is an [edge]().
234+Examples
235+--------
166236
167237 ~zod/try=> `@t`(scan "%him" ;~(pfix cen sym))
168238 'him'
@@ -175,6 +245,25 @@ ignoring the result of the first and producing the result of the second.
175245
176246Parse to tuple
177247
248+Parsing composer: connects an [`++edge`]() `vex` with a following [`++rule`]() `sab`, producing
249+a cell of both the results. See also: the monad applicator [;\~]() for a
250+more detailed explanation.
251+
252+Accepts
253+-------
254+
255+`sab` is a `++rule`.
256+
257+`vex` is an `++edge`.
258+
259+Produces
260+--------
261+
262+
263+
264+Source
265+------
266+
178267 ++ plug :: first then second
179268 ~/ %plug
180269 |* [vex=edge sab=_rule]
@@ -187,13 +276,8 @@ Parse to tuple
187276 [p=yur q=[~ u=[p=[p.u.q.vex p.u.q.yit] q=q.u.q.yit]]]
188277 ::
189278
190−Parsing composer: connects `vex` with a following rule `sab`, producing
191−a cell of both the results. See also: the monad applicator [;\~]() for a
192−more detailed explanation.
193−
194−`sab` is a [rule]().
195−
196−`vex` is an [edge]().
279+Examples
280+--------
197281
198282 ~zod/try=> (scan "1..20" ;~(plug dem dot dot dem))
199283 [q=1 ~~~. ~~~. q=20]
@@ -208,6 +292,24 @@ more detailed explanation.
208292
209293Parse options
210294
295+Parsing composer: if `vex` reflects a failure, connect it with the
296+following rule `sab`. See also: the monad applicator [;\~]()
297+
298+Accepts
299+-------
300+
301+`sab` is a [`++rule`]().
302+
303+`vex` is an [`++edge`]().
304+
305+Produces
306+--------
307+
308+
309+
310+Source
311+------
312+
211313 ++ pose :: first or second
212314 ~/ %pose
213315 |* [vex=edge sab=_rule]
@@ -216,12 +318,8 @@ Parse options
216318 [p=(last p.vex p.roq) q=q.roq]
217319 vex
218320
219−Parsing composer: if `vex` reflects a failure, connect it with the
220−following rule `sab`. See also: the monad applicator [;\~]()
221−
222−`sab` is a [rule]().
223−
224−`vex` is an [edge]().
321+Examples
322+--------
225323
226324 ~zod/try=> `@t`(scan "+" ;~(pose lus tar cen))
227325 '+'
@@ -239,6 +337,24 @@ following rule `sab`. See also: the monad applicator [;\~]()
239337
240338First and second
241339
340+Parsing composer: if an [`++edge`]() `vex` reflects a failure, fail. Otherwise,
341+connect `vex` with the following [`++rule`]().
342+
343+Accepts
344+-------
345+
346+`sab` is a `++rule`.
347+
348+`vex` is an `++edge`.
349+
350+Produces
351+--------
352+
353+
354+
355+Source
356+------
357+
242358 ++ simu :: first and second
243359 |* [vex=edge sab=_rule]
244360 ?~ q.vex
@@ -247,12 +363,8 @@ First and second
247363 roq
248364 ::
249365
250−Parsing composer: if an edge `vex` reflects a failure, fail. Otherwise,
251−connect `vex` with the following rule.
252−
253−`sab` is a [rule]().
254−
255−`vex` is an [edge]().
366+Examples
367+--------
256368
257369 ~zod/try=> (scan "~zod" scat:vast)
258370 [%dtzy p=%p q=0]
@@ -270,16 +382,30 @@ connect `vex` with the following rule.
270382
271383Discard second rule
272384
385+Parsing composer: connects [`++edge`]()s `vex` with two subsequent [`++rule`]()s returning the
386+result of the first and discarding the result of the second.
387+
388+Accepts
389+-------
390+
391+`a` is the result of parsing the first `++rule`.
392+
393+`b` is the result of of parsing the second `++rule`.
394+
395+Produces
396+--------
397+
398+
399+
400+Source
401+------
402+
273403 ++ sfix :: discard second rule
274404 ~/ %sfix
275405 (comp |*([a=* b=*] a))
276406
277−Parsing composer: connects `vex` with two subsequent rules returning the
278−result of the first and discarding the result of the second.
279−
280−`a` is the result of parsing the first [rule]().
281−
282−`b` is the result of of parsing the second [rule]().
407+Examples
408+--------
283409
284410 ~zod/try=> `@t`(scan "him%" ;~(sfix sym cen))
285411 'him'
docs/dev/hoon/library/2ee.md+166−56
@@ -1,8 +1,26 @@
1−section 2eE, parsing (composers)
1+section 2ee, parsing (composers)
22================================
33
44### `++bass`
55
6+Parser modifier: [LSB](http://en.wikipedia.org/wiki/Least_significant_bit)
7+ordered [`++list`]() as atom of a [`++base`]().
8+
9+Accepts
10+-------
11+
12+`wuc` is an atom.
13+
14+`tyd` is a [`++rule`]().
15+
16+Produces
17+--------
18+
19+A [`++rule`]().
20+
21+Source
22+------
23+
624 ++ bass
725 |* [wuc=@ tyd=_rule]
826 %+ cook
@@ -11,16 +29,10 @@ section 2eE, parsing (composers)
1129 waq
1230 =|([p=@ q=@] |.((add p (mul wuc q))))
1331 tyd
14− ::
15−
16−Parser modifier:
17−[LSB](http://en.wikipedia.org/wiki/Least_significant_bit) ordered list
18−as atom of a base.
19−
20−`wuc` is an [atom]().
21−
22−`tyd` is a [rule]().
2332
33+Examples
34+--------
35+
2436 ~zod/try=> (scan "123" (bass 10 (star dit)))
2537 q=123
2638 ~zod/try=> (scan "123" (bass 8 (star dit)))
@@ -32,6 +44,24 @@ as atom of a base.
3244
3345### `++boss`
3446
47+Parser modifier: [LSB](http://en.wikipedia.org/wiki/Least_significant_bit)
48+ordered [`++list`]() as atom of a [`++base`]().
49+
50+Accepts
51+-------
52+
53+`wuc` is an atom.
54+
55+`tyd` is a [`++rule`]().
56+
57+Produces
58+--------
59+
60+A [`++rule`]().
61+
62+Source
63+------
64+
3565 ++ boss
3666 |* [wuc=@ tyd=_rule]
3767 %+ cook
@@ -40,16 +70,10 @@ as atom of a base.
4070 waq
4171 =|([p=@ q=@] |.((add p (mul wuc q))))
4272 tyd
43− ::
44−
45−Parser modifier:
46−[LSB](http://en.wikipedia.org/wiki/Least_significant_bit) ordered list
47−as atom of a base.
48−
49−`wuc` is an [atom]().
50−
51−`tyd` is a [rule]().
5273
74+Examples
75+--------
76+
5377 ~zod/try=> (scan "123" (boss 10 (star dit)))
5478 q=321
5579 ~zod/try=> `@t`(scan "bam" (boss 256 (star alp)))
@@ -61,18 +85,33 @@ as atom of a base.
6185
6286### `++ifix`
6387
64− ++ ifix
65− |* [fel=[p=_rule q=_rule] hof=_rule]
66− ;~(pfix p.fel ;~(sfix hof q.fel))
67− ::
88+Surround
6889
69−Parser modifier: surround with pair of rules, output of which is
90+Parser modifier: surround with pair of [`++rule`]()s, the output of which is
7091discarded.
7192
72−`fel` is a pair of [rule]()s.
93+Accepts
94+-------
95+
96+`fel` is a pair of `++rule`s.
97+
98+`hof` is a `++rule`.
7399
74−`hof` is a [rule]().
100+Produces
101+--------
75102
103+A `++rule`.
104+
105+Source
106+------
107+
108+ ++ ifix
109+ |* [fel=[p=_rule q=_rule] hof=_rule]
110+ ;~(pfix p.fel ;~(sfix hof q.fel))
111+
112+Examples
113+--------
114+
76115 ~zod/try=> (scan "-40-" (ifix [hep hep] dem))
77116 q=40
78117 ~zod/try=> (scan "4my4" (ifix [dit dit] (star alf)))
@@ -82,17 +121,32 @@ discarded.
82121
83122### `++more`
84123
85− ++ more
86− |* [bus=_rule fel=_rule]
87− ;~(pose (most bus fel) (easy ~))
88− ::
124+Parse list with delimiter
125+
126+Parser modifier: Parse a list of matches using a delimiter [`++rule`]().
127+
128+Accepts
129+-------
130+
131+`bus` is a `++rule`.
132+
133+`fel` is a `++rule`.
134+
135+Produces
136+--------
89137
90−Parser modifier: using a delimiter rule, parse a list of matches.
138+A `++rule`.
91139
92−`bus` is a [rule]().
140+Source
141+------
93142
94−`fel` is a [rule]().
143+ ++ more
144+ |* [bus=_rule fel=_rule]
145+ ;~(pose (most bus fel) (easy ~))
95146
147+Examples
148+--------
149+
96150 ~zod/try=> (scan "" (more ace dem))
97151 ~
98152 ~zod/try=> (scan "40 20" (more ace dem))
@@ -104,18 +158,32 @@ Parser modifier: using a delimiter rule, parse a list of matches.
104158
105159### `++most`
106160
107− ++ most
108− |* [bus=_rule fel=_rule]
109− ;~(plug fel (star ;~(pfix bus fel)))
110− ::
161+Parse list of at least one match
162+
163+Parser modifier: parse a [`++list`]() of at least one match using a delimiter [`++rule`]().
164+
165+Accepts
166+-------
167+
168+`bus` is a `++rule`.
169+
170+`fel` is a `++rule`.
111171
112−Parser modifier: using a delimiter rule, parse a list of at least one
113−match.
172+Produces
173+--------
114174
115−`bus` is a [rule]().
175+A `++rule`.
116176
117−`fel` is a [rule]().
177+Source
178+------
118179
180+ ++ most
181+ |* [bus=_rule fel=_rule]
182+ ;~(plug fel (star ;~(pfix bus fel)))
183+
184+Examples
185+--------
186+
119187 ~zod/try=> (scan "40 20" (most ace dem))
120188 [q=40 ~[q=20]]
121189 ~zod/try=> (scan "40 20 60 1 5" (most ace dem))
@@ -128,12 +196,28 @@ match.
128196
129197### `++plus`
130198
131− ++ plus |*(fel=_rule ;~(plug fel (star fel)))
199+List of at least one match.
132200
133−Parser modifier: parse list of at least one match
201+Parser modifier: parse [`++list`]() of at least one match.
134202
135−`fel` is a [rule]().
203+Accepts
204+-------
136205
206+`fel` is a [`++rule`]().
207+
208+Produces
209+--------
210+
211+A `++rule`.
212+
213+Source
214+------
215+
216+ ++ plus |*(fel=_rule ;~(plug fel (star fel)))
217+
218+Examples
219+--------
220+
137221 ~zod/try=> (scan ">>>>" (cook lent (plus gar)))
138222 4
139223 ~zod/try=> (scan "- - " (plus ;~(pose ace hep)))
@@ -147,19 +231,34 @@ Parser modifier: parse list of at least one match
147231
148232### `++slug`
149233
150− ++ slug
151− |* raq=_|*([a=* b=*] [a b])
152− |* [bus=_rule fel=_rule]
153− ;~((comp raq) fel (stir rud raq ;~(pfix bus fel)))
154− ::
234+Use gate to parse delimited list
155235
156−Parser modifier: By composing with a gate, parse a delimited list of
236+Parser modifier: By composing with a [gate](), parse a delimited [`++list`]() of
157237matches.
158238
159−`bus` is a [rule]().
239+Accepts
240+-------
241+
242+`bus` is a [`++rule`]().
160243
161−`fel` is a [rule]().
244+`fel` is a `++rule`.
162245
246+Produces
247+--------
248+
249+A `++rule`.
250+
251+Source
252+------
253+
254+ ++ slug
255+ |* raq=_|*([a=* b=*] [a b])
256+ |* [bus=_rule fel=_rule]
257+ ;~((comp raq) fel (stir +<+.raq raq ;~(pfix bus fel)))
258+
259+Examples
260+--------
261+
163262 ~zod/try=> (scan "20+5+110" ((slug add) lus dem))
164263 135
165264 ~zod/try=> `@t`(scan "a b c" ((slug |=(a=[@ @t] (cat 3 a))) ace alp))
@@ -169,14 +268,25 @@ matches.
169268
170269### `++star`
171270
271+List of matches
272+
273+Parser modifier: parse [`++list`]() of matches.
274+
275+Accepts
276+-------
277+
278+`fel` is a [`++rule`]().
279+
280+Produces
281+--------
282+
172283 ++ star :: 0 or more times
173284 |* fel=_rule
174285 (stir `(list ,_(wonk *fel))`~ |*([a=* b=*] [a b]) fel)
175286
176−Parser modifier: parse list of matches.
177−
178−`fel` is a [rule]().
179−
287+Examples
288+--------
289+
180290 ~zod/try=> (scan "aaaaa" (just 'a'))
181291 ! {1 2}
182292 ! 'syntax-error'
docs/dev/hoon/library/2ef.md+241−46
@@ -5,9 +5,15 @@ section 2eF, parsing (ascii)
55
66Parse space
77
8+Parses ASCII character 32, space.
9+
10+Source
11+------
12+
813 ++ ace (just ' ')
914
10−Parses ASCII character 32, space.
15+Examples
16+--------
1117
1218 ~zod/try=> (scan " " ace)
1319 ~~.
@@ -24,9 +30,15 @@ Parses ASCII character 32, space.
2430
2531Parse vertical bar
2632
33+Parses ASCII character 124, the vertical bar.
34+
35+Source
36+------
37+
2738 ++ bar (just '|')
2839
29−Parses ASCII character 124, the vertical bar.
40+Examples
41+--------
3042
3143 ~zod/try=> (scan "|" bar)
3244 ~~~7c.
@@ -43,10 +55,17 @@ Parses ASCII character 124, the vertical bar.
4355
4456Parse backslash
4557
58+Parses ASCII character 92, the backslash. Note the extra `\` in the calling of
59+`bas` with [`++just`](/doc/hoon/library/2ec#++just) is to escape the escape
60+character, `\`.
61+
62+Source
63+------
64+
4665 ++ bas (just '\\')
4766
48−Parses ASCII character 92, the backslash. Note the extra `\` in the slam
49−of `bas` with [`++just`](/doc/hoon/library/2ec#++just) is to escape the escape character, `\`.
67+Examples
68+--------
5069
5170 ~zod/try=> (scan "\\" bas)
5271 ~~~5c.
@@ -65,9 +84,15 @@ of `bas` with [`++just`](/doc/hoon/library/2ec#++just) is to escape the escape c
6584
6685Parse dollar sign
6786
87+Parses ASCII character 36, the dollar sign.
88+
89+Source
90+------
91+
6892 ++ buc (just '$')
6993
70−Parses ASCII character 36, the dollar sign.
94+Examples
95+--------
7196
7297 ~zod/try=> (scan "$" buc)
7398 ~~~24.
@@ -84,9 +109,15 @@ Parses ASCII character 36, the dollar sign.
84109
85110Parse underscore
86111
112+Parses ASCII character 95, the underscore.
113+
114+Source
115+------
116+
87117 ++ cab (just '_')
88118
89−Parses ASCII character 95, the underscore.
119+Examples
120+--------
90121
91122 ~zod/try=> (scan "_" cab)
92123 ~~~5f.
@@ -103,9 +134,15 @@ Parses ASCII character 95, the underscore.
103134
104135Parses percent sign
105136
137+Parses ASCII character 37, the percent sign.
138+
139+Source
140+------
141+
106142 ++ cen (just '%')
107143
108−Parses ASCII character 37, the percent sign.
144+Examples
145+--------
109146
110147 ~zod/try=> (scan "%" cen)
111148 ~~~25.
@@ -122,9 +159,15 @@ Parses ASCII character 37, the percent sign.
122159
123160Parse colon
124161
162+Parses ASCII character 58, the colon
163+
164+Source
165+------
166+
125167 ++ col (just ':')
126168
127−Parses ASCII character 58, the colon
169+Examples
170+--------
128171
129172 ~zod/try=> (scan ":" col)
130173 ~~~3a.
@@ -141,9 +184,15 @@ Parses ASCII character 58, the colon
141184
142185Parse comma
143186
187+Parses ASCII character 44, the comma.
188+
189+Source
190+------
191+
144192 ++ com (just ',')
145193
146−Parses ASCII character 44, the comma.
194+Examples
195+--------
147196
148197 ~zod/try=> (scan "," com)
149198 ~~~2c.
@@ -160,19 +209,25 @@ Parses ASCII character 44, the comma.
160209
161210Parse double quote
162211
212+Parses ASCII character 34, the double quote.
213+
214+Source
215+------
216+
163217 ++ doq (just '"')
164218
165−Parses ASCII character 34, the double quote.
219+Examples
220+--------
166221
167− ~tadbyl-hilbel/try=> (scan "\"" doq)
222+ ~zod/try=> (scan "\"" doq)
168223 ~~~22.
169− ~tadbyl-hilbel/try=> `cord`(scan "\"" doq)
224+ ~zod/try=> `cord`(scan "\"" doq)
170225 '"'
171− ~tadbyl-hilbel/try=> (doq [[1 1] "\""])
226+ ~zod/try=> (doq [[1 1] "\""])
172227 [p=[p=1 q=2] q=[~ [p=~~~22. q=[p=[p=1 q=2] q=""]]]]
173− ~tadbyl-hilbel/try=> (doq [[1 1] "not successfully parsed"])
228+ ~zod/try=> (doq [[1 1] "not successfully parsed"])
174229 [p=[p=1 q=1] q=~]
175− ~tadbyl-hilbel/try=> (scan "see?" doq)
230+ ~zod/try=> (scan "see?" doq)
176231 ! {1 1}
177232 ! 'syntax-error'
178233 ! exit
@@ -183,9 +238,15 @@ Parses ASCII character 34, the double quote.
183238
184239Parse period
185240
241+Parses ASCII character 46, the period.
242+
243+Source
244+------
245+
186246 ++ dot (just '.')
187247
188−Parses ASCII character 46, the period.
248+Examples
249+--------
189250
190251 ~zod/try=> (scan "." dot)
191252 ~~~.
@@ -202,9 +263,15 @@ Parses ASCII character 46, the period.
202263
203264Parse forward slash
204265
266+Parses ASCII character 47, the forward slash.
267+
268+Source
269+------
270+
205271 ++ fas (just '/')
206272
207−Parses ASCII character 47, the forward slash.
273+Examples
274+--------
208275
209276 ~zod/try=> (scan "/" fas)
210277 ~~~2f.
@@ -221,9 +288,15 @@ Parses ASCII character 47, the forward slash.
221288
222289Parse less-than sign
223290
291+Parses ASCII character 60, the less-than sign.
292+
293+Source
294+------
295+
224296 ++ gal (just '<')
225297
226−Parses ASCII character 60, the less-than sign.
298+Examples
299+--------
227300
228301 ~zod/try=> (scan "<" gal)
229302 ~~~3c.
@@ -242,9 +315,15 @@ Parses ASCII character 60, the less-than sign.
242315
243316Parse greater-than sign
244317
318+Parses ASCII character 62, the greater-than sign.
319+
320+Source
321+------
322+
245323 ++ gar (just '>')
246324
247−Parses ASCII character 62, the greater-than sign.
325+Examples
326+--------
248327
249328 ~zod/try=> (scan ">" gar)
250329 ~~~3e.
@@ -261,9 +340,15 @@ Parses ASCII character 62, the greater-than sign.
261340
262341Parse number sign
263342
343+Parses ASCII character 35, the number sign.
344+
345+Source
346+------
347+
264348 ++ hax (just '#')
265349
266−Parses ASCII character 35, the number sign.
350+Examples
351+--------
267352
268353 ~zod/try=> (scan "#" hax)
269354 ~~~23.
@@ -280,12 +365,18 @@ Parses ASCII character 35, the number sign.
280365
281366Parse left curley bracket
282367
283− ++ kel (just '{')
284−
285368Parses ASCII character 123, the left curly bracket. Note that `{`
286369(`kel`) and `}` (`ker`) open and close a Hoon expression for Hoon string
287370interpolation. To parse either of them, they must be escaped.
288371
372+Source
373+------
374+
375+ ++ kel (just '{')
376+
377+Examples
378+--------
379+
289380 ~zod/try=> (scan "\{" kel)
290381 ~~~7b.
291382 ~zod/try=> `cord`(scan "\{" kel)
@@ -301,12 +392,18 @@ interpolation. To parse either of them, they must be escaped.
301392
302393Parse right curley bracket
303394
304− ++ ker (just '}')
305−
306395Parses ASCII character 125, the right curly bracket. Note that `{`
307396(`kel`) and `}` (`ker`) open and close a Hoon expression for Hoon string
308397interpolation. To parse either of them, they must be escaped.
309398
399+Source
400+------
401+
402+ ++ ker (just '}')
403+
404+Examples
405+--------
406+
310407 ~zod/try=> (scan "}" ker)
311408 ~~~7d.
312409 ~zod/try=> `cord`(scan "}" ker)
@@ -322,9 +419,15 @@ interpolation. To parse either of them, they must be escaped.
322419
323420Parse caret
324421
422+Parses ASCII character 94, the caret.
423+
424+Source
425+------
426+
325427 ++ ket (just '^')
326428
327−Parses ASCII character 94, the caret.
429+Examples
430+--------
328431
329432 ~zod/try=> (scan "^" ket)
330433 ~~~5e.
@@ -341,9 +444,15 @@ Parses ASCII character 94, the caret.
341444
342445Parse plus sign
343446
447+Parses ASCII character 43, the plus sign.
448+
449+Source
450+------
451+
344452 ++ lus (just '+')
345453
346−Parses ASCII character 43, the plus sign.
454+Examples
455+--------
347456
348457 ~zod/try=> (scan "+" lus)
349458 ~~~2b.
@@ -360,9 +469,15 @@ Parses ASCII character 43, the plus sign.
360469
361470Parse hyphen
362471
472+Parses ASCII character 45, the hyphen.
473+
474+Source
475+------
476+
363477 ++ hep (just '-')
364478
365−Parses ASCII character 45, the hyphen.
479+Examples
480+--------
366481
367482 ~zod/try=> (scan "-" hep)
368483 ~~-
@@ -379,9 +494,15 @@ Parses ASCII character 45, the hyphen.
379494
380495Parse left parenthesis
381496
497+Parses ASCII character 40, the left parenthesis.
498+
499+Source
500+------
501+
382502 ++ pel (just '(')
383503
384−Parses ASCII character 40, the left parenthesis.
504+Examples
505+--------
385506
386507 ~zod/try=> (scan "(" pel)
387508 ~~~28.
@@ -398,9 +519,15 @@ Parses ASCII character 40, the left parenthesis.
398519
399520Parse ampersand
400521
522+Parses ASCII character 38, the ampersand.
523+
524+Source
525+------
526+
401527 ++ pam (just '&')
402528
403−Parses ASCII character 38, the ampersand.
529+Examples
530+--------
404531
405532 ~zod/try=> (scan "&" pam)
406533 ~~~26.
@@ -417,9 +544,15 @@ Parses ASCII character 38, the ampersand.
417544
418545Parse right parenthesis
419546
547+Parses ASCII character 41, the right parenthesis.
548+
549+Source
550+------
551+
420552 ++ per (just ')')
421553
422−Parses ASCII character 41, the right parenthesis.
554+Examples
555+--------
423556
424557 ~zod/try=> (scan ")" per)
425558 ~~~29.
@@ -436,9 +569,15 @@ Parses ASCII character 41, the right parenthesis.
436569
437570Parse "at" sign
438571
572+Parses ASCII character 64, the "at" sign.
573+
574+Source
575+------
576+
439577 ++ pat (just '@')
440578
441−Parses ASCII character 64, the "at" sign.
579+Examples
580+--------
442581
443582 ~zod/try=> (scan "@" pat)
444583 ~~~4.
@@ -455,11 +594,15 @@ Parses ASCII character 64, the "at" sign.
455594
456595Parse left square bracket
457596
458−Left square bracket
597+Parses ASCII character 91, the left square bracket.
598+
599+Source
600+------
459601
460602 ++ sel (just '[')
461603
462−Parses ASCII character 91, the left square bracket.
604+Examples
605+--------
463606
464607 ~zod/try=> (scan "[" sel)
465608 ~~~5b.
@@ -476,11 +619,15 @@ Parses ASCII character 91, the left square bracket.
476619
477620Parse semicolon
478621
479− ++ sem (just ';')
480−
481622Parses ASCII character 59, the semicolon.
482623
483−### `Examples`
624+Source
625+------
626+
627+ ++ sem (just ';')
628+
629+Examples
630+--------
484631
485632 ~zod/try=> (scan ";" sem)
486633 ~~~3b.
@@ -497,9 +644,15 @@ Parses ASCII character 59, the semicolon.
497644
498645Parse right square bracket
499646
647+Parses ASCII character 93, the right square bracket.
648+
649+Source
650+------
651+
500652 ++ ser (just ']')
501653
502−Parses ASCII character 93, the right square bracket.
654+Examples
655+--------
503656
504657 ~zod/try=> (scan "]" ser)
505658 ~~~5d.
@@ -516,9 +669,15 @@ Parses ASCII character 93, the right square bracket.
516669
517670Parse tilde
518671
672+Parses ASCII character 126, the tilde.
673+
674+Source
675+------
676+
519677 ++ sig (just '~')
520678
521−Parses ASCII character 126, the tilde.
679+Examples
680+--------
522681
523682 ~zod/try=> (scan "~" sig)
524683 ~~~~
@@ -535,10 +694,16 @@ Parses ASCII character 126, the tilde.
535694
536695Parse single quote
537696
697+Parses ASCII character 39, soq. Note the extra '' is to escape the first
698+`soq` because soq delimits a [`++cord`]().
699+
700+Source
701+------
702+
538703 ++ soq (just '\'')
539704
540−Parses ASCII character 39, soq. Note the extra '' is to escape the first
541−`soq` because soq delimits a cord.
705+Examples
706+--------
542707
543708 ~zod/try=> (scan "'" soq)
544709 ~~~27.
@@ -555,9 +720,15 @@ Parses ASCII character 39, soq. Note the extra '' is to escape the first
555720
556721Parse asterisk
557722
723+Parses ASCII character 42, the asterisk.
724+
725+Source
726+------
727+
558728 ++ tar (just '*')
559729
560−Parses ASCII character 42, the asterisk.
730+Examples
731+--------
561732
562733 ~zod/try=> (scan "*" tar)
563734 ~~~2a.
@@ -574,10 +745,16 @@ Parses ASCII character 42, the asterisk.
574745
575746Parse backtick
576747
748+Parses ASCII character 96, the backtick (also known as the "grave
749+accent").
750+
751+Source
752+------
753+
577754 ++ tec (just '`') :: backTiCk
578755
579−Parses ASCII character 96, the backtick (also known as the "grave
580−accent".
756+Examples
757+--------
581758
582759 ~zod/try=> (scan "`" tec)
583760 ~~~6.
@@ -594,9 +771,15 @@ accent".
594771
595772Parse equals sign
596773
774+Parses ASCII character 61, the equals sign.
775+
776+Source
777+------
778+
597779 ++ tis (just '=')
598780
599−Parses ASCII character 61, the equals sign.
781+Examples
782+--------
600783
601784 ~zod/try=> (scan "=" tis)
602785 ~~~3d.
@@ -613,9 +796,15 @@ Parses ASCII character 61, the equals sign.
613796
614797Parses question mark
615798
799+Parses ASCII character 63, the question mark.
800+
801+Source
802+------
803+
616804 ++ wut (just '?')
617805
618−Parses ASCII character 63, wut.
806+Examples
807+--------
619808
620809 ~zod/try=> (scan "?" wut)
621810 ~~~3f.
@@ -632,9 +821,15 @@ Parses ASCII character 63, wut.
632821
633822Exclamation point
634823
824+Parses ASCII character 33, the exclamation point zap.
825+
826+Source
827+------
828+
635829 ++ zap (just '!')
636830
637−Parses ASCII character 33, the exclamation point zap.
831+Examples
832+--------
638833
639834 ~zod/try=> (scan "!" zap)
640835 ~~~21.
docs/dev/hoon/library/2eg.md+63−12
@@ -5,9 +5,15 @@ section 2eG, parsing (whitespace)
55
66`.` optional gap
77
8+Dot followed by an optional gap, used with numbers.
9+
10+Source
11+------
12+
813 ++ dog ;~(plug dot gay) ::
914
10−Dot followed by an optional gap, used in numbers.
15+Examples
16+--------
1117
1218 /~zod/try=> 1.234.
1319 703
@@ -21,9 +27,15 @@ Dot followed by an optional gap, used in numbers.
2127
2228`@p` separator
2329
30+Phonetic base phrase separator
31+
32+Source
33+------
34+
2435 ++ doh ;~(plug ;~(plug hep hep) gay) ::
2536
26−Phonetic base phrase separator
37+Examples
38+--------
2739
2840 /~zod/try=> ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
2941 ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
@@ -41,9 +53,15 @@ Phonetic base phrase separator
4153
4254`--` to `~`
4355
56+Parse phep, `--`, to null, `~`.
57+
58+Source
59+------
60+
4461 ++ dun (cold ~ ;~(plug hep hep)) :: -- (phep) to ~
4562
46−Parse phep, `--`, to null, `~`.
63+Examples
64+--------
4765
4866 ~zod/try=> (scan "--" dun)
4967 ~
@@ -56,9 +74,15 @@ Parse phep, `--`, to null, `~`.
5674
5775`==` to `~`
5876
77+Parse stet, `==`, to null `~`.
78+
79+Source
80+------
81+
5982 ++ duz (cold ~ ;~(plug tis tis)) :: == (stet) to ~
6083
61−Parse stet, `==`, to null `~`.
84+Examples
85+--------
6286
6387 ~zod/try=> (scan "==" duz)
6488 ~
@@ -71,9 +95,15 @@ Parse stet, `==`, to null `~`.
7195
7296Newline or ' '
7397
98+Whitespace component, either newline or space.
99+
100+Source
101+------
102+
74103 ++ gah (mask [`@`10 ' ' ~]) :: newline or ace
75104
76−Whitespace component, either newline or space.
105+Examples
106+--------
77107
78108 /~zod/try=> ^- * :: show spaces
79109 """
@@ -100,23 +130,30 @@ Whitespace component, either newline or space.
100130
101131Plural whitespace
102132
103− ++ gap (cold ~ ;~(plug gaq (star ;~(pose vul gah)))) :: plural whitespace
104−
105133Separates tall runes
106134
135+Source
136+------
137+
138+ ++ gap (cold ~ ;~(plug gaq (star ;~(pose vul gah)))) :: plural whitespace
139+
107140------------------------------------------------------------------------
108141
109142### `++gaq`
110143
111144End of line
112145
146+Two spaces, a newline, or comment.
147+
148+Source
149+------
150+
113151 ++ gaq ;~ pose :: end of line
114152 (just `@`10)
115153 ;~(plug gah ;~(pose gah vul))
116154 vul
117155 ==
118156
119−Two spaces, a newline, or comment.
120157
121158------------------------------------------------------------------------
122159
@@ -124,24 +161,35 @@ Two spaces, a newline, or comment.
124161
125162Classic whitespace
126163
127− ++ gaw (cold ~ (star ;~(pose vul gah))) :: classic white
164+Terran whitespace.
128165
129−Terran whitespace
166+Source
167+------
168+
169+ ++ gaw (cold ~ (star ;~(pose vul gah))) :: classic white
130170
131171------------------------------------------------------------------------
132172
133173### `++gay`
134174
175+Optional gap
176+
135177Optional gap.
136178
137− ++ gay ;~(pose gap (easy ~)) ::
179+Source
180+------
138181
139−Optional gap.
182+ ++ gay ;~(pose gap (easy ~)) ::
140183
141184------------------------------------------------------------------------
142185
143186### `++vul`
144187
188+Comments to null
189+
190+Source
191+------
192+
145193 ++ vul %- cold :- ~ :: comments
146194 ;~ plug col col
147195 (star prn)
@@ -151,6 +199,9 @@ Optional gap.
151199Parse comments and produce a null. Note that a comment must be ended
152200with a newline character.
153201
202+Examples
203+--------
204+
154205 ~zod/try=> (scan "::this is a comment \0a" vul)
155206 ~
156207 ~zod/try=> (scan "::this is a comment " vul)
docs/dev/hoon/library/2eh.md+187−32
@@ -5,9 +5,15 @@ section 2eH, parsing (idioms)
55
66Alphabetic characters
77
8+Parse alphabetic characters, both upper and lowercase.
9+
10+Source
11+------
12+
813 ++ alf ;~(pose low hig) :: alphabetic
914
10−Parse alphabetic characters, both upper and lowercase.
15+Examples
16+--------
1117
1218 ~zod/try=> (scan "a" alf)
1319 ~~a
@@ -22,9 +28,15 @@ Parse alphabetic characters, both upper and lowercase.
2228
2329Alphanumeric characters
2430
31+Parse alphanumeric characters - both alphabetic characters and numbers.
32+
33+Source
34+------
35+
2536 ++ aln ;~(pose low hig nud) :: alphanumeric
2637
27−Parse alphanumeric characters - both alphabetic characters and numbers.
38+Examples
39+--------
2840
2941 ~zod/try=> (scan "0" aln)
3042 ~~0
@@ -39,9 +51,15 @@ Parse alphanumeric characters - both alphabetic characters and numbers.
3951
4052Alphanumeric and `-`
4153
54+Parse alphanumeric strings and hep, "-".
55+
56+Source
57+------
58+
4259 ++ alp ;~(pose low hig nud hep) :: alphanumeric and -
4360
44−Parse alphanumeric strings and hep, "-".
61+Examples
62+--------
4563
4664 ~zod/try=> (scan "7" alp)
4765 ~~7
@@ -56,9 +74,15 @@ Parse alphanumeric strings and hep, "-".
5674
5775Axis syntax `-`, `+`
5876
77+Parse the hep and lus axis syntax.
78+
79+Source
80+------
81+
5982 ++ bet ;~(pose (cold 2 hep) (cold 3 lus)) :: axis syntax - +
6083
61−Parse the hep and lus axis syntax.
84+Examples
85+--------
6286
6387 ~zod/try=> (scan "-" bet)
6488 2
@@ -71,10 +95,15 @@ Parse the hep and lus axis syntax.
7195
7296Binary to atom
7397
98+Parse a tape of binary (0s and 1s) and produce its atomic representation.
99+
100+Source
101+------
102+
74103 ++ bin (bass 2 (most gon but)) :: binary to atom
75104
76−Parse a tape of binary (0s and 1s) and produce its atomic
77−representation.
105+Examples
106+--------
78107
79108 ~zod/try=> (scan "0000" bin)
80109 0
@@ -91,9 +120,15 @@ representation.
91120
92121Binary digit
93122
123+Parse a single binary digit.
124+
125+Source
126+------
127+
94128 ++ but (cook |=(a=@ (sub a '0')) (shim '0' '1')) :: binary digit
95129
96−Parse a single binary digit.
130+Examples
131+--------
97132
98133 ~zod/try=> (scan "0" but)
99134 0
@@ -112,9 +147,15 @@ Parse a single binary digit.
112147
113148Octal digit
114149
150+Parse a single octal digit.
151+
152+Source
153+------
154+
115155 ++ cit (cook |=(a=@ (sub a '0')) (shim '0' '7')) :: octal digit
116156
117−Parse a single octal digit.
157+Examples
158+--------
118159
119160 ~zod/try=> (scan "1" cit)
120161 1
@@ -133,9 +174,15 @@ Parse a single octal digit.
133174
134175Decimal to atom
135176
177+Parse a decimal number to an atom.
178+
179+Source
180+------
181+
136182 ++ dem (bass 10 (most gon dit)) :: decimal to atom
137183
138−Parse a decimal number to an atom.
184+Examples
185+--------
139186
140187 ~zod/try=> (scan "7" dem)
141188 7
@@ -152,9 +199,15 @@ Parse a decimal number to an atom.
152199
153200Decimal digit
154201
202+Parse a single decimal digit.
203+
204+Source
205+------
206+
155207 ++ dit (cook |=(a=@ (sub a '0')) (shim '0' '9')) :: decimal digit
156208
157−Parse a single decimal digit.
209+Examples
210+--------
158211
159212 ~zod/try=> (scan "7" dit)
160213 7
@@ -169,9 +222,15 @@ Parse a single decimal digit.
169222
170223Axis syntax `<` or `>`
171224
225+Parse the axis gal and gar axis syntax.
226+
227+Source
228+------
229+
172230 ++ gul ;~(pose (cold 2 gal) (cold 3 gar)) :: axis syntax < >
173231
174−Parse the axis gal and gar axis syntax.
232+Examples
233+--------
175234
176235 ~zod/try=> (scan "<" gul)
177236 2
@@ -184,10 +243,16 @@ Parse the axis gal and gar axis syntax.
184243
185244Long numbers
186245
187− ++ gon ;~(pose ;~(plug bas gay fas) (easy ~)) :: long numbers \ /
188−
189246Parse long numbers - Numbers which wrap around the shell with the line
190−break characters bas and fas.
247+
248+Source
249+------
250+
251+break ++ gon ;~(pose ;~(plug bas gay fas) (easy ~)) :: long numbers \ /
252+
253+Examples
254+--------
255+characters bas and fas.
191256
192257 ~zod/try=> (scan "\\/" gon)
193258 [~~~5c. ~ ~~~2f.]
@@ -200,9 +265,15 @@ break characters bas and fas.
200265
201266Hex to atom
202267
268+Parse any hexadecimal number to an atom.
269+
270+Source
271+------
272+
203273 ++ hex (bass 16 (most gon hit)) :: hex to atom
204274
205−Parse any hexadecimal number to an atom.
275+Examples
276+--------
206277
207278 ~zod/try=> (scan "a" hex)
208279 10
@@ -225,9 +296,15 @@ Parse any hexadecimal number to an atom.
225296
226297Uppercase
227298
299+Parse a single uppercase letter.
300+
301+Source
302+------
303+
228304 ++ hig (shim 'A' 'Z') :: uppercase
229305
230−Parse a single uppercase letter.
306+Examples
307+--------
231308
232309 ~zod/try=> (scan "G" hig)
233310 ~~~47.
@@ -244,13 +321,19 @@ Parse a single uppercase letter.
244321
245322Hex digits
246323
324+Parse a single hexadecimal digit.
325+
326+Source
327+------
328+
247329 ++ hit ;~ pose :: hex digits
248330 dit
249331 (cook |=(a=char (sub a 87)) (shim 'a' 'f'))
250332 (cook |=(a=char (sub a 55)) (shim 'A' 'F'))
251333 ==
252334
253−Parse a single hexadecimal digit.
335+Examples
336+--------
254337
255338 ~zod/try=> (scan "a" hit)
256339 10
@@ -267,9 +350,15 @@ Parse a single hexadecimal digit.
267350
268351Lowercase
269352
353+Parse a single lowercase letter.
354+
355+Source
356+------
357+
270358 ++ low (shim 'a' 'z') :: lowercase
271359
272−Parse a single lowercase letter.
360+Examples
361+--------
273362
274363 ~zod/try=> (scan "g" low)
275364 ~~g
@@ -286,11 +375,17 @@ Parse a single lowercase letter.
286375
287376Hexbyte
288377
378+Parse a hexbyte.
379+
380+Source
381+------
382+
289383 ++ mes %+ cook :: hexbyte
290384 |=([a=@ b=@] (add (mul 16 a) b))
291385 ;~(plug hit hit)
292386
293−Parse a hexbyte.
387+Examples
388+--------
294389
295390 ~zod/try=> (scan "2A" mes)
296391 42
@@ -303,11 +398,17 @@ Parse a hexbyte.
303398
304399### `++nix`
305400
306−Letters, `-`, and `_`
401+Letters and `-`
402+
403+Parse Letters and `-`.
404+
405+Source
406+------
307407
308408 ++ nix (boss 256 (star ;~(pose aln cab))) ::
309409
310−Letters, `-`, and `_`
410+Examples
411+--------
311412
312413 ~zod/try=> (scan "as_me" nix)
313414 q=435.626.668.897
@@ -320,9 +421,15 @@ Letters, `-`, and `_`
320421
321422Numeric
322423
424+Parse a numeric character - A number.
425+
426+Source
427+------
428+
323429 ++ nud (shim '0' '9') :: numeric
324430
325−Parse a numeric character - A number.
431+Examples
432+--------
326433
327434 ~zod/try=> (scan "0" nud)
328435 ~~0
@@ -339,9 +446,15 @@ Parse a numeric character - A number.
339446
340447Printable character
341448
449+Parse any printable character.
450+
451+Source
452+------
453+
342454 ++ prn ;~(less (just `@`127) (shim 32 256))
343455
344−Parse any printable character
456+Examples
457+--------
345458
346459 ~zod/try=> (scan "h" prn)
347460 ~~h
@@ -357,12 +470,18 @@ Parse any printable character
357470
358471Chars in blockcord
359472
473+Parse character in cord block.
474+
475+Source
476+------
477+
360478 ++ qat ;~ pose :: chars in blockcord
361479 prn
362480 ;~(less ;~(plug (just `@`10) soqs) (just `@`10))
363481 ==
364482
365−Parse character in cord block.
483+Examples
484+--------
366485
367486 ~zod/try=> (scan "h" qat)
368487 ~~h
@@ -380,12 +499,18 @@ Parse character in cord block.
380499
381500Chars in cord
382501
502+Parse an individual character to its cord atom representation.
503+
504+Source
505+------
506+
383507 ++ qit ;~ pose :: chars in a cord
384508 ;~(less bas soq prn)
385509 ;~(pfix bas ;~(pose bas soq mes)) :: escape chars
386510 ==
387511
388−Parse an individual character to its cord atom representation.
512+Examples
513+--------
389514
390515 ~zod/try=> (scan "%" qit)
391516 37
@@ -410,7 +535,13 @@ Parse an individual character to its cord atom representation.
410535
411536Cord
412537
413− ++ qut ;~ pose :: cord
538+Parse single-soq cord with `\{gap}/` anywhere in the middle, or triple-single
539+quote (aka triple-soq) cord, between which must be in an indented block.
540+
541+Source
542+------
543+
544+ ++ qut ;~ pose :: cord
414545 ;~ less soqs
415546 (ifix [soq soq] (boss 256 (more gon qit)))
416547 ==
@@ -423,8 +554,8 @@ Cord
423554 ==
424555 ::
425556
426−Parse single-soq cord with `\{gap}/` anywhere in the middle, or
427−triple-soq cord which must be in an indented block.
557+Examples
558+--------
428559
429560 ~zod/try=> (scan "'cord'" qut)
430561 q=1.685.221.219
@@ -443,9 +574,15 @@ triple-soq cord which must be in an indented block.
443574
444575Delimiting `'''`
445576
577+Parse a triple-single quote, used for multiline strings.
578+
579+Source
580+------
581+
446582 ++ soqs ;~(plug soq soq soq) :: delimiting '''
447583
448−Triple single quote
584+Examples
585+--------
449586
450587 ~zod/try=> (scan "'''" soqs)
451588 [~~~27. ~~~27. ~~~27.]
@@ -459,13 +596,19 @@ Triple single quote
459596
460597Term
461598
599+A term: a letter(lowercase), followed by letters, numbers, or `-`.
600+
601+Source
602+------
603+
462604 ++ sym
463605 %+ cook
464606 |=(a=tape (rap 3 ^-((list ,@) a)))
465607 ;~(plug low (star ;~(pose nud low hep)))
466608 ::
467609
468−A term: a letter(lowercase), followed by letters, numbers, or `-`.
610+Examples
611+--------
469612
470613 ~zod/try=> (scan "sam-2" sym)
471614 215.510.507.891
@@ -480,6 +623,11 @@ A term: a letter(lowercase), followed by letters, numbers, or `-`.
480623
481624`+>-` axis syntax
482625
626+Axis syntax parser
627+
628+Source
629+------
630+
483631 ++ ven ;~ (comp |=([a=@ b=@] (peg a b))) :: +>- axis syntax
484632 bet
485633 =+ hom=`?`|
@@ -493,7 +641,8 @@ A term: a letter(lowercase), followed by letters, numbers, or `-`.
493641 [p.wag [~ (peg p.u.q.vex p.u.q.wag) q.u.q.wag]]
494642 ==
495643
496−Axis syntax parser
644+Examples
645+--------
497646
498647 ~zod/arvo=/hoon/hoon> (scan "->+" ven)
499648 11
@@ -510,6 +659,11 @@ Axis syntax parser
510659
511660Base64 digit
512661
662+Parse a Terran base64 digit.
663+
664+Source
665+------
666+
513667 ++ vit :: base64 digit
514668 ;~ pose
515669 (cook |=(a=@ (sub a 65)) (shim 'A' 'Z'))
@@ -519,7 +673,8 @@ Base64 digit
519673 (cold 63 (just '+'))
520674 ==
521675
522−Terran base64
676+Examples
677+--------
523678
524679 ~zod/arvo=/hoon/hoon> (scan "C" vit)
525680 2
docs/dev/hoon/library/2ei.md+75−19
@@ -5,14 +5,28 @@ section 2eI, parsing (external)
55
66Parse or crash
77
8− ++ rash |*([naf=@ sab=_rule] (scan (trip naf) sab)) ::
9−
10−Parse a cord with a given rule and crash if the cord isn't entirely
8+Parse a cord with a given [`++rule`]() and crash if the [`++cord`]() isn't entirely
119parsed.
1210
13−`naf` is an [atom]().
11+Accepts
12+-------
1413
15−`sab` is a [rule]().
14+`naf` is an atom.
15+
16+`sab` is a `++rule`.
17+
18+Produces
19+--------
20+
21+The value of the parse result, or crash.
22+
23+Source
24+------
25+
26+ ++ rash |*([naf=@ sab=_rule] (scan (trip naf) sab)) ::
27+
28+Examples
29+--------
1630
1731 ~zod/try=> (rash 'I was the world in which I walked, and what I saw' (star (shim 0 200)))
1832 "I was the world in which I walked, and what I saw"
@@ -33,15 +47,29 @@ parsed.
3347
3448Parse or null
3549
36− ++ rush |*([naf=@ sab=_rule] (rust (trip naf) sab))
37−
3850Parse a given with a given rule and produce null if the cord isn't
3951entirely parsed.
4052
53+Accepts
54+-------
55+
4156`naf` is an [atom]().
4257
4358`sab` is a [rule]().
4459
60+Produces
61+--------
62+
63+The value of the parse result, or null.
64+
65+Source
66+------
67+
68+ ++ rush |*([naf=@ sab=_rule] (rust (trip naf) sab))
69+
70+Examples
71+--------
72+
4573 ~zod/try=> (rush 'I was the world in which I walked, and what I saw' (star (shim 0 200)))
4674 [~ "I was the world in which I walked, and what I saw"]
4775 ~zod/try=> (rush 'abc' (just 'a'))
@@ -59,16 +87,30 @@ entirely parsed.
5987
6088Parse tape or null
6189
90+Parse a [`++tape`]() with a given [`++rule`]() and produce null if the `++tape` isn't
91+entirely parsed.
92+
93+Accepts
94+-------
95+
96+`los` is a `++tape`.
97+
98+`sab` is a `++rule`.
99+
100+Produces
101+--------
102+
103+A `(unit ,@t)`
104+
105+Source
106+------
107+
62108 ++ rust |* [los=tape sab=_rule]
63109 =+ vex=((full sab) [[1 1] los])
64110 ?~(q.vex ~ [~ u=p.u.q.vex])
65111
66−Parse a tape with a given rule and produce null if the tape isn't
67−entirely parsed.
68−
69−`los` is a [tape]().
70−
71−`sab` is a [rule]().
112+Examples
113+--------
72114
73115 ~zod/try=> (rust "I was the world in which I walked, and what I saw" (star (shim 0 200)))
74116 [~ "I was the world in which I walked, and what I saw"]
@@ -83,6 +125,24 @@ entirely parsed.
83125
84126Parse tape or crash
85127
128+Parse a [`++tape`]() with a given [`++rule`]() and crash if the `++tape` isn't entirely
129+parsed.
130+
131+Accepts
132+-------
133+
134+`los` is a [tape]().
135+
136+`sab` is a [rule]().
137+
138+Produces
139+--------
140+
141+Either a `++tape` or a crash.
142+
143+Source
144+------
145+
86146 ++ scan |* [los=tape sab=_rule]
87147 =+ vex=((full sab) [[1 1] los])
88148 ?~ q.vex
@@ -90,12 +150,8 @@ Parse tape or crash
90150 ~|('syntax-error' !!)
91151 p.u.q.vex
92152
93−Parse a tape with a given rule and crash if the tape isn't entirely
94−parsed.
95−
96−`los` is a [tape]().
97−
98−`sab` is a [rule]().
153+Examples
154+--------
99155
100156 ~zod/try=> (scan "I was the world in which I walked, and what I saw" (star (shim 0 200)))
101157 "I was the world in which I walked, and what I saw"
docs/dev/hoon/library/2ej.md+316−64
@@ -5,15 +5,29 @@ section 2eJ, formatting (basic text)
55
66To lowercase
77
8+Produce the case insensitive (all lowercase) [`++cord`]() of a [`++tape`]().
9+
10+Accepts
11+-------
12+
13+`vib` is a `++tape`.
14+
15+Produces
16+--------
17+
18+A `++cord`.
19+
20+Source
21+------
22+
823 ++ cass :: lowercase
924 |= vib=tape
1025 %+ rap 3
1126 (turn vib |=(a=@ ?.(&((gte a 'A') (lte a 'Z')) a (add 32 a))))
1227 ::
1328
14−Produce the case insensitive (all lowercase) cord of a tape.
15−
16−`vib` is a [tape]().
29+Examples
30+--------
1731
1832 ~zod/try=> (cass "john doe")
1933 7.309.170.810.699.673.450
@@ -30,6 +44,22 @@ Produce the case insensitive (all lowercase) cord of a tape.
3044
3145To uppercase
3246
47+Turn all occurances of lowercase letters in any [`++tape`]() into uppercase
48+letters, as a [`++cord`]().
49+
50+Accepts
51+-------
52+
53+`vib` is a `++tape`.
54+
55+Produces
56+--------
57+
58+A `++cord`.
59+
60+Source
61+------
62+
3363 ++ cuss :: uppercase
3464 |= vib=tape
3565 ^- @t
@@ -37,10 +67,8 @@ To uppercase
3767 (turn vib |=(a=@ ?.(&((gte a 'a') (lte a 'z')) a (sub a 32))))
3868 ::
3969
40−Turn all occurances of lowercase letters in any tape into uppercase
41−letters, as a cord.
42−
43−`vib` is a [tape]().
70+Examples
71+--------
4472
4573 ~zod/try=> (cuss "john doe")
4674 'JOHN DOE'
@@ -57,11 +85,25 @@ letters, as a cord.
5785
5886Tape to cord
5987
60− ++ crip |=(a=tape `@t`(rap 3 a)) :: tape to cord
88+Produce a [`++cord`]() from a [`++tape`]().
6189
62−Produce cord from a tape.
90+Accepts
91+-------
6392
64−`a` is a [tape]().
93+`a` is a `++tape`.
94+
95+Produces
96+--------
97+
98+A `++cord`.
99+
100+Source
101+------
102+
103+ ++ crip |=(a=tape `@t`(rap 3 a)) :: tape to cord
104+
105+Examples
106+--------
65107
66108 ~zod/try=> (crip "john doe")
67109 'john doe'
@@ -76,6 +118,21 @@ Produce cord from a tape.
76118
77119Escape special chars
78120
121+Escape special characters, used in [`++show`](/doc/hoon/library/2ez#++show)
122+
123+Accepts
124+-------
125+
126+`vib` is a [`++tape`]().
127+
128+Produces
129+--------
130+
131+A `++tape`.
132+
133+Source
134+------
135+
79136 ++ mesc :: ctrl code escape
80137 |= vib=tape
81138 ^- tape
@@ -88,9 +145,8 @@ Escape special chars
88145 [i.vib $(vib t.vib)]
89146 ::
90147
91−Escape special characters, used in [`++show`](/doc/hoon/library/2ez#++show)
92−
93−`vib` is a [tape]().
148+Examples
149+--------
94150
95151 /~zod/try=> (mesc "ham lus")
96152 "ham lus"
@@ -105,6 +161,23 @@ Escape special characters, used in [`++show`](/doc/hoon/library/2ez#++show)
105161
106162Prepend `n` times
107163
164+Add `a` repetitions of character `b` to the head of [`++tape`]() `c`.
165+
166+Accepts
167+-------
168+
169+`a` and `b` are atoms.
170+
171+`c` is a `++tape`.
172+
173+Produces
174+--------
175+
176+A `++tape`.
177+
178+Source
179+------
180+
108181 ++ runt :: prepend repeatedly
109182 |= [[a=@ b=@] c=tape]
110183 ^- tape
@@ -113,11 +186,8 @@ Prepend `n` times
113186 [b $(a (dec a))]
114187 ::
115188
116−Add `a` repetitions of character `b` to the head of `c`
117−
118−`a` and `b` are [atom]()s.
119−
120−`c` is a [tape]().
189+Examples
190+--------
121191
122192 /~zod/try=> (runt [2 '/'] "ham")
123193 "//ham"
@@ -130,17 +200,31 @@ Add `a` repetitions of character `b` to the head of `c`
130200
131201Soft-cast by odor
132202
203+Soft-cast validity by [odor]().
204+
205+Accepts
206+-------
207+
208+`a` is a [`++span`]() (`@ta`).
209+
210+`b` is an atom.
211+
212+Produces
213+--------
214+
215+A `(unit ,@)`.
216+
217+Source
218+------
219+
133220 ++ sand :: atom sanity
134221 |= a=@ta
135222 |= b=@ ^- (unit ,@)
136223 ?.(((sane a) b) ~ [~ b])
137224 ::
138225
139−Soft-cast validity by odor.
140−
141−`a` is a [`@ta`]().
142−
143−`b` is an [atom]().
226+Examples
227+--------
144228
145229 /~zod/try=> `(unit ,@ta)`((sand %ta) 'sym-som')
146230 [~ ~.sym-som]
@@ -153,6 +237,23 @@ Soft-cast validity by odor.
153237
154238Check odor validity
155239
240+Check validity by [odor](). Produces a [gate]().
241+
242+Accepts
243+-------
244+
245+`a` is a [`++span`]() (`@ta`).
246+
247+`b` is an [atom]().
248+
249+Produces
250+--------
251+
252+A boolean.
253+
254+Source
255+------
256+
156257 ++ sane :: atom sanity
157258 |= a=@ta
158259 |= b=@ ^- ?
@@ -189,11 +290,8 @@ Check odor validity
189290 ==
190291 ::
191292
192−Check validity by odor. Produces a gate.
193−
194−`a` is a [`@ta`]().
195−
196−`b` is an [atom]().
293+Examples
294+--------
197295
198296 /~zod/try=> ((sane %tas) %mol)
199297 %.y
@@ -208,6 +306,23 @@ Check validity by odor. Produces a gate.
208306
209307Tape split
210308
309+Split first `a` characters off [`++tape`]() `b`.
310+
311+Accepts
312+-------
313+
314+`a` is an atom.
315+
316+`b` is a `++tape`.
317+
318+Produces
319+--------
320+
321+A cell of `++tape`s, `p` and `q`.
322+
323+Source
324+------
325+
211326 ++ trim :: tape split
212327 |= [a=@ b=tape]
213328 ^- [p=tape q=tape]
@@ -219,11 +334,8 @@ Tape split
219334 [[i.b p.c] q.c]
220335 ::
221336
222−Split first `a` characters off tape.
223−
224−`a` is an [atom]().
225−
226−`b` is a [tape]().
337+Examples
338+--------
227339
228340 /~zod/try=> (trim 5 "lasok termun")
229341 [p="lasok" q=" termun"]
@@ -236,6 +348,21 @@ Split first `a` characters off tape.
236348
237349Cord to tape
238350
351+Produce a [`++tape`]() from [`++cord`]().
352+
353+Accepts
354+-------
355+
356+`a` is an atom.
357+
358+Produces
359+--------
360+
361+A `++tape`.
362+
363+Source
364+------
365+
239366 ++ trip :: cord to tape
240367 ~/ %trip
241368 |= a=@ ^- tape
@@ -244,9 +371,8 @@ Cord to tape
244371 [^-(@ta (end 3 1 a)) $(a (rsh 3 1 a))]
245372 ::
246373
247−Produce tape from cord.
248−
249−`a` is an [atom]().
374+Examples
375+--------
250376
251377 /~zod/try=> (trip 'john doe')
252378 "john doe"
@@ -261,6 +387,21 @@ Produce tape from cord.
261387
262388UTF8 Length
263389
390+Produces the number of utf8 bytes.
391+
392+Accepts
393+-------
394+
395+`a` is a [`@t`]().
396+
397+Produces
398+--------
399+
400+An atom.
401+
402+Source
403+------
404+
264405 ++ teff :: length utf8
265406 |= a=@t ^- @
266407 =+ b=(end 3 1 a)
@@ -270,9 +411,8 @@ UTF8 Length
270411 ?:((lte b 127) 1 ?:((lte b 223) 2 ?:((lte b 239) 3 4)))
271412 ::
272413
273−Number of utf8 bytes.
274−
275−`a` is a [`@t`]().
414+Examples
415+--------
276416
277417 /~zod/try=> (teff 'a')
278418 1
@@ -285,6 +425,21 @@ Number of utf8 bytes.
285425
286426UTF8 to UTF32 cord
287427
428+Convert utf8 ([`++cord`]()) to utf32 codepoints.
429+
430+Accepts
431+-------
432+
433+`a` is a [`@t`]().
434+
435+Produces
436+--------
437+
438+A [`@c`](), UTF-32 codepoint.
439+
440+Source
441+------
442+
288443 ++ turf :: utf8 to utf32
289444 |= a=@t
290445 ^- @c
@@ -305,9 +460,8 @@ UTF8 to UTF32 cord
305460 $(a (rsh 3 b a))
306461 ::
307462
308−Convert utf8 ([cord]()) to utf32 codepoints.
309−
310−`a` is a [`@t`]().
463+Examples
464+--------
311465
312466 /~zod/try=> (turf 'my ßam')
313467 ~-my.~df.am
@@ -326,15 +480,29 @@ Convert utf8 ([cord]()) to utf32 codepoints.
326480
327481UTF8 to UTF32 tape
328482
483+Convert [`++tape`]() to a [`++list`]() of codepoints ([`@c`]()).
484+
485+Accepts
486+-------
487+
488+`a` is a `++tape`.
489+
490+Produces
491+--------
492+
493+A `++list` of codepoints [`@c`]().
494+
495+Source
496+------
497+
329498 ++ tuba :: utf8 to utf32 tape
330499 |= a=tape
331500 ^- (list ,@c)
332501 (rip 5 (turf (rap 3 a))) :: XX horrible
333502 ::
334503
335−Convert tape to list of codepoints.
336−
337−`a` is a [tape]()
504+Examples
505+--------
338506
339507 /~zod/try=> (tuba "я тут")
340508 ~[~-~44f. ~-. ~-~442. ~-~443. ~-~442.]
@@ -347,6 +515,21 @@ Convert tape to list of codepoints.
347515
348516UTF32 to UTF8 tape
349517
518+Wrap a [`++list`]() of utf32 codepoints into a utf8 [`++tape`]().
519+
520+Accepts
521+-------
522+
523+`a` is a `++list` of [`@c`]().
524+
525+Produces
526+--------
527+
528+A `++tape`.
529+
530+Source
531+------
532+
350533 ++ tufa :: utf32 to utf8 tape
351534 |= a=(list ,@c)
352535 ^- tape
@@ -354,9 +537,8 @@ UTF32 to UTF8 tape
354537 (weld (rip 3 (tuft i.a)) $(a t.a))
355538 ::
356539
357−Wrap list of utf32 codepoints to utf8 [tape]().
358−
359−`a` is a [list]() of [`@c`]().
540+Examples
541+--------
360542
361543 /~zod/try=> (tufa ~[~-~44f. ~-. ~-~442. ~-~443. ~-~442.])
362544 "я тут"
@@ -369,6 +551,22 @@ Wrap list of utf32 codepoints to utf8 [tape]().
369551
370552UTF32 to UTF8 text
371553
554+Convert utf32 glyph to
555+[LSB](http://en.wikipedia.org/wiki/Least_significant_bit) utf8 [`++cord`]().
556+
557+Accepts
558+-------
559+
560+`a` is a codepoint ([`@c`]()).
561+
562+Produces
563+--------
564+
565+A `++cord`.
566+
567+Source
568+------
569+
372570 ++ tuft :: utf32 to utf8 text
373571 |= a=@c
374572 ^- @t
@@ -399,10 +597,8 @@ UTF32 to UTF8 text
399597 ==
400598 ::
401599
402−Convert utf32 glyph to
403−[LSB](http://en.wikipedia.org/wiki/Least_significant_bit) utf8 cord.
404−
405−`a` is a [`@c`]().
600+Examples
601+--------
406602
407603 /~zod/try=> (tuft `@c`%a)
408604 'a'
@@ -415,6 +611,21 @@ Convert utf32 glyph to
415611
416612Coin format encode
417613
614+Escape [`++span`]() `~` as `~~` and `_` as `~-`. Used for printing.
615+
616+Accepts
617+-------
618+
619+`a` is a `++span` (`@ta`).
620+
621+Produces
622+--------
623+
624+A [`++span`]() (`@ta`).
625+
626+Source
627+------
628+
418629 ++ wack :: coin format
419630 |= a=@ta
420631 ^- @ta
@@ -428,9 +639,8 @@ Coin format encode
428639 [i.b $(b t.b)]
429640 ::
430641
431−Escape span `~` as `~~` and `_` as `~-`. Used for printing.
432−
433−`a` is a [`@ta`]().
642+Examples
643+--------
434644
435645 /~zod/try=> (wack '~20_sam~')
436646 ~.~~20~-sam~~
@@ -447,6 +657,21 @@ Escape span `~` as `~~` and `_` as `~-`. Used for printing.
447657
448658Coin format decode
449659
660+Unescape [`++span`]() `~~` as `~` and `~-` as `_`.
661+
662+Accepts
663+-------
664+
665+`a` is a an [atom]().
666+
667+Produces
668+--------
669+
670+A [`++span`]() `@ta`.
671+
672+Source
673+------
674+
450675 ++ wick :: coin format
451676 |= a=@
452677 ^- @ta
@@ -461,9 +686,8 @@ Coin format decode
461686 [i.b $(b t.b)]
462687 ::
463688
464−Unescape span `~~` as `~` and `~-` as `_`.
465−
466−`a` is a an [atom]().
689+Examples
690+--------
467691
468692 /~zod/try=> `@t`(wick '~-ams~~lop')
469693 '_ams~lop'
@@ -476,6 +700,21 @@ Unescape span `~~` as `~` and `~-` as `_`.
476700
477701Unescape cord
478702
703+Unescape [`++cord`]() codepoints.
704+
705+Accepts
706+-------
707+
708+`a` is a [`@ta`]().
709+
710+Produces
711+--------
712+
713+A [`++cord`]().
714+
715+Source
716+------
717+
479718 ++ woad :: cord format
480719 |= a=@ta
481720 ^- @t
@@ -510,9 +749,8 @@ Unescape cord
510749 ==
511750 ::
512751
513−Unescape cord codepoints.
514−
515−`a` is a [`@ta`]().
752+Examples
753+--------
516754
517755 /~zod/try=> (woad ~.~b6.20.as)
518756 '¶20 as'
@@ -523,6 +761,21 @@ Unescape cord codepoints.
523761
524762Escape cord
525763
764+Escape [`++cord`]() codepoints.
765+
766+Accepts
767+-------
768+
769+`a` is a [`++span`]() (`@ta`).
770+
771+Produces
772+--------
773+
774+A [`++span`]() (`@ta`).
775+
776+Source
777+------
778+
526779 ++ wood :: cord format
527780 |= a=@t
528781 ^- @ta
@@ -553,9 +806,8 @@ Escape cord
553806 %'~' ['~' '~' d]
554807 ==
555808
556−Escape cord codepoints.
557−
558−`a` is a [`@ta`]().
809+Examples
810+--------
559811
560812 /~zod/try=> (wood 'my ßam')
561813 ~.my.~df.am
docs/dev/hoon/library/2ek.md+115−13
@@ -5,12 +5,21 @@ section 2eK, formatting (layout)
55
66Pretty-printing engine
77
8+Pretty-printing engine that accepts a [`++tank`](/doc/hoon/library/1#++tank) [sample]() and contains arms that perform computation on it.
9+
10+Accepts
11+-------
12+
13+`tac` is a `++tank`.
14+
15+Produces
16+--------
17+
818 ++ re
919 |_ tac=tank
1020
11−Pretty-printing engine.
12−
13−`tac` is a [`++tank`](/doc/hoon/library/1#++tank).
21+Examples
22+--------
1423
1524 /~zod/try=> ~(. re leaf/"ham")
1625 <2.ghl [[%leaf ""] <414.gly 100.xkc 1.ypj %164>]>
@@ -19,6 +28,21 @@ Pretty-printing engine.
1928
2029Flatten to tape
2130
31+Flatten [`++tank`]() out into a [`++tape`]().
32+
33+Accepts
34+-------
35+
36+`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
37+
38+Produces
39+--------
40+
41+A `++tape`.
42+
43+Source
44+------
45+
2246 ++ ram
2347 ^- tape
2448 ?- -.tac
@@ -35,7 +59,8 @@ Flatten to tape
3559 ==
3660 ::
3761
38−Flatten tank out into a tape.
62+Examples
63+--------
3964
4065 /~zod/try=> ~(ram re leaf/"foo")
4166 "foo"
@@ -46,6 +71,23 @@ Flatten tank out into a tape.
4671
4772Render at indent
4873
74+Render at indent level `tab` and width `edg`.
75+
76+Accepts
77+-------
78+
79+`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
80+
81+`tab` and `edg` are atoms.
82+
83+Produces
84+--------
85+
86+A [`++wall`]() ([`++list`]() of [`++tapes`]()).
87+
88+Source
89+------
90+
4991 ++ win
5092 |= [tab=@ edg=@]
5193 =+ lug=`wall`~
@@ -86,9 +128,8 @@ Render at indent
86128 ==
87129 ::
88130
89−Render at indent level `tab` and width `edg`.
90−
91−`tab` and `edg` are [atom]()s.
131+Examples
132+--------
92133
93134 /~zod/try=> (~(win re leaf/"samoltekon-lapdok") 0 20)
94135 <<"samoltekon-lapdok">>
@@ -101,22 +142,70 @@ Render at indent level `tab` and width `edg`.
101142
102143### `++din`
103144
145+XX document
146+
147+Accepts
148+-------
149+
150+Produces
151+--------
152+
153+Source
154+------
155+
104156 ++ din (mod (add 2 tab) (mul 2 (div edg 3)))
105157
106−XX document
158+
159+----------------------------------------------------------------------
107160
108161### `++fit`
109162
110163Fit on one line test
111164
112− ++ fit (lte (lent ram) (sub edg tab))
113−
114165Determine whether `tac` fits on one line. Internal to `++win`
115166
167+Accepts
168+-------
169+
170+Produces
171+--------
172+
173+Source
174+------
175+
176+++ fit (lte (lent ram) (sub edg tab))
177+
178+
179+Examples
180+--------
181+
182+
183+
184+
185+----------------------------------------------------------------------
186+
116187### `++rig`
117188
118189Wrap in `\/`
119190
191+Wrap [`++tape`]() in `\/` if it doesn't fit at current indentation. Internal to
192+[`++win`]()
193+
194+Accepts
195+-------
196+
197+`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
198+
199+`hom` is a `++tape`.
200+
201+Produces
202+--------
203+
204+A [`++wall`]() (list of `++tape`s).
205+
206+Source
207+------
208+
120209 ++ rig
121210 |= hom=tape
122211 ^- wall
@@ -136,13 +225,25 @@ Wrap in `\/`
136225 [(runt [tab ' '] p.mut) $(hom q.mut)]
137226 ::
138227
139−Wrap tape in `\/` if it doesn't fit at current indentation. Internal to
140−`++win`
228+Examples
229+--------
141230
142231### `++wig`
143232
144233`++win` render tape
145234
235+Render [`++tape`](). Internal to [`++win`]().
236+
237+Accepts
238+-------
239+
240+`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
241+
242+`hom` is a `++tape`.
243+
244+Produces
245+--------
246+
146247 ++ wig
147248 |= hom=tape
148249 ^- wall
@@ -159,4 +260,5 @@ Wrap tape in `\/` if it doesn't fit at current indentation. Internal to
159260 --
160261 --
161262
162−Render tape. Internal to `++win`.
263+Examples
264+--------
docs/dev/hoon/library/2el.md+1128−136
@@ -5,10 +5,16 @@ section 2eL, formatting (path)
55
66Primitive parser engine
77
8+A core containing numeric parser primitives.
9+
10+Source
11+------
12+
813 ++ ab
914 |%
1015
11−A core containing numeric parser primitives.
16+Examples
17+--------
1218
1319 ~zod/try=> ab
1420 <36.ecc 414.gly 100.xkc 1.ypj %164>
@@ -19,9 +25,25 @@ A core containing numeric parser primitives.
1925
2026Parse hex pair
2127
28+Parsing [`++rule`](). Parses a pair of base-16 digits. Used in escapes.
29+
30+Accepts
31+-------
32+
33+XX
34+
35+Produces
36+--------
37+
38+A an atom. XX
39+
40+Source
41+------
42+
2243 ++ bix (bass 16 (stun [2 2] six))
2344
24−Parsing rule. Parses a pair of base-16 digits. Used in escapes.
45+Examples
46+--------
2547
2648 ~zod/try=> (scan "07" bix:ab)
2749 q=7
@@ -36,10 +58,26 @@ Parsing rule. Parses a pair of base-16 digits. Used in escapes.
3658
3759Parse phonetic pair
3860
61+Parsing [`++rule`](). Parses an atom of [odor]() [`@pE`](), a phrase of two bytes
62+encoded phonetically.
63+
64+Accepts
65+-------
66+
67+XX
68+
69+Produces
70+--------
71+
72+An atom.
73+
74+Source
75+------
76+
3977 ++ hif (boss 256 ;~(plug tip tiq (easy ~)))
4078
41−Parsing rule. Parses an atom of odor [`@pE`](), a phrase of two bytes
42−encoded phonetically.
79+Examples
80+--------
4381
4482 ~zod/try=> (scan "doznec" hif:ab)
4583 q=256
@@ -52,12 +90,28 @@ encoded phonetically.
5290
5391Parse two phonetic pairs
5492
93+Parsing [`++rule`](). Parses and unscrambles an atom of odor [@pF](), a phrase
94+of two two-byte pairs that are encoded (and scrambled) phonetically.
95+
96+Accepts
97+-------
98+
99+XX
100+
101+Produces
102+--------
103+
104+An atom. XX
105+
106+Source
107+------
108+
55109 ++ huf %+ cook
56110 |=([a=@ b=@] (wred:un ~(zug mu ~(zag mu [a b]))))
57111 ;~(plug hif ;~(pfix hep hif))
58112
59−Parsing rule. Parses and unscrambles an atom of odor [@pF](), a phrase
60−of two two-byte pairs that are encoded (and scrambled) phonetically.
113+Examples
114+--------
61115
62116 ~zod/try=> (scan "pittyp-pittyp" huf:ab)
63117 328.203.557
@@ -72,10 +126,26 @@ of two two-byte pairs that are encoded (and scrambled) phonetically.
72126
73127Parse 8 phonetic bytes
74128
129+Parsing [`++rule`](). Parses an atom of odor [@pG](), a phrase of eight of
130+phonetic bytes.
131+
132+Accepts
133+-------
134+
135+An atom of odor [`@pG`]()
136+
137+Produces
138+--------
139+
140+An atom. XX
141+
142+Source
143+------
144+
75145 ++ hyf (bass 0x1.0000.0000 ;~(plug huf ;~(pfix hep huf) (easy ~)))
76146
77−Parsing rule. Parses an atom of odor [@pG](), a phrase of eight of
78−phonetic bytes.
147+Examples
148+--------
79149
80150 ~zod/try=> (scan "sondel-forsut-tillyn-nillyt" hyf:ab)
81151 q=365.637.097.828.335.095
@@ -88,9 +158,25 @@ phonetic bytes.
88158
89159Parse \<= 5 base-32
90160
161+Parsing [`++rule`](). Parses up to five base-32 digits without a leading zero.
162+
163+Accepts
164+-------
165+
166+Up to five [@uv]() (base 64) digits.
167+
168+Produces
169+--------
170+
171+An atom.
172+
173+Source
174+------
175+
91176 ++ pev (bass 32 ;~(plug sev (stun [0 4] siv)))
92177
93−Parsing rule. Parses up to five base-32 digits without a leading zero.
178+Examples
179+--------
94180
95181 ~zod/try=> (scan "a" pev:ab)
96182 q=10
@@ -108,9 +194,25 @@ Parsing rule. Parses up to five base-32 digits without a leading zero.
108194
109195Parse \<= 5 base-64
110196
197+Parsing [`++rule`](). Parses up to five base-64 digits without a leading zero.
198+
199+Accepts
200+-------
201+
202+Up to five [@uw]() (base 64) digits.
203+
204+Produces
205+--------
206+
207+
208+
209+Source
210+------
211+
111212 ++ pew (bass 64 ;~(plug sew (stun [0 4] siw)))
112213
113−Parsing rule. Parses up to five base-64 digits without a leading zero.
214+Examples
215+--------
114216
115217 ~zod/try=> (scan "Q" pew:ab)
116218 q=52
@@ -131,9 +233,21 @@ Parsing rule. Parses up to five base-64 digits without a leading zero.
131233
132234Parse 5 base-32
133235
236+Parsing [`++rule`](). Parses exactly five base-32 digits.
237+
238+Accepts
239+-------
240+
241+Produces
242+--------
243+
244+Source
245+------
246+
134247 ++ piv (bass 32 (stun [5 5] siv))
135248
136−Parsing rule. Parses exactly five base-32 digits.
249+Examples
250+--------
137251
138252 ~zod/try=> (scan "10b3l" piv:ab)
139253 q=1.059.957
@@ -147,9 +261,23 @@ Parsing rule. Parses exactly five base-32 digits.
147261
148262Parse 5 base-64
149263
264+Parsing [`++rule`](). Parses exactly five base-64 digits.
265+
266+Accepts
267+-------
268+
269+Produces
270+--------
271+
272+My name henry let's see how fast I can type.
273+
274+Source
275+------
276+
150277 ++ piw (bass 64 (stun [5 5] siw))
151278
152−Parsing rule. Parses exactly five base-64 digits.
279+Examples
280+--------
153281
154282 ~zod/try=> (scan "2C-pZ" piw:ab)
155283 q=43.771.517
@@ -163,10 +291,22 @@ Parsing rule. Parses exactly five base-64 digits.
163291
164292Parse \<= 4 binary
165293
294+Parsing [`++rule`](). Parses a binary number of up to 4 digits in length without
295+a leading zero.
296+
297+Accepts
298+-------
299+
300+Produces
301+--------
302+
303+Source
304+------
305+
166306 ++ qeb (bass 2 ;~(plug seb (stun [0 3] sib)))
167307
168−Parsing rule. Parses a binary number of up to 4 digits in length without
169−a leading zero.
308+Examples
309+--------
170310
171311 ~zod/try=> (scan "1" qeb:ab)
172312 q=1
@@ -187,10 +327,22 @@ a leading zero.
187327
188328Parse \<= 4 hex
189329
330+Parsing [`++rule`](). Parses a hexadecimal number of up to 4 digits in length
331+without a leading zero.
332+
333+Accepts
334+-------
335+
336+Produces
337+--------
338+
339+Source
340+------
341+
190342 ++ qex (bass 16 ;~(plug sex (stun [0 3] hit)))
191343
192−Parsing rule. Parses a hexadecimal number of up to 4 digits in length
193−without a leading zero.
344+Examples
345+--------
194346
195347 ~zod/try=> (scan "ca" qex:ab)
196348 q=202
@@ -209,9 +361,21 @@ without a leading zero.
209361
210362Parse 4 binary
211363
364+Parsing [`++rule`](). Parses exactly four binary digits.
365+
366+Accepts
367+-------
368+
369+Produces
370+--------
371+
372+Source
373+------
374+
212375 ++ qib (bass 2 (stun [4 4] sib))
213376
214−Parsing rule. Parses exactly four binary digits.
377+Examples
378+--------
215379
216380 ~zod/try=> (scan "0001" qib:ab)
217381 q=1
@@ -227,9 +391,21 @@ Parsing rule. Parses exactly four binary digits.
227391
228392Parse 4 hex
229393
394+Parsing [`++rule`](). Parses exactly four hexadecimal digits.
395+
396+Accepts
397+-------
398+
399+Produces
400+--------
401+
402+Source
403+------
404+
230405 ++ qix (bass 16 (stun [4 4] six))
231406
232−Parsing rule. Parses exactly four hexadecimal digits.
407+Examples
408+--------
233409
234410 ~zod/try=> (scan "0100" qix:ab)
235411 q=256
@@ -245,9 +421,21 @@ Parsing rule. Parses exactly four hexadecimal digits.
245421
246422Parse 1
247423
424+Parsing [`++rule`](). Parses the number 1.
425+
426+Accepts
427+-------
428+
429+Produces
430+--------
431+
432+Source
433+------
434+
248435 ++ seb (cold 1 (just '1'))
249436
250−Parsing rule. Parses the number 1.
437+Examples
438+--------
251439
252440 ~zod/try=> (scan "1" seb:ab)
253441 1
@@ -264,9 +452,21 @@ Parsing rule. Parses the number 1.
264452
265453Parse decimal
266454
455+Parsing [`++rule`](). Parses a nonzero decimal digit.
456+
457+Accepts
458+-------
459+
460+Produces
461+--------
462+
463+Source
464+------
465+
267466 ++ sed (cook |=(a=@ (sub a '0')) (shim '1' '9'))
268467
269−Parsing rule. Parses a nonzero decimal digit.
468+Examples
469+--------
270470
271471 ~zod/try=> (scan "5" sed:ab)
272472 5
@@ -280,9 +480,21 @@ Parsing rule. Parses a nonzero decimal digit.
280480
281481Parse base-32
282482
483+Parsing [`++rule`](). Parses a nonzero base-32 digit
484+
485+Accepts
486+-------
487+
488+Produces
489+--------
490+
491+Source
492+------
493+
283494 ++ sev ;~(pose sed sov)
284495
285−Parsing rule. Parses a nonzero base-32 digit
496+Examples
497+--------
286498
287499 ~zod/try=> (scan "c" sev:ab)
288500 12
@@ -296,9 +508,21 @@ Parsing rule. Parses a nonzero base-32 digit
296508
297509Parse base-64
298510
511+Parsing [`++rule`](). Parses a nonzero base-64 digit
512+
513+Accepts
514+-------
515+
516+Produces
517+--------
518+
519+Source
520+------
521+
299522 ++ sew ;~(pose sed sow)
300523
301−Parsing rule. Parses a nonzero base-64 digit
524+Examples
525+--------
302526
303527 ~zod/try=> (scan "M" sew:ab)
304528 48
@@ -312,9 +536,21 @@ Parsing rule. Parses a nonzero base-64 digit
312536
313537Parse hex
314538
539+Parsing [`++rule`](). Parses a nonzero hexadecimal digit.
540+
541+Accepts
542+-------
543+
544+Produces
545+--------
546+
547+Source
548+------
549+
315550 ++ sex ;~(pose sed sox)
316551
317−Parsing rule. Parses a nonzero hexadecimal digit.
552+Examples
553+--------
318554
319555 ~zod/try=> (scan "e" sex:ab)
320556 14
@@ -328,9 +564,21 @@ Parsing rule. Parses a nonzero hexadecimal digit.
328564
329565Parse binary
330566
567+Parsing [`++rule`](). Parses a binary digit.
568+
569+Accepts
570+-------
571+
572+Produces
573+--------
574+
575+Source
576+------
577+
331578 ++ sib (cook |=(a=@ (sub a '0')) (shim '0' '1'))
332579
333−Parsing rule. Parses a binary digit.
580+Examples
581+--------
334582
335583 ~zod/try=> (scan "1" sib:ab)
336584 1
@@ -343,9 +591,21 @@ Parsing rule. Parses a binary digit.
343591
344592Parse decimal
345593
594+Parsing [`++rule`](). Parses a decimal digit.
595+
596+Accepts
597+-------
598+
599+Produces
600+--------
601+
602+Source
603+------
604+
346605 ++ sid (cook |=(a=@ (sub a '0')) (shim '0' '9'))
347606
348−Parsing rule. Parses a decimal digit.
607+Examples
608+--------
349609
350610 ~zod/try=> (scan "5" sid:ab)
351611 5
@@ -356,9 +616,21 @@ Parsing rule. Parses a decimal digit.
356616
357617Parse base-32
358618
619+Parsing [`++rule`](). Parses a base-32 digit.
620+
621+Accepts
622+-------
623+
624+Produces
625+--------
626+
627+Source
628+------
629+
359630 ++ siv ;~(pose sid sov)
360631
361−Parsing rule. Parses a base-32 digit.
632+Examples
633+--------
362634
363635 ~zod/try=> (scan "c" siv:ab)
364636 12
@@ -369,9 +641,21 @@ Parsing rule. Parses a base-32 digit.
369641
370642Parse base-64
371643
644+Parsing [`++rule`](). Parses a base-64 digit.
645+
646+Accepts
647+-------
648+
649+Produces
650+--------
651+
652+Source
653+------
654+
372655 ++ siw ;~(pose sid sow)
373656
374−Parsing rule. Parses a base-64 digit.
657+Examples
658+--------
375659
376660 ~zod/try=> (scan "M" siw:ab)
377661 48
@@ -382,9 +666,21 @@ Parsing rule. Parses a base-64 digit.
382666
383667Parse hex
384668
669+Parsing [`++rule`](). Parses a hexadecimal digit.
670+
671+Accepts
672+-------
673+
674+Produces
675+--------
676+
677+Source
678+------
679+
385680 ++ six ;~(pose sid sox)
386681
387−Parsing rule. Parses a hexadecimal digit.
682+Examples
683+--------
388684
389685 ~zod/try=> (scan "e" six:ab)
390686 14
@@ -395,9 +691,21 @@ Parsing rule. Parses a hexadecimal digit.
395691
396692Parse base-32
397693
694+Parsing [`++rule`](). Parses a base-32 letter.
695+
696+Accepts
697+-------
698+
699+Produces
700+--------
701+
702+Source
703+------
704+
398705 ++ sov (cook |=(a=@ (sub a 87)) (shim 'a' 'v'))
399706
400−Parsing rule. Parses a base-32 letter.
707+Examples
708+--------
401709
402710 ~zod/try=> (scan "c" sov:ab)
403711 12
@@ -408,6 +716,17 @@ Parsing rule. Parses a base-32 letter.
408716
409717Parse base-64
410718
719+Parsing [`++rule`](). Parses a base-64 letter/symbol.
720+
721+Accepts
722+-------
723+
724+Produces
725+--------
726+
727+Source
728+------
729+
411730 ++ sow ;~ pose
412731 (cook |=(a=@ (sub a 87)) (shim 'a' 'z'))
413732 (cook |=(a=@ (sub a 29)) (shim 'A' 'Z'))
@@ -415,7 +734,8 @@ Parse base-64
415734 (cold 63 (just '~'))
416735 ==
417736
418−Parsing rule. Parses a base-64 letter/symbol.
737+Examples
738+--------
419739
420740 ~zod/try=> (scan "M" sow:ab)
421741 48
@@ -426,9 +746,21 @@ Parsing rule. Parses a base-64 letter/symbol.
426746
427747Parse hex letter
428748
749+Parsing [`++rule`](). Parses a hexadecimal letter.
750+
751+Accepts
752+-------
753+
754+Produces
755+--------
756+
757+Source
758+------
759+
429760 ++ sox (cook |=(a=@ (sub a 87)) (shim 'a' 'f'))
430761
431−Parsing rule. Parses a hexadecimal letter.
762+Examples
763+--------
432764
433765 ~zod/try=> (scan "e" sox:ab)
434766 14
@@ -439,10 +771,22 @@ Parsing rule. Parses a hexadecimal letter.
439771
440772Parse \<= 3 decimal
441773
774+Parsing [`++rule`](). Parses a decimal number of up to 3 digits without a
775+leading zero.
776+
777+Accepts
778+-------
779+
780+Produces
781+--------
782+
783+Source
784+------
785+
442786 ++ ted (bass 10 ;~(plug sed (stun [0 2] sid)))
443787
444−Parsing rule. Parses a decimal number of up to 3 digits without a
445−leading zero.
788+Examples
789+--------
446790
447791 ~zod/try=> (scan "21" ted:ab)
448792 q=21
@@ -460,10 +804,22 @@ leading zero.
460804
461805Leading phonetic byte
462806
807+Parsing [`++rule`](). Parses the leading phonetic byte, which represents a
808+syllable.
809+
810+Accepts
811+-------
812+
813+Produces
814+--------
815+
816+Source
817+------
818+
463819 ++ tip (sear |=(a=@ (ins:po a)) til)
464820
465−Parsing rule. Parses the leading phonetic byte, which represents a
466−syllable.
821+Examples
822+--------
467823
468824 ~zod/try=> (scan "doz" tip:ab)
469825 0
@@ -476,10 +832,22 @@ syllable.
476832
477833Trailing phonetic syllable
478834
835+Parsing [`++rule`](). Parses the trailing phonetic byte, which represents a
836+syllable.
837+
838+Accepts
839+-------
840+
841+Produces
842+--------
843+
844+Source
845+------
846+
479847 ++ tiq (sear |=(a=@ (ind:po a)) til)
480848
481−Parsing rule. Parses the trailing phonetic byte, which represents a
482−syllable.
849+Examples
850+--------
483851
484852 ~zod/try=> (scan "zod" tiq:ab)
485853 0
@@ -492,9 +860,21 @@ syllable.
492860
493861Parse 3 decimal digits
494862
863+Parsing [`++rule`](). Parses exactly three decimal digits.
864+
865+Accepts
866+-------
867+
868+Produces
869+--------
870+
871+Source
872+------
873+
495874 ++ tid (bass 10 (stun [3 3] sid))
496875
497−Parsing rule. Parses exactly three decimal digits.
876+Examples
877+--------
498878
499879 ~zod/try=> (scan "013" tid:ab)
500880 q=13
@@ -508,9 +888,21 @@ Parsing rule. Parses exactly three decimal digits.
508888
509889Parse 3 lowercase
510890
891+Parsing [`++rule`](). Parses exactly three lowercase letters.
892+
893+Accepts
894+-------
895+
896+Produces
897+--------
898+
899+Source
900+------
901+
511902 ++ til (boss 256 (stun [3 3] low))
512903
513−Parsing rule. Parses exactly three lowercase letters.
904+Examples
905+--------
514906
515907 ~zod/try=> (scan "mer" til:ab)
516908 q=7.497.069
@@ -526,11 +918,23 @@ Parsing rule. Parses exactly three lowercase letters.
526918
527919Parse span characters
528920
921+Parsing rule. Parses characters from an atom of the span odor [`@ta`]().
922+
923+Accepts
924+-------
925+
926+Produces
927+--------
928+
929+Source
930+------
931+
529932 ++ urs %+ cook
530933 |=(a=tape (rap 3 ^-((list ,@) a)))
531934 (star ;~(pose nud low hep dot sig cab))
532935
533−Parsing rule. Parses characters from an atom of the span odor [`@ta`]().
936+Examples
937+--------
534938
535939 ~zod/try=> `@ta`(scan "asa-lom_tak" urs:ab)
536940 ~.asa-lom_tak
@@ -543,12 +947,24 @@ Parsing rule. Parses characters from an atom of the span odor [`@ta`]().
543947
544948Parse non-`_` span
545949
950+Parsing rule. Parses all characters of the span odor [`@ta`]() except
951+for cab, `_`.
952+
953+Accepts
954+-------
955+
956+Produces
957+--------
958+
959+Source
960+------
961+
546962 ++ urt %+ cook
547963 |=(a=tape (rap 3 ^-((list ,@) a)))
548964 (star ;~(pose nud low hep dot sig))
549965
550−Parsing rule. Parses all characters of the span odor [`@ta`]() except
551−for cab, `_`.
966+Examples
967+--------
552968
553969 ~zod/try=> `@t`(scan "asa-lom.t0k" urt:ab)
554970 'asa-lom.t0k'
@@ -559,11 +975,23 @@ for cab, `_`.
559975
560976Parse bas, soq, or bix
561977
562− ++ voy ;~(pfix bas ;~(pose bas soq bix))
563−
564978Parsing rule. Parses an escaped backslash, single quote, or hex pair
565979byte.
566980
981+Accepts
982+-------
983+
984+Produces
985+--------
986+
987+Source
988+------
989+
990+ ++ voy ;~(pfix bas ;~(pose bas soq bix))
991+
992+Examples
993+--------
994+
567995 ~zod/try=> (scan "\\0a" voy:ab)
568996 q=10
569997 ~zod/try=> (scan "\\'" voy:ab)
@@ -575,10 +1003,22 @@ byte.
5751003
5761004Top-level atom parser engine
5771005
1006+A core containing top-level atom parsers.
1007+
1008+Accepts
1009+-------
1010+
1011+Produces
1012+--------
1013+
1014+Source
1015+------
1016+
5781017 ++ ag
5791018 |%
5801019
581−A core containing top-level atom parsers.
1020+Examples
1021+--------
5821022
5831023 ~zod/try=> ag
5841024 <14.vpu 414.mof 100.xkc 1.ypj %164>
@@ -589,12 +1029,24 @@ A core containing top-level atom parsers.
5891029
5901030Parse 0 or rule
5911031
592− ++ ape |*(fel=_rule ;~(pose (cold 0 (just '0')) fel))
593−
5941032Parser modifier. Parses 0 or the sample rule `fel`.
5951033
1034+Accepts
1035+-------
1036+
1037+Produces
1038+--------
1039+
5961040`fel` is a [`rule`]().
5971041
1042+Source
1043+------
1044+
1045+ ++ ape |*(fel=_rule ;~(pose (cold 0 (just '0')) fel))
1046+
1047+Examples
1048+--------
1049+
5981050 ~zod/try=> (scan "202" (star (ape:ag (cold 2 (just '2')))))
5991051 ~[2 0 2]
6001052
@@ -604,9 +1056,21 @@ Parser modifier. Parses 0 or the sample rule `fel`.
6041056
6051057Parses binary number
6061058
1059+Parsing rule. Parses a binary number without a leading zero.
1060+
1061+Accepts
1062+-------
1063+
1064+Produces
1065+--------
1066+
1067+Source
1068+------
1069+
6071070 ++ bay (ape (bass 16 ;~(plug qeb:ab (star ;~(pfix dog qib:ab)))))
6081071
609−Parsing rule. Parses a binary number without a leading zero.
1072+Examples
1073+--------
6101074
6111075 ~zod/try=> (scan "10.0110" bay:ag)
6121076 q=38
@@ -617,10 +1081,22 @@ Parsing rule. Parses a binary number without a leading zero.
6171081
6181082Parse IPv6
6191083
1084+Parsing rule. Parses a [`@is`](), an IPv6 address.
1085+
1086+Accepts
1087+-------
1088+
1089+Produces
1090+--------
1091+
1092+Source
1093+------
1094+
6201095 ++ bip =+ tod=(ape qex:ab)
6211096 (bass 0x1.0000 ;~(plug tod (stun [7 7] ;~(pfix dog tod))))
6221097
623−Parsing rule. Parses a [`@is`](), an IPv6 address.
1098+Examples
1099+--------
6241100
6251101 ~zod/try=> (scan "0.0.ea.3e6c.0.0.0.0" bip:ag)
6261102 q=283.183.420.760.121.105.516.068.864
@@ -633,9 +1109,21 @@ Parsing rule. Parses a [`@is`](), an IPv6 address.
6331109
6341110Parse decimal with dots
6351111
1112+Parsing rule. Parses a decimal number that includes dot separators.
1113+
1114+Accepts
1115+-------
1116+
1117+Produces
1118+--------
1119+
1120+Source
1121+------
1122+
6361123 ++ dem (ape (bass 1.000 ;~(plug ted:ab (star ;~(pfix dog tid:ab)))))
6371124
638−Parsing rule. Parses a decimal number that includes dot separators.
1125+Examples
1126+--------
6391127
6401128 ~zod/try=> (scan "52" dem:ag)
6411129 q=52
@@ -648,9 +1136,21 @@ Parsing rule. Parses a decimal number that includes dot separators.
6481136
6491137Parse decimal number
6501138
1139+Parsing rule. Parses a decimal number without a leading zero.
1140+
1141+Accepts
1142+-------
1143+
1144+Produces
1145+--------
1146+
1147+Source
1148+------
1149+
6511150 ++ dim (ape (bass 10 ;~(plug sed:ab (star sid:ab))))
6521151
653−Parsing rule. Parses a decimal number without a leading zero.
1152+Examples
1153+--------
6541154
6551155 ~zod/try=> (scan "52" dim:ag)
6561156 q=52
@@ -664,9 +1164,21 @@ Parsing rule. Parses a decimal number without a leading zero.
6641164
6651165Parse decimal with leading `0`
6661166
1167+Parsing rule. Parses a decmial number with leading zeroes.
1168+
1169+Accepts
1170+-------
1171+
1172+Produces
1173+--------
1174+
1175+Source
1176+------
1177+
6671178 ++ dum (bass 10 (plus sid:ab))
6681179
669−Parsing rule. Parses a decmial number with leading zeroes.
1180+Examples
1181+--------
6701182
6711183 ~zod/try=> (scan "52" dum:ag)
6721184 q=52
@@ -681,6 +1193,17 @@ Parsing rule. Parses a decmial number with leading zeroes.
6811193
6821194Parse phonetic base
6831195
1196+Parsing rule. Parses an atom of odor [`@p`](), the phonetic base.
1197+
1198+Accepts
1199+-------
1200+
1201+Produces
1202+--------
1203+
1204+Source
1205+------
1206+
6841207 ++ fed ;~ pose
6851208 (bass 0x1.0000.0000.0000.0000 (most doh hyf:ab))
6861209 huf:ab
@@ -688,7 +1211,8 @@ Parse phonetic base
6881211 tiq:ab
6891212 ==
6901213
691−Parsing rule. Parses an atom of odor [`@p`](), the phonetic base.
1214+Examples
1215+--------
6921216
6931217 ~zod/try=> (scan "zod" fed:ag)
6941218 0
@@ -711,9 +1235,21 @@ Parsing rule. Parses an atom of odor [`@p`](), the phonetic base.
7111235
7121236Parse hex
7131237
1238+Parsing rule. Parses a hexadecimal number
1239+
1240+Accepts
1241+-------
1242+
1243+Produces
1244+--------
1245+
1246+Source
1247+------
1248+
7141249 ++ hex (ape (bass 0x1.0000 ;~(plug qex:ab (star ;~(pfix dog qix:ab)))))
7151250
716−Parsing rule. Parses a hexadecimal number
1251+Examples
1252+--------
7171253
7181254 ~zod/try=> (scan "4" hex:ag)
7191255 q=4
@@ -730,10 +1266,22 @@ Parsing rule. Parses a hexadecimal number
7301266
7311267Parse IPv4 address
7321268
1269+Parsing rule. Parses an IPv4 address.
1270+
1271+Accepts
1272+-------
1273+
1274+Produces
1275+--------
1276+
1277+Source
1278+------
1279+
7331280 ++ lip =+ tod=(ape ted:ab)
7341281 (bass 256 ;~(plug tod (stun [3 3] ;~(pfix dog tod))))
7351282
736−Parsing rule. Parses an IPv4 address.
1283+Examples
1284+--------
7371285
7381286 ~zod/try=> (scan "127.0.0.1" lip:ag)
7391287 q=2.130.706.433
@@ -748,9 +1296,21 @@ Parsing rule. Parses an IPv4 address.
7481296
7491297Parse Base-32 with dots
7501298
1299+Parsing rule. Parses a Base-32 number with dot separators.
1300+
1301+Accepts
1302+-------
1303+
1304+Produces
1305+--------
1306+
1307+Source
1308+------
1309+
7511310 ++ viz (ape (bass 0x200.0000 ;~(plug pev:ab (star ;~(pfix dog piv:ab)))))
7521311
753−Parsing rule. Parses a Base-32 number with dot separators.
1312+Examples
1313+--------
7541314
7551315 ~zod/try=> (scan "e2.ol4pm" viz:ag)
7561316 q=15.125.353.270
@@ -761,9 +1321,21 @@ Parsing rule. Parses a Base-32 number with dot separators.
7611321
7621322Parse base-32 string
7631323
1324+Parsing rule. Parses a raw base-32 string.
1325+
1326+Accepts
1327+-------
1328+
1329+Produces
1330+--------
1331+
1332+Source
1333+------
1334+
7641335 ++ vum (bass 32 (plus siv:ab))
7651336
766−Parsing rule. Parses a raw base-32 string.
1337+Examples
1338+--------
7671339
7681340 ~zod/try=> (scan "e2ol4pm" vum:ag)
7691341 q=15.125.353.270
@@ -774,11 +1346,23 @@ Parsing rule. Parses a raw base-32 string.
7741346
7751347Parse base-64
7761348
1349+Parsing rule. Parses a base-64 number.
1350+
1351+Accepts
1352+-------
1353+
1354+Produces
1355+--------
1356+
1357+Source
1358+------
1359+
7771360 ++ wiz (ape (bass 0x4000.0000 ;~(plug pew:ab (star ;~(pfix dog piw:ab)))))
7781361 --
7791362 ::
7801363
781−Parsing rule. Parses a base-64 number.
1364+Examples
1365+--------
7821366
7831367 ~zod/try=> (scan "e2O.l4Xpm" wiz:ag)
7841368 q=61.764.130.813.526
@@ -789,13 +1373,25 @@ Parsing rule. Parses a base-64 number.
7891373
7901374Literal rendering engine
7911375
792− ++ co
793− =< |_ lot=coin
794−
7951376A [door]() that contains arms that operate on the sample coin `lot`.
7961377
1378+Accepts
1379+-------
1380+
1381+Produces
1382+--------
1383+
7971384`lot` is a [`++coin`]().
7981385
1386+Source
1387+------
1388+
1389+ ++ co
1390+ =< |_ lot=coin
1391+
1392+Examples
1393+--------
1394+
7991395 ~zod/try=> ~(. co many/~[`ta/'mo' `ud/5])
8001396 < 3.dhd
8011397 [ [ %many
@@ -813,14 +1409,26 @@ A [door]() that contains arms that operate on the sample coin `lot`.
8131409
8141410Prepend & render as tape
8151411
816− ++ rear |=(rom=tape =>(.(rex rom) rend))
817−
8181412Renders a coin `lot` as a [tape]() prepended to the sample tape `rom`.
8191413
1414+Accepts
1415+-------
1416+
1417+Produces
1418+--------
1419+
8201420`rom` is a [`pe`]()
8211421
8221422`lot` is a [`++coin`]().
8231423
1424+Source
1425+------
1426+
1427+ ++ rear |=(rom=tape =>(.(rex rom) rend))
1428+
1429+Examples
1430+--------
1431+
8241432 ~zod/try=> (~(rear co %$ %ux 200) "--ha")
8251433 "0xc8--ha"
8261434
@@ -830,12 +1438,24 @@ Renders a coin `lot` as a [tape]() prepended to the sample tape `rom`.
8301438
8311439Render as span
8321440
833− ++ rent `@ta`(rap 3 rend)
834−
8351441Renders a coin `lot` as a span.
8361442
1443+Accepts
1444+-------
1445+
1446+Produces
1447+--------
1448+
8371449`lot` is a [`++coin`]().
8381450
1451+Source
1452+------
1453+
1454+ ++ rent `@ta`(rap 3 rend)
1455+
1456+Examples
1457+--------
1458+
8391459 ~zod/try=> ~(rent co %$ %ux 200)
8401460 ~.0xc8
8411461 ~zod/try=> `@t`~(rent co %$ %ux 200)
@@ -847,6 +1467,19 @@ Renders a coin `lot` as a span.
8471467
8481468Render as tape
8491469
1470+Renders a coin `lot` as a tape.
1471+
1472+Accepts
1473+-------
1474+
1475+Produces
1476+--------
1477+
1478+`lot` is a [`++coin`]().
1479+
1480+Source
1481+------
1482+
8501483 ++ rend
8511484 ^- tape
8521485 ?: ?=(%blob -.lot)
@@ -1046,9 +1679,8 @@ Render as tape
10461679 --
10471680 ::
10481681
1049−Renders a coin `lot` as a tape.
1050−
1051−`lot` is a [`++coin`]().
1682+Examples
1683+--------
10521684
10531685 ~zod/try=> ~(rend co ~ %ux 200)
10541686 "0xc8"
@@ -1077,14 +1709,26 @@ Renders a coin `lot` as a tape.
10771709
10781710Digit rendering engine
10791711
1080− ++ ne
1081− |_ tig=@
1082−
10831712A [door]() containing arms that render digits at bases 10, 16, 32, and
1084171364.
10851714
1715+Accepts
1716+-------
1717+
1718+Produces
1719+--------
1720+
10861721`tig` is an [`atom`]().
10871722
1723+Source
1724+------
1725+
1726+ ++ ne
1727+ |_ tig=@
1728+
1729+Examples
1730+--------
1731+
10881732 ~zod/try=> ~(. ne 20)
10891733 <4.gut [@ud <414.hhh 100.xkc 1.ypj %164>]>
10901734
@@ -1094,12 +1738,24 @@ A [door]() containing arms that render digits at bases 10, 16, 32, and
10941738
10951739Render decimal
10961740
1097− ++ d (add tig '0')
1098−
10991741Renders a decimal digit as an atom of an ACII byte value.
11001742
1743+Accepts
1744+-------
1745+
1746+Produces
1747+--------
1748+
11011749`tig` is an [`atom`]().
11021750
1751+Source
1752+------
1753+
1754+ ++ d (add tig '0')
1755+
1756+Examples
1757+--------
1758+
11031759 ~zod/try=> `@t`~(d ne 7)
11041760 '7'
11051761
@@ -1109,12 +1765,24 @@ Renders a decimal digit as an atom of an ACII byte value.
11091765
11101766Render hex
11111767
1112− ++ x ?:((gte tig 10) (add tig 87) d)
1113−
11141768Renders a hexadecimal digit as an atom of an ASCII byte value.
11151769
1770+Accepts
1771+-------
1772+
1773+Produces
1774+--------
1775+
11161776`tig` is an [`atom`]().
11171777
1778+Source
1779+------
1780+
1781+ ++ x ?:((gte tig 10) (add tig 87) d)
1782+
1783+Examples
1784+--------
1785+
11181786 ~zod/try=> `@t`~(x ne 7)
11191787 '7'
11201788 ~zod/try=> `@t`~(x ne 14)
@@ -1126,9 +1794,21 @@ Renders a hexadecimal digit as an atom of an ASCII byte value.
11261794
11271795Render base-32
11281796
1797+Renders a base-32 digit as an atom of an ASCII byte value.
1798+
1799+Accepts
1800+-------
1801+
1802+Produces
1803+--------
1804+
1805+Source
1806+------
1807+
11291808 ++ v ?:((gte tig 10) (add tig 87) d)
11301809
1131−Renders a base-32 digit as an atom of an ASCII byte value.
1810+Examples
1811+--------
11321812
11331813 ~zod/try=> `@t`~(v ne 7)
11341814 '7'
@@ -1143,13 +1823,25 @@ Renders a base-32 digit as an atom of an ASCII byte value.
11431823
11441824Render base-64
11451825
1826+Renders a base-64 digit as an atom of an ASCII byte value.
1827+
1828+Accepts
1829+-------
1830+
1831+Produces
1832+--------
1833+
1834+`tig` is an [`atom`]().
1835+
1836+Source
1837+------
1838+
11461839 ++ w ?:(=(tig 63) '~' ?:(=(tig 62) '-' ?:((gte tig 36) (add tig 29) x)))
11471840 --
11481841 ::
11491842
1150−Renders a base-64 digit as an atom of an ASCII byte value.
1151−
1152−`tig` is an [`atom`]().
1843+Examples
1844+--------
11531845
11541846 ~zod/try=> `@t`~(w ne 7)
11551847 '7'
@@ -1172,17 +1864,29 @@ Renders a base-64 digit as an atom of an ASCII byte value.
11721864
11731865Core used to scramble 16-bit atoms
11741866
1175− ++ mu
1176− |_ [top=@ bot=@]
1177−
11781867A [door]() that contains arms that are used to scramble two atoms, `top`
11791868and `bot`. Used especially in the phonetic base to disguise the
11801869relationship between a destroyer and its cruiser.
11811870
1871+Accepts
1872+-------
1873+
1874+Produces
1875+--------
1876+
11821877`bot` is an [atom]().
11831878
11841879`top` is an [atom]().
11851880
1881+Source
1882+------
1883+
1884+ ++ mu
1885+ |_ [top=@ bot=@]
1886+
1887+Examples
1888+--------
1889+
11861890 ~zod/try=> ~(. mu 0x20e5 0x5901)
11871891 <3.sjm [[@ux @ux] <414.hhh 100.xkc 1.ypj %164>]>
11881892
@@ -1192,16 +1896,28 @@ relationship between a destroyer and its cruiser.
11921896
11931897Add bottom into top
11941898
1195− ++ zag [p=(end 4 1 (add top bot)) q=bot]
1196−
11971899Produces the cell of `top` and `bot` with `top` scrambled to the result
11981900of adding `bot` to `top` modulo 16. Used to scramble the name of a
11991901destroyer.
12001902
1903+Accepts
1904+-------
1905+
1906+Produces
1907+--------
1908+
12011909`bot` is an [atom]().
12021910
12031911`top` is an [atom]().
12041912
1913+Source
1914+------
1915+
1916+ ++ zag [p=(end 4 1 (add top bot)) q=bot]
1917+
1918+Examples
1919+--------
1920+
12051921 ~zod/try=> `[@ux @ux]`~(zag mu 0x20e0 0x201)
12061922 [0x22e1 0x201]
12071923
@@ -1211,17 +1927,29 @@ destroyer.
12111927
12121928Subtract bottom from top
12131929
1214− ++ zig [p=(end 4 1 (add top (sub 0x1.0000 bot))) q=bot]
1215−
12161930The inverse of [`++zag`](). Produces the cell of `top` and `bot` with
12171931`top` unscrambled. The unscrambled `top` is the sum of the sample `top`
12181932and the 16-bit complement of `bot`. Used to unscramble the name of the
12191933destroyer.
12201934
1935+Accepts
1936+-------
1937+
1938+Produces
1939+--------
1940+
12211941`bot` is an [atom]().
12221942
12231943`top` is an [atom]().
12241944
1945+Source
1946+------
1947+
1948+ ++ zig [p=(end 4 1 (add top (sub 0x1.0000 bot))) q=bot]
1949+
1950+Examples
1951+--------
1952+
12251953 ~zod/try=> `[@ux @ux]`~(zig mu 0x2f46 0x1042)
12261954 [0x1f04 0x1042]
12271955
@@ -1231,15 +1959,27 @@ destroyer.
12311959
12321960Concatenate into atom
12331961
1234− ++ zug (mix (lsh 4 1 top) bot)
1235−
12361962Produces the concatenation of `top` and `bot`. Used to assemble a
12371963destroyer name.
12381964
1965+Accepts
1966+-------
1967+
1968+Produces
1969+--------
1970+
12391971`bot` is an [atom]().
12401972
12411973`top` is an [atom]().
12421974
1975+Source
1976+------
1977+
1978+ ++ zug (mix (lsh 4 1 top) bot)
1979+
1980+Examples
1981+--------
1982+
12431983 ~zod/try=> `@ux`~(zug mu 0x10e1 0xfa)
12441984 0x10e1.00fa
12451985
@@ -1249,10 +1989,22 @@ destroyer name.
12491989
12501990Coin parser engine
12511991
1992+Core containing arms that parse [`++coin`]s.
1993+
1994+Accepts
1995+-------
1996+
1997+Produces
1998+--------
1999+
2000+Source
2001+------
2002+
12522003 ++ so
12532004 |%
12542005
1255−Core containing arms that parse [`++coin`]s.
2006+Examples
2007+--------
12562008
12572009 ~zod/try=> so
12582010 <10.mkn 414.hhh 100.xkc 1.ypj %164>
@@ -1263,6 +2015,18 @@ Core containing arms that parse [`++coin`]s.
12632015
12642016Parse odor-atom pair
12652017
2018+Parsing rule. Parses an unsigned integer of any permitted base,
2019+producing a [`++dime`]().
2020+
2021+Accepts
2022+-------
2023+
2024+Produces
2025+--------
2026+
2027+Source
2028+------
2029+
12662030 ++ bisk
12672031 ;~ pose
12682032 ;~ pfix (just '0')
@@ -1277,8 +2041,8 @@ Parse odor-atom pair
12772041 (stag %ud dem:ag)
12782042 ==
12792043
1280−Parsing rule. Parses an unsigned integer of any permitted base,
1281−producing a [`++dime`]().
2044+Examples
2045+--------
12822046
12832047 ~zod/try=> (scan "25" bisk:so)
12842048 [%ud q=25]
@@ -1291,6 +2055,19 @@ producing a [`++dime`]().
12912055
12922056Parse `@da`, `@dr`, `@p`, `@t`
12932057
2058+Parsing rule. Parses any atom of any of the following odors after a
2059+leading sig, `~` into a [`++dime`](): [`@da`](), [`@dr`](), [`@p`](),
2060+and [`@t`](), producing a [`++dime`]().
2061+
2062+Accepts
2063+-------
2064+
2065+Produces
2066+--------
2067+
2068+Source
2069+------
2070+
12942071 ++ crub
12952072 ;~ pose
12962073 %+ cook
@@ -1345,9 +2122,8 @@ Parse `@da`, `@dr`, `@p`, `@t`
13452122 ;~(pfix hep (stag %c (cook turf (cook woad urs:ab))))
13462123 ==
13472124
1348−Parsing rule. Parses any atom of any of the following odors after a
1349−leading sig, `~` into a [`++dime`](): [`@da`](), [`@dr`](), [`@p`](),
1350−and [`@t`](), producing a [`++dime`]().
2125+Examples
2126+--------
13512127
13522128 ~zod/try=> (scan "1926.5.12" crub:so)
13532129 [p=~.da q=170.141.184.449.747.016.871.285.095.307.149.312.000]
@@ -1368,6 +2144,18 @@ and [`@t`](), producing a [`++dime`]().
13682144
13692145Top-level coin parser
13702146
2147+Parsing rule. Switches on the first character and applies the
2148+corresponding [`++coin`]() parser.
2149+
2150+Accepts
2151+-------
2152+
2153+Produces
2154+--------
2155+
2156+Source
2157+------
2158+
13712159 ++ nuck
13722160 %+ knee *coin |. ~+
13732161 %- stew
@@ -1379,8 +2167,8 @@ Top-level coin parser
13792167 :- '~' ;~(pfix sig ;~(pose twid (easy [~ %n 0])))
13802168 ==
13812169
1382−Parsing rule. Switches on the first character and applies the
1383−corresponding [`++coin`]() parser.
2170+Examples
2171+--------
13842172
13852173 ~zod/try=> (scan "~pillyt" nuck:so)
13862174 [% p=[p=~.p q=32.819]]
@@ -1410,11 +2198,23 @@ corresponding [`++coin`]() parser.
14102198
14112199Parse coin literal with escapes
14122200
2201+Parsing rule. Parses a coin literal with escapes. (See also: xx tuple
2202+formatting).
2203+
2204+Accepts
2205+-------
2206+
2207+Produces
2208+--------
2209+
2210+Source
2211+------
2212+
14132213 ++ nusk
14142214 (sear |=(a=@ta (rush (wick a) nuck)) urt:ab)
14152215
1416−Parsing rule. Parses a coin literal with escapes. (See also: xx tuple
1417−formatting).
2216+Examples
2217+--------
14182218
14192219 ~zod/try=> ~.asd_a
14202220 ~.asd_a
@@ -1431,14 +2231,26 @@ formatting).
14312231
14322232Parsing rule.
14332233
2234+Parsing rule. Parses a dime or tuple without their respective standard
2235+prefixes.
2236+
2237+Accepts
2238+-------
2239+
2240+Produces
2241+--------
2242+
2243+Source
2244+------
2245+
14342246 ++ perd
14352247 ;~ pose
14362248 (stag ~ zust)
14372249 (stag %many (ifix [cab ;~(plug cab cab)] (more cab nusk)))
14382250 ==
14392251
1440−Parsing rule. Parses a dime or tuple without their respective standard
1441−prefixes.
2252+Examples
2253+--------
14422254
14432255 ~zod/try=> (scan "y" perd:so)
14442256 [~ [%f %.y]]
@@ -1455,6 +2267,17 @@ prefixes.
14552267
14562268Parse dime float
14572269
2270+Parsing rule. Parses a number into a [`++dime`]() float.
2271+
2272+Accepts
2273+-------
2274+
2275+Produces
2276+--------
2277+
2278+Source
2279+------
2280+
14582281 ++ royl
14592282 =+ ^= zer
14602283 (cook lent (star (just '0')))
@@ -1478,7 +2301,8 @@ Parse dime float
14782301 (stag %rs (cook ryls voy)
14792302 ==
14802303
1481−Parsing rule. Parses a number into a [`++dime`]() float.
2304+Examples
2305+--------
14822306
14832307 ~zod/try=> (scan "~3.14" royl:so)
14842308 [%rd .~3.13999999999999]
@@ -1491,6 +2315,31 @@ Parsing rule. Parses a number into a [`++dime`]() float.
14912315
14922316XX still not fully functional
14932317
2318+Intermediate parsed float convereter
2319+
2320+------------------------------------------------------------------------
2321+
2322+### `++tash`
2323+
2324+Parse signed dime
2325+
2326+Accepts
2327+-------
2328+
2329+Accepts
2330+-------
2331+
2332+Produces
2333+--------
2334+
2335+Produces
2336+--------
2337+
2338+Parsing rule. Parses a signed number into a [`++dime`]().
2339+
2340+Source
2341+------
2342+
14942343 ++ royl-cell
14952344 |= [a=? b=[c=@ d=@ e=@] f=(unit ,[h=? i=@])]
14962345 ^- [? @ @ @ (unit ,@s)]
@@ -1500,13 +2349,11 @@ XX still not fully functional
15002349 [a c.b d.b e.b [~ (mul i.u.f 2)]]
15012350 [a c.b d.b e.b [~ (dec (mul i.u.f 2))]]
15022351
1503−Intermediate parsed float convereter
1504−
1505−------------------------------------------------------------------------
1506−
1507−### `++tash`
2352+Examples
2353+--------
15082354
1509−Parse signed dime
2355+Source
2356+------
15102357
15112358 ++ tash
15122359 =+ ^= neg
@@ -1520,7 +2367,8 @@ Parse signed dime
15202367 ==
15212368 ==
15222369
1523−Parsing rule. Parses a signed number into a [`++dime`]().
2370+Examples
2371+--------
15242372
15252373 ~zod/try=> (scan "-20" tash:so)
15262374 [p=~.sd q=39]
@@ -1537,6 +2385,17 @@ Parsing rule. Parses a signed number into a [`++dime`]().
15372385
15382386Parse coins without `~` prefix
15392387
2388+Parsing rule. Parses coins after a leading sig, `~`.
2389+
2390+Accepts
2391+-------
2392+
2393+Produces
2394+--------
2395+
2396+Source
2397+------
2398+
15402399 ++ twid
15412400 ;~ pose
15422401 (cook |=(a=@ [%blob (cue a)]) ;~(pfix (just '0') vum:ag))
@@ -1544,7 +2403,8 @@ Parse coins without `~` prefix
15442403 ==
15452404 ::
15462405
1547−Parsing rule. Parses coins after a leading sig, `~`.
2406+Examples
2407+--------
15482408
15492409 ~zod/try=> (scan "zod" twid:so)
15502410 [~ [%p 0]]
@@ -1563,6 +2423,18 @@ Parsing rule. Parses coins after a leading sig, `~`.
15632423
15642424Parse prefixed dimes from `@if`, `@f`, `@rd`
15652425
2426+Parsing rule. Parses an atom of either [`@if`]() (IP address), [`@f`]()
2427+(loobean), or [`rf`]()(floating point) into a [`++dime`]().
2428+
2429+Accepts
2430+-------
2431+
2432+Produces
2433+--------
2434+
2435+Source
2436+------
2437+
15662438 ++ zust
15672439 ;~ pose
15682440 (stag %is bip:ag)
@@ -1572,8 +2444,8 @@ Parse prefixed dimes from `@if`, `@f`, `@rd`
15722444 ==
15732445 --
15742446
1575−Parsing rule. Parses an atom of either [`@if`]() (IP address), [`@f`]()
1576−(loobean), or [`rf`]()(floating point) into a [`++dime`]().
2447+Examples
2448+--------
15772449
15782450 ~zod/try=> (scan "127.0.0.1" zust:so)
15792451 [%if q=2.130.706.433]
@@ -1594,12 +2466,24 @@ Parsing rule. Parses an atom of either [`@if`]() (IP address), [`@f`]()
15942466
15952467Render dime as cord
15962468
1597− ++ scot |=(mol=dime ~(rent co %$ mol))
1598−
15992469Renders a dime `mol` as a cord.
16002470
2471+Accepts
2472+-------
2473+
2474+Produces
2475+--------
2476+
16012477`mol` is a [`++dime`]().
16022478
2479+Source
2480+------
2481+
2482+ ++ scot |=(mol=dime ~(rent co %$ mol))
2483+
2484+Examples
2485+--------
2486+
16032487 ~zod/try=> (scot %p ~pillyt)
16042488 ~.~pillyt
16052489 ~zod/try=> `@t`(scot %p ~pillyt)
@@ -1623,12 +2507,24 @@ Renders a dime `mol` as a cord.
16232507
16242508Render dime as tape
16252509
1626− ++ scow |=(mol=dime ~(rend co %$ mol))
1627−
16282510Renders `mol` as a tape.
16292511
2512+Accepts
2513+-------
2514+
2515+Produces
2516+--------
2517+
16302518`mol` is a [`++dime`]().
16312519
2520+Source
2521+------
2522+
2523+ ++ scow |=(mol=dime ~(rend co %$ mol))
2524+
2525+Examples
2526+--------
2527+
16322528 ~zod/try=> (scow %p ~pillyt)
16332529 "~pillyt"
16342530 ~zod/try=> (scow %ux 0x12)
@@ -1644,15 +2540,27 @@ Renders `mol` as a tape.
16442540
16452541Curried slaw
16462542
1647− ++ slat |=(mod=@tas |=(txt=@ta (slaw mod txt)))
1648−
16492543Produces a [`gate`]() that parses a [`term`]() `txt` to an atom of the
16502544odor specified by `mod`.
16512545
2546+Accepts
2547+-------
2548+
2549+Produces
2550+--------
2551+
16522552`mod` is a term, an atom of odor [`@tas`]().
16532553
16542554`txt` is a span, an atom of odor [`@ta`]().
16552555
2556+Source
2557+------
2558+
2559+ ++ slat |=(mod=@tas |=(txt=@ta (slaw mod txt)))
2560+
2561+Examples
2562+--------
2563+
16562564 ~zod/try=> `(unit ,@p)`((slat %p) '~pillyt')
16572565 [~ ~pillyt]
16582566 ~zod/try=> `(unit ,@ux)`((slat %ux) '0x12')
@@ -1668,15 +2576,27 @@ odor specified by `mod`.
16682576
16692577Demand: parse span with input odor
16702578
1671− ++ slav |=([mod=@tas txt=@ta] (need (slaw mod txt)))
1672−
16732579Parses a span `txt` to an atom of the odor specificed by `mod`. Crashes
16742580if it failes to parse.
16752581
2582+Accepts
2583+-------
2584+
2585+Produces
2586+--------
2587+
16762588`mod` is a term, an atom of odor [`@tas`]().
16772589
16782590`txt` is a span, an atom of odor [`@ta`]().
16792591
2592+Source
2593+------
2594+
2595+ ++ slav |=([mod=@tas txt=@ta] (need (slaw mod txt)))
2596+
2597+Examples
2598+--------
2599+
16802600 ~zod/try=> `@p`(slav %p '~pillyt')
16812601 ~pillyt
16822602 ~zod/try=> `@p`(slav %p '~pillam')
@@ -1700,6 +2620,21 @@ if it failes to parse.
17002620
17012621Parse span to input odor
17022622
2623+Parses a span `txt` to an atom of the odor specified by `mod`.
2624+
2625+Accepts
2626+-------
2627+
2628+Produces
2629+--------
2630+
2631+`mod` is a term, an atom of odor [`@tas`]().
2632+
2633+`txt` is a span, an atom of odor [`@ta`]().
2634+
2635+Source
2636+------
2637+
17032638 ++ slaw
17042639 |= [mod=@tas txt=@ta]
17052640 ^- (unit ,@)
@@ -1707,11 +2642,8 @@ Parse span to input odor
17072642 ?.(&(?=([~ %$ @ @] con) =(p.p.u.con mod)) ~ [~ q.p.u.con])
17082643 ::
17092644
1710−Parses a span `txt` to an atom of the odor specified by `mod`.
1711−
1712−`mod` is a term, an atom of odor [`@tas`]().
1713−
1714−`txt` is a span, an atom of odor [`@ta`]().
2645+Examples
2646+--------
17152647
17162648 ~zod/try=> `(unit ,@p)`(slaw %p '~pillyt')
17172649 [~ ~pillyt]
@@ -1736,6 +2668,19 @@ Parses a span `txt` to an atom of the odor specified by `mod`.
17362668
17372669Parse span to coin
17382670
2671+Parses a span `txt` to the unit of a [`++coin`]().
2672+
2673+Accepts
2674+-------
2675+
2676+Produces
2677+--------
2678+
2679+`txt` is a [`@ta`]().
2680+
2681+Source
2682+------
2683+
17392684 ++ slay
17402685 |= txt=@ta ^- (unit coin)
17412686 =+ vex=((full nuck:so) [[1 1] (trip txt)])
@@ -1744,9 +2689,8 @@ Parse span to coin
17442689 [~ p.u.q.vex]
17452690 ::
17462691
1747−Parses a span `txt` to the unit of a [`++coin`]().
1748−
1749−`txt` is a [`@ta`]().
2692+Examples
2693+--------
17502694
17512695 ~zod/try=> (slay '~pillyt')
17522696 [~ [% p=[p=~.p q=32.819]]]
@@ -1781,16 +2725,28 @@ Parses a span `txt` to the unit of a [`++coin`]().
17812725
17822726Render path as tank
17832727
2728+Renders the path `bon` as a [`tank`](), which is used for
2729+pretty-printing.
2730+
2731+Accepts
2732+-------
2733+
2734+Produces
2735+--------
2736+
2737+`bon` is a [`++path`]().
2738+
2739+Source
2740+------
2741+
17842742 ++ smyt
17852743 |= bon=path ^- tank
17862744 :+ %rose [['/' ~] ['/' ~] ['/' ~]]
17872745 |- ^- (list tank)
17882746 (turn bon |=(a=@ [%leaf (rip 3 a)]))
17892747
1790−Renders the path `bon` as a [`tank`](), which is used for
1791−pretty-printing.
1792−
1793−`bon` is a [`++path`]().
2748+Examples
2749+--------
17942750
17952751 ~zod/try=> (smyt %)
17962752 [ %rose
@@ -1813,12 +2769,24 @@ pretty-printing.
18132769
18142770Render path as cord
18152771
1816− ++ spat |=(pax=path (crip (spud pax))) :: path to cord
1817−
18182772Renders a path `pax` as cord.
18192773
2774+Accepts
2775+-------
2776+
2777+Produces
2778+--------
2779+
18202780`pax` is a [`path`]().
18212781
2782+Source
2783+------
2784+
2785+ ++ spat |=(pax=path (crip (spud pax))) :: path to cord
2786+
2787+Examples
2788+--------
2789+
18222790 ~zod/try=> (spat %)
18232791 '~zod/try/~2014.10.28..18.40.20..4287'
18242792 ~zod/try=> (spat %/bin)
@@ -1832,12 +2800,24 @@ Renders a path `pax` as cord.
18322800
18332801Render path as tape
18342802
1835− ++ spud |=(pax=path ~(ram re (smyt pax))) :: path to tape
1836−
18372803Renders a path `pax` as [tape]().
18382804
2805+Accepts
2806+-------
2807+
2808+Produces
2809+--------
2810+
18392811`pax` is a [`path`]().
18402812
2813+Source
2814+------
2815+
2816+ ++ spud |=(pax=path ~(ram re (smyt pax))) :: path to tape
2817+
2818+Examples
2819+--------
2820+
18412821 ~zod/try=> (spud %)
18422822 "~zod/try/~2014.10.28..18.40.46..e951"
18432823 ~zod/try=> (spud %/bin)
@@ -1851,11 +2831,23 @@ Renders a path `pax` as [tape]().
18512831
18522832Parse span to path
18532833
2834+Parsing rule. Parses a span `zep` to a static [`++path`](/doc/hoon/library/1#++path).
2835+
2836+Accepts
2837+-------
2838+
2839+Produces
2840+--------
2841+
2842+Source
2843+------
2844+
18542845 ++ stab :: parse span to path
18552846 |= zep=@ta ^- path
18562847 (rash zep ;~(pfix fas ;~(sfix (more fas urs:ab) fas)))
18572848
1858−Parsing rule. Parses a span `zep` to a static [`++path`](/doc/hoon/library/1#++path).
2849+Examples
2850+--------
18592851
18602852 ~zod/try=> (stab '/as/lek/tor')
18612853 /as/lek/tor
docs/dev/hoon/library/2en.md+279−36
@@ -17,6 +17,22 @@ Used in the `@p` phonetic base.
1717
1818Conceal structure
1919
20+Scrambles a bytestring `pyn` by adding the current position to each
21+byte, looking it up in an s-box, and then performing the XOR operation
22+on the result, pushing it forward. Produces an atom.
23+
24+Accepts
25+-------
26+
27+`pyn` is an [atom]().
28+
29+
30+Produces
31+--------
32+
33+Source
34+------
35+
2036 ++ wren :: conceal structure
2137 |= pyn=@ ^- @
2238 =+ len=(met 3 pyn)
@@ -35,11 +51,8 @@ Conceal structure
3551 [[1 mog] $(mig mog)]
3652 ::
3753
38−Scrambles a bytestring `pyn` by adding the current position to each
39−byte, looking it up in an s-box, and then performing the XOR operation
40−on the result, pushing it forward. Produces an atom.
41−
42−`pyn` is an [atom]().
54+Examples
55+--------
4356
4457 ~zod/try=> `@ux`(wren:un 'testing')
4558 0x30.bf6a.b9fe.7d8f
@@ -54,6 +67,21 @@ on the result, pushing it forward. Produces an atom.
5467
5568Restore structure
5669
70+Unscrambles a bytestring `cry` by subtracting the current position from
71+each byte, looking it up in an s-box, and performing the XOR operation
72+on the result, pushing it forward. Produces an atom.
73+
74+Accepts
75+-------
76+
77+`cry` is an [atom]().
78+
79+Produces
80+--------
81+
82+Source
83+------
84+
5785 ++ wred :: restore structure
5886 |= cry=@ ^- @
5987 =+ len=(met 3 cry)
@@ -72,11 +100,8 @@ Restore structure
72100 [[1 :(mix mig (end 3 1 len) (zyrt mog))] $(mig mog)]
73101 ::
74102
75−Unscrambles a bytestring `cry` by subtracting the current position from
76−each byte, looking it up in an s-box, and performing the XOR operation
77−on the result, pushing it forward. Produces an atom.
78−
79−`cry` is an [atom]().
103+Examples
104+--------
80105
81106 ~zod/try=> (wred:un 0x30.bf6a.b9fe.7d8f)
82107 29.113.321.805.538.676
@@ -91,9 +116,20 @@ on the result, pushing it forward. Produces an atom.
91116
92117Add modulo 255
93118
119+Produces the sum of two atoms modulo 255, encoded as a nonzero byte.
120+
121+Accepts
122+-------
123+
124+A cell of two atoms, `a` and `b`.
125+
126+Source
127+------
128+
94129 ++ xafo |=([a=@ b=@] +((mod (add (dec b) a) 255)))
95130
96−Produces the sum of two atoms modulo 255, encoded as a nonzero byte.
131+Examples
132+--------
97133
98134 ~zod/try=> (xafo:un 5 6)
99135 11
@@ -106,11 +142,27 @@ Produces the sum of two atoms modulo 255, encoded as a nonzero byte.
106142
107143Subtract modulo 255
108144
109− ++ xaro |=([a=@ b=@] +((mod (add (dec b) (sub 255 (mod a 255))) 255)))
110−
111145Produces the difference between two atoms modulo 255, encoded as a
112146nonzero byte.
113147
148+Accepts
149+-------
150+
151+A cell of two atoms, `a` and `b`.
152+
153+Produces
154+--------
155+
156+An atom.
157+
158+Source
159+------
160+
161+ ++ xaro |=([a=@ b=@] +((mod (add (dec b) (sub 255 (mod a 255))) 255)))
162+
163+Examples
164+--------
165+
114166 ~zod/try=> (xaro:un 17 57)
115167 40
116168 ~zod/try=> (xaro:un 265 12)
@@ -122,6 +174,23 @@ nonzero byte.
122174
123175Look up in 255 sub box
124176
177+The inverse of [`++zart`](). Looks up a nonzero byte`a\` in a substiution
178+box with 255 values, producing a unique nonzero byte.
179+
180+Accepts
181+-------
182+
183+`a` is an atom of one byte in length.
184+
185+
186+Produces
187+--------
188+
189+An atom.
190+
191+Source
192+------
193+
125194 ++ zaft :: forward 255-sbox
126195 |= a=@D
127196 =+ ^= b
@@ -139,10 +208,8 @@ Look up in 255 sub box
139208 (cut 3 [(dec a) 1] b)
140209 ::
141210
142−The inverse of [`++zart`](). Looks up a nonzero byte`a\` in a substiution
143−box with 255 values, producing a unique nonzero byte.
144−
145−`a` is an [atom]() of one byte in length.
211+Examples
212+--------
146213
147214 ~zod/try=> (zaft:un 0x12)
148215 42
@@ -158,6 +225,22 @@ box with 255 values, producing a unique nonzero byte.
158225
159226Reverse look up in 255 sub box
160227
228+The inverse of [`++zaft`](). Looks up the index of a nonzero byte `a` in
229+the substitution box with 255 values, producing a unique nonzero byte.
230+
231+Accepts
232+-------
233+
234+`a` is an atom of one byte in length.
235+
236+Produces
237+--------
238+
239+An atom.
240+
241+Source
242+------
243+
161244 ++ zart :: reverse 255-sbox
162245 |= a=@D
163246 =+ ^= b
@@ -175,10 +258,8 @@ Reverse look up in 255 sub box
175258 (cut 3 [(dec a) 1] b)
176259 ::
177260
178−The inverse of [`++zaft`](). Looks up the index of a nonzero byte `a` in
179−the substitution box with 255 values, producing a unique nonzero byte.
180−
181−`a` is an [atom]() of one byte in length.
261+Examples
262+--------
182263
183264 ~zod/try=> `@ux`(zart:un 204)
184265 0xff
@@ -191,6 +272,22 @@ the substitution box with 255 values, producing a unique nonzero byte.
191272
192273Lookup byte in 256 sub box
193274
275+The inverse of [`++zyrt`](). Looks up a byte `a` in a substituion box
276+with 256 values, producing a byte.
277+
278+Accepts
279+-------
280+
281+`a` is an [atom]() of one byte in length.
282+
283+Produces
284+--------
285+
286+An atom.
287+
288+Source
289+------
290+
194291 ++ zyft :: forward 256-sbox
195292 |= a=@D
196293 =+ ^= b
@@ -209,10 +306,8 @@ Lookup byte in 256 sub box
209306 (cut 3 [a 1] b)
210307 ::
211308
212−The inverse of [`++zyrt`](). Looks up a byte `a` in a substituion box
213−with 256 values, producing a byte.
214−
215−`a` is an [atom]() of one byte in length.
309+Examples
310+--------
216311
217312 ~zod/try=> (zyft:un 0x12)
218313 57
@@ -227,6 +322,22 @@ with 256 values, producing a byte.
227322
228323Reverse lookup byte in 256 sub box
229324
325+The inverse of [`++zyft`](/doc/hoon/library/2en#++zyft). Looks up a byte `a` in a substituion box
326+with 256 values, producing a byte.
327+
328+Accepts
329+-------
330+
331+`a` is an [atom]() of one byte in length.
332+
333+Produces
334+--------
335+
336+An atom.
337+
338+Source
339+------
340+
230341 ++ zyrt :: reverse 256-sbox
231342 |= a=@D
232343 =+ ^= b
@@ -244,10 +355,8 @@ Reverse lookup byte in 256 sub box
244355 df4d.225e.2d56.7fd6.1395.a3f8.c582
245356 (cut 3 [a 1] b)
246357
247−The inverse of [`++zyft`](/doc/hoon/library/2en#++zyft). Looks up a byte `a` in a substituion box
248−with 256 values, producing a byte.
249−
250−`a` is an [atom]() of one byte in length.
358+Examples
359+--------
251360
252361 ~zod/try=> `@ux`(zyrt:un 57)
253362 0x12
@@ -271,6 +380,23 @@ A core for performing reversible scrambling operations for the `@p` phonetic bas
271380
272381Conceal structure, v2
273382
383+Randomly permutes atoms that fit into 17 to 32 bits into one another. If the
384+atom fits into 33 to 64 bits, does the same permutation on the low 32 bits
385+only. Otherwise, passes the atom through unchanged.
386+
387+Accepts
388+-------
389+
390+An atom.
391+
392+Produces
393+--------
394+
395+An atom.
396+
397+Source
398+------
399+
274400 ++ feen :: conceal structure v2
275401 |= pyn=@ ^- @
276402 ?: &((gte pyn 0x1.0000) (lte pyn 0xffff.ffff))
@@ -282,12 +408,34 @@ Conceal structure, v2
282408 (add 0x1.0000 (fice (sub lo 0x1.0000)))
283409 pyn
284410
285−Randomly permutes atoms that fit into 17 to 32 bits into one another. If the atom fits into 33 to 64 bits, does the same permutation on the low 32 bits only. Otherwise, passes the atom through unchanged.
411+Examples
412+--------
413+
286414
287415------------------------------------------------------------------------
288416
289417### `++fend`
290418
419+XX
420+
421+Randomly permutes atoms that fit into 17 to 32 bits into one another, and
422+randomly permutes the low 32 bits of atoms that fit into 33 to 64 bits;
423+otherwise, passes the atom through unchanged. The permutation is the inverse of
424+the one applied by [`++feen`]().
425+
426+Accepts
427+-------
428+
429+An atom.
430+
431+Produces
432+--------
433+
434+An atom.
435+
436+Source
437+------
438+
291439 ++ fend :: restore structure v2
292440 |= cry=@ ^- @
293441 ?: &((gte cry 0x1.0000) (lte cry 0xffff.ffff))
@@ -299,12 +447,30 @@ Randomly permutes atoms that fit into 17 to 32 bits into one another. If the ato
299447 (add 0x1.0000 (teil (sub lo 0x1.0000)))
300448 cry
301449
302−Randomly permutes atoms that fit into 17 to 32 bits into one another, and randomly permutes the low 32 bits of atoms that fit into 33 to 64 bits; otherwise, passes the atom through unchanged. The permutation is the inverse of the one applied by [`++feen`]().
450+Examples
451+--------
303452
304453------------------------------------------------------------------------
305454
306455### `++fice`
307456
457+XX
458+
459+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.
460+
461+Accepts
462+-------
463+
464+An atom.
465+
466+Produces
467+--------
468+
469+An atom.
470+
471+Source
472+------
473+
308474 ++ fice :: adapted from
309475 |= nor=@ :: black and rogaway
310476 ^- @ :: "ciphers with
@@ -315,12 +481,33 @@ Randomly permutes atoms that fit into 17 to 32 bits into one another, and random
315481 [(mod nor 65.535) (div nor 65.535)]
316482 (add (mul 65.535 -.sel) +.sel)
317483
318−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.
484+Examples
485+--------
319486
320487------------------------------------------------------------------------
321488
322489### `++teil`
323490
491+XX
492+
493+Applies the reverse of the Feistel-like cipher applied by [`++fice`](). Unlike
494+a conventional Feistel cipher that is its own inverse if keys are used in
495+reverse order, this Feistel-like cipher uses two moduli that must be swapped
496+when applying the reverse transformation.
497+
498+Accepts
499+-------
500+
501+An atom.
502+
503+Produces
504+--------
505+
506+An atom.
507+
508+Source
509+------
510+
324511 ++ teil :: reverse ++fice
325512 |= vip=@
326513 ^- @
@@ -331,12 +518,31 @@ Applies a 3-round Feistel-like cipher to randomly permute atoms in the range `0`
331518 [(mod vip 65.535) (div vip 65.535)]
332519 (add (mul 65.535 -.sel) +.sel)
333520
334−Applies the reverse of the Feistel-like cipher applied by [`++fice`](). Unlike a conventional Feistel cipher that is its own inverse if keys are used in reverse order, this Feistel-like cipher uses two moduli that must be swapped when applying the reverse transformation.
521+Examples
522+--------
335523
336524------------------------------------------------------------------------
337525
338526### `++rynd`
339527
528+XX
529+
530+A single round of the Feistel-like cipher [`++fice`](). AES ([`++aesc`]()) is
531+used as the round function.
532+
533+Accepts
534+-------
535+
536+A cell of three atoms, `n`, `l`, and `r`.
537+
538+Produces
539+--------
540+
541+A cell of two atoms.
542+
543+Source
544+------
545+
340546 ++ rynd :: feistel round
341547 |= [n=@ l=@ r=@]
342548 ^- [@ @]
@@ -345,12 +551,30 @@ Applies the reverse of the Feistel-like cipher applied by [`++fice`](). Unlike a
345551 (~(sum fo 65.535) l (en:aesc (snag n raku) r))
346552 (~(sum fo 65.536) l (en:aesc (snag n raku) r))
347553
348−A single round of the Feistel-like cipher [`++fice`](). AES ([`++aesc`]()) is used as the round function.
554+Examples
555+--------
349556
350557------------------------------------------------------------------------
351558
352559### `++rund`
353560
561+XX
562+
563+A single round of the Feistel-like reverse cipher [`++teil`]().
564+
565+Accepts
566+-------
567+
568+A cell of three atoms, `n`, `l`, and `r`.
569+
570+Produces
571+--------
572+
573+A cell of two atoms.
574+
575+Source
576+------
577+
354578 ++ rund :: reverse round
355579 |= [n=@ l=@ r=@]
356580 ^- [@ @]
@@ -359,12 +583,29 @@ A single round of the Feistel-like cipher [`++fice`](). AES ([`++aesc`]()) is us
359583 (~(dif fo 65.535) l (en:aesc (snag n raku) r))
360584 (~(dif fo 65.536) l (en:aesc (snag n raku) r))
361585
362−A single round of the Feistel-like reverse cipher [`++teil`]().
586+Examples
587+--------
363588
364589------------------------------------------------------------------------
365590
366591### `++raku`
367592
593+XX
594+
595+
596+Accepts
597+-------
598+
599+A list of atoms of [odor]() [`@ux`]() (hexadecimal).
600+
601+Produces
602+--------
603+
604+Arbitrary keys for use with [`++aesc`]().
605+
606+Source
607+------
608+
368609 ++ raku
369610 ^- (list ,@ux)
370611 :~ 0x15f6.25e3.083a.eb3e.7a55.d4db.fb99.32a3.
@@ -375,4 +616,6 @@ A single round of the Feistel-like reverse cipher [`++teil`]().
375616 6f5f.ab8e.88b9.c089.b2dc.95a6.aed5.e3a4
376617 ==
377618
378−Arbitrary keys for use with [`++aesc`]().
619+Examples
620+--------
621+
docs/dev/hoon/library/2eo.md+185−60
@@ -5,6 +5,25 @@ section 2eO, virtualization
55
66Nock subject to unit
77
8+Accepts a nock subject-formula cell and wraps it into a [`++unit`]().
9+`fol` is pure nock, meaning that nock `11` operations result in a block,
10+producing a `~`.
11+
12+Accepts
13+-------
14+
15+`sub` is a subject [noun]().
16+
17+`fol` is a formula noun, which is generally a `++nock`.
18+
19+Produces
20+--------
21+
22+The `++unit` of a noun.
23+
24+Source
25+------
26+
827 ++ mack
928 |= [sub=* fol=*]
1029 ^- (unit)
@@ -12,13 +31,8 @@ Nock subject to unit
1231 ?.(?=([0 *] ton) ~ [~ p.ton])
1332 ::
1433
15−Accepts a nock subject-formula cell and wraps it into a [`++unit`]().
16−`fol` is pure nock, meaning that nock `11` operations result in a block,
17−producing a `~`.
18−
19−`sub` is a subject [noun]().
20−
21−`fol` is a formula [noun](), which is generally a `++nock`.
34+Examples
35+--------
2236
2337 ~zod/try=> (mack [[1 2 3] [0 1]])
2438 [~ [1 2 3]]
@@ -37,6 +51,28 @@ producing a `~`.
3751
3852Mock interpreter
3953
54+Bottom-level [mock]() (virtual nock) interpreter. Produces a
55+[`++tone`](), a nock computation result. If nock 11 is invoked, `sky`
56+computes on the subject and produces a [`++unit`]() result. An empty
57+result becomes a `%1` `++tone`, indicating a block.
58+
59+Accepts
60+-------
61+
62+`sub` is the subject as a [noun]().
63+
64+`fol` is the formula as a noun.
65+
66+`sky` is an [`%iron`]() gate invoked with [nock operator 11]().
67+
68+Produces
69+--------
70+
71+A `++tone`.
72+
73+Source
74+------
75+
4076 ++ mink
4177 ~/ %mink
4278 |= [[sub=* fol=*] sky=$+(* (unit))]
@@ -113,16 +149,8 @@ Mock interpreter
113149 ==
114150 ::
115151
116−Bottom-level [mock]() (virtual nock) interpreter. Produces a
117−[`++tone`](), a nock computation result. If nock 11 is invoked, `sky`
118−computes on the subject and produces a [`++unit`]() result. An empty
119−result becomes a `%1` `++tone`, indicating a block.
120−
121−`sub` is the subject as a [noun]().
122−
123−`fol` is the formula as a [noun]().
124−
125−`sky` is an [`%iron`]() gate invoked with [nock operator 11]().
152+Examples
153+--------
126154
127155 ~zod/try=> (mink [20 [4 0 1]] ,~)
128156 [%0 p=21]
@@ -147,22 +175,36 @@ result becomes a `%1` `++tone`, indicating a block.
147175
148176Compute formula on subject with hint
149177
150− ++ mock
151− |= [[sub=* fol=*] sky=$+(* (unit))]
152− (mook (mink [sub fol] sky))
153− ::
154−
155178Produces a [`++toon`](), which is either a sucessful, blocked, or
156179crashed result. If nock 11 is invoked, `sky` computes on the subject and
157180produces a [`++unit`]() result. An empty result becomes a `%1` `++tune`,
158181indicating a block.
159182
183+Accepts
184+-------
185+
160186`sub` is the subject as a [noun]().
161187
162−`fol` is the formula as a [noun]().
188+`fol` is the formula as a noun.
163189
164190`sky` is an [%iron]() gate invoked with [nock operator 11]().
165191
192+Produces
193+--------
194+
195+The `++unit` of a noun.
196+
197+Source
198+------
199+
200+ ++ mock
201+ |= [[sub=* fol=*] sky=$+(* (unit))]
202+ (mook (mink [sub fol] sky))
203+ ::
204+
205+Examples
206+--------
207+
166208 ~zod/try=> (mock [5 4 0 1] ,~)
167209 [%0 p=6]
168210 ~zod/try=> (mock [~ 11 1 0] |=(* `999))
@@ -184,6 +226,22 @@ indicating a block.
184226
185227Intelligently render crash annotation
186228
229+Converts a `%2` `++tone` nock stack trace to a list of [`++tank`]().
230+Each may be a tank, cord, [`++spot`](), or trapped tank.
231+
232+Accepts
233+-------
234+
235+`ton` is a [`++tone`]().
236+
237+Produces
238+--------
239+
240+A [`++toon`]().
241+
242+Source
243+------
244+
187245 ++ mook
188246 |= ton=tone
189247 ^- toon
@@ -231,11 +289,8 @@ Intelligently render crash annotation
231289 ==
232290 ::
233291
234−Converts a `%2` `++tone` nock stack trace to a list of [`++tank`]().
235−Each may be a tank, cord, [`++spot`](), or trapped tank. Produces a
236−[`++toon`]().
237−
238−`ton` is a [`++tone`]().
292+Examples
293+--------
239294
240295 ~zod/try=> (mook [%0 5 4 5 1])
241296 [%0 p=[5 4 5 1]]
@@ -254,23 +309,37 @@ Each may be a tank, cord, [`++spot`](), or trapped tank. Produces a
254309
255310Unit: Slam gate with sample
256311
257− ++ mang
258− |= [[gat=* sam=*] sky=$+(* (unit))]
259− ^- (unit)
260− =+ ton=(mong [[gat sam] sky])
261− ?.(?=([0 *] ton) ~ [~ p.ton])
262− ::
263−
264312Produces a [`++unit`]() computation result from slamming `gat` with
265313`sam`, using `sky` to compute or block on nock 11 when applicable.
266314Similar to [`++mong`]().
267315
316+Accepts
317+-------
318+
268319`gat` is a [noun]() that is generally a [`gate`]().
269320
270321`sam` is a [`sample`]() noun.
271322
272323`sky` is an [%iron]() gate invoked with [nock operator 11]().
273324
325+Produces
326+--------
327+
328+The `++unit` of a noun.
329+
330+Source
331+------
332+
333+ ++ mang
334+ |= [[gat=* sam=*] sky=$+(* (unit))]
335+ ^- (unit)
336+ =+ ton=(mong [[gat sam] sky])
337+ ?.(?=([0 *] ton) ~ [~ p.ton])
338+ ::
339+
340+Examples
341+--------
342+
274343 ~zod/try=> (mang [|=(@ 20) ~] ,~)
275344 [~ 20]
276345 ~zod/try=> (mang [|=(@ !!) ~] ,~)
@@ -296,23 +365,37 @@ Similar to [`++mong`]().
296365
297366Slam gate with sample
298367
299− ++ mong
300− |= [[gat=* sam=*] sky=$+(* (unit))]
301− ^- toon
302− ?. &(?=(^ gat) ?=(^ +.gat))
303− [%2 ~]
304− (mock [[-.gat [sam +>.gat]] -.gat] sky)
305− ::
306−
307368Produces a [`++toon`]() computation result from slamming `gat` with
308369`sam`, using `sky` to compute or block on nock 11 when applicable.
309370
371+Accepts
372+-------
373+
310374`gat` is a [noun]() that is generally a [`gate`]().
311375
312376`sam` is a [`sample`]() noun.
313377
314378`sky` is an [%iron]() gate invoked with [nock operator 11]().
315379
380+Produces
381+--------
382+
383+A `++toon`.
384+
385+Source
386+------
387+
388+ ++ mong
389+ |= [[gat=* sam=*] sky=$+(* (unit))]
390+ ^- toon
391+ ?. &(?=(^ gat) ?=(^ +.gat))
392+ [%2 ~]
393+ (mock [[-.gat [sam +>.gat]] -.gat] sky)
394+ ::
395+
396+Examples
397+--------
398+
316399 ~zod/try=> (mong [|=(@ 20) ~] ,~)
317400 [%0 p=20]
318401 ~zod/try=> (mong [|=(@ !!) ~] ,~)
@@ -338,23 +421,37 @@ Produces a [`++toon`]() computation result from slamming `gat` with
338421
339422Virtualize slamming gate
340423
341− ++ mung
342− |= [[gat=* sam=*] sky=$+(* (unit))]
343− ^- tone
344− ?. &(?=(^ gat) ?=(^ +.gat))
345− [%2 ~]
346− (mink [[-.gat [sam +>.gat]] -.gat] sky)
347− ::
348−
349424Produces a [`++tone`]() computation result from slamming `gat` with
350425`sam`, using `sky` to compute or block on nock 11 when applicable.
351426
427+Accepts
428+-------
429+
352430`gat` is a [noun]() that is generally a [`gate`]().
353431
354432`sam` is a [`sample`]() noun.
355433
356434`sky` is an [%iron]() gate invoked with [nock operator 11]().
357435
436+Produces
437+--------
438+
439+A `++tone`.
440+
441+Source
442+------
443+
444+ ++ mung
445+ |= [[gat=* sam=*] sky=$+(* (unit))]
446+ ^- tone
447+ ?. &(?=(^ gat) ?=(^ +.gat))
448+ [%2 ~]
449+ (mink [[-.gat [sam +>.gat]] -.gat] sky)
450+ ::
451+
452+Examples
453+--------
454+
358455 ~zod/try=> (mung [|=(@ 20) ~] ,~)
359456 [%0 p=20]
360457 ~zod/try=> (mung [|=(@ !!) ~] ,~)
@@ -380,6 +477,22 @@ Produces a [`++tone`]() computation result from slamming `gat` with
380477
381478Typed virtual
382479
480+Kicks a [`++trap`](), producing its results or any errors that occur along
481+the way. Used to lazily compute stack traces.
482+
483+Accepts
484+-------
485+
486+`taq` is a [`++trap`](), generally producing a list of [`++tank`]()s.
487+
488+Produces
489+--------
490+
491+XX
492+
493+Source
494+------
495+
383496 ++ mule :: typed virtual
384497 ~/ %mule
385498 |* taq=_|.(_*)
@@ -390,10 +503,8 @@ Typed virtual
390503 ==
391504 ::
392505
393−Kicks a `++trap`, producing its results or any errors that occur along
394−the way. Used to lazily compute stack traces.
395−
396−`taq` is a [`++trap`](), generally producing a list of [`++tank`]()s.
506+Examples
507+--------
397508
398509 ~zod/try=> (mule |.(leaf/"hello"))
399510 [%.y p=[%leaf "hello"]]
@@ -419,6 +530,23 @@ the way. Used to lazily compute stack traces.
419530
420531Untyped virtual
421532
533+Kicks a `++trap`, producing its result as a noun or the tanks of any
534+error that occurs. Similar to [`++mule`](), but preserves no type
535+information.
536+
537+Accepts
538+-------
539+
540+`taq` is a [`++trap`](/doc/hoon/library/1#++trap).
541+
542+Produces
543+--------
544+
545+Either a noun or a [`++list`]() of [`++tank`]().
546+
547+Source
548+------
549+
422550 ++ mute :: untyped virtual
423551 |= taq=_^?(|.(_*))
424552 ^- (each ,* (list tank))
@@ -429,11 +557,8 @@ Untyped virtual
429557 %2 [%| p.ton]
430558 ==
431559
432−Kicks a `++trap`, producing its result as a noun or the tanks of any
433−error that occurs. Similar to [`++mule`](), but preserves no type
434−information.
435−
436−`taq` is a [`++trap`](/doc/hoon/library/1#++trap).
560+Examples
561+--------
437562
438563 ~zod/try=> (mute |.(leaf/"hello"))
439564 [%.y p=[1.717.658.988 104 101 108 108 111 0]]
docs/dev/hoon/library/2ep.md+249−26
@@ -12,6 +12,22 @@ anyway.
1212
1313Invert diff patches
1414
15+Inverts a list of changes `bur`. Skips stay constant and replaces are
16+swapped. Produces a `bur`.
17+
18+Accepts
19+-------
20+
21+`bur` is a [`++urge`]().
22+
23+Produces
24+--------
25+
26+The `++urge` of a noun.
27+
28+Source
29+------
30+
1531 ++ berk :: invert diff patch
1632 |* bur=(urge)
1733 |- ^+ bur
@@ -23,10 +39,8 @@ Invert diff patches
2339 ==
2440 ::
2541
26−Inverts a list of changes `bur`. Skips stay constant and replaces are
27−swapped. Produces a `bur`.
28−
29−`bur` is a [`++urge`]().
42+Examples
43+--------
3044
3145 ~zod/try=> (berk `(urge)`~[`10 %|^[~[2] ~[3 4]] `5])
3246 ~[[%.y p=10] [%.n p=~[3 4] q=~[2]] [%.y p=5]]
@@ -43,6 +57,21 @@ swapped. Produces a `bur`.
4357
4458Generate patch
4559
60+Produces a patch between two nouns, by change type
61+
62+Accepts
63+-------
64+
65+`pum` is an [`++umph`]().
66+
67+Produces
68+--------
69+
70+An [`++udon`]()
71+
72+Source
73+------
74+
4675 ++ diff :: generate patch
4776 |= pum=umph
4877 |= [old=* new=*] ^- udon
@@ -56,9 +85,8 @@ Generate patch
5685 ==
5786 ::
5887
59−Produces a patch between two nouns, by change type
60−
61−`pum` is an [`++umph`]().
88+Examples
89+--------
6290
6391 ~zod/try=> ((diff %a) 20 21)
6492 [p=%a q=[%d p=[%1 p=21] q=[%1 p=20]]]
@@ -88,6 +116,26 @@ Produces a patch between two nouns, by change type
88116
89117Longest subsequence
90118
119+Finds a subsequence of repeated elements within two [`++list`]()s, using
120+several internal helper arms. Produces a [`++tape`]().
121+
122+Accepts
123+-------
124+
125+`hel` is a [`++list`]() of [nouns]().
126+
127+`hev` is a [++list`]() of nouns.
128+
129+Produces
130+--------
131+
132+XX
133+
134+A [++list`]() of nouns.
135+
136+Source
137+------
138+
91139 ++ loss :: longest subsequence
92140 ~/ %loss
93141 |* [hel=(list) hev=(list)]
@@ -153,12 +201,8 @@ Longest subsequence
153201 $(hel t.hel, hev t.hev, rag (done %| [i.hel ~] [i.hev ~]))
154202 --
155203
156−Finds a subsequence of repeated elements within two [`++list`]()s, using
157−several internal helper arms. Produces a [`++tape`]().
158−
159−`hel` is a [`++list`]() of characters.
160−
161−`hev` is a [++list\`]() of characters.
204+Examples
205+--------
162206
163207 ~zod/try=> (loss "sam" "sem")
164208 "sm"
@@ -177,6 +221,22 @@ several internal helper arms. Produces a [`++tape`]().
177221
178222Find common
179223
224+Finds a subsequence of repeated elements within two
225+[`++list`](/doc/hoon/library/1#++list)s, producing a [\`++tape]().
226+
227+Accepts
228+-------
229+
230+A cell of two `++tape`s, `hel` and `hev`.
231+
232+Produces
233+--------
234+
235+A `++tape`.
236+
237+Source
238+------
239+
180240 ++ locz :: trivial algorithm
181241 |= [hel=tape hev=tape]
182242 ^- tape
@@ -194,8 +254,8 @@ Find common
194254 ?:((gth p.lef p.rig) lef rig)
195255 ::
196256
197−Finds a subsequence of repeated elements within two [`++list`](/doc/hoon/library/1#++list)s,
198−producing a [\`++tape]().
257+Examples
258+--------
199259
200260 ~zod/try=> (locz "samukot" "semelkot")
201261 "smkot"
@@ -208,6 +268,22 @@ producing a [\`++tape]().
208268
209269Split on `\n`
210270
271+Split on newlines, ascii `10`
272+
273+Accepts
274+-------
275+
276+`lub` is an atom.
277+
278+Produces
279+--------
280+
281+XX
282+
283+A `++list` of atoms of odor [`@t`]() ([`++cord`]()).
284+
285+Source
286+------
211287 ++ lore :: atom to line list
212288 ~/ %lore
213289 |= lub=@
@@ -225,7 +301,8 @@ Split on `\n`
225301 $(lub res, tez [(end 3 meg lub) tez])
226302 ::
227303
228−Split on newlines, ascii `10`
304+Examples
305+--------
229306
230307 ~zod/try=> (lore 'soke\0alas\0amep')
231308 <|soke las mep|>
@@ -244,12 +321,30 @@ Split on newlines, ascii `10`
244321
245322Join with `\n`
246323
324+Join line list with newlines.
325+
326+Accepts
327+-------
328+
329+A `++list` of atoms of [odor]() [`@t`]() ([`++cord`]()).
330+
331+Produces
332+--------
333+
334+XX
335+
336+An atom of [odor]() [`@t`]() ([`++cord`]().
337+
338+Source
339+------
340+
247341 ++ role :: line list to atom
248342 |= tez=(list ,@t)
249343 (rap 3 (turn tez |=(a=@t (cat 3 a 10))))
250344 ::
251345
252−Join line list with newlines.
346+Examples
347+--------
253348
254349 ~zod/try=> (role 'sep' 'tek' 'lap' ~)
255350 3.230.709.852.558.292.782.985.274.739
@@ -266,6 +361,21 @@ Join line list with newlines.
266361
267362Change with `++udon`
268363
364+Use [`++udon`]() to change [noun]().
365+
366+Accepts
367+-------
368+
369+A cell of an `++udon`, `don`, and a noun, `src`.
370+
371+Produces
372+--------
373+
374+A noun.
375+
376+Source
377+------
378+
269379 ++ lump :: apply patch
270380 |= [don=udon src=*]
271381 ^- *
@@ -287,7 +397,8 @@ Change with `++udon`
287397 ==
288398 ::
289399
290−Use udon to change noun
400+Examples
401+--------
291402
292403 ~zod/try=> (lump [%a %a 20 25] 20)
293404 25
@@ -313,6 +424,21 @@ Use udon to change noun
313424
314425Patch `a`
315426
427+Patch a by references to axis and literal.
428+
429+Accepts
430+-------
431+
432+A cell of a [noun](), `a`, and an [`++upas`](), `b`.
433+
434+Produces
435+--------
436+
437+A noun.
438+
439+Source
440+------
441+
316442 ++ lure :: apply tree diff
317443 |= [a=* b=upas]
318444 ^- *
@@ -323,7 +449,8 @@ Patch `a`
323449 %1 .*(a [1 p.b])
324450 ==
325451
326−Patch a by references to axis and literal.
452+Examples
453+--------
327454
328455 ~zod/try=> (lure ~[1 2] [[%0 2] [%1 3] [%0 7]])
329456 [1 3 0]
@@ -336,6 +463,21 @@ Patch a by references to axis and literal.
336463
337464Reverse patch
338465
466+Reverse a patch (preprocessor unchanged)
467+
468+Accepts
469+-------
470+
471+`don` is an [`++udon`]().
472+
473+Produces
474+--------
475+
476+An `++udon`.
477+
478+Source
479+------
480+
339481 ++ limp :: invert patch
340482 |= don=udon ^- udon
341483 :- p.don
@@ -346,7 +488,8 @@ Reverse patch
346488 ==
347489 ::
348490
349−Reverse a patch (preprocessor unchanged)
491+Examples
492+--------
350493
351494 ~zod/try=> (limp [%a %a 20 40])
352495 [p=%a q=[%a p=40 q=20]]
@@ -361,6 +504,21 @@ Reverse a patch (preprocessor unchanged)
361504
362505Prep for diff
363506
507+Prep atom for diff: leave alone, cue, or split by newlines.
508+
509+Accepts
510+-------
511+
512+A cell of an [`++umph`](), `pum`, and a [noun](), `src`.
513+
514+Produces
515+--------
516+
517+A noun.
518+
519+Source
520+------
521+
364522 ++ hump :: general prepatch
365523 |= [pum=umph src=*] ^- *
366524 ?+ pum ~|(%unsupported !!)
@@ -370,7 +528,8 @@ Prep for diff
370528 ==
371529 ::
372530
373−Prep atom for diff: leave alone, cue, or split by newlines.
531+Examples
532+--------
374533
375534 ~zod/try=> (hump %a ~)
376535 0
@@ -391,6 +550,21 @@ Prep atom for diff: leave alone, cue, or split by newlines.
391550
392551Atomize post diff
393552
553+Re-atomize after diff: leave alone, jam, or join with newlines.
554+
555+Accepts
556+-------
557+
558+A cell of an [`++umph`](), `pum`, and a [noun](), `dst`.
559+
560+Produces
561+--------
562+
563+A noun.
564+
565+Source
566+------
567+
394568 ++ husk :: unprepatch
395569 |= [pum=umph dst=*] ^- *
396570 ?+ pum ~|(%unsupported !!)
@@ -400,7 +574,8 @@ Atomize post diff
400574 ==
401575 ::
402576
403−Re-atomize after diff: leave alone, jam, or join with newlines.
577+Examples
578+--------
404579
405580 ~zod/try=> (husk %a 0)
406581 0
@@ -438,6 +613,23 @@ Re-atomize after diff: leave alone, jam, or join with newlines.
438613
439614Apply list patch
440615
616+Amend list using an urge: [`++list`]() of `[%& {number skipped}]` and
617+`[%| old new]`
618+
619+
620+Accepts
621+-------
622+
623+A cell of a `++list` of [noun]()s, `hel`, and an [`++urge`]() of a noun, `rug`.
624+
625+Produces
626+--------
627+
628+A `++list` of nouns.
629+
630+Source
631+------
632+
441633 ++ lurk :: apply list patch
442634 |* [hel=(list) rug=(urge)]
443635 ^+ hel
@@ -464,8 +656,8 @@ Apply list patch
464656 ==
465657 ::
466658
467−Amend list using an urge: list of `[%& {number skipped}]` and
468−`[%| old new]`
659+Examples
660+--------
469661
470662 ~zod/try=> (lurk "hema" `(urge char)`~[`1 [%| "e" "ru"] `2])
471663 "hurma"
@@ -478,6 +670,20 @@ Amend list using an urge: list of `[%& {number skipped}]` and
478670
479671`lcs` to list patch
480672
673+Using a common sequence, generate urge from two [`++list`]()s.
674+
675+
676+Accepts
677+-------
678+
679+A cell of three `++list`s of [noun](), `hel`, `hev`, and `lcs`.
680+
681+Produces
682+--------
683+
684+Source
685+------
686+
481687 ++ lusk :: lcs to list patch
482688 |* [hel=(list) hev=(list) lcs=(list)]
483689 =+ ^= rag
@@ -522,7 +728,8 @@ Amend list using an urge: list of `[%& {number skipped}]` and
522728 $(hel t.hel, hev t.hev, rag (done %| [i.hel ~] [i.hev ~]))
523729 --
524730
525−Using a common sequence, generate urge from two lists
731+Examples
732+--------
526733
527734 ~zod/try=> (lusk "hamok" "hasok" "haok")
528735 ~[[%.y p=2] [%.n p="m" q="s"] [%.y p=2]]
@@ -539,6 +746,21 @@ Using a common sequence, generate urge from two lists
539746
540747Tree change
541748
749+Generate tree diff from two nouns.
750+
751+Accepts
752+-------
753+
754+A cell of two nouns, `a` and `b`.
755+
756+Produces
757+--------
758+
759+A cell of two [`++upas`](), `p` and `q`.
760+
761+Source
762+------
763+
542764 ++ nude :: tree change
543765 |= [a=* b=*]
544766 ^- [p=upas q=upas]
@@ -572,7 +794,8 @@ Tree change
572794 [%0 u.c]
573795 --
574796
575−Generate tree diff from two nouns.
797+Examples
798+--------
576799
577800 ~zod/try=> (nude 40 20)
578801 [p=[%1 p=20] q=[%1 p=40]]
docs/dev/hoon/library/3bc.md+174−30
@@ -5,6 +5,22 @@ section 3bC, Gregorian UTC
55
66Weekday of Jan 1
77
8+Computes which day of the week January 1st falls on for a year `yer`,
9+producing an atom. Weeks are zero-indexed beginning on Sunday.
10+
11+Accepts
12+-------
13+
14+`yer` is an unsigned decimal, [`@ud`]().
15+
16+Produces
17+--------
18+
19+An atom.
20+
21+Source
22+------
23+
824 ++ dawn :: weekday of jan 1
925 |= yer=@ud
1026 =+ yet=(sub yer 1)
@@ -12,10 +28,8 @@ Weekday of Jan 1
1228 :(add 1 (mul 5 (mod yet 4)) (mul 4 (mod yet 100)) (mul 6 (mod yet 400)))
1329 ::
1430
15−Computes which day of the week January 1st falls on for a year `yer`,
16−producing an atom. Weeks are zero-indexed beginning on Sunday.
17−
18−`yer` is an unsigned decimal, [`@ud`]().
31+Examples
32+--------
1933
2034 ~zod/try=> (dawn 2.015)
2135 4
@@ -27,20 +41,36 @@ producing an atom. Weeks are zero-indexed beginning on Sunday.
2741
2842------------------------------------------------------------------------
2943
44+
45+
3046### `++daws`
3147
3248Weekday of date
3349
50+Produces the day of the week of a given date `yed` as an atom. Weeks are
51+zero-indexed beginning on Sunday.
52+
53+Accepts
54+-------
55+
56+`yed` is a [`++date`]().
57+
58+Produces
59+--------
60+
61+An atom.
62+
63+Source
64+------
65+
3466 ++ daws :: weekday of date
3567 |= yed=date
3668 %- mod :_ 7
3769 (add (dawn y.yed) (sub (yawn [y.yed m.yed d.t.yed]) (yawn y.yed 1 1)))
3870 ::
3971
40−Produces the day of the week of a given date `yed` as an atom. Weeks are
41−zero-indexed beginning on Sunday.
42−
43−`yed` is a [`date`]().
72+Examples
73+--------
4474
4575 ~zod/try=> (daws [[a=%.y y=2.014] m=6 t=[d=6 h=21 m=9 s=15 f=~[0xa16]]])
4676 5
@@ -55,6 +85,21 @@ zero-indexed beginning on Sunday.
5585
5686Add leap seconds
5787
88+Produces a [`++date`]() with the 25 leap seconds added.
89+
90+Accepts
91+-------
92+
93+`yer` is an absolute date, [`@da`]().
94+
95+Produces
96+--------
97+
98+A `++date`.
99+
100+Source
101+------
102+
58103 ++ deal :: to leap sec time
59104 |= yer=@da
60105 =+ n=0
@@ -69,9 +114,8 @@ Add leap seconds
69114 $(n +(n))
70115 ::
71116
72−Produces a [`date`]() with the 25 leap seconds added.
73−
74−`yer` is an absolute date, [`@da`]().
117+Examples
118+--------
75119
76120 ~zod/try=> (yore (bex 127))
77121 [[a=%.y y=226] m=12 t=[d=5 h=15 m=30 s=8 f=~]]
@@ -86,6 +130,22 @@ Produces a [`date`]() with the 25 leap seconds added.
86130
87131Subtract leap seconds
88132
133+Produces an absolute date ([`@ud`]()) with the 25 leap seconds
134+subtracted.
135+
136+Accepts
137+-------
138+
139+`ley` is a [`++date`]().
140+
141+Produces
142+--------
143+
144+An atom of [odor]() [`@da`](), which represents an absolute date.
145+
146+Source
147+------
148+
89149 ++ lead :: from leap sec time
90150 |= ley=date
91151 =+ ler=(year ley)
@@ -103,10 +163,8 @@ Subtract leap seconds
103163 $(n +(n))
104164 ::
105165
106−Produces an absolute date ([`@ud`]()) with the 25 leap seconds
107−subtracted.
108−
109−`ley` is a [`date`]().
166+Examples
167+--------
110168
111169 ~zod/try=> (yore `@da`(bex 127))
112170 [[a=%.y y=226] m=12 t=[d=5 h=15 m=30 s=8 f=~]]
@@ -121,6 +179,21 @@ subtracted.
121179
122180Print UTC format
123181
182+Produces a [`++tape`]() of the date in UTC format.
183+
184+Accepts
185+-------
186+
187+`yed` is a [`++date`]().
188+
189+Produces
190+--------
191+
192+A `++tape`.
193+
194+Source
195+------
196+
124197 ++ dust :: print UTC format
125198 |= yed=date
126199 ^- tape
@@ -135,9 +208,8 @@ Print UTC format
135208 ==
136209 ::
137210
138−Produces a [tape]() of the date in UTC format.
139−
140−`yed` is a [`date`]().
211+Examples
212+--------
141213
142214 ~zod/try=> (dust (yore ->-))
143215 "Tue, 21 Oct 2014 21:35:12 +0000"
@@ -150,6 +222,22 @@ Produces a [tape]() of the date in UTC format.
150222
151223Parse UTC format
152224
225+Accepts a [`++tape`]() containing a date in UTC format and produces the
226+[`++unit`]() of a [`++date`]().
227+
228+Accepts
229+-------
230+
231+`cud` is a `++tape`.
232+
233+Produces
234+--------
235+
236+The `++unit` of a `++date`.
237+
238+Source
239+------
240+
153241 ++ stud :: parse UTC format
154242 |= cud=tape
155243 ^- (unit date)
@@ -177,8 +265,8 @@ Parse UTC format
177265 ==
178266 ::
179267
180−Accepts a [tape]() containing a date in UTC format and produces the
181−[unit]() of a [`date`]().
268+Examples
269+--------
182270
183271 ~zod/try=> (stud "Tue, 21 Oct 2014 21:21:55 +0000")
184272 [~ [[a=%.y y=2.014] m=10 t=[d=21 h=21 m=21 s=55 f=~]]]
@@ -193,11 +281,29 @@ Accepts a [tape]() containing a date in UTC format and produces the
193281
194282UGT to UTC time
195283
284+Transforms Urbit Galactic Time to UTC time, producing an atom.
285+
286+Accepts
287+-------
288+
289+An atom of [odor]() [`@da`](), representing an absolute date.
290+
291+Produces
292+--------
293+
294+An atom.
295+
296+Source
297+------
298+
196299 ++ unt :: UGT to UTC time
197300 |= a=@da
198301 (div (sub a ~1970.1.1) (bex 64))
199302 ::
200303
304+Examples
305+--------
306+
201307 ~zod/try=/hom> (unt -<-)
202308 1.413.927.704
203309 ~zod/try=> (unt ~20014.1.1)
@@ -205,16 +311,15 @@ UGT to UTC time
205311 ~zod/try=> (unt ~2014.1.1)
206312 1.388.534.400
207313
208−Transforms Urbit Galactic Time to UTC time, producing an atom.
209−
210−`a` is an [atom]().
211−
212314------------------------------------------------------------------------
213315
214316### `++yu`
215317
216318UTC format constants
217319
320+Source
321+------
322+
218323 ++ yu :: UTC format constants
219324 |%
220325
@@ -227,13 +332,24 @@ UTC format constants
227332
228333Months
229334
335+Produces a list of [`++tapes`]() containing the 12 months of the year.
336+
337+Produces
338+--------
339+
340+A `++list` of `++tape`s.
341+
342+Source
343+------
344+
230345 ++ mon ^- (list tape)
231346 :~ "January" "February" "March" "April" "May" "June" "July"
232347 "August" "September" "October" "November" "December"
233348 ==
234349 ::
235350
236−Produces a list of [tapes]() containing the 12 months of the year.
351+Examples
352+--------
237353
238354 ~zod/try=/hom> mon:yu
239355 <<
@@ -259,14 +375,20 @@ Produces a list of [tapes]() containing the 12 months of the year.
259375
260376Weeks
261377
378+Produces a list of [tapes]() containing the 7 days of the week,
379+beginning with Sunday.
380+
381+Source
382+------
383+
262384 ++ wik ^- (list tape)
263385 :~ "Sunday" "Monday" "Tuesday" "Wednesday" "Thursday"
264386 "Friday" "Saturday"
265387 ==
266388 ::
267389
268−Produces a list of [tapes]() containing the 7 days of the week,
269−beginning with Sunday.
390+Examples
391+--------
270392
271393 ~zod/try=/hom> wik:yu
272394 <<"Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday">>
@@ -281,6 +403,16 @@ beginning with Sunday.
281403
282404Leap second dates
283405
406+Produces a [`++list`]() of the (absolute) dates ([`@da`]) of the 25 leap seconds.
407+
408+Produces
409+--------
410+
411+A `++list` of atoms of odor `@da`.
412+
413+Source
414+------
415+
284416 ++ les ^- (list ,@da)
285417 :~ ~2015.7.1 ~2012.7.1 ~2009.1.1 ~2006.1.1 ~1999.1.1 ~1997.7.1
286418 ~1996.1.1 ~1994.7.1 ~1993.7.1 ~1992.7.1 ~1991.1.1 ~1990.1.1
@@ -289,7 +421,8 @@ Leap second dates
289421 ~1973.1.1 ~1972.7.1
290422 ==
291423
292−Produces a list of the (absolute) dates ([`@da`]) of the 25 leap seconds
424+Examples
425+--------
293426
294427 ~zod/try=/hom> les:yu
295428 ~[
@@ -329,6 +462,17 @@ Produces a list of the (absolute) dates ([`@da`]) of the 25 leap seconds
329462
330463Back-shifted leap second dates
331464
465+Produces a [`++list`]() of absolute dates ([`@da`]()s) that represent the Urbit
466+Galactc Time equivalents of the UTC leap second dates in [`++les`](/doc/hoon/library/3bc#++les).
467+
468+Produces
469+--------
470+
471+A `++list` of atoms of odor `@da`.
472+
473+Source
474+------
475+
332476 ++ lef ^- (list ,@da)
333477 :~ ~2015.6.30..23.59.59 ~2012.6.30..23.59.59
334478 ~2008.12.31..23.59.58 ~2005.12.31..23.59.57
@@ -346,8 +490,8 @@ Back-shifted leap second dates
346490 ==
347491 ::
348492
349−Produces a list of absolute dates ([`@da`]()) that represent the Urbit
350−Galactc Time equivalents of the UTC leap second dates in [`++les`](/doc/hoon/library/3bc#++les).
493+Examples
494+--------
351495
352496 ~zod/try=/hom> lef:yu
353497 ~[
docs/dev/hoon/library/3bd.md+1384−269
@@ -5,6 +5,21 @@ section 3bD, JSON and XML
55
66Mime type to `++cord`
77
8+Renders a [mime](http://en.wikipedia.org/wiki/MIME) type path with infix
9+`/` to a [`++cord`]().
10+Accepts
11+-------
12+
13+`myn` is a ++[`mite`](), a [`++list`]() of [`@ta`]().
14+
15+Produces
16+--------
17+
18+A `++cord`.
19+
20+Source
21+------
22+
823 ++ moon :: mime type to text
924 |= myn=mite
1025 %+ rap
@@ -15,10 +30,8 @@ Mime type to `++cord`
1530 (weld (trip i.myn) `tape`['/' $(myn t.myn)])
1631 ::
1732
18−Renders a [mime](http://en.wikipedia.org/wiki/MIME) type path with infix
19−`/` to a [cord]().
20−
21−`myn` is a ++[mite](), a list of [@ta]().
33+Examples
34+--------
2235
2336 ~zod/try=> `@t`(moon /image/png)
2437 'image/png'
@@ -31,29 +44,43 @@ Renders a [mime](http://en.wikipedia.org/wiki/MIME) type path with infix
3144
3245Parse cube with fork
3346
34− ++ perk :: parse cube with fork
35− |* a=(pole ,@tas)
36− ?~ a fail
37− ;~ pose
38− (cold -.a (jest -.a))
39− $(a +.a)
40− ==
41− ::
42−
4347Parser generator. Produces a parser that succeeds upon encountering one
4448of the [`++term`]()s in a faceless list `a`.
4549
46−A- perk is an arm used to parse one of a finite set of options, formally
47−a choice between terms: if you want to match "true" or "false", and
50+A perk is an arm used to parse one of a finite set of options, formally
51+a choice between [`++term`]()s: if you want to match "true" or "false", and
4852nothing else, (perk \~[%true %false]) produces the relevant parser,
4953whose result type is `?(%true %false)`. For more complicated
50−transformations, a combintation of ++sear and map ++get is recommended,
54+transformations, a combintation of ++[`++sear`]() and map ++[`++get`]() is recommended,
5155e.g. `(sear ~(get by (mo ~[[%true &] [%false |]]))) sym)` will have a
52−similar effect but produce `?(& |)` ,a loobean. However, constructions
56+similar effect but produce `?(& |)` , a [boolean](). However, constructions
5357such as `(sear (flit ~(has in (sa %true %false %other ~))) sym)` are
5458needlessly unwieldy.
5559
56−`a` is a [`++pole`](), which is a [`++list`]() without [`%face`]()s
60+Accepts
61+-------
62+
63+`a` is a [`++pole`](), which is a [`++list`]() without [`%face`]()s.
64+
65+Produces
66+--------
67+
68+XX
69+
70+Source
71+------
72+
73+ ++ perk :: parse cube with fork
74+ |* a=(pole ,@tas)
75+ ?~ a fail
76+ ;~ pose
77+ (cold -.a (jest -.a))
78+ $(a +.a)
79+ ==
80+ ::
81+
82+Examples
83+--------
5784
5885 ~zod/try=> (scan "ham" (perk %sam %ham %lam ~))
5986 %ham
@@ -65,14 +92,29 @@ needlessly unwieldy.
6592
6693JSON parser core
6794
95+JSON parser core: parses a [`++cord`]() `a` to the hoon structure for JSON,
96+a [`++json`]().
97+
98+Accepts
99+-------
100+
101+`a` is [`++cord`]().
102+
103+Produces
104+--------
105+
106+
107+A `(like json)`.
108+
109+Source
110+------
111+
68112 ++ poja :: JSON parser core
69113 =< |=(a=cord (rush a apex))
70114 |%
71115
72−JSON parser core: parses a `++cord` `a` to the hoon structure for JSON,
73−a [`++json`]().
74−
75−`a` is [`++cord`]().
116+Examples
117+--------
76118
77119 ~zod/try=> (poja '[1,2,3]')
78120 [~ [%a p=~[[%n p=~.1] [%n p=~.2] [%n p=~.3]]]]
@@ -81,19 +123,30 @@ a [`++json`]().
81123 ~zod/try=> (poja 'invalid{json')
82124 ~
83125
84−### `++apex`
126+### `++tops`
85127
86128Parse object
87129
88− ++ apex ;~(pose abox obox) :: JSON object
89−
90−Top level parsing rule. Parses either a single JSON object, or an array
130+Top level parsing [`++rule`](). Parses either a single JSON object, or an array
91131of JSON objects to a [`++json`](). See also: [`++abox`](), [`++obox`]().
92132
93−A- this is now called ++tops, and ++apex is the old ++valu, which
94−apparently didn't make its way into the docs. Apologies for the
95−confusion, many things have been restructured in ++shell inconsistently
96−with current test:urbit.git
133+Accepts
134+-------
135+
136+A [`++nail`]().
137+
138+Produces
139+--------
140+
141+A `(like json)`.
142+
143+Source
144+------
145+
146+ ++ apex ;~(pose abox obox) :: JSON object
147+
148+Examples
149+--------
97150
98151 ~zod/try=> (rash '[1,2]' apex:poja)
99152 [%a p=~[[%n p=~.1] [%n p=~.2]]]
@@ -103,10 +156,25 @@ with current test:urbit.git
103156 ! {1 1}
104157 ! exit
105158
106−### `++valu`
159+### `++apex`
107160
108161Parse value
109162
163+Parsing [`++rule`](). Parses JSON values to [`++json`]().
164+
165+Accepts
166+-------
167+
168+A [`++nail`]().
169+
170+Produces
171+--------
172+
173+A `(like json)`.
174+
175+Source
176+------
177+
110178 ++ valu :: JSON value
111179 %+ knee *json |. ~+
112180 ;~ pfix spac
@@ -120,7 +188,8 @@ Parse value
120188 ==
121189 ==
122190
123−Parsing rule. Parses JSON values to [`++json`]().
191+Examples
192+--------
124193
125194 ~zod/try=> (rash '[1,2]' valu:poja)
126195 [%a p=~[[%n p=~.1] [%n p=~.2]]]
@@ -139,11 +208,27 @@ Parsing rule. Parses JSON values to [`++json`]().
139208
140209Parse array
141210
142− ++ abox (stag %a (ifix [sel (ws ser)] (more (ws com) valu)))
143−
144211Parsing rule. Parses a JSON array with values enclosed within `[]` and
145212delimited by a `,`.
146213
214+Accepts
215+-------
216+
217+A [`++nail`]().
218+
219+Produces
220+--------
221+
222+A `(like json)`.
223+
224+Source
225+------
226+
227+ ++ abox (stag %a (ifix [sel (ws ser)] (more (ws com) valu)))
228+
229+Examples
230+--------
231+
147232 ~zod/try=> (rash '[1, 2,4]' abox:poja)
148233 [[%n p=~.1] ~[[%n p=~.2] [%n p=~.4]]]
149234
@@ -154,11 +239,27 @@ JSON Objects
154239
155240Parse key value pair
156241
157− ++ pair ;~(plug ;~(sfix (ws stri) (ws col)) valu)
158−
159242Parsing rule. Parses a [`++json`]() from a JSON key-value pair of a
160243string and value delimited by `:`.
161244
245+Accepts
246+-------
247+
248+A [`++nail`]().
249+
250+Produces
251+--------
252+
253+A `(like json)`.
254+
255+Source
256+------
257+
258+ ++ pair ;~(plug ;~(sfix (ws stri) (ws col)) valu)
259+
260+Examples
261+--------
262+
162263 ~zod/try=> (rash '"ham": 2' pair:poja)
163264 ['ham' [%n p=~.2]]
164265
@@ -166,11 +267,27 @@ string and value delimited by `:`.
166267
167268Parse array of objects
168269
169− ++ obje (ifix [(ws kel) (ws ker)] (more (ws com) pair))
170−
171270Parsing rule. Parses a [`++json`]() from an array of JSON object
172271key-value pairs that are enclosed within `{}` and separated by `,`.
173272
273+Accepts
274+-------
275+
276+A [`++nail`]().
277+
278+Produces
279+--------
280+
281+A `(like ,[%o p=(map ,@t json)])`
282+
283+Source
284+------
285+
286+ ++ obje (ifix [(ws kel) (ws ker)] (more (ws com) pair))
287+
288+Examples
289+--------
290+
174291 ~zod/try=> (rash '{"ham": 2, "lam":true}' obje:poja)
175292 [['ham' [%n p=~.2]] ~[['lam' [%b p=%.y]]]]
176293
@@ -178,10 +295,25 @@ key-value pairs that are enclosed within `{}` and separated by `,`.
178295
179296Parse boxed object
180297
298+Parsing rule. Parses an array of JSON objects to an object of [`++json`](). See also: [`++json`]().
299+
300+Accepts
301+-------
302+
303+A [`++nail`]().
304+
305+Produces
306+--------
307+
308+A `(like ,[%o p=(map ,@t json)])`
309+
310+Source
311+------
312+
181313 ++ obox (stag %o (cook mo obje))
182314
183−Parsing rule. Parses an array of JSON objects to a [`++json`]() map with
184−a tag of `%o`. See also: [`++json`]().
315+Examples
316+--------
185317
186318 ~zod/try=> (rash '{"ham": 2, "lam":true}' obox:poja)
187319 [%o {[p='lam' q=[%b p=%.y]] [p='ham' q=[%n p=~.2]]}]
@@ -193,11 +325,29 @@ JSON Booleans
193325
194326Parse boolean
195327
196− ++ bool ;~(pose (cold & (jest 'true')) (cold | (jest 'false')))
197−
198328Parsing rule. Parses a string of either `true` or `false` to a
199329[`++json`]() boolean.
200330
331+
332+Accepts
333+-------
334+
335+A [`++nail`]().
336+
337+Produces
338+--------
339+
340+
341+A `(like ,[%b p=?])`
342+
343+Source
344+------
345+
346+ ++ bool ;~(pose (cold & (jest 'true')) (cold | (jest 'false')))
347+
348+Examples
349+--------
350+
201351 ~zod/try=> (rash 'true' bool:poja)
202352 %.y
203353 ~zod/try=> (rash 'false' bool:poja)
@@ -213,13 +363,29 @@ JSON strings
213363
214364Parse string
215365
216− ++ stri
217− (cook crip (ifix [doq doq] (star jcha)))
218−
219366Parsing rule. Parse a string to a [`++cord`](). A JSON string is a list
220367of characters enclosed in double quotes along with escaping `\`s, to a
221368[`++cord`](). See also [`++jcha`]().
222369
370+Accepts
371+-------
372+
373+A [`++nail`]().
374+
375+Produces
376+--------
377+
378+A `(like ,[%s p=@t])`.
379+
380+Source
381+------
382+
383+ ++ stri
384+ (cook crip (ifix [doq doq] (star jcha)))
385+
386+Examples
387+--------
388+
223389 ~zod/try=> (rash '"ham"' stri:poja)
224390 'ham'
225391 ~zod/try=> (rash '"h\\nam"' stri:poja)
@@ -232,11 +398,28 @@ of characters enclosed in double quotes along with escaping `\`s, to a
232398
233399Parse char from string
234400
235− ++ jcha ;~(pose ;~(less doq bas prn) esca) :: character in string
236−
237401Parsing rule. Parses either a literal or escaped character from a JSON
238402string to a [`++cord`]().
239403
404+
405+Accepts
406+-------
407+
408+A [`++nail`]().
409+
410+Produces
411+--------
412+
413+A `(like cord)`.
414+
415+Source
416+------
417+
418+ ++ jcha ;~(pose ;~(less doq bas prn) esca) :: character in string
419+
420+Examples
421+--------
422+
240423 ~zod/try=> (rash 'a' jcha:poja)
241424 'a'.
242425 ~zod/try=> (rash '!' jcha:poja)
@@ -253,6 +436,23 @@ string to a [`++cord`]().
253436
254437Parse escaped char
255438
439+Parsing rule. Parses a backslash-escaped special character, low ASCII,
440+or UTF16 codepoint, to a [`++cord`]().
441+
442+
443+Accepts
444+-------
445+
446+A [`++nail`]().
447+
448+Produces
449+--------
450+
451+A `(like cord)`.
452+
453+Source
454+------
455+
256456 ++ esca :: Escaped character
257457 ;~ pfix bas
258458 ;~ pose
@@ -261,8 +461,8 @@ Parse escaped char
261461 ;~(pfix (just 'u') (cook tuft qix:ab)) :: 4-digit hex to UTF-8
262462 ==
263463
264−Parsing rule. Parses a backslash-escaped special character, low ASCII,
265−or UTF16 codepoint, to a [`++cord`]().
464+Examples
465+--------
266466
267467 ~zod/try=> (rash 'b' esca:poja)
268468 ! {1 1}
@@ -282,7 +482,7 @@ or UTF16 codepoint, to a [`++cord`]().
282482JSON numbers
283483------------
284484
285−A- JSON numbers are stored as cords internally in lieu of full float
485+A JSON numbers are stored as cords internally in lieu of full float
286486support, so ++numb and subarms are really more *validators* than parsers
287487per se.
288488
@@ -290,6 +490,22 @@ per se.
290490
291491Parse number
292492
493+Parsing rule. Parses decimal numbers with an optional `-`, fractional
494+part, or exponent part, to a [`++tape`]().
495+
496+Accepts
497+-------
498+
499+A [`++nail`]().
500+
501+Produces
502+--------
503+
504+An [`++edge`]() of a [`++tape`]().
505+
506+Source
507+------
508+
293509 ++ numb
294510 ;~ (comp twel)
295511 (mayb (piec hep))
@@ -301,8 +517,8 @@ Parse number
301517 (mayb expo)
302518 ==
303519
304−Parsing rule. Parses decimal numbers with an optional `-`, fractional
305−part, or exponent part, to a [`++cord`]().
520+Examples
521+--------
306522
307523 ~zod/try=> (rash '0' numb:poja)
308524 ~[~~0]
@@ -322,9 +538,25 @@ part, or exponent part, to a [`++cord`]().
322538
323539Parse 1-9
324540
541+Parsing rule. Parses digits `0` through `9` to a [`++tape`]().
542+
543+Accepts
544+-------
545+
546+A [`++nail`]().
547+
548+Produces
549+--------
550+
551+The [`++edge`]() of a `++tape`.
552+
553+Source
554+------
555+
325556 ++ digs (star (shim '0' '9'))
326557
327−Parsing rule. Parses digits `0` through `9` to a [`++tape`]().
558+Examples
559+--------
328560
329561 ~zod/try=> (rash '' digs:poja)
330562 ""
@@ -339,6 +571,22 @@ Parsing rule. Parses digits `0` through `9` to a [`++tape`]().
339571
340572Parse exponent part
341573
574+Parsing rule. Parses an exponent to a [`++tape`]() .An exponent is an
575+`e` or 'E', followed by an optional `+` or `-`, and then by digits.
576+
577+Accepts
578+-------
579+
580+A [`++nail`]().
581+
582+Produces
583+--------
584+
585+The [`++edge`]() of a `++tape`.
586+
587+Source
588+------
589+
342590 ++ expo :: Exponent part
343591 ;~ (comp twel)
344592 (piec (mask "eE"))
@@ -346,8 +594,8 @@ Parse exponent part
346594 digs
347595 ==
348596
349−Parsing rule. Parses an exponent to a [`++cord`](). An exponent is an
350−`e`, followed by an optional `+` or `-`, followed by digits.
597+Examples
598+--------
351599
352600 ~zod/try=> `tape`(rash 'e7' expo:poja)
353601 "e7"
@@ -360,9 +608,25 @@ Parsing rule. Parses an exponent to a [`++cord`](). An exponent is an
360608
361609Fractional part
362610
611+Parsing rule. Parses a dot followed by digits to a [`++cord`]().
612+
613+Accepts
614+-------
615+
616+A `++nail`.
617+
618+Produces
619+--------
620+
621+The [`++edge`]() of a `++tape`.
622+
623+Source
624+------
625+
363626 ++ frac ;~(plug dot digs) :: Fractional part
364627
365−Parsing rule. Parses a dot followed by digits to a [`++cord`]().
628+Examples
629+--------
366630
367631 ~zod/try=> (rash '.25' frac:poja)
368632 [~~~. "25"]
@@ -378,9 +642,25 @@ whitespace
378642
379643Parse whitespace
380644
645+Parsing rule. Parses a whitespace to a [`++tape`]().
646+
647+Accepts
648+-------
649+
650+A [`++nail`]().
651+
652+Produces
653+--------
654+
655+A `(like tape)`.
656+
657+Source
658+------
659+
381660 ++ spac (star (mask [`@`9 `@`10 `@`13 ' ' ~]))
382661
383−Parsing rule. Parses a whitespace to a [`++tape`]().
662+Examples
663+--------
384664
385665 ~zod/try=> (scan "" spac:poja)
386666 ""
@@ -396,13 +676,27 @@ Parsing rule. Parses a whitespace to a [`++tape`]().
396676
397677Allow prefix whitespace
398678
399− ++ ws |*(sef=_rule ;~(pfix spac sef))
400−
401679Parser modifier. Produces a rule that allows for a whitespace before
402680applying `sef`.
403681
682+Accepts
683+-------
684+
404685`sef` is a [`++rule`]().
405686
687+Produces
688+--------
689+
690+A `++rule`.
691+
692+Source
693+------
694+
695+ ++ ws |*(sef=_rule ;~(pfix spac sef))
696+
697+Examples
698+--------
699+
406700 ~zod/try=> (rash ' 4' digs:poja)
407701 ! {1 1}
408702 ! exit
@@ -421,9 +715,25 @@ Plumbing
421715
422716Maybe parse
423717
718+Parser modifier. Need to document, an example showing failure.
719+
720+Accepts
721+-------
722+
723+XX
724+
725+Produces
726+--------
727+
728+XX
729+
730+Source
731+------
732+
424733 ++ mayb |*(bus=_rule ;~(pose bus (easy "")))
425734
426−Parser modifier. Need to document, an example showing failure.
735+Examples
736+--------
427737
428738 ~zod/try=> (abox:poja 1^1 "not-an-array")
429739 [p=[p=1 q=1] q=~]
@@ -434,14 +744,28 @@ Parser modifier. Need to document, an example showing failure.
434744
435745Weld two tapes
436746
437− ++ twel |=([a=tape b=tape] (weld a b))
747+Concatenates two tapes, `a` and `b`, producing a [`++tape`]().
438748
439−Concatenates two tapes, `a` and `b`, producing a `++tape`.
749+Accepts
750+-------
440751
441752`a` is a [`++tape`]().
442753
443754`b` is a [`++tape`]().
444755
756+Produces
757+--------
758+
759+The [`++edge`]() of a `++tape`.
760+
761+Source
762+------
763+
764+ ++ twel |=([a=tape b=tape] (weld a b))
765+
766+Examples
767+--------
768+
445769 ~zod/try=> (twel "sam" "hok"):poja
446770 ~[~~s ~~a ~~m ~~h ~~o ~~k]
447771 ~zod/try=> (twel "kre" ""):poja
@@ -451,23 +775,52 @@ Concatenates two tapes, `a` and `b`, producing a `++tape`.
451775
452776Parse char to list
453777
778+Parser modifer. Parses an atom with `bus` and then wraps it in a
779+[`++list`]().
780+
781+Accepts
782+-------
783+
784+`bus` is a [`++rule`]().
785+
786+Produces
787+--------
788+
789+A `++rule`.
790+
791+Source
792+------
793+
454794 ++ piec
455795 |* bus=_rule
456796 (cook |=(a=@ [a ~]) bus)
457797 ::
458798
459−Parser modifer. Parses an atom with `bus` and then wraps it in a
460−[`++list`]().
461−
462−`bus` is a [`++rule`]().
799+Examples
800+--------
463801
464− ~zod/try=> (scan "4" (piec:poja dem:ag))
802+ d~zod/try=> (scan "4" (piec:poja dem:ag))
465803 [4 ~]
466804
467805### `++pojo`
468806
469807Print JSON
470808
809+Renders a [`++json`]() `val` as a [`++tape`]().
810+
811+Accepts
812+-------
813+
814+`val` is a [`json`]().
815+
816+Produces
817+--------
818+
819+A `++tape`.
820+
821+Source
822+------
823+
471824 ++ pojo :: print json
472825 |= val=json
473826 ^- tape
@@ -510,9 +863,8 @@ Print JSON
510863 ==
511864 ::
512865
513−Renders a `++json` `val` as a [`++tape`]().
514−
515−`val` is a [`json`]().
866+Examples
867+--------
516868
517869 ~zod/try=> (pojo [%n '12.6'])
518870 "12.6"
@@ -531,13 +883,27 @@ Renders a `++json` `val` as a [`++tape`]().
531883
532884Print XML
533885
886+Renders a `++manx` `a` as a [`++tape`]().
887+
888+Accepts
889+-------
890+
891+`a` is a [`++manx`]().
892+
893+Produces
894+--------
895+
896+A `++tape`.
897+
898+Source
899+------
900+
534901 ++ poxo :: node to tape
535902 =< |=(a=manx `tape`(apex a ~))
536903 |_ unq=? :: unq
537904
538−Renders a `++manx` `a` as a [`++tape`]().
539−
540−`a` is a [`++manx`]().
905+Examples
906+--------
541907
542908 ~zod/try=> (poxo ;div;)
543909 "<div></div>"
@@ -550,6 +916,23 @@ Renders a `++manx` `a` as a [`++tape`]().
550916
551917Inner XML printer
552918
919+Renders a [`++manx`]() as a [`++tape`](), appending a suffix `rez`.
920+
921+XX is `rez/` a typo or is the `/` intentional
922+
923+Accepts
924+-------
925+
926+`rez` is a [`++tape`]().
927+
928+Produces
929+--------
930+
931+A `++tape`.
932+
933+Source
934+------
935+
553936 ++ apex :: top level
554937 |= [mex=manx rez=tape]
555938 ^- tape
@@ -566,9 +949,8 @@ Inner XML printer
566949 ?~(att rez [' ' (attr att rez)])
567950 ::
568951
569−Renders a `++manx` as a [`++tape`](), appending a suffix `rez\`.
570−
571−`rez` is a [`++tape`]().
952+Examples
953+--------
572954
573955 ~zod/try=> (apex:poxo ;div; "")
574956 "<div></div>"
@@ -585,6 +967,23 @@ Renders a `++manx` as a [`++tape`](), appending a suffix `rez\`.
585967
586968Print attributes
587969
970+Render XML attributes as a [`++tape`]().
971+
972+Accepts
973+-------
974+
975+`tat` is a [`++mart`]().
976+
977+`rez` is a `++tape`.
978+
979+Produces
980+--------
981+
982+A `++tape`.
983+
984+Source
985+------
986+
588987 ++ attr :: attributes to tape
589988 |= [tat=mart rez=tape]
590989 ^- tape
@@ -596,11 +995,8 @@ Print attributes
596995 (escp(unq |) v.i.tat '"' ?~(t.tat rez [' ' rez]))
597996 ==
598997
599−Render XML attributes as a [`++tape`]().
600−
601−`tat` is a [`++mart`]().
602−
603−`rez` is a [`++tape`]().
998+Examples
999+--------
6041000
6051001 ~zod/try=> (attr:poxo ~ "")
6061002 ""
@@ -613,6 +1009,23 @@ Render XML attributes as a [`++tape`]().
6131009
6141010Escape XML
6151011
1012+Escapes the XML special characters `"`, `&`, `'`, `<`, `>`.
1013+
1014+Accepts
1015+-------
1016+
1017+`tex`is a [`++tape`]().
1018+
1019+`rez` is a `++tape`.
1020+
1021+Produces
1022+--------
1023+
1024+`++tape`.
1025+
1026+Source
1027+------
1028+
6161029 ++ escp :: escape for xml
6171030 |= [tex=tape rez=tape]
6181031 ?: unq
@@ -633,11 +1046,8 @@ Escape XML
6331046 ==
6341047 ::
6351048
636−Escapes the XML special characters `"`, `&`, `'`, `<`, `>`.
637−
638−`tex`is a [`++tape`]().
639−
640−`rez` is a [`++tape`]().
1049+Examples
1050+--------
6411051
6421052 ~zod/try=> (escp:poxo "astra" ~)
6431053 ~[~~a ~~s ~~t ~~r ~~a]
@@ -652,15 +1062,29 @@ Escapes the XML special characters `"`, `&`, `'`, `<`, `>`.
6521062
6531063Print name
6541064
1065+Renders a [`++mane`]() as a [`++tape`]().
1066+
1067+Accepts
1068+-------
1069+
1070+`man` is a `++mane`.
1071+
1072+Produces
1073+--------
1074+
1075+A `++tape`.
1076+
1077+Source
1078+------
1079+
6551080 ++ name :: name to tape
6561081 |= man=mane ^- tape
6571082 ?@ man (trip man)
6581083 (weld (trip -.man) `tape`[':' (trip +.man)])
6591084 ::
6601085
661−Renders a `++mane` as a `++tape`.
662−
663−`man` is a [`++mane`]().
1086+Examples
1087+--------
6641088
6651089 ~zod/try=> (name:poxo %$)
6661090 ""
@@ -673,6 +1097,23 @@ Renders a `++mane` as a `++tape`.
6731097
6741098Print node list
6751099
1100+Renders multiple XML nodes as a [`++tape`]().
1101+
1102+Accepts
1103+-------
1104+
1105+`lix` is a [`++list`]() of [`++manx`]().
1106+
1107+`rez` is a `++tape`.
1108+
1109+Produces
1110+--------
1111+
1112+A `++tape`.
1113+
1114+Source
1115+------
1116+
6761117 ++ many :: nodelist to tape
6771118 |= [lix=(list manx) rez=tape]
6781119 |- ^- tape
@@ -680,11 +1121,8 @@ Print node list
6801121 (apex i.lix $(lix t.lix))
6811122 ::
6821123
683−Renders multiple XML nodes as a [`++tape`]()
684−
685−`lix` is a [`++list`]() of [`++manx`]().
686−
687−`rez` is a [`++tape`]().
1124+Examples
1125+--------
6881126
6891127 ~zod/try=> (many:poxo ~ "")
6901128 ""
@@ -701,13 +1139,27 @@ Renders multiple XML nodes as a [`++tape`]()
7011139
7021140Parse XML
7031141
1142+Parses an XML node from a [`++cord`](), producing a [`++unit`]() [`++manx`]().
1143+
1144+Accepts
1145+-------
1146+
1147+`a` is a [`++cord`]().
1148+
1149+Produces
1150+--------
1151+
1152+A `(unit manx)`.
1153+
1154+Source
1155+------
1156+
7041157 ++ poxa :: xml parser
7051158 =< |=(a=cord (rush a apex))
7061159 |%
7071160
708−Parses an XML node from a [`++cord`](), producing a unit [`++manx`]().
709−
710−`a` is a [`++cord`]().
1161+Examples
1162+--------
7111163
7121164 ~zod/try=> (poxa '<div />')
7131165 [~ [g=[n=%div a=~] c=~]]
@@ -722,6 +1174,21 @@ Parses an XML node from a [`++cord`](), producing a unit [`++manx`]().
7221174
7231175Top level parser
7241176
1177+Parses a node of XML, type [`++manx`]().
1178+
1179+Accepts
1180+-------
1181+
1182+A [`++nail`]().
1183+
1184+Produces
1185+--------
1186+
1187+A `++manx`.
1188+
1189+Source
1190+------
1191+
7251192 ++ apex
7261193 =+ spa=;~(pose comt whit)
7271194 %+ knee *manx |. ~+
@@ -733,21 +1200,38 @@ Top level parser
7331200 ==
7341201 ::
7351202
736−Parses a node of XML, type [`++manx`]().
1203+Examples
1204+--------
7371205
738− ~zod/try=> (rash '<div />' apex:xmlp)
1206+ ~zod/try=> (rash '<div />' apex:poxa)
7391207 [g=[n=%div a=~] c=~]
740− ~zod/try=> (rash '<html><head/> <body/></html>' apex:xmlp)
1208+ ~zod/try=> (rash '<html><head/> <body/></html>' apex:poxa)
7411209 [g=[n=%html a=~] c=~[[g=[n=%head a=~] c=~] [g=[n=%body a=~] c=~]]]
742− ~zod/try=> (rash '<script src="/gep/hart.js"/>' apex:xmlp)
1210+ ~zod/try=> (rash '<script src="/gep/hart.js"/>' apex:poxa)
7431211 [g=[n=%script a=~[[n=%src v="/gep/hart.js"]]] c=~]
744− ~zod/try=> (rash '<<<<' apex:xmlp)
1212+ ~zod/try=> (rash '<<<<' apex:poxa)
7451213 ! {1 2}
7461214 ! exit
7471215
748−### `++attr`
1216+### `++attr`
1217+
1218+Parse XML attributes
1219+
1220+Parses the list of attributes inside the opening XML tag, which is zero
1221+or more space-prefixed name to string values.
1222+
1223+Accepts
1224+-------
7491225
750−Parse XML attributes
1226+A [`++nail`]().
1227+
1228+Produces
1229+--------
1230+
1231+A [`++mart`]().
1232+
1233+Source
1234+------
7511235
7521236 ++ attr :: attributes
7531237 %+ knee *mart |. ~+
@@ -761,23 +1245,23 @@ Parse XML attributes
7611245 ==
7621246 ::
7631247
764−Parses the list of attributes inside the opening XML tag, which is zero
765−or more space-prefixed name to string values. Result type [`++mart`]()
1248+Examples
1249+--------
7661250
767− ~zod/try=> (rash '' attr:xmlp)
1251+ ~zod/try=> (rash '' attr:poxa)
7681252 ~
769− ~zod/try=> (rash 'sam=""' attr:xmlp)
1253+ ~zod/try=> (rash 'sam=""' attr:poxa)
7701254 ! {1 1}
7711255 ! exit
772− ~zod/try=> (rash ' sam=""' attr:xmlp)
1256+ ~zod/try=> (rash ' sam=""' attr:poxa)
7731257 ~[[n=%sam v=""]]
774− ~zod/try=> (rash ' sam="hek"' attr:xmlp)
1258+ ~zod/try=> (rash ' sam="hek"' attr:poxa)
7751259 ~[[n=%sam v="hek"]]
776− ~zod/try=> (rash ' sam="hek" res="actor"' attr:xmlp)
1260+ ~zod/try=> (rash ' sam="hek" res="actor"' attr:poxa)
7771261 ~[[n=%sam v="hek"] [n=%res v="actor"]]
778− ~zod/try=> (rash ' sam=\'hek\' res="actor"' attr:xmlp)
1262+ ~zod/try=> (rash ' sam=\'hek\' res="actor"' attr:poxa)
7791263 ~[[n=%sam v="hek"] [n=%res v="actor"]]
780− ~zod/try=> (rash ' sam=\'hek" res="actor"' attr:xmlp)
1264+ ~zod/try=> (rash ' sam=\'hek" res="actor"' attr:poxa)
7811265 ! {1 23}
7821266 ! exit
7831267
@@ -785,18 +1269,34 @@ or more space-prefixed name to string values. Result type [`++mart`]()
7851269
7861270Parse character data
7871271
1272+Parsing rule. Parses XML character data.
1273+
1274+Accepts
1275+-------
1276+
1277+A [`++nail`]().
1278+
1279+Produces
1280+--------
1281+
1282+A [`++mars`]().
1283+
1284+Source
1285+------
1286+
7881287 ++ chrd :: character data
7891288 %+ cook |=(a=tape ^-(mars :/(a)))
7901289 (plus ;~(less soq doq ;~(pose (just `@`10) escp)))
7911290 ::
7921291
793−Parsing rule. Parses XML character data. Result type [`++mars`]()
1292+Examples
1293+--------
7941294
795− ~zod/try=> (rash 'asa' chrd:xmlp)
1295+ ~zod/try=> (rash 'asa' chrd:poxa)
7961296 [g=[n=%$ a=~[[n=%$ v="asa"]]] c=~]
797− ~zod/try=> (rash 'asa &gt; are' chrd:xmlp)
1297+ ~zod/try=> (rash 'asa &gt; are' chrd:poxa)
7981298 [g=[n=%$ a=~[[n=%$ v="asa > are"]]] c=~]
799− ~zod/try=> (rash 'asa > are' chrd:xmlp)
1299+ ~zod/try=> (rash 'asa > are' chrd:poxa)
8001300 ! {1 6}
8011301 ! exit
8021302
@@ -804,6 +1304,21 @@ Parsing rule. Parses XML character data. Result type [`++mars`]()
8041304
8051305Parses comments
8061306
1307+Parsing rule. Parses XML comment blocks.
1308+
1309+Accepts
1310+-------
1311+
1312+A [`++nail`]().
1313+
1314+Produces
1315+--------
1316+
1317+A [`++like`]().
1318+
1319+Source
1320+------
1321+
8071322 ++ comt :: comments
8081323 =- (ifix [(jest '<!--') (jest '-->')] (star -))
8091324 ;~ pose
@@ -812,14 +1327,16 @@ Parses comments
8121327 ;~(less (jest '-->') hep)
8131328 ==
8141329 ::
1330+A [`++unit`]() of.
8151331
816−Parsing rule. Parses XML comment blocks.
1332+Examples
1333+--------
8171334
818− ~zod/try=> (rash '<!-- bye -->' comt:xmlp)
1335+ ~zod/try=> (rash '<!-- bye -->' comt:poxa)
8191336 " bye "
820− ~zod/try=> (rash '<!-- bye ><<<>< - - -->' comt:xmlp)
1337+ ~zod/try=> (rash '<!-- bye ><<<>< - - -->' comt:poxa)
8211338 " bye ><<<>< - - "
822− ~zod/try=> (rash '<!-- invalid -->-->' comt:xmlp)
1339+ ~zod/try=> (rash '<!-- invalid -->-->' comt:poxa)
8231340 ! {1 18}
8241341 ! exit
8251342
@@ -827,6 +1344,22 @@ Parsing rule. Parses XML comment blocks.
8271344
8281345Parse (possibly) escaped char
8291346
1347+Parsing rule. Parses a nonspecial or escaped character. Result type
1348+[`++char`]()
1349+
1350+Accepts
1351+-------
1352+
1353+A [`++nail`]().
1354+
1355+Produces
1356+--------
1357+
1358+The [`++edge`]() of a [`++cord`]().
1359+
1360+Source
1361+------
1362+
8301363 ++ escp
8311364 ;~ pose
8321365 ;~(less gal gar pam prn)
@@ -837,42 +1370,59 @@ Parse (possibly) escaped char
8371370 (cold '\'' (jest '&apos;'))
8381371 ==
8391372
840−Parsing rule. Parses a nonspecial or escaped character. Result type
841−[`++char`]()
1373+Examples
1374+--------
8421375
843− ~zod/try=> (rash 'a' escp:xmlp)
1376+ ~zod/try=> (rash 'a' escp:poxa)
8441377 'a'
845− ~zod/try=> (rash 'ab' escp:xmlp)
1378+ ~zod/try=> (rash 'ab' escp:poxa)
8461379 ! {1 2}
8471380 ! exit
848− ~zod/try=> (rash '.' escp:xmlp)
1381+ ~zod/try=> (rash '.' escp:poxa)
8491382 '.'
850− ~zod/try=> (rash '!' escp:xmlp)
1383+ ~zod/try=> (rash '!' escp:poxa)
8511384 '!'
852− ~zod/try=> (rash '>' escp:xmlp)
1385+ ~zod/try=> (rash '>' escp:poxa)
8531386 ! {1 2}
8541387 ! exit
855− ~zod/try=> (rash '&gt;' escp:xmlp)
1388+ ~zod/try=> (rash '&gt;' escp:poxa)
8561389 '>'
857− ~zod/try=> (rash '&quot;' escp:xmlp)
1390+ ~zod/try=> (rash '&quot;' escp:poxa)
8581391 '"'
8591392
8601393### `++empt`
8611394
8621395Parse self-closing tag
8631396
1397+Parsing rule. Parses self-closing XML tags that end in `/>`.
1398+
1399+Accepts
1400+-------
1401+
1402+A [`++nail`]().
1403+
1404+Produces
1405+--------
1406+
1407+
1408+A `(like tape)`.
1409+
1410+Source
1411+------
1412+
8641413 ++ empt :: self-closing tag
8651414 %+ ifix [gal (jest '/>')]
8661415 ;~(plug ;~(plug name attr) (cold ~ (star whit)))
8671416 ::
8681417
869−Parsing rule. Parses self-closing XML tags that end in `/>`.
1418+Examples
1419+--------
8701420
871− ~zod/try=> (rash '<div/>' empt:xmlp)
1421+ ~zod/try=> (rash '<div/>' empt:poxa)
8721422 [[%div ~] ~]
873− ~zod/try=> (rash '<pre color="#eeffee" />' empt:xmlp)
1423+ ~zod/try=> (rash '<pre color="#eeffee" />' empt:poxa)
8741424 [[%pre ~[[n=%color v="#eeffee"]]] ~]
875− ~zod/try=> (rash '<pre color="#eeffee"></pre>' empt:xmlp)
1425+ ~zod/try=> (rash '<pre color="#eeffee"></pre>' empt:poxa)
8761426 ! {1 21}
8771427 ! exit
8781428
@@ -880,18 +1430,34 @@ Parsing rule. Parses self-closing XML tags that end in `/>`.
8801430
8811431Parse opening tag
8821432
1433+Parsing rule. Parses the opening tag of an XML node. Result type
1434+[`++marx`]()
1435+
1436+Accepts
1437+-------
1438+
1439+A [`++nail`]().
1440+
1441+Produces
1442+--------
1443+
1444+A `(like marx)`.
1445+
1446+Source
1447+------
1448+
8831449 ++ head :: opening tag
8841450 (ifix [gal gar] ;~(plug name attr))
8851451 ::
8861452
887−Parsing rule. Parses the opening tag of an XML node. Result type
888−[`++marx`]()
1453+Examples
1454+--------
8891455
890− ~zod/try=> (rash '<a>' head:xmlp)
1456+ ~zod/try=> (rash '<a>' head:poxa)
8911457 [n=%a a=~]
892− ~zod/try=> (rash '<div mal="tok">' head:xmlp)
1458+ ~zod/try=> (rash '<div mal="tok">' head:poxa)
8931459 [n=%div a=~[[n=%mal v="tok"]]]
894− ~zod/try=> (rash '<div mal="tok" />' head:xmlp)
1460+ ~zod/try=> (rash '<div mal="tok" />' head:poxa)
8951461 ! {1 16}
8961462 ! exit
8971463
@@ -899,6 +1465,21 @@ Parsing rule. Parses the opening tag of an XML node. Result type
8991465
9001466Parse tag name
9011467
1468+Parsing rule. Parses the name of an XML tag.
1469+
1470+Accepts
1471+-------
1472+
1473+A [`++nail`]().
1474+
1475+Produces
1476+--------
1477+
1478+An [`++edge`]() of a [`++mane`]().
1479+
1480+Source
1481+------
1482+
9021483 ++ name :: tag name
9031484 %+ knee *mane |. ~+
9041485 =+ ^= chx
@@ -910,15 +1491,16 @@ Parse tag name
9101491 ;~(pose ;~(plug ;~(sfix chx col) chx) chx)
9111492 ::
9121493
913−Parsing rule. Parses the name of an XML tag. Result type [`++mane`]()
1494+Examples
1495+--------
9141496
915− ~zod/try=> (scan "ham" name:xmlp)
1497+ ~zod/try=> (scan "ham" name:poxa)
9161498 %ham
917− ~zod/try=> (scan "ham:tor" name:xmlp)
1499+ ~zod/try=> (scan "ham:tor" name:poxa)
9181500 [%ham %tor]
919− ~zod/try=> (scan "ham-tor" name:xmlp)
1501+ ~zod/try=> (scan "ham-tor" name:poxa)
9201502 %ham-tor
921− ~zod/try=> (scan "ham tor" name:xmlp)
1503+ ~zod/try=> (scan "ham tor" name:poxa)
9221504 ! {1 4}
9231505 ! exit
9241506
@@ -926,15 +1508,31 @@ Parsing rule. Parses the name of an XML tag. Result type [`++mane`]()
9261508
9271509Parse closing tag
9281510
1511+Parsing rule. Parses an XML closing tag.
1512+
1513+Accepts
1514+-------
1515+
1516+A [`++nail`]().
1517+
1518+Produces
1519+--------
1520+
1521+A `(like tail)`.
1522+
1523+Source
1524+------
1525+
9291526 ++ tail (ifix [(jest '</') gar] name) :: closing tag
9301527
931−Parsing rule. Parses an XML closing tag.
1528+Examples
1529+--------
9321530
933− ~zod/try=> (scan "</div>" tail:xmlp)
1531+ ~zod/try=> (scan "</div>" tail:poxa)
9341532 %div
935− ~zod/try=> (scan "</a>" tail:xmlp)
1533+ ~zod/try=> (scan "</a>" tail:poxa)
9361534 %a
937− ~zod/try=> (scan "</>" tail:xmlp)
1535+ ~zod/try=> (scan "</>" tail:poxa)
9381536 ! {1 3}
9391537 ! exit
9401538
@@ -942,21 +1540,37 @@ Parsing rule. Parses an XML closing tag.
9421540
9431541Parse whitespace, etc.
9441542
1543+Parsing rule. Parses newlines, tabs, and spaces.
1544+
1545+Accepts
1546+-------
1547+
1548+A [`++nail`]().
1549+
1550+Produces
1551+--------
1552+
1553+A `(like char)`.
1554+
1555+Source
1556+------
1557+
9451558 ++ whit (mask ~[' ' `@`0x9 `@`0xa]) :: whitespace
9461559 ::
9471560
948−Parsing rule. Parses newlines, tabs, and spaces.
1561+Examples
1562+--------
9491563
950− ~zod/try=> `@`(scan " " whit:xmlp)
1564+ ~zod/try=> `@`(scan " " whit:poxa)
9511565 32
952− ~zod/try=> `@`(scan " " whit:xmlp)
1566+ ~zod/try=> `@`(scan " " whit:poxa)
9531567 ! {1 2}
9541568 ! exit
955− ~zod/try=> `@`(scan "\0a" whit:xmlp)
1569+ ~zod/try=> `@`(scan "\0a" whit:poxa)
9561570 10
957− ~zod/try=> `@`(scan "\09" whit:xmlp)
1571+ ~zod/try=> `@`(scan "\09" whit:poxa)
9581572 9
959− ~zod/try=> `@`(scan "\08" whit:xmlp)
1573+ ~zod/try=> `@`(scan "\08" whit:poxa)
9601574 ! {1 1}
9611575 ! exit
9621576
@@ -964,21 +1578,46 @@ Parsing rule. Parses newlines, tabs, and spaces.
9641578
9651579JSON reparsing core
9661580
967− ++ jo :: json reparser
968− => |% ++ grub (unit ,*)
969− ++ fist $+(json grub)
970− |%
1581+Contains converters of [`++json`]() to [`++unit`]()s of well-typed structures.
9711582
972−Contains converters of ++json to [`++unit`]() well-typed structures.
1583+Accepts
1584+-------
9731585
9741586A `fist` is a gate that produces a `grub`.
9751587
9761588A `grub` is a unit of some JSON value.
9771589
1590+Source
1591+------
1592+
1593+ ++ jo :: json reparser
1594+ => |% ++ grub (unit ,*)
1595+ ++ fist $+(json grub)
1596+ |%
1597+
1598+
9781599### `++ar`
9791600
9801601Parse array to list
9811602
1603+Reparser modifier. Reparses an array to the [`++unit`]() of a homogenous
1604+[`++list`]() using `wit` to reparse every element.
1605+
1606+`wit` is a [`++fist`](), a JSON reparser.
1607+
1608+
1609+Accepts
1610+-------
1611+
1612+A [`++fist`]().
1613+
1614+Produces
1615+--------
1616+
1617+A [`++rule`]().
1618+
1619+Source
1620+------
9821621 ++ ar :: array as list
9831622 |* wit=fist
9841623 |= jon=json
@@ -989,19 +1628,34 @@ Parse array to list
9891628 [i=(wit i.p.jon) t=$(p.jon t.p.jon)]
9901629 ::
9911630
992−Reparser modifier. Reparses an array to the [`++unit`]() of a homogenous
993−[`++list`]() using `wit` to reparse every element.
994−
995−`wit` is a [`++fist`](), a JSON reparser.
1631+Examples
1632+--------
9961633
9971634 ~zod/try=> :type; ((ar ni):jo a/~[n/'1' n/'2'])
9981635 [~ u=~[1 2]]
9991636 {[%~ u=it(@)] %~}
10001637
1638+
10011639### `++at`
10021640
10031641Reparse array as tuple
10041642
1643+Reparser generator. Reparses an array as a fixed-length tuple of
1644+[`++unit`]()s, using a list of `++fist`s.
1645+
1646+Accepts
1647+-------
1648+
1649+`wil` is a [`++pole`](), a [`face`]()less list of [`++fist`]()s.
1650+
1651+Produces
1652+--------
1653+
1654+A [`++rule`]().
1655+
1656+Source
1657+------
1658+
10051659 ++ at :: array as tuple
10061660 |* wil=(pole fist)
10071661 |= jon=json
@@ -1010,10 +1664,8 @@ Reparse array as tuple
10101664 ?.((za raw) ~ (some (zp raw)))
10111665 ::
10121666
1013−Reparser generator. Reparses an array as a fixed-length tuple of
1014−[`++unit`]()s, using a list of `++fist`s.
1015−
1016−`wil` is a [`++pole`]() a [`face`]()less list of [`++fist`]()s.
1667+Examples
1668+--------
10171669
10181670 ~zod/try=> ((at ni so ni ~):jo a/~[n/'3' s/'to' n/'4'])
10191671 [~ u=[q=3 ~.to q=4]]
@@ -1027,6 +1679,21 @@ Reparser generator. Reparses an array as a fixed-length tuple of
10271679
10281680Reparse array to tuple
10291681
1682+Reparser generator. Reparses a list of [`++json`]() with `wil` to a tuple of [`++unit`]()s.
1683+
1684+Accepts
1685+-------
1686+
1687+`wil` is a [`++pole`](), a [face]()less list of [`++fist`]()s.
1688+
1689+Produces
1690+--------
1691+
1692+A [`++rule`]().
1693+
1694+Source
1695+------
1696+
10301697 ++ at-raw :: array as tuple
10311698 |* wil=(pole fist)
10321699 |= jol=(list json)
@@ -1035,10 +1702,8 @@ Reparse array to tuple
10351702 ((at-raw +.wil) ?~(jol ~ t.jol))
10361703 ::
10371704
1038−Reparser generator. Reparses a list of [`++json`]() to a tuple of
1039−[`++unit`]() using `wil`.
1040−
1041−`wil` is a [`++pole`](), a [face]()less list of [`++fist`]()s.
1705+Examples
1706+--------
10421707
10431708 ~zod/try=> ((at-raw ni ni bo ~):jo ~[s/'hi' n/'1' b/&])
10441709 [~ [~ 1] [~ u=%.y] ~]
@@ -1047,12 +1712,28 @@ Reparser generator. Reparses a list of [`++json`]() to a tuple of
10471712
10481713Reparse boolean
10491714
1715+Reparser modifier. Reparses a boolean to the [`++unit`]() of a
1716+boolean.
1717+
1718+Accepts
1719+-------
1720+
1721+A [`++json`]().
1722+
1723+Produces
1724+--------
1725+
1726+A [`++fist`]().
1727+
1728+Source
1729+------
1730+
10501731 ++ bo :: boolean
10511732 |=(jon=json ?.(?=([%b *] jon) ~ [~ u=p.jon]))
10521733 ::
10531734
1054−Reparser modifier. Reparses a boolean to the [`++unit`]() of a
1055−[`loobean`]().
1735+Examples
1736+--------
10561737
10571738 ~zod/try=> (bo:jo [%b &])
10581739 [~ u=%.y]
@@ -1065,12 +1746,29 @@ Reparser modifier. Reparses a boolean to the [`++unit`]() of a
10651746
10661747Reparse boolean not
10671748
1749+Reparser modifier. Reparses the inverse of a boolean to the [`++unit`]()
1750+of a loobean.
1751+
1752+
1753+Accepts
1754+-------
1755+
1756+A [`++json`]().
1757+
1758+Produces
1759+--------
1760+
1761+A [`++fist`]().
1762+
1763+Source
1764+------
1765+
10681766 ++ bu :: boolean not
10691767 |=(jon=json ?.(?=([%b *] jon) ~ [~ u=!p.jon]))
10701768 ::
10711769
1072−Reparser modifier. Reparses the inverse of a boolean to the [`++unit`]()
1073−of a loobean.
1770+Examples
1771+--------
10741772
10751773 ~zod/try=> (bu:jo [%b &])
10761774 [~ u=%.n]
@@ -1083,19 +1781,33 @@ of a loobean.
10831781
10841782Reparse and transform
10851783
1086− ++ cu :: transform
1087− |* [poq=$+(* *) wit=fist]
1088− |= jon=json
1089− (bind (wit jon) poq)
1090− ::
1091−
10921784Reparser modifier. Reparses `jon` and slams the result through `wit`,
10931785producing a [`++unit`]().
10941786
1787+Accepts
1788+-------
1789+
10951790`wit` is a [`++fist`]().
10961791
10971792`poq` is a [`gate`]() that accepts and returns a [noun]().
10981793
1794+Produces
1795+--------
1796+
1797+A [`++fist`]().
1798+
1799+Source
1800+------
1801+
1802+ ++ cu :: transform
1803+ |* [poq=$+(* *) wit=fist]
1804+ |= jon=json
1805+ (bind (wit jon) poq)
1806+ ::
1807+
1808+Examples
1809+--------
1810+
10991811 ~zod/try=> ((cu dec ni):jo [%n '20'])
11001812 [~ 19]
11011813 ~zod/try=> ((cu dec ni):jo [%b &])
@@ -1105,13 +1817,29 @@ producing a [`++unit`]().
11051817
11061818Reparse UTC date
11071819
1820+Reparser modifier. Reparses a UTC date string to a [`++unit`]().
1821+
1822+Accepts
1823+-------
1824+
1825+`jon` is a [`++json`]().
1826+
1827+Produces
1828+--------
1829+
1830+A [`++fist`]().
1831+
1832+Source
1833+------
1834+
11081835 ++ da :: UTC date
11091836 |= jon=json
11101837 ?. ?=([%s *] jon) ~
11111838 (bind (stud (trip p.jon)) |=(a=date (year a)))
11121839 ::
11131840
1114−Reparser modifier. Reparses a UTC date string to a [`++unit`]().
1841+Examples
1842+--------
11151843
11161844 ~zod/try=> (da:jo [%s 'Wed, 29 Oct 2014 0:26:15 +0000'])
11171845 [~ ~2014.10.29..00.26.15]
@@ -1124,6 +1852,22 @@ Reparser modifier. Reparses a UTC date string to a [`++unit`]().
11241852
11251853Reparse millisecond date
11261854
1855+Reparser modifier. Reparses the javascript millisecond date integer to a
1856+[`++unit`]().
1857+
1858+Accepts
1859+-------
1860+
1861+`jon` is a [`++json`]().
1862+
1863+Produces
1864+--------
1865+
1866+A [`++fist`]().
1867+
1868+Source
1869+------
1870+
11271871 ++ di :: millisecond date
11281872 |= jon=json
11291873 %+ bind (ni jon)
@@ -1131,8 +1875,8 @@ Reparse millisecond date
11311875 (add ~1970.1.1 (div (mul ~s1 a) 1.000))
11321876 ::
11331877
1134−Reparser modifier. Reparses the JavaScript millisecond date integer to a
1135−[`++unit`]().
1878+Examples
1879+--------
11361880
11371881 ~zod/try=> (di:jo [%s '2014-10-29'])
11381882 ~
@@ -1147,18 +1891,32 @@ Reparser modifier. Reparses the JavaScript millisecond date integer to a
11471891
11481892Reparse unit
11491893
1894+Reparser modifier. Reparses `wit` to a [`++unit`]().
1895+
1896+JSON units are considered to be either JSON null or the requested
1897+value, and are reparsed to results of \~ or (some {value}) respectively.
1898+
1899+Accepts
1900+-------
1901+
1902+`wit` is a [`++fist`]().
1903+
1904+Produces
1905+--------
1906+
1907+A [`++fist`]().
1908+
1909+Source
1910+------
1911+
11501912 ++ mu :: true unit
11511913 |* wit=fist
11521914 |= jon=json
11531915 ?~(jon (some ~) (bind (wit jon) some))
11541916 ::
11551917
1156−Reparser modifier. Reparses `wit` to a [`++unit`]().
1157−
1158−A- JSON units are considered to be either JSON null or the requested
1159−value, and are reparsed to results of \~ or (some {value}) respectively
1160−
1161−`wit` is a [`++fist`]().
1918+Examples
1919+--------
11621920
11631921 ~zod/try=> ((mu ni):jo [%n '20'])
11641922 [~ [~ u=q=20]]
@@ -1173,12 +1931,6 @@ value, and are reparsed to results of \~ or (some {value}) respectively
11731931
11741932Reparse number as real
11751933
1176− ++ ne :: number as real
1177− |= jon=json
1178− ^- (unit ,@rd)
1179− !!
1180− ::
1181−
11821934XX Currently unimplemented
11831935
11841936A- yup, this will eventually reparse a floating point atom, but
@@ -1188,13 +1940,29 @@ interfaces for the latter are not currently stable.
11881940
11891941Reparse number as integer
11901942
1943+Reparser modifier. Reparses an integer representation to a [`++unit]().
1944+
1945+Accepts
1946+-------
1947+
1948+`jon` is a ++[`++json`]().
1949+
1950+Produces
1951+--------
1952+
1953+The `++unit` of an atom.
1954+
1955+Source
1956+------
1957+
11911958 ++ ni :: number as integer
11921959 |= jon=json
11931960 ?. ?=([%n *] jon) ~
11941961 (rush p.jon dem)
11951962 ::
11961963
1197−Reparser modifier. Reparses an integer representation to a [\`++unit]().
1964+Examples
1965+--------
11981966
11991967 ~zod/try=> (ni:jo [%n '0'])
12001968 [~ q=0]
@@ -1215,13 +1983,29 @@ Reparser modifier. Reparses an integer representation to a [\`++unit]().
12151983
12161984Reparse number as text
12171985
1986+Reparser modifier. Reparses a numeric representation to a [++cord]().
1987+
1988+Accepts
1989+-------
1990+
1991+`jon` is a `++json`.
1992+
1993+Produces
1994+--------
1995+
1996+The [`++unit`]() of a `++cord`.
1997+
1998+Source
1999+------
2000+
12182001 ++ no :: number as text
12192002 |= jon=json
12202003 ?. ?=([%n *] jon) ~
12212004 (some p.jon)
12222005 ::
12232006
1224−Reparser modifier. Reparses a numeric representation to a [++cord]().
2007+Examples
2008+--------
12252009
12262010 ~zod/try=> (no:jo [%n '0'])
12272011 [~ u=~.0]
@@ -1242,6 +2026,23 @@ Reparser modifier. Reparses a numeric representation to a [++cord]().
12422026
12432027Reparse object to frond
12442028
2029+Reparser generator. Reparses an object, succeeding if it corresponds to
2030+one of the key-value pairs in `wer`.
2031+
2032+Accepts
2033+-------
2034+
2035+`wer` is a [`++pole`](), a [`++face`]()less list of [`++cord`]() and
2036+[`++fist`]() key-value pairs.
2037+
2038+Produces
2039+--------
2040+
2041+The [`++unit`]() of a cell of a.....
2042+
2043+Source
2044+------
2045+
12452046 ++ of :: object as frond
12462047 |* wer=(pole ,[cord fist])
12472048 |= jon=json
@@ -1253,11 +2054,8 @@ Reparse object to frond
12532054 ((of +.wer) jon)
12542055 ::
12552056
1256−Reparser generator. Reparses an object, succeeding if it corresponds to
1257−one of the key-value pairs in `wer`.
1258−
1259−`wer` is a [`++pole`](), a [`++face`]()less list of [`++cord`]() and
1260−[`++fist`]() key-value pairs.
2057+Examples
2058+--------
12612059
12622060 ~zod/try=> ((of sem/sa som/ni ~):jo %o [%sem s/'hi'] ~ ~)
12632061 [~ [%sem "hi"]]
@@ -1282,6 +2080,24 @@ one of the key-value pairs in `wer`.
12822080
12832081Reparse object as tuple
12842082
2083+Reparser generator. For every key in `wer` that matches a key in the
2084+[`++edge`], the fist in `wer` is applied to the corresponding value in
2085+the [`++edge`](), the results of which are produced in a tuple.
2086+
2087+
2088+Accepts
2089+-------
2090+
2091+`wer` is a [`++pole`]() of [`++cord`]() to [`++fist`]() key-value pairs.
2092+
2093+Produces
2094+--------
2095+
2096+A [`++unit`]() of a tuple XX?
2097+
2098+Source
2099+------
2100+
12852101 ++ ot :: object as tuple
12862102 |* wer=(pole ,[cord fist])
12872103 |= jon=json
@@ -1290,11 +2106,8 @@ Reparse object as tuple
12902106 ?.((za raw) ~ (some (zp raw)))
12912107 ::
12922108
1293−Reparser generator. For every key in `wer` that matches a key in the
1294−[`++edge`], the fist in `wer` is applied to the corresponding value in
1295−the [`++edge`](), the results of which are produced in a tuple.
1296−
1297−`wer` is a [`++pole`]() of [`++cord`]() to [`++fist`]() key-value pairs.
2109+Examples
2110+--------
12982111
12992112 ~zod/try=> (jobe [%sem s/'ha'] [%som n/'20'] ~)
13002113 [%o p={[p='sem' q=[%s p=~.ha]] [p='som' q=[%n p=~.20]]}]
@@ -1303,6 +2116,25 @@ the [`++edge`](), the results of which are produced in a tuple.
13032116
13042117### `++ot-raw`
13052118
2119+Reparser generator. Reparses a map `jom` using `wer`; for every key in
2120+`wer` that matches a key in `map`, the corresponding `++fist` is applied
2121+to the corresponding value in `jom`, the results of which are produced
2122+in a tuple.
2123+
2124+
2125+Accepts
2126+-------
2127+
2128+`wer` is a [`++pole`]() of [`++cord`]() to [`++fist`]() key-value pairs.
2129+
2130+Produces
2131+--------
2132+
2133+A [`++unit`]() of.
2134+
2135+Source
2136+------
2137+
13062138 ++ ot-raw :: object as tuple
13072139 |* wer=(pole ,[cord fist])
13082140 |= jom=(map ,@t json)
@@ -1311,10 +2143,8 @@ the [`++edge`](), the results of which are produced in a tuple.
13112143 [?~(ten ~ (+.-.wer u.ten)) ((ot-raw +.wer) jom)]
13122144 ::
13132145
1314−Reparser generator. Reparses a map `jom` using `wer`; for every key in
1315−`wer` that matches a key in `map`, the corresponding `++fist` is applied
1316−to the corresponding value in `jom`, the results of which are produced
1317−in a tuple.
2146+Examples
2147+--------
13182148
13192149 ~zod/try=> ((ot-raw sem/sa som/ni sem/sa ~):jo (mo [%sem s/'ha'] [%som n/'20'] ~))
13202150 [[~ u="ha"] [~ q=20] [~ u="ha"] ~]
@@ -1325,6 +2155,22 @@ in a tuple.
13252155
13262156Parse object to map
13272157
2158+Reparser modifier. Reparses a [`++json`]() object to a homogenous map
2159+using `wit`.
2160+
2161+Accepts
2162+-------
2163+
2164+`wit` is a [`++fist`]().
2165+
2166+Produces
2167+--------
2168+
2169+A [`++unit`]() of...
2170+
2171+Source
2172+------
2173+
13282174 ++ om :: object as map
13292175 |* wit=fist
13302176 |= jon=json
@@ -1332,10 +2178,8 @@ Parse object to map
13322178 (zm ~(run by p.jon) wit)
13332179 ::
13342180
1335−Reparser modifier. Reparses a [`++json`]() object to a homogenous map
1336−using `wit`.
1337−
1338−`wit` is a [`++fist`]().
2181+Examples
2182+--------
13392183
13402184 ~zod/try=> ((om ni):jo (jobe [%sap n/'20'] [%sup n/'5'] [%sop n/'177'] ~))
13412185 [~ {[p='sup' q=q=5] [p='sop' q=q=177] [p='sap' q=q=20]}]
@@ -1346,15 +2190,29 @@ using `wit`.
13462190
13472191Add prefix
13482192
2193+Reparser modifier. Adds a static prefix `pre` to the parse result of
2194+`wit`. See also: [`++stag`]().
2195+
2196+Accepts
2197+-------
2198+
2199+`pre` is a prefix [`noun`]().
2200+
2201+Produces
2202+--------
2203+
2204+The [`++unit`]() of a cell of [noun]() and the result of parsing `wit`.
2205+
2206+Source
2207+------
2208+
13492209 ++ pe :: prefix
13502210 |* [pre=* wit=fist]
13512211 (cu |*(a=* [pre a]) wit)
13522212 ::
13532213
1354−Reparser modifier. Adds a static prefix `pre` to the parse result of
1355−`wit`. See also: [`++stag`]().
1356−
1357−`pre` is a prefix [`noun`]().
2214+Examples
2215+--------
13582216
13592217 ~zod/try=> (ni:jo n/'2')
13602218 [~ q=2]
@@ -1369,12 +2227,28 @@ Reparser modifier. Adds a static prefix `pre` to the parse result of
13692227
13702228Reparse string to tape
13712229
2230+Reparser modifier. Reparses a [`++json`]() string to a [`++tape`]().
2231+
2232+Accepts
2233+-------
2234+
2235+`jon` is a [`++json`]().
2236+
2237+Produces
2238+--------
2239+
2240+The [`++unit`]() of a [`++tape`]().
2241+
2242+Source
2243+------
2244+
13722245 ++ sa :: string as tape
13732246 |= jon=json
13742247 ?.(?=([%s *] jon) ~ (some (trip p.jon)))
13752248 ::
13762249
1377−Reparser modifier. Reparses a [`++json`]() string to a [`++tape`]().
2250+Examples
2251+--------
13782252
13792253 ~zod/try=> (sa:jo s/'value')
13802254 [~ u="value"]
@@ -1387,12 +2261,28 @@ Reparser modifier. Reparses a [`++json`]() string to a [`++tape`]().
13872261
13882262Reparse string to cord
13892263
2264+Reparser modifier. Reparses a string to a [`++cord`]().
2265+
2266+Accepts
2267+-------
2268+
2269+`jon` is a [`++json`]().
2270+
2271+Produces
2272+--------
2273+
2274+The [`++unit`]() of a [`++cord`]().
2275+
2276+Source
2277+------
2278+
13902279 ++ so :: string as cord
13912280 |= jon=json
13922281 ?.(?=([%s *] jon) ~ (some p.jon))
13932282 ::
13942283
1395−Reparser modifier. Reparses a string to a [`++cord`]().
2284+Examples
2285+--------
13962286
13972287 ~zod/try=> (so:jo s/'value')
13982288 [~ u=~.value]
@@ -1405,6 +2295,21 @@ Reparser modifier. Reparses a string to a [`++cord`]().
14052295
14062296Reparse string
14072297
2298+Reparser generator. Produces a reparser that applies `sab` to a string.
2299+
2300+Accepts
2301+-------
2302+
2303+`sab` is a [`++rule`].
2304+
2305+Produces
2306+--------
2307+
2308+A [`++rule`]().
2309+
2310+Source
2311+------
2312+
14082313 ++ su :: parse string
14092314 |* sab=rule
14102315 |= jon=json
@@ -1412,9 +2317,8 @@ Reparse string
14122317 (rush p.jon sab)
14132318 ::
14142319
1415−Reparser generator. Produces a reparser that applies `sab` to a string.
1416−
1417−`sab` is a [`++rule`]().
2320+Examples
2321+--------
14182322
14192323 ~zod/try=> ((su:jo fed:ag) s/'zod')
14202324 [~ 0]
@@ -1429,9 +2333,25 @@ Reparser generator. Produces a reparser that applies `sab` to a string.
14292333
14302334Reparse null
14312335
2336+Reparser modifier. Reparses a null value.
2337+
2338+Accepts
2339+-------
2340+
2341+`jon` is a [`++json`]().
2342+
2343+Produces
2344+--------
2345+
2346+The [`++unit`]() of null.
2347+
2348+Source
2349+------
2350+
14322351 ++ ul |=(jon=json ?~(jon (some ~) ~)) :: null
14332352
1434−Reparser modifier. Reparses a null value.
2353+Examples
2354+--------
14352355
14362356 ~zod/try=> (ul:jo `json`~)
14372357 [~ u=~]
@@ -1446,6 +2366,22 @@ Reparser modifier. Reparses a null value.
14462366
14472367Pole of nonempty units
14482368
2369+Determines if `pod` contains all non-empty units, producing a boolean. Used
2370+internally.
2371+
2372+Accepts
2373+-------
2374+
2375+`pod` is a [`++pole`]() of [`++unit`]().
2376+
2377+Produces
2378+--------
2379+
2380+A boolean.
2381+
2382+Source
2383+------
2384+
14492385 ++ za :: full unit pole
14502386 |* pod=(pole (unit))
14512387 ?~ pod &
@@ -1453,10 +2389,8 @@ Pole of nonempty units
14532389 (za +.pod)
14542390 ::
14552391
1456−Determines if `pod` contains no empty units, producing a loobean. Used
1457−internally.
1458−
1459−`pod` is a [`++pole`]() of [`++unit`]().
2392+Examples
2393+--------
14602394
14612395 ~zod/try=> (za:jo ~[`1 `2 `3])
14622396 %.y
@@ -1467,6 +2401,22 @@ internally.
14672401
14682402Collapse unit list
14692403
2404+Produces a unit of the values of `lut` if every unit in `lut` is
2405+nonempty. Otherwise, produces `~`.
2406+
2407+Accepts
2408+-------
2409+
2410+`lut` is a [`++list`]() of [`++unit`]()s.
2411+
2412+Produces
2413+--------
2414+
2415+A boolean.
2416+
2417+Source
2418+------
2419+
14702420 ++ zl :: collapse unit list
14712421 |* lut=(list (unit))
14722422 ?. |- ^- ?
@@ -1478,11 +2428,8 @@ Collapse unit list
14782428 [i=u:+.i.lut t=$(lut t.lut)]
14792429 ::
14802430
1481−Produces a unit of the values of `lut` if every unit in `lut` is
1482−nonempty. Otherwise, produces `~`. If any of the `++unit`s in `lut` are
1483−empty, produces null.
1484−
1485−`lut` is a [`++list`]() of [`++unit`]()s.
2431+Examples
2432+--------
14862433
14872434 ~zod/try=> (zl:jo `(list (unit))`~[`1 `2 `3])
14882435 [~ u=~[1 2 3]]
@@ -1493,7 +2440,22 @@ empty, produces null.
14932440
14942441### `++zp`
14952442
1496−Parses a
2443+XX
2444+
2445+Collapses a `++pole` of `++unit`s `but`, producing a tuple.
2446+
2447+Accepts
2448+-------
2449+
2450+`but` is a [`++pole`]() of [`++unit`]().
2451+
2452+Produces
2453+--------
2454+
2455+??
2456+
2457+Source
2458+------
14972459
14982460 ++ zp :: unit tuple
14992461 |* but=(pole (unit))
@@ -1503,9 +2465,8 @@ Parses a
15032465 [u:->.but (zp +.but)]
15042466 ::
15052467
1506−Collapses a `++pole` of `++unit`s `but`, producing a tuple.
1507−
1508−`but` is a [`++pole`]() of [`++unit`]().
2468+Examples
2469+--------
15092470
15102471 ~zod/try=> (zp:jo `(pole (unit))`~[`1 `2 `3])
15112472 [1 2 3]
@@ -1518,6 +2479,24 @@ Collapses a `++pole` of `++unit`s `but`, producing a tuple.
15182479
15192480Collapse unit map
15202481
2482+Produces a [`++unit`]() of the [`++map`]() `lum` of term to `++unit` key value
2483+pairs, with all of the nonempty values stripped of their `++unit`
2484+wrappers. If any of the `++units` in `lum` are empty, `~` is produced.
2485+See also: [`++zp`](), [`++zl`]().
2486+
2487+Accepts
2488+-------
2489+
2490+`lum` is a map of [`++term`]() to [`++unit`]()s.
2491+
2492+Produces
2493+--------
2494+
2495+The `++unit` of a tuple of what were the key-value pairs of `lum`.
2496+
2497+Source
2498+------
2499+
15212500 ++ zm :: collapse unit map
15222501 |* lum=(map term (unit))
15232502 ?: (~(rep by lum) | |=([[@ a=(unit)] b=?] |(b ?=(~ a))))
@@ -1525,12 +2504,8 @@ Collapse unit map
15252504 (some (~(run by lum) need))
15262505 ::
15272506
1528−Produces a `++unit` of the map `lum` of term to `++unit` key value
1529−pairs, with all of the nonempty values stripped of their `++unit`
1530−wrappers. If any of the `++units` in `lum` are empty, `~` is produced.
1531−See also: [`++zp`](), [`++zl`]().
1532−
1533−`lum` is a map of [`++term`]() to [`++unit`]()s.
2507+Examples
2508+--------
15342509
15352510 ~zod/try=> (zm:jo `(map term (unit ,@u))`(mo a/`4 b/`1 c/`2 ~))
15362511 [~ {[p=%a q=4] [p=%c q=2] [p=%b q=1]}]
@@ -1549,17 +2524,31 @@ See also: [`++zp`](), [`++zl`]().
15492524
15502525`++json` from key-value pair
15512526
2527+Produces a ++json object with one key-value pair.
2528+
2529+Accepts
2530+-------
2531+
2532+`p` is a `@t` key.
2533+
2534+`q` is a [`++json`]().
2535+
2536+Produces
2537+--------
2538+
2539+A [`++json`]().
2540+
2541+Source
2542+------
2543+
15522544 ++ joba :: object from k-v pair
15532545 |= [p=@t q=json]
15542546 ^- json
15552547 [%o [[p q] ~ ~]]
15562548 ::
15572549
1558−Produces a ++json object with one key.
1559−
1560−`p` is a `@t` key.
1561−
1562−`q` is a [`++json`]().
2550+Examples
2551+--------
15632552
15642553 ~zod/try=> (joba %hi %b |)
15652554 [%o p={[p='hi' q=[%b p=%.n]]}]
@@ -1574,15 +2563,29 @@ Produces a ++json object with one key.
15742563
15752564Object from key-value list
15762565
2566+Produces a `++json` object from a [`++list`]() `a` of key to `++json` values.
2567+
2568+Accepts
2569+-------
2570+
2571+`a` is a [`++list`]() of [`++cord`]() to [`++json`]() values.
2572+
2573+Produces
2574+--------
2575+
2576+A `++json`.
2577+
2578+Source
2579+------
2580+
15772581 ++ jobe :: object from k-v list
15782582 |= a=(list ,[p=@t q=json])
15792583 ^- json
15802584 [%o (~(gas by *(map ,@t json)) a)]
15812585 ::
15822586
1583−Produces a `++json` object from a list `a` of key to `++json` values.
1584−
1585−`a` is a [`++list`]() of [`++cord`]() to [`++json`]() values.
2587+Examples
2588+--------
15862589
15872590 ~zod/try=> (jobe a/n/'20' b/~ c/a/~[s/'mol'] ~)
15882591 [%o p={[p='a' q=[%n p=~.20]] [p='c' q=[%a p=~[[%s p=~.mol]]]] [p='b' q=~]}]
@@ -1593,13 +2596,29 @@ Produces a `++json` object from a list `a` of key to `++json` values.
15932596
15942597`++json` string from tape
15952598
2599+Produces a [`++json`]() string from a [`++tape`]().
2600+
2601+Accepts
2602+-------
2603+
2604+A [`++tape`]().
2605+
2606+Produces
2607+--------
2608+
2609+A `++json`.
2610+
2611+Source
2612+------
2613+
15962614 ++ jape :: string from tape
15972615 |= a=tape
15982616 ^- json
15992617 [%s (crip a)]
16002618 ::
16012619
1602−Produces a [`++json`]() string from a [`++tape`]().
2620+Examples
2621+--------
16032622
16042623 ~zod/try=> (jape ~)
16052624 [%s p=~.]
@@ -1614,6 +2633,21 @@ Produces a [`++json`]() string from a [`++tape`]().
16142633
16152634`++json` number from unigned
16162635
2636+Produces a `++json` number from an unsigned atom.
2637+
2638+Accepts
2639+-------
2640+
2641+`a` is an atom of odor [`@u`]().
2642+
2643+Produces
2644+--------
2645+
2646+A [`++json`]().
2647+
2648+Source
2649+------
2650+
16172651 ++ jone :: number from unsigned
16182652 |= a=@u
16192653 ^- json
@@ -1622,9 +2656,8 @@ Produces a [`++json`]() string from a [`++tape`]().
16222656 (crip (flop |-(^-(tape ?:(=(0 a) ~ [(add '0' (mod a 10)) $(a (div a 10))])))))
16232657 ::
16242658
1625−Produces a `++json` number from an unsigned atom.
1626−
1627−`a` is a [`@u`]().
2659+Examples
2660+--------
16282661
16292662 ~zod/try=> (jone 1)
16302663 [%n p=~.1]
@@ -1639,6 +2672,21 @@ Produces a `++json` number from an unsigned atom.
16392672
16402673Escape JSON character
16412674
2675+Produces a [`++tape`]() of an escaped [`++json`](/doc/hoon/library/3bi#++json) character `a`.
2676+
2677+Accepts
2678+-------
2679+
2680+`a` is an atom of odor [`@tD`](), aka a [`++char`]().
2681+
2682+Produces
2683+--------
2684+
2685+A [`++tape`]().
2686+
2687+Source
2688+------
2689+
16422690 ++ jesc
16432691 |= a=@ ^- tape
16442692 ?+ a [a ~]
@@ -1648,9 +2696,8 @@ Escape JSON character
16482696 ==
16492697 ::
16502698
1651−Produces a `++tape` of an escaped [`++json`](/doc/hoon/library/3bi#++json) character `a`.
1652−
1653−`a` is an atom
2699+Examples
2700+--------
16542701
16552702 ~zod/try=> (jesc 'a')
16562703 "a"
@@ -1661,7 +2708,7 @@ Produces a `++tape` of an escaped [`++json`](/doc/hoon/library/3bi#++json) chara
16612708 ~zod/try=> (jesc '"')
16622709 "\""
16632710
1664−### `++scanf`
2711+### `++scanf` XX
16652712
16662713Formatted scan
16672714
@@ -1693,7 +2740,7 @@ collapses the result list to a tuple, such that (scanf "foo 1 2 bar"
16932740 ~zod/try=> `@da`(year `date`dat(- [%& -.dat], |6 ~[(div (mul |6.dat (bex 16)) 1.000)]))
16942741 ~2014.8.12..23.10.58..ee56
16952742
1696−### `++parsf`
2743+### `++parsf` XX
16972744
16982745 ++ parsf :: make parser from:
16992746 |^ |* a=(pole ,_:/(*$&(_rule tape))) :: ;"chars{rule}chars"
@@ -1710,7 +2757,7 @@ the embedded rules' results.
17102757
17112758Two intermediate arms are used:
17122759
1713−#### ++norm
2760+#### ++norm XX
17142761
17152762 :: .= (norm [;"{n}, {n}"]:n=dim:ag) ~[[& dim] [| ", "] [& dim]]:ag
17162763 ++ norm
@@ -1729,7 +2776,7 @@ Two intermediate arms are used:
17292776`norm` converts a `;"` pole of `[[%~. [%~. ?(tape _rule)] ~] ~]` into a
17302777more convenient list of discriminated tapes and rules.
17312778
1732−#### ++bill
2779+#### ++bill XX
17332780
17342781 :: .= (bill ~[[& dim] [| ", "] [& dim]]:ag)
17352782 :: ;~(plug dim ;~(pfix com ace ;~(plug dim (easy)))):ag
@@ -1747,12 +2794,24 @@ sections and producing a list of the rules' results.
17472794
17482795### `++taco`
17492796
2797+Converts an atom to an octet stream [`++octs`](), which contains a length, to
2798+encode trailing zeroes.
2799+
2800+Produces
2801+--------
2802+
2803+An `++octs`.
2804+
2805+Source
2806+------
2807+
17502808 ++ taco :: atom to octstream
17512809 |= tam=@ ^- octs
17522810 [(met 3 tam) tam]
17532811 ::
17542812
1755−An [octs] contains a length, to encode trailing zeroes.
2813+Examples
2814+--------
17562815
17572816 ~zod/try=> (taco 'abc')
17582817 [p=3 q=6.513.249]
@@ -1761,12 +2820,31 @@ An [octs] contains a length, to encode trailing zeroes.
17612820
17622821### `++tact`
17632822
2823+tape to octs
2824+
2825+Converts a `++tape` to an octet stream ([`++octs`](), which contains a length
2826+to encode trailing zeroes.
2827+
2828+Accepts
2829+-------
2830+
2831+A `++tape`.
2832+
2833+Produces
2834+--------
2835+
2836+An [`++octs`]().
2837+
2838+Source
2839+------
2840+
17642841 ++ tact :: tape to octstream
17652842 |= tep=tape ^- octs
17662843 (taco (rap 3 tep))
17672844 ::
17682845
1769−octs from tape
2846+Examples
2847+--------
17702848
17712849 ~zod/try=> (tact "abc")
17722850 [p=3 q=6.513.249]
@@ -1775,13 +2853,32 @@ octs from tape
17752853
17762854### `++tell`
17772855
2856+octs from wall
2857+
2858+Converts a [`++wall`]() to an octet stream ([`++octs`](), which contains a length
2859+to encode trailing zeroes.
2860+
2861+Accepts
2862+-------
2863+
2864+`wol` is a [`++wall`]().
2865+
2866+Produces
2867+--------
2868+
2869+An `++octs`.
2870+
2871+Source
2872+------
2873+
17782874 ++ tell :: wall to octstream
17792875 |= wol=wall ^- octs
17802876 =+ buf=(rap 3 (turn wol |=(a=tape (crip (weld a `tape`[`@`10 ~])))))
17812877 [(met 3 buf) buf]
17822878 ::
17832879
1784−octs from wall
2880+Examples
2881+--------
17852882
17862883 ~zod/try=> (tell ~["abc" "line" "3"])
17872884 [p=11 q=12.330.290.663.108.538.769.039.969]
@@ -1794,14 +2891,32 @@ octs from wall
17942891
17952892### `++txml`
17962893
2894+Tape to xml CDATA node
2895+
2896+Converts a [`++tape`]() to an xml CDATA node XX
2897+
2898+Accepts
2899+-------
2900+
2901+`tep` is a [`++tape`]().
2902+
2903+Produces
2904+--------
2905+
2906+A [`++manx`]().
2907+
2908+Source
2909+------
2910+
17972911 ++ txml :: string to xml
17982912 |= tep=tape ^- manx
17992913 [[%$ [%$ tep] ~] ~]
18002914 ::
18012915
1802−Tape to xml CDATA node
2916+Examples
2917+--------
18032918
18042919 ~zod/try=> (txml "hi")
18052920 [g=[n=%$ a=~[[n=%$ v="hi"]]] c=~]
18062921 ~zod/try=> (txml "larton bestok")
1807− [g=[n=%$ a=~[[n=%$ v="larton bestok"]]] c=~]
2922+ [
docs/dev/hoon/library/3bf.md+218−91
@@ -5,23 +5,37 @@ section 3bF, filesystem interface
55
66Generate file diff
77
8− ++ feel :: simple file write
9− |= [pax=path val=*]
10− ^- miso
11− =+ dir=((hard arch) .^(%cy pax))
12− ?~ q.dir [%ins val]
13− :- %mut
14− ^- udon
15− [%a %a .^(%cx pax) val]
16− ::
17−
188Generates a diff between a file located at `pax` and an input value
199`val`.
2010
11+Accepts
12+-------
13+
2114`pax` is a [`++path`]().
2215
2316`val` is a value as a [noun]().
2417
18+Produces
19+--------
20+
21+A [`++miso`]().
22+
23+Source
24+------
25+
26+ ++ feel :: simple file write
27+ |= [pax=path val=*]
28+ ^- miso
29+ =+ dir=((hard arch) .^(%cy pax))
30+ ?~ q.dir [%ins val]
31+ :- %mut
32+ ^- udon
33+ [%a %a .^(%cx pax) val]
34+ ::
35+
36+Examples
37+--------
38+
2539 ~zod/try=> + %/mel 'test'
2640 + /~zod/try/2/mel
2741 ~zod/try=> (feel %/mel 'tesh?')
@@ -37,18 +51,32 @@ Generates a diff between a file located at `pax` and an input value
3751
3852Simple file load
3953
40− ++ file :: simple file load
41− |= pax=path
42− ^- (unit)
43− =+ dir=((hard arch) .^(%cy pax))
44− ?~(q.dir ~ [~ .^(%cx pax)])
45− ::
46−
4754Reads the value of a file located at `pax` and renders it as a
4855[`++unit`]().
4956
57+Accepts
58+-------
59+
5060`pax` is a [`++path`]().
5161
62+Produces
63+--------
64+
65+The `++unit` of a [`++noun`]().
66+
67+Source
68+------
69+
70+ ++ file :: simple file load
71+ |= pax=path
72+ ^- (unit)
73+ =+ dir=((hard arch) .^(%cy pax))
74+ ?~(q.dir ~ [~ .^(%cx pax)])
75+ ::
76+
77+Examples
78+--------
79+
5280 ~zod/try=> %/zak
5381 ~zod/try=/zak> :ls %
5482 ~zod/try=/zak> + %/mop 20
@@ -66,20 +94,34 @@ Reads the value of a file located at `pax` and renders it as a
6694
6795Write high-level change
6896
69− ++ foal :: high-level write
70− |= [pax=path val=*]
71− ^- toro
72− ?> ?=([* * * *] pax)
73− [i.t.pax [%& [*cart [[t.t.t.pax (feel pax val)] ~]]]]
74− ::
75−
7697Produces a [`++toro`](), a change intended for whatever file is located
7798at `pax`. Handled by `%clay`.
7899
100+Accepts
101+-------
102+
79103`pax` is a [`++path`]().
80104
81105`val` is a value as a [noun]().
82106
107+Produces
108+--------
109+
110+A [`++toro`]().
111+
112+Source
113+------
114+
115+ ++ foal :: high-level write
116+ |= [pax=path val=*]
117+ ^- toro
118+ ?> ?=([* * * *] pax)
119+ [i.t.pax [%& [*cart [[t.t.t.pax (feel pax val)] ~]]]]
120+ ::
121+
122+Examples
123+--------
124+
83125 ~zod/try=> + %/mek 'a'
84126 + /~zod/try/4/mek
85127 ~zod/try=> (foal %/mek 'b')
@@ -94,18 +136,32 @@ at `pax`. Handled by `%clay`.
94136
95137High-level delete
96138
97− ++ fray :: high-level delete
98− |= pax=path
99− ^- toro
100− ?> ?=([* * * *] pax)
101− [i.t.pax [%& [*cart [[t.t.t.pax [%del .^(%cx pax)]] ~]]]]
102− ::
103−
104139Produces a deletion [`++toro`]() for a file located at path `pax`.
105140Handled by `%clay`.
106141
142+Accepts
143+-------
144+
107145`pax` is a [`++path`]().
108146
147+Produces
148+--------
149+
150+A `++toro`.
151+
152+Source
153+------
154+
155+ ++ fray :: high-level delete
156+ |= pax=path
157+ ^- toro
158+ ?> ?=([* * * *] pax)
159+ [i.t.pax [%& [*cart [[t.t.t.pax [%del .^(%cx pax)]] ~]]]]
160+ ::
161+
162+Examples
163+--------
164+
109165 ~zod/try=> + %/mek 'a'
110166 + /~zod/try/4/mek
111167 ~zod/try=> (fray %/mek)
@@ -117,22 +173,36 @@ Handled by `%clay`.
117173
118174Unify changes
119175
120− ++ furl :: unify changes
121− |= [one=toro two=toro]
122− ^- toro
123− ~| %furl
124− ?> ?& =(p.one p.two) :: same path
125− &(?=(& -.q.one) ?=(& -.q.two)) :: both deltas
126− ==
127− [p.one [%& [*cart (weld q.q.q.one q.q.q.two)]]]
128− ::
129−
130176Merge two [`++toro`]()s `one` and `two` that are in the same [`desk`]()
131177and pointed at the same [`++path`]().
132178
133−`one` is a [`++toro`]().
179+Accepts
180+-------
181+
182+`one` is a `++toro`.
183+
184+`two` is a `++toro`.
185+
186+Produces
187+--------
188+
189+A `++toro`.
134190
135−`two` is a [`++toro`]().
191+Source
192+------
193+
194+ ++ furl :: unify changes
195+ |= [one=toro two=toro]
196+ ^- toro
197+ ~| %furl
198+ ?> ?& =(p.one p.two) :: same path
199+ &(?=(& -.q.one) ?=(& -.q.two)) :: both deltas
200+ ==
201+ [p.one [%& [*cart (weld q.q.q.one q.q.q.two)]]]
202+ ::
203+
204+Examples
205+--------
136206
137207 ~zod/try=> %/zak
138208 ~zod/try=/zak> :ls %
@@ -150,18 +220,32 @@ and pointed at the same [`++path`]().
150220
151221### `++meat`
152222
153−Kite to .\^ path
154−
155− ++ meat :: kite to .^ path
156− |= kit=kite
157− ^- path
158− [(cat 3 'c' p.kit) (scot %p r.kit) s.kit (scot `dime`q.kit) t.kit]
159− ::
223+Kite to .^ path
160224
161225Converts a type request name to a [`++path`]().
162226
227+Accepts
228+-------
229+
163230`kit` is a [`++kite`]().
164231
232+Produces
233+--------
234+
235+A `++path`.
236+
237+Source
238+------
239+
240+ ++ meat :: kite to .^ path
241+ |= kit=kite
242+ ^- path
243+ [(cat 3 'c' p.kit) (scot %p r.kit) s.kit (scot `dime`q.kit) t.kit]
244+ ::
245+
246+Examples
247+--------
248+
165249 zod/try=/zop> `kite`[%x ud/1 ~zod %main /sur/down/gate/hook]
166250 [p=%x q=[%ud p=1] r=~zod s=%main t=/sur/down/gate/hook]
167251 ~zod/try=/zop> (meat [%x ud/1 ~zod %main /sur/down/gate/hook])
@@ -185,34 +269,48 @@ Converts a type request name to a [`++path`]().
185269
186270Parse kite path
187271
188− ++ tame :: parse kite path
189− |= hap=path
190− ^- (unit kite)
191− ?. ?=([@ @ @ @ *] hap) ~
192− =+ :* hyr=(slay i.hap)
193− fal=(slay i.t.hap)
194− dyc=(slay i.t.t.hap)
195− ved=(slay i.t.t.t.hap)
196− :: ved=(slay i.t.hap)
197− :: fal=(slay i.t.t.hap)
198− :: dyc=(slay i.t.t.t.hap)
199− tyl=t.t.t.t.hap
200− ==
201− ?. ?=([~ %$ %tas @] hyr) ~
202− ?. ?=([~ %$ %p @] fal) ~
203− ?. ?=([~ %$ %tas @] dyc) ~
204− ?. ?=([~ %$ case] ved) ~
205− =+ his=`@p`q.p.u.fal
206− =+ [dis=(end 3 1 q.p.u.hyr) rem=(rsh 3 1 q.p.u.hyr)]
207− ?. ?&(?=(%c dis) ?=(?(%v %w %x %y %z) rem)) ~
208− [~ rem p.u.ved q.p.u.fal q.p.u.dyc tyl]
209− ::
210−
211272Parses a clay [.\^]()
212273[`++path` ]()to request details. Produces the [`++unit`]() of a [`++kite`]().
213274
275+Accepts
276+-------
277+
214278`hap` is a [`++path`]().
215279
280+Produces
281+--------
282+
283+A `(unit kite)`.
284+
285+Source
286+------
287+
288+ ++ tame :: parse kite path
289+ |= hap=path
290+ ^- (unit kite)
291+ ?. ?=([@ @ @ @ *] hap) ~
292+ =+ :* hyr=(slay i.hap)
293+ fal=(slay i.t.hap)
294+ dyc=(slay i.t.t.hap)
295+ ved=(slay i.t.t.t.hap)
296+ :: ved=(slay i.t.hap)
297+ :: fal=(slay i.t.t.hap)
298+ :: dyc=(slay i.t.t.t.hap))
299+ tyl=t.t.t.t.hap
300+ ==
301+ ?. ?=([~ %$ %tas @] hyr) ~
302+ ?. ?=([~ %$ %p @] fal) ~
303+ ?. ?=([~ %$ %tas @] dyc) ~
304+ ?. ?=([~ %$ case] ved) ~
305+ =+ his=`@p`q.p.u.fal
306+ =+ [dis=(end 3 1 q.p.u.hyr) rem=(rsh 3 1 q.p.u.hyr)]
307+ ?. ?&(?=(%c dis) ?=(?(%v %w %x %y %z) rem)) ~
308+ [~ rem p.u.ved q.p.u.fal q.p.u.dyc tyl]
309+ ::
310+
311+Examples
312+--------
313+
216314 ~zod/try=/zop> (tame /cx/~zod/main/1/sur/down/gate/hook)
217315 [~ [p=%x q=[%ud p=1] r=~zod s=%main t=/sur/down/gate/hook]]
218316 ~zod/try=/zop> (tame /cx/0/main/1/sur/down/gate/hook)
@@ -224,21 +322,37 @@ Parses a clay [.\^]()
224322
225323Parse path to beam
226324
227− ++ tome :: parse path to beam
228− |= pax=path
229− ^- (unit beam)
230− ?. ?=([* * * *] pax) ~
231− %+ biff (slaw %p i.pax)
232− |= who=ship
233− %+ biff (slaw %tas i.t.pax)
234− |= dex=desk
235− %+ biff (slay i.t.t.pax)
236− |= cis=coin
237− ?. ?=([%$ case] cis) ~
238− `(unit beam)`[~ [who dex `case`p.cis] (flop t.t.t.pax)]
239− ::
325+Parses a [`++path`]() `pax` to a [`++beam](), a well-typed location.
326+
327+Accepts
328+-------
329+
330+`pax` is a [`++path`]().
331+
332+Produces
333+--------
334+
335+A `(unit beam)`.
240336
241−Parses a [`++path`]() `pax` to a [\`++beam](), a well-typed location.
337+Source
338+------
339+
340+ ++ tome :: parse path to beam
341+ |= pax=path
342+ ^- (unit beam)
343+ ?. ?=([* * * *] pax) ~
344+ %+ biff (slaw %p i.pax)
345+ |= who=ship
346+ %+ biff (slaw %tas i.t.pax)
347+ |= dex=desk
348+ %+ biff (slay i.t.t.pax)
349+ |= cis=coin
350+ ?. ?=([%$ case] cis) ~
351+ `(unit beam)`[~ [who dex `case`p.cis] (flop t.t.t.pax)]
352+ ::
353+
354+Examples
355+--------
242356
243357 ~zod/try=/zop> (tome /~fyr/try/2/for/me)
244358 [~ [[p=~fyr q=%try r=[%ud p=2]] s=/me/for]]
@@ -249,13 +363,26 @@ Parses a [`++path`]() `pax` to a [\`++beam](), a well-typed location.
249363 ~zod/try=/zop> (tome /~zod/main/0x12)
250364 ~
251365
252−### `++tope :: beam to path`
366+### `++tope`
253367
254368Parse beam to path
255369
256− |= bem=beam
257− ^- path
258− [(scot %p p.bem) q.bem (scot r.bem) (flop s.bem)]
370+Parses a [`++beam`]() `bem` to a [`++path`]().
371+
372+Accepts
373+-------
374+
375+`bem` is a `++beam`.
376+
377+Produces
378+--------
379+
380+A `++path`.
381+
382+ ++tope
383+ |= bem=beam
384+ ^- path
385+ [(scot %p p.bem) q.bem (scot r.bem) (flop s.bem)]
259386
260387Parses a [`++beam`]() to a [`++path`](/doc/hoon/library/1#++path).
261388
docs/dev/hoon/library/3bg.md+787−305

This diff is too big to show here.

docs/dev/hoon/library/3bh.md+102−9

This diff is too big to show here.

docs/dev/hoon/library/3bi.md+2076

This diff is too big to show here.

docs/dev/hoon/reference/cheat-sheet.mdnew file+532

This diff is too big to show here.

docs/dev/hoon/runes/bc.mddeleted−49

This diff is too big to show here.

docs/dev/hoon/runes/bc/bcbr.md+13−24

This diff is too big to show here.

docs/dev/hoon/runes/bc/bccb.md+18−9

This diff is too big to show here.

docs/dev/hoon/runes/bc/bccl.md+14−14

This diff is too big to show here.

docs/dev/hoon/runes/bc/bccm.mddeleted−61

This diff is too big to show here.

docs/dev/hoon/runes/bc/bccn.md+7−19

This diff is too big to show here.

docs/dev/hoon/runes/bc/bckt.mddeleted−49

This diff is too big to show here.

docs/dev/hoon/runes/bc/bcls.md+11−16

This diff is too big to show here.

docs/dev/hoon/runes/bc/bcpm.md+8−17

This diff is too big to show here.

docs/dev/hoon/runes/bc/bcpt.mddeleted−37

This diff is too big to show here.

docs/dev/hoon/runes/bc/bctr.md+10−7

This diff is too big to show here.

docs/dev/hoon/runes/bc/bcts.md+18−12

This diff is too big to show here.

docs/dev/hoon/runes/bc/bcwt.md+9−15

This diff is too big to show here.

docs/dev/hoon/runes/bc/bczp.mddeleted−40

This diff is too big to show here.

docs/dev/hoon/runes/br.mddeleted−47

This diff is too big to show here.

docs/dev/hoon/runes/br/brcb.md+14−33

This diff is too big to show here.

docs/dev/hoon/runes/br/brcn.md+12−32

This diff is too big to show here.

docs/dev/hoon/runes/br/brdt.md+8−21

This diff is too big to show here.

docs/dev/hoon/runes/br/brfs.md+12−28

This diff is too big to show here.

docs/dev/hoon/runes/br/brhp.md+7−23

This diff is too big to show here.

docs/dev/hoon/runes/br/brkt.md+9−27

This diff is too big to show here.

docs/dev/hoon/runes/br/brls.md+10−24

This diff is too big to show here.

docs/dev/hoon/runes/br/brtr.md+11−26

This diff is too big to show here.

docs/dev/hoon/runes/br/brts.md+9−20

This diff is too big to show here.

docs/dev/hoon/runes/br/brwt.md+10−16

This diff is too big to show here.

docs/dev/hoon/runes/cl.mddeleted−44

This diff is too big to show here.

docs/dev/hoon/runes/cl/clcb.md+7−13

This diff is too big to show here.

docs/dev/hoon/runes/cl/clfs.md+7−17

This diff is too big to show here.

docs/dev/hoon/runes/cl/clhp.md+10−16

This diff is too big to show here.

docs/dev/hoon/runes/cl/clkt.md+8−15

This diff is too big to show here.

docs/dev/hoon/runes/cl/clls.md+7−14

This diff is too big to show here.

docs/dev/hoon/runes/cl/clsg.md+8−10

This diff is too big to show here.

docs/dev/hoon/runes/cl/cltr.md+9−10

This diff is too big to show here.

docs/dev/hoon/runes/cn.mddeleted−41

This diff is too big to show here.

docs/dev/hoon/runes/cn/cncb.md+23−23

This diff is too big to show here.

docs/dev/hoon/runes/cn/cncl.mddeleted−55

This diff is too big to show here.

docs/dev/hoon/runes/cn/cndt.md+10−19

This diff is too big to show here.

docs/dev/hoon/runes/cn/cnhp.md+16−9

This diff is too big to show here.

docs/dev/hoon/runes/cn/cnkt.md+7−24

This diff is too big to show here.

docs/dev/hoon/runes/cn/cnls.md+9−16

This diff is too big to show here.

docs/dev/hoon/runes/cn/cnsg.md+15−8

This diff is too big to show here.

docs/dev/hoon/runes/cn/cntr.md+4−16

This diff is too big to show here.

docs/dev/hoon/runes/cn/cnts.md+10−13

This diff is too big to show here.

docs/dev/hoon/runes/cn/cnzy.mddeleted−40

This diff is too big to show here.

docs/dev/hoon/runes/cn/cnzz.mddeleted−43

This diff is too big to show here.

docs/dev/hoon/runes/dt.mddeleted−33

This diff is too big to show here.

docs/dev/hoon/runes/dt/dtkt.md+9−14

This diff is too big to show here.

docs/dev/hoon/runes/dt/dtls.md+7−7

This diff is too big to show here.

docs/dev/hoon/runes/dt/dttr.md+8−15

This diff is too big to show here.

docs/dev/hoon/runes/dt/dtts.md+9−15

This diff is too big to show here.

docs/dev/hoon/runes/dt/dtwt.md+8−14

This diff is too big to show here.

docs/dev/hoon/runes/dt/dtzz.md−5

This diff is too big to show here.

docs/dev/hoon/runes/hx.mddeleted−19

This diff is too big to show here.

docs/dev/hoon/runes/hx/hxgl.md+3−4

This diff is too big to show here.

docs/dev/hoon/runes/kt.mddeleted−40

This diff is too big to show here.

docs/dev/hoon/runes/kt/ktbr.md+10−25

This diff is too big to show here.

docs/dev/hoon/runes/kt/ktdt.md+11−20

This diff is too big to show here.

docs/dev/hoon/runes/kt/kthp.md+10−22

This diff is too big to show here.

docs/dev/hoon/runes/kt/ktls.md+11−24

This diff is too big to show here.

docs/dev/hoon/runes/kt/ktsg.md+10−16

This diff is too big to show here.

docs/dev/hoon/runes/kt/ktts.md+7−6

This diff is too big to show here.

docs/dev/hoon/runes/kt/ktwt.md+4−13

This diff is too big to show here.

docs/dev/hoon/runes/sg.mddeleted−32

This diff is too big to show here.

docs/dev/hoon/runes/sg/sgbc.md+6−12

This diff is too big to show here.

docs/dev/hoon/runes/sg/sgbr.md+8−16

This diff is too big to show here.

docs/dev/hoon/runes/sg/sgcb.md+8−13

This diff is too big to show here.

docs/dev/hoon/runes/sg/sgcn.md+8−17

This diff is too big to show here.

docs/dev/hoon/runes/sg/sgfs.md+8−14

This diff is too big to show here.

docs/dev/hoon/runes/sg/sggl.md+5−10

This diff is too big to show here.

docs/dev/hoon/runes/sg/sggr.md+6−11

This diff is too big to show here.

docs/dev/hoon/runes/sg/sgls.md+7−13

This diff is too big to show here.

docs/dev/hoon/runes/sg/sgpm.md+9−10

This diff is too big to show here.

docs/dev/hoon/runes/sg/sgts.md+8−13

This diff is too big to show here.

docs/dev/hoon/runes/sg/sgwt.md+10−15

This diff is too big to show here.

docs/dev/hoon/runes/sg/sgzp.md+3−3

This diff is too big to show here.

docs/dev/hoon/runes/sm/smcl.md+8−6

This diff is too big to show here.

docs/dev/hoon/runes/sm/smcn.md+9−20

This diff is too big to show here.

docs/dev/hoon/runes/sm/smdq.md+5−15

This diff is too big to show here.

docs/dev/hoon/runes/sm/smhp.md+6−16

This diff is too big to show here.

docs/dev/hoon/runes/sm/smls.md+3−13

This diff is too big to show here.

docs/dev/hoon/runes/sm/smsg.md+5−10

This diff is too big to show here.

docs/dev/hoon/runes/sm/smsm.md+5−10

This diff is too big to show here.

docs/dev/hoon/runes/sm/smtr.md+7−18

This diff is too big to show here.

docs/dev/hoon/runes/sm/smzz.md+6−11

This diff is too big to show here.

docs/dev/hoon/runes/ts.mddeleted−49

This diff is too big to show here.

docs/dev/hoon/runes/ts/tsbr.md+9−17

This diff is too big to show here.

docs/dev/hoon/runes/ts/tscl.md+7−21

This diff is too big to show here.

docs/dev/hoon/runes/ts/tsdt.md+7−10

This diff is too big to show here.

docs/dev/hoon/runes/ts/tsgl.md+8−11

This diff is too big to show here.

docs/dev/hoon/runes/ts/tsgr.md+4−15

This diff is too big to show here.

docs/dev/hoon/runes/ts/tshp.md+9−16

This diff is too big to show here.

docs/dev/hoon/runes/ts/tskt.md+11−10

This diff is too big to show here.

docs/dev/hoon/runes/ts/tsls.md+7−16

This diff is too big to show here.

docs/dev/hoon/runes/ts/tssg.md+5−9

This diff is too big to show here.

docs/dev/hoon/runes/ts/tstr.md+7−10

This diff is too big to show here.

docs/dev/hoon/runes/wt.mddeleted−39

This diff is too big to show here.

docs/dev/hoon/runes/wt/wtbr.md+7−8

This diff is too big to show here.

docs/dev/hoon/runes/wt/wtcl.md+7−23

This diff is too big to show here.

docs/dev/hoon/runes/wt/wtdt.md+8−21

This diff is too big to show here.

docs/dev/hoon/runes/wt/wtgl.md+7−19

This diff is too big to show here.

docs/dev/hoon/runes/wt/wtgr.md+7−19

This diff is too big to show here.

docs/dev/hoon/runes/wt/wthp.md+9−23

This diff is too big to show here.

docs/dev/hoon/runes/wt/wthz.md+1−1

This diff is too big to show here.

docs/dev/hoon/runes/wt/wtkt.md+7−15

This diff is too big to show here.

docs/dev/hoon/runes/wt/wtls.md+10−21

This diff is too big to show here.

docs/dev/hoon/runes/wt/wtpm.md+7−8

This diff is too big to show here.

docs/dev/hoon/runes/wt/wtpt.md+7−13

This diff is too big to show here.

docs/dev/hoon/runes/wt/wtsg.md+8−12

This diff is too big to show here.

docs/dev/hoon/runes/wt/wtts.md+6−12

This diff is too big to show here.

docs/dev/hoon/runes/wt/wttz.md+2−2

This diff is too big to show here.

docs/dev/hoon/runes/wt/wtzp.md+7−7

This diff is too big to show here.

docs/dev/hoon/runes/zp.mddeleted−23

This diff is too big to show here.

docs/dev/hoon/runes/zp/zpcb.md+8−8

This diff is too big to show here.

docs/dev/hoon/runes/zp/zpcm.md+9−14

This diff is too big to show here.

docs/dev/hoon/runes/zp/zpfs.md+4−9

This diff is too big to show here.

docs/dev/hoon/runes/zp/zpgr.md+9−14

This diff is too big to show here.

docs/dev/hoon/runes/zp/zpsm.md+5−10

This diff is too big to show here.

docs/dev/hoon/runes/zp/zpts.md+8−13

This diff is too big to show here.

docs/dev/hoon/runes/zp/zpwt.md+5−15

This diff is too big to show here.

docs/dev/hoon/runes/zp/zpzp.md+11−17

This diff is too big to show here.

docs/user/clay.md+14−16

This diff is too big to show here.