on master help sign in
Merge branch 'cleanorg' of github.com:urbit/docs into free
16d4dc4Galen Wolfe-Pauly
docs/system/hoon/core.mdnew file+24
@@ -0,0 +1,24 @@
1+---
2+sort: 1
3+---
4+
5+# Core Hoon
6+
7+Hoon is strict, typed functional programming without math.
8+
9+Hoon is named after a Wallace Stevens poem. Coincidentally, it
10+means "hooligan" in Australian. Practically, "Hoon" is a short
11+punchy name which search engines handle well.
12+
13+This manual defines a practical Hoon subset we call Core Hoon.
14+(Some of the internal structures we present are simplified to
15+reflect the Core subset.)
16+
17+To read it for the first time, read these links in order:
18+
19+<list>
20+</list>
21+
22+Once you've been through all this material, you can try some
23+[exercises]() if you feel you're ready, or read [Deep Hoon]() for
24+a more narrative introduction.
docs/system/hoon/core/demo.mdnew file+56
@@ -0,0 +1,56 @@
1+---
2+sort: 1
3+---
4+
5+# Demo
6+
7+Here's everyone's favorite whiteboard example, FizzBuzz. Each
8+line is commented with its number:
9+
10+```
11+:gate end/atom :: 1
12+:var count 1 :: 2
13+:loop :: 3
14+:if =(end count) :: 4
15+ ~ :: 5
16+:cons :: 6
17+ :if =(0 (mod count 15)) :: 7
18+ "FizzBuzz" :: 8
19+ :if =(0 (mod count 5)) :: 9
20+ "Fizz" :: 10
21+ :if =(0 (mod count 3)) :: 11
22+ "Buzz" :: 12
23+ (text :wrap(count)) :: 13
24+:moar(count (add 1 count)) :: 14
25+```
26+
27+Can you understand this code by just looking at it? Hopefully,
28+but let's explain it anyway.
29+
30+Hoon is a functional language. FizzBuzz is usually defined as a
31+side effect, but Hoon has no side effects. This code will
32+*make* a list of strings, not *print* a list of strings.
33+
34+Line 1 defines a function of one argument, `end`, an unsigned
35+integer.
36+
37+Line 2 declares a variable, `count`, with initial value `1`.
38+
39+Line 3 begins a loop.
40+
41+Line 4 checks if `count` equals `end`. If so, line 5 (and the
42+whole loop) produces the value `~`, null. If not, line 6 begins
43+an ordered pair.
44+
45+The head of the pair is "FizzBuzz", or "Fizz", or "Buzz", if the
46+respective tests hit. If not, line 13 wraps a runtime type
47+around `count`, then prints the type-value pair to a string (like
48+C `sprintf()`). This string is the first item in the output list.
49+
50+The tail of the pair is line 14, which repeats the loop (like
51+Clojure `recur`), with `count` incremented. This list of strings
52+is the rest of the output list.
53+
54+You can test this code by typing it into `home/gen/fizzbuzz.hoon`
55+in your Urbit mount directory, then typing `+fizzbuzz 100` in the
56+Urbit dojo (shell).
docs/system/hoon/core/examples.mdnew file+453
@@ -0,0 +1,453 @@
1+---
2+sort: 9
3+---
4+
5+# Examples
6+
7+Now we know enough to write two quick examples: the Sieve of
8+Eratosthenes (a naive prime sieve) and a tictactoe engine.
9+
10+(Note that these are not examples of perfect Hoon code; they are
11+meant for teaching. They err, more than usual for Hoon, on the
12+side of simple manual construction over high-octane FP.)
13+
14+## `sieve`: code in basic style
15+
16+A function that produces the list of primes less than or equal to
17+than its argument, an atom:
18+```
19+:gate thru/atom :: 1
20+:cast (list atom) :: 2
21+:var field/(set atom) (silt (gulf 2 thru)) :: 3
22+:rap abet:main :: 4
23+:core :: 5
24+++ abet :: 6
25+ (sort (~(tap in field) ~) lth) :: 7
26+:: :: 8
27+++ main :: 9
28+ :var factor/atom 2 :: 10
29+ :loop :like ..main :: 11
30+ :if (gth (mul factor factor) thru) :: 12
31+ ..main :: 13
32+ :moar(factor +(factor), ..main (reap factor)) :: 14
33+:: :: 15
34+++ reap :: 16
35+ :gate factor/atom :: 17
36+ :var count/atom (mul 2 factor) :: 18
37+ :loop :like ..reap :: 19
38+ :if (gth count thru) :: 20
39+ ..reap :: 21
40+ :moar :: 22
41+ count (add count factor) :: 23
42+ field (~(del in field) count) :: 24
43+ == :: 25
44+-- :: 26
45+```
46+
47+## `sieve`: explanation
48+
49+Line `1`: we are building a gate (function) whose sample
50+(argument) is `thru`, an atom.
51+
52+Line `2`: the product of this gate is a list of atoms.
53+
54+Line `3`: we introduce a variable `field`, whose type is a set of
55+atoms. The `silt` function converts a list to a set. The `gulf`
56+function creates the range `2` through `thru` inclusive, as a
57+list of atoms.
58+
59+Line `4`: below, we introduce a core which does our work. With
60+reverse flow, we compute `main` on this core, then `abet` on the
61+product of `main`. (`abet:main` means `:rap(abet main)`.)
62+
63+The core is a state machine; `main` produces the core itself,
64+with the computation completed. `abet` then extracts the result.
65+
66+Line `5`: we wrap a core around our existing subject. The
67+`field` and `thru` atoms are within the payload and of course
68+remain accessible.
69+
70+Lines `6` and `7`: the `abet` arm, which produces the field as a
71+sorted list. `in` is the set core; `tap` is an arm which
72+produces a gate that exports the set as a list, prepending it to
73+a tail which is nil in this case (and most cases). We sort this
74+list in ascending order with `lth` (less-than).
75+
76+Line `9`: the `main` arm, which performs the main calculation.
77+
78+Line `10`: we declare a counter, `factor`, which will iterate
79+up through the factors we're removing.
80+
81+Line `11`: we start a loop. The product of the loop is cast to
82+`..main`, which is the core we're in (`+1.main`).
83+
84+Lines `12` and `13`: we terminate the loop, returning `..main`,
85+if the square of the counter exceeds the range.
86+
87+Line `14`: repeats the loop, incrementing the counter, and
88+replacing the core with a version sieved by `reap`.
89+
90+Lines `16` and `17`: the `reap` arm, which produces a gate that
91+removes multiples of a factor from the field (set of possible
92+primes). The sample of this gate is the factor to remove.
93+
94+Line `18`: we declare a variable `count`, an atom, with the
95+initial value `(mul 2 factor)`.
96+
97+Line `19`: we enter a loop. This loop produces the core itself.
98+
99+Lines `20` and `21`: we are done if the counter is out of range.
100+
101+Lines `22` to `25`: repeat the loop, stepping `count` to the next
102+multiple of `factor`, and deleting it from `field`.
103+
104+## `sieve`: code in kernel style
105+
106+Finally, the same code transliterated into runes (and in a more
107+concise "kernel" style).
108+
109+```
110+|= top/@
111+^- (list @)
112+=+ fed=(silt (gulf 2 top))
113+=< abet:main
114+|%
115+++ abet (sort (~(tap in fed)) lth)
116+++ main
117+ =+ fac=2
118+ |- ^+ ..main
119+ ?: (gth (mul fac fac) top)
120+ ..main
121+ $(fac +(fac), ..main (reap fac))
122+::
123+++ reap
124+ |= fac/atom
125+ =+ cot=(mul 2 fac)
126+ |- ^+ ..reap
127+ ?: (gth cot top)
128+ ..reap
129+ $(cot (add cot fac), fed (~(del in fed) cot))
130+--
131+```
132+
133+### `toe`: tictactoe engine
134+
135+The `toe` tictactoe engine applies a list of events to a game
136+state, producing a list of game actions. Events are tictactoe
137+moves (`move)`; actions are tictactoe results (`fact`).
138+
139+```
140+:rap :gate feed/(list move) :: 1
141+ :new game/game :: 2
142+ :loop :cast (list fact) :: 3
143+ :ifno feed ~ :: 4
144+ :sip this/(unit fact) :: 5
145+ game :: 6
146+ (~(do go game) i.feed) :: 7
147+ :var rest/(list fact) :moar(feed t.feed) :: 8
148+ :ifno(this rest [u.this rest]) :: 9
149+:: :: 10
150+:per :core :: 11
151+ ++ side atom :: 12
152+ ++ spot {x/atom y/atom} :: 13
153+ ++ fact :book {$tie $~} :: 14
154+ {$win p/cord} :: 15
155+ == :: 16
156+ ++ move :book {$x p/spot} :: 17
157+ {$o p/spot} :: 18
158+ {$z $~} :: 19
159+ == :: 20
160+ ++ game :bank w/? :: 21
161+ a/side :: 22
162+ z/side :: 23
163+ == :: 24
164+ -- :: 25
165+:core :: 26
166+++ bo :: 27
167+ :door half/side :: 28
168+ ++ bit :gate(a/atom =(1 (cut 0 [a 1] half))) :: 29
169+ ++ off :gate(a/spot (add x.a (mul 3 y.a))) :: 30
170+ ++ get :gate(a/spot (bit (off a))) :: 31
171+ ++ set :gate(a/spot (con half (bex (off a)))) :: 32
172+ ++ win :calt lien :: 33
173+ (rip 4 0wl04h0.4A0Aw.4A00s.0e070) :: 34
174+ :gate(a/atom =(a (dis a half))) :: 35
175+ -- :: 36
176+++ go :: 37
177+ :door game/game :: 38
178+ ++ do :: 39
179+ :gate act/move :: 40
180+ :cast {(unit fact) ^game} :: 41
181+ :case act :: 42
182+ {$x *} :sure(w.game ~(mo on p.act)) :: 43
183+ {$o *} :deny(w.game ~(mo on p.act)) :: 44
184+ {$z *} [~ nu] :: 45
185+ == :: 46
186+ :: :: 47
187+ ++ nu :like(game [& 0 0]) :: 48
188+ ++ on :: 49
189+ :door here/spot :: 50
190+ ++ is :or (~(get bo a.game) here) :: 51
191+ (~(get bo z.game) here) :: 52
192+ == :: 53
193+ ++ mo :cast {(unit fact) ^game} :: 54
194+ :deny is :: 55
195+ :var next/side (~(set bo a.game) here) :: 56
196+ :if ~(win bo next) :: 57
197+ [[~ %win ?:(w.game %x %o)] nu] :: 58
198+ [~ game(w !w.game, a z.game, z next)] :: 59
199+ -- :: 60
200+ -- :: 62
201+-- :: 63
202+```
203+
204+### `toe`: explanation
205+
206+Line `1` wraps a conclusion around a stack of cores. The cores
207+at `11` and `26` are the data structures and functions of the
208+engine; the conclusion is the interface and top-level logic. It
209+produces a gate whose sample is `feed`, a list of `move`.
210+
211+Line `2` declares a blank new variable named `game`, whose type
212+is the `game` mold (tictactoe game state) defined on line `21`.
213+Under line `2`, `game` pulls the variable and `^game` the mold.
214+
215+Line `3` enters a loop producing a list of game events, `fact`.
216+
217+Line `4` produces nil, `~`, if `feed` is empty.
218+
219+Lines `5` through `7` apply the move. We open a `go` core on the
220+current game state, produce a `do` gate, and call that gate on
221+the move. The product of the `do` gate is a pair; the head is
222+`(unit fact)`, either `~` or `[~ fact]`; the tail is a new
223+`game`. The `:sip` twig declares the head as a new variable,
224+`this`; it modifies the subject by setting `game` to the tail.
225+
226+Line `8` declares a new variable, `rest`, which is all the facts
227+generated by the moves in `t.feed`, the tail of the move list.
228+(Yes, this is gratuitous head recursion.) Line `9` produces
229+`rest` if the `i.feed` move produced no fact; otherwise it
230+prepends the new fact to `rest`.
231+
232+Line `11` wraps a library core around a data structure core, a
233+common pattern. (You could put the molds and the gates in the
234+same core, but the compiler couldn't constant-fold gate samples
235+that use these molds, an efficiency cost.)
236+
237+Line `12` defines the `side` mold, an alias for `atom` (`@`).
238+A side is a half of the board, as a marked/unmarked bitfield.
239+
240+Line `13` defines the `spot` mold, a 2D coordinate.
241+
242+Lines `14` to `16` define the `fact` mold, a game event (ie,
243+output action), as a book (tagged union). There are two forms of
244+`fact`: `[%tie ~]` (reporting a tie), and `[%win cord]`
245+(reporting that `'X'` or `'O'` won a game.
246+
247+Lines `17` to `20` define the `move` mold, a game move. This is
248+either `[%x spot]`, `[%o spot]`, or `[%z ~]` to reset the board.
249+
250+Lines `21` to `23` define the `game` mold, the game state. This
251+is an `a` side, the next side to move; a `z` side, the other
252+side; and `w`, which is `&` (yes) if `a` is X and `b` is O; `|`
253+otherwise. (Obviously, we swap `a` and `z` on every move.)
254+
255+Line `26` introduces the library core, which contains the doors
256+`bo` (for `side` bitfields) and `go` (for game state).
257+
258+Lines `27` to `28` begin the `bo` core, a door around `half`, a
259+board side.
260+
261+Line `29` is the `bit` gate, which tests a bit in `half`.
262+
263+Line `30` is the `off` gate, which maps from a `spot` (coordinate)
264+to a bit index.
265+
266+Line `31` is the `get` gate, which produces the bit at a `spot`.
267+
268+Line `32` is the `set` gate, which produces a new side with the
269+bit at a `spot` set. It works by ORing (`con`) `half` with the
270+binary exponent (`bex`) of the offset (`off`) of the spot.
271+
272+Lines `33` to `35` are a victory test. It calls the
273+standard `lien` function, which iterates a boolean gate over a
274+list and produces `&` (yes) if any item tests as true, against a
275+list of magic bitfields (expanded from a base64 constant), each
276+of which must equal itself when ANDed (`dis`) with `half`.
277+
278+Lines `37` to `38` begin the `go` core, a door around a `game`.
279+Again we name the sample `game`. (This is a legitimate style,
280+but not used much.)
281+
282+Lines `40` to `42` begin the `do` gate, whose sample is `act`, a
283+move. The product is cast to a pair of `(unit fact)` and a new
284+game state, written `^game` to skip to the second binding.
285+
286+Lines `42` through `46` switch on the form of `act`. If it's an
287+`%x` or `%o` move, we assert that it's the right turn, then use
288+the `mo` door to apply the move. If it's a `%z` move, we clear
289+the board.
290+
291+Line `48` is the `nu` arm, which produces a blank game state.
292+
293+Lines `49` to `50` begin the `on` door, a door around `here`, a
294+`spot`. Just as we have multiple computed attributes against the
295+game state, we have multiple computed attributes (`is` and `mo`)
296+against the combination of game state and coordinate.
297+
298+Lines `51` to `53` define the `is` arm, which is `&` (yes) iff
299+either `a` or `z` has played `here`.
300+
301+Line `54` begins the `mo` arm, which produces (with a
302+nonessential cast) a pair of `(unit fact)` and game state.
303+Again we see `^game` to pull the mold, since `game` is the
304+current game state in the `go` core.
305+
306+Line `55` asserts that no one has yet played `here`.
307+
308+Line `56` declares a variable `next`, as game side `a` with
309+`here` played in it.
310+
311+Lines `57` and `58` test if `a` has won with this move. If so,
312+we produce the win fact and a blank game state.
313+
314+Line `59` produces no fact (since nothing has happened), but
315+inverts the `w` turn indicator, replaces side `a` with the other
316+side `z`, and replaces `z` with `next`.
317+
318+### `toe`: code, kernel style
319+
320+```
321+=< |= fed/(list move)
322+ =| mag/game
323+ |- ^- (list fact)
324+ ?~ fed ~
325+ =^ did/(unit fact) mag (~(do go mag) i.fed)
326+ =+ res=$(fed t.fed)
327+ ?~(did res [u.did res])
328+=> |%
329+ ++ side @
330+ ++ spot {x/@ y/@}
331+ ++ fact $% {$tie $~}
332+ {$win p/cord}
333+ ==
334+ ++ move $% {$x p/spot}
335+ {$o p/spot}
336+ {$z $~}
337+ ==
338+ ++ game $: w/?
339+ a/side
340+ z/side
341+ ==
342+ --
343+|%
344+++ bo
345+ |_ haf/side
346+ ++ bit |=(a/atom =(1 (cut 0 [a 1] haf)))
347+ ++ get |=(a/spot (bit (off a)))
348+ ++ off |=(a/spot (add x.a (mul 3 y.a)))
349+ ++ set |=(a/spot (con haf (bex (off a))))
350+ ++ win %+ lien
351+ (rip 4 0wl04h0.4A0Aw.4A00s.0e070)
352+ |=(a/atom =(a (dis a haf)))
353+ --
354+++ go
355+ |_ mag/game
356+ ++ do
357+ |= act/move
358+ ^- {(unit fact) game}
359+ ?- act
360+ {$x *} ?>(w.mag ~(mo on p.act))
361+ {$o *} ?<(w.mag ~(mo on p.act))
362+ {$z *} [~ nu]
363+ ==
364+ ::
365+ ++ nu `game`[& 0 0]
366+ ++ on
367+ =| her/spot
368+ |%
369+ ++ is ?| (~(get bo a.mag) her)
370+ (~(get bo z.mag) her)
371+ ==
372+ ++ mo ^- {(unit fact) game}
373+ ?< is
374+ =+ next=(~(set bo a.mag) her)
375+ ?: ~(win bo next)
376+ [[~ %win ?:(w.mag %x %o)] nu]
377+ [~ mag(w !w.mag, a z.mag, z next)]
378+ --
379+ --
380+--
381+```
382+
383+## Basic molds
384+```
385+++ atom @ :: just an atom
386+++ axis @ :: tree address
387+++ bean ? :: 0=&=yes, 1=|=no
388+++ bloq @ :: blockclass
389+++ char @tD :: UTF-8 byte
390+++ cord @t :: text atom (UTF-8)
391+++ gate $-(* *) :: general gate
392+++ knot @ta :: ASCII text
393+++ noun * :: any noun
394+++ null $~ :: null, nil, etc
395+++ time @da :: galactic time
396+++ path (list knot) :: eg, fs location
397+++ tang (list tank) :: error trace
398+++ tank ::
399+ $% {$leaf p/tape} :: printing formats
400+ $: $palm :: backstep list
401+ p/{p/tape q/tape r/tape s/tape} ::
402+ q/(list tank) ::
403+ == ::
404+ $: $rose :: flat list
405+ p/{p/tape q/tape r/tape} :: mid open close
406+ q/(list tank) ::
407+ == ::
408+ == ::
409+++ tanq :: future tank
410+ $? {$~ p/(list tanq)} :: list of printables
411+ {$~ $~ p/tape} :: simple string
412+ (pair @tas tanq) :: captioned
413+ == ::
414+++ tape (list char) :: string as list
415+++ term @tas :: ascii symbol
416+++ wall (list tape) :: text lines (no \n)
417+++ wain (list cord) :: text lines (no \n)
418+
419+::::
420+::::
421+
422+++ tree |* a/gate :: binary tree
423+ $@($~ {n/a l/(tree a) r/(tree a)}) ::
424+++ trap |*(a/_* _|?(*a)) :: makes perfect sense
425+++ trel |* {a/gate b/gate c/gate} :: just a triple
426+ {p/a q/b r/c} ::
427+++ each |* {a/gate b/gate} :: either a or b
428+ $%({$& p/a} {$| p/b}) :: a default
429+
430+++ qual |* {a/gate b/gate c/gate d/gate} :: just a quadruple
431+ {p/a q/b r/c s/d} ::
432+++ pair |*({a/gate b/gate} {p/a q/b}) :: just a pair
433+++ quid |*({a/gate b/*} {a _b}) :: for =^
434+++ quip |*({a/gate b/*} {(list a) _b}) :: for =^
435+++ unit |* a/gate :: maybe
436+ $@($~ {$~ u/a}) ::
437+++ list |* a/gate :: null-term list
438+ $@($~ {i/a t/(list a)}) ::
439+++ lone |*(a/gate p/a) :: just one thing
440+
441+::::
442+::::
443+++ map |* {a/gate b/gate} :: associative tree
444+ $@($~ {n/{p/a q/b} l/(map a b) r/(map a b)}) ::
445+++ qeu |* a/gate :: queue
446+ $@($~ {n/a l/(qeu a) r/(qeu a)}) ::
447+++ set |* a/gate :: set
448+ $@($~ {n/a l/(set a) r/(set a)}) ::
449+++ jar |*({a/gate b/gate} (map a (list b))) :: map of lists
450+++ jug |*({a/gate b/gate} (map a (set b))) :: map of sets
451+```
452+
453+### Basic libraries
docs/system/hoon/core/jargon.mdnew file+83
@@ -0,0 +1,83 @@
1+---
2+sort: 3
3+---
4+
5+# Terminology
6+
7+Usually, a new language is an improvement on one you already
8+know. If it isn't, it probably at least shares concepts with a
9+large family of relatives. These concepts come with words, like
10+*type* or *function*, that map cleanly onto its semantics.
11+
12+In Hoon we throw away almost all these words and invent new
13+ones, which mean almost the same things. But wait, wat?
14+
15+## Motivation
16+
17+Hoon has no close relatives, and the normal jargon of programming
18+maps poorly onto its semantics. For example, although Hoon is a
19+typed language, the term *type* is not formally defined in Hoon.
20+It's a great word, but Hoon has three quite separate concepts
21+which could comfortably claim it. We say *type* all the time;
22+we mean `span`, or `mold`, or `mark`, or possibly all three.
23+Sometimes this is ok and sometimes it isn't.
24+
25+Other common programming concepts used only informally in Hoon
26+are "function," "object," "event," "expression," "variable,"
27+"label," "closure", "environment," "stack," and probably a few
28+more. We can get away with any of these conventional words --
29+and we do. But when we do, we're making an analogy that relies
30+on context for precision.
31+
32+## Notation
33+
34+Any `word` in code font is a `limb` (label) in the Hoon kernel.
35+Any jargon that isn't a limb is in *italics*.
36+
37+## Enumeration
38+
39+Top-level Hoon concepts: `noun` (data), `nock` (interpreter),
40+`mint` (compiler), `span` (type), `twig` (expression).
41+
42+## Execution
43+
44+### `noun` (data)
45+
46+A value in Hoon is called a [`noun`](noun). A noun is either a
47+unsigned integer of any size (`atom`), or an ordered pair of any
48+two nouns (`cell`). Nouns are like Lisp S-expressions, but
49+simpler (Lisp atoms effectively have dynamic type bits).
50+
51+### `nock` (interpreter)
52+
53+Hoon compiles itself to the [Nock](nock) VM, a "functional assembly
54+language" whose spec fits on a T-shirt. You don't need to know
55+Nock to use Urbit, but it helps. Nock is an interpreter function
56+that maps a pair `{data nock}` to a *product* noun, where `data`
57+is the *subject* (input) and `nock` is the *formula* (program).
58+
59+## Compilation
60+
61+### `mint` (compiler)
62+
63+[`mint`](mint) is the Hoon compiler. It maps a cell `{span twig}` to a
64+cell `{span nock}`, where a `span` is a type, a `twig` is a compiled
65+expression (AST), and a `nock` is a Nock formula. `mint` accepts
66+a subject type and a source expression; it produces a product type
67+and an executable formula.
68+
69+### `span` (type, as range)
70+
71+A [`span`](span) is a Hoon type. It defines a set (finite or
72+infinite) of nouns and ascribes some semantics to it. There is
73+no syntax for spans; they are always defined by inference (ie, by
74+`mint`), usually using a constructor (`mold`).
75+### `twig` (expression)
76+
77+A [`twig`](twig) is a Hoon AST node, the result of parsing a
78+source expression. In general, a twig is a tagged union of the
79+form `{stem bulb}`, where `stem` is a symbolic atom which
80+controls the type of `bulb`. The regular form is a Hoon keyword
81+`:stem` and a *rune*, or digraph keyword, made of two ASCII
82+punctuation marks. The rune prefix character defines a twig
83+category, like `:`
docs/system/hoon/core/mint.mdnew file+25
@@ -0,0 +1,25 @@
1+---
2+sort: 6
3+---
4+
5+# Compiler: `mint`
6+
7+`mint` is the Hoon compiler. It maps a cell `{subject/span
8+source/twig}` to a cell `{product/span formula/nock}`, where
9+`span` is a type, `twig` is a compiled expression, and `nock` is
10+a Nock formula.
11+
12+Calculating the output type from the input type and the source
13+code is called "type inference." If you've used another typed
14+functional language, like Haskell, Hoon's type inference does the
15+same job but with less intelligence.
16+
17+Haskell infers backward and forward; Hoon only infers forward.
18+Hoon can't figure out the type of a noun from how you use it,
19+only from how you make it. Hoon can infer tail recursion, but
20+not head recursion.
21+
22+Low-powered type inference means you need more type annotations,
23+which makes your program more readable anyway. (Also, the dumber
24+the compiler, the easier it is for a dumb human to understand
25+what the compiler is thinking.)
docs/system/hoon/core/nock.mdnew file+160
@@ -0,0 +1,160 @@
1+---
2+sort: 5
3+---
4+
5+# Interpreter: `nock`
6+
7+The Nock VM is a Turing-complete function that maps a cell
8+`{subject formula}` to a noun `product`, where `subject` is the
9+data, `formula` is the code, and `product` is the result.
10+
11+To program in Hoon, this is all you need to know about Nock.
12+It's probably at least worth skimming this definition, though.
13+
14+(Also, the Hoon programmer should know that (a) tail call
15+elimination in Nock is straightforward; and (b) tail calls in
16+Hoon always become tail calls in Nock.)
17+
18+## Rules
19+
20+Nock is a combinator interpreter defined by the spec below.
21+
22+This pseudocode (any system of axioms is properly defined in
23+pseudocode) is a system of problem reduction rules. Variables
24+match any noun; the first rule from the top matches.
25+
26+A problem that reduces to itself is an infinite loop, hence a
27+crash ("bottom" in formal logic). Obviously a real interpreter
28+can detect this crash and produce an out-of-band value instead.
29+
30+```
31+?[a b] 0
32+?a 1
33++[a b] +[a b]
34++a 1 + a
35+=[a a] 0
36+=[a b] 1
37+=a =a
38+
39+/[1 a] a
40+/[2 a b] a
41+/[3 a b] b
42+/[(a + a) b] /[2 /[a b]]
43+/[(a + a + 1) b] /[3 /[a b]]
44+/a /a
45+
46+*[a [b c] d] [*[a b c] *[a d]]
47+
48+*[a 0 b] /[b a]
49+*[a 1 b] b
50+*[a 2 b c] *[*[a b] *[a c]]
51+*[a 3 b] ?*[a b]
52+*[a 4 b] +*[a b]
53+*[a 5 b] =*[a b]
54+
55+*[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0]
56+ 2 [1 2 3] [1 0] 4 4 b]
57+*[a 7 b c] *[a 2 b 1 c]
58+*[a 8 b c] *[a 7 [[7 [0 1] b] 0 1] c]
59+*[a 9 b c] *[a 7 c 2 [0 1] 0 b]
60+*[a 10 [b c] d] *[a 8 c 7 [0 3] d]
61+*[a 10 b c] *[a c]
62+
63+*a *a
64+```
65+
66+## Operators
67+
68+The pseudocode notation defines five prefix operators: `?`, `+`,
69+`=`, `/`, and `*`.
70+
71+`?[x]` produces `0` if `x` is a cell, `1` if an atom.
72+
73+`+[x]` produces the atom `x` plus `1`.
74+
75+`=[x y]` produces `0` if `x` and `y` are the same noun, `1`
76+otherwise.
77+
78+`/` is a tree addressing operator. The root of the tree is `1`;
79+the left child of any node `n` is `2n`; the right child is
80+`2n+1`. `/[x y]` is the subtree of `y` at address `x`.
81+
82+(For instance, `/[1 [531 25 99]]` is `[531 25 99]`; `/[2 [531 25
83+99]]` is `531`; `/[3 [531 25 99]]` is `[25 99]`; `/[6 [531 25
84+99]]` is `25`; `/[12 [531 25 99]]` crashes.)
85+
86+`*[x y]` is the Nock interpreter function. `x` is the subject,
87+`y` is the formula.
88+
89+An invalid use of any operator (eg, incrementing a cell) crashes.
90+This is specified as an infinite loop, but it's not actually an
91+infinite loop.
92+
93+## Instructions
94+
95+A valid formula is always a cell. If the head of the formula is a
96+cell, Nock treats both head and tail as formulas, resolves each
97+against the subject, and produces the cell of their products. In
98+other words, the Lisp program `(cons x y)` becomes the Nock
99+formula `[x y]`.
100+
101+If the head of the formula is an atom, it's an instruction from
102+`0` to `10`.
103+
104+A formula `[0 b]` produces the noun at tree address `b`
105+in the subject.
106+
107+A formula `[1 b]` produces the constant noun `b`.
108+
109+A formula `[2 b c]` treats `b` and `c` is formulas, resolves each
110+against the subject, then computes Nock again with the product of
111+`b` as the subject, `c` as the formula.
112+
113+In formulas `[3 b]`, `[4 b]`, and `[5 b]`, `b` is another
114+formula, whose product against the subject becomes the input to
115+an axiomatic operator. `3` is `?`, `4` is `+`, `5` is `=`.
116+
117+Instructions `6` through `10` are macros; deleting them
118+from Nock would decrease compactness, but not expressiveness.
119+
120+`[6 b c d]` is *if* `b`, *then* `c`, *else* `d`. Each of `b`,
121+`c`, `d` is a formula against the subject. Remember that `0` is
122+true and `1` is false.
123+
124+`[7 b c]` composes the formulas `b` and `c`.
125+
126+`[8 b c]` produces the product of formula `c`, against
127+a subject whose head is the product of formula `b` with the
128+original subject, and whose tail is the original subject. (Think
129+of `8` as a ``variable declaration'' or ``stack push.'')
130+
131+`[9 b c]` computes the product of formula `c` with the
132+current subject; from that product `d` it extracts a formula
133+`e` at tree address `b`, then computes `*[d e]`.
134+(Think, very roughly, of `d` as an object and `e` as a
135+method.)
136+
137+`[10 b c]` is a *hint* semantically equivalent to the formula
138+`c`. If `b` is an atom, it's a *static hint*, which is just
139+discarded. If `b` is a cell, it's a *dynamic* hint; the head of
140+`b` is discarded, and the tail of `b` is executed as a formula
141+against the current subject; the product of this is discarded.
142+
143+A practical interpreter can do anything with discarded data, so
144+long as the result it computes complies with the semantics of
145+Nock. For example, the simplest use of hints is the ordinary
146+"debug printf." It is erroneous for an interpreter to skip
147+computing dynamic hints; they might crash.
148+
149+## Implementation
150+
151+The reader might wonder how an interpreter whose only arithmetic
152+operation is increment can ever be practical.
153+
154+The short answer is that a Nock interpreter doesn't have to use
155+the algorithm above; it just has to get the same result as the
156+algorithm above.
157+
158+The algorithm for decrementing an atom is to count up to it, an
159+O(n) operation. But if we know we are running a decrement
160+formula,
docs/system/hoon/core/noun.mdnew file+33
@@ -0,0 +1,33 @@
1+---
2+sort: 4
3+---
4+
5+# Data model: `noun`
6+
7+A value in Hoon is called a `noun`. A noun is either a unsigned
8+integer of any size (`atom`), or an ordered pair of any two
9+nouns (`cell`). In other words, a noun is a binary tree whose
10+leaves are unsigned integers.
11+
12+Nouns are a Nock concept; there is no Nock syntax; so there is no
13+general noun syntax. But nouns are usually written with square
14+brackets associating right; `[a b c]` means `[a [b c]]`. In Hoon
15+we also see `{a b c}`, a constructor (`mold`) for `[a b c]`.
16+
17+Nouns are almost like Lisp's S-expressions, but S-expressions
18+have dynamic type tags in atoms. Nouns can lose this feature
19+because they're designed to sit under a static type system. For
20+the same reason, nouns tend to be tuple-centric where Lisp is
21+list-centric. Lisp `(a b c)` as a noun is `[a b c 0]`; Nock `[a
22+b c]` is Lisp `(a . b . c)`.
23+
24+Nouns are immutable and acyclic. A naive implementation uses
25+reference counting and needs no tracing GC. There is no test for
26+pointer equality as in Lisp. But indirect nouns have a lazily
27+computed short hash, so nonduplicates have O(1) comparison cost.
28+
29+All kinds of atomic values can be and are stored as atoms:
30+unsigned integers, signed integers (with sign bit low), dates,
31+floats, UTF-8 strings (LSB first), even whole files. Again,
32+a static type system is essential; an atom is not usable or even
33+printable if we don't know what it means.
docs/system/hoon/core/philosophy.mdnew file+41
@@ -0,0 +1,41 @@
1+---
2+sort: 2
3+---
4+
5+# Philosophy
6+
7+Hoon is a strict, typed functional language which compiles itself
8+to the Nock VM (whose spec fits on a T-shirt).
9+
10+Hoon's design goal is to support higher-order typed functional
11+programming without category theory, formal logic, or other
12+interesting math. The reasoning: (a) a programming language is a
13+user interface for programmers; (b) most programmers are not very
14+good at math. Hoon is not quite as expressive as Haskell, though
15+fairly close.
16+
17+Good Hoon style varies from good Haskell style. Hoon encourages
18+coders to use higher-order programming as little as possible --
19+again, simply for UI reasons. For example, multiple arguments
20+are curried by default in Haskell and tupled by default in Hoon.
21+The house style has been described as "procedural programming in
22+a functional language." The power of Haskell, or close, is there
23+when we really need it. But we try not to swat flies with it.
24+
25+Hoon is objectively simple: its complexity is bounded by the size
26+of the compiler, about 3000 lines of Hoon. This is split about
27+halfway half between frontend (parsing and macro expansion) and
28+backend (code generation and type inference).
29+
30+This parser-heavy ratio reflects the belief that our brains are
31+better than everyone thinks at learning languages (symbols and/or
32+grammars), and worse at learning abstractions (proofs and/or
33+algorithms). At first glance, Hoon may look gnarly (though its
34+squiggles are more structured than most ASCII-heavy languages).
35+But there's surprisingly little under the hood.
36+
37+Keeping the Hoon-to-Nock mapping straightforward is a priority.
38+Very roughly, Hoon is to Haskell as C is to Pascal. Pascal tries
39+to conceal its implementation beneath a layer of abstract
40+concepts; C, an "advanced macro assembler," tries to provide a
41+similar user experience with few abstract ideas as possible.
docs/system/hoon/core/span.mdnew file+118
@@ -0,0 +1,118 @@
1+---
2+sort: 7
3+---
4+
5+# Type: `span`
6+
7+A `span` is a type as most languages define it: a set of values
8+and a semantic interpretation of these values.
9+
10+## `mold`: type (as constructor)
11+
12+Why isn't `span` called "type"? Because Hoon also has a `mold`,
13+a completely different concept that could also be called a "type."
14+Hoon has no syntax for declaring spans. Spans are always created
15+by `mint`, using type inference.
16+
17+But we do want to define data structures with regular shapes. A
18+*mold* is an idempotent function (`gate`), accepting any noun.
19+The span of our structure is the result set of this function.
20+
21+In theory, either molds or spans could be called "types." In
22+practice, they're both called "types." The T-word has to stay
23+informal: it can't be banned, and it's already confusing enough.
24+
25+## `span`: definition
26+
27+This twig defines a mold named `span`, whose icon is the set of
28+all spans. Don't worry about the syntax yet:
29+
30+```
31+++ span
32+ $@ $? $noun
33+ $void
34+ == $% {$atom p/term q/(unit atom)}
35+ {$cell p/span q/span}
36+ {$core p/span q/(map term span)}
37+ {$face p/term q/span}
38+ {$fork p/(set span)}
39+ {$hold p/span q/twig}
40+ ==
41+```
42+
43+## `$noun` and `$void`
44+
45+`$noun` is the set of all nouns. `$void` is the set of
46+no nouns.
47+
48+## `{$cell p/span q/span}`
49+
50+`{$cell p/span q/span}` is the set of all cells with head `p` and
51+tail `q`.
52+
53+## `{$fork p/(set span)}
54+
55+`{$fork p/(set span)}` is the union of all spans in the set `p`.
56+
57+## `{$hold p/span q/twig}`
58+
59+A `$hold` span, with span `p` and twig `q`, is a lazy reference
60+to the span of `(mint p q)`. In English it means: "the type of
61+the product when we compile `q` with the subject `p`. (Hoon is
62+a strict language and the Hoon compiler is written in Hoon, so
63+laziness has to be implemented manually.)
64+
65+## `{$face p/term q/span}
66+
67+A `{$face p/term q/span}` wraps the label `p` around the span
68+`q`. See the twig section for how labels are resolved.
69+
70+## `{%atom p/term q/(unit atom))}
71+
72+An `$atom` is an atom, with two twists. `q` is a `unit`, Hoon's
73+equivalent of `Maybe` in Haskell or a nullable in Rust. If `q`
74+is `~`, null, the span is *warm*; any atom is in the span.
75+If `q` is `[~ x]`, where `x` is any atom, the span is *cold*;
76+its only legal value is the constnat `x`.
77+
78+`p` in the atom is a terminal used as an *aura*, or soft atom
79+type. Auras are a lightweight, advisory representation of the
80+units, semantics, and/or syntax of an atom. Two auras are
81+compatible if one is a prefix of the other.
82+
83+For instance, `@t` means UTF-8 text (LSB low), `@ta` means ASCII
84+text, and `@tas` means an ASCII symbol. `@u` means an unsigned
85+integer, `@ud` an unsigned decimal, `@ux` an unsigned
86+hexadecimal. You can use a `@ud` atom as a `@u` or vice versa,
87+but not as a `@tas`.
88+
89+Auras are truly soft; you can turn any aura into any other,
90+statically, by casting through the empty aura `@`. Hoon is not
91+dependently typed and can't enforce data constraints.
92+
93+## `{$core p/span q/(map term span)}
94+
95+A `$core` is a code-data cell. The data (or *payload*) is the
96+tail; the code (or *battery*) is the head. `p`, a span, is the
97+span of the payload. `q`, a name-twig table, is the source code
98+for the battery.
99+
100+Each twig in the battery source is compiled to a formula, with
101+the core itself as the subject. The battery is a tree of these
102+formulas, or *arms*. An arm is a computed attribute against its
103+core.
104+
105+All code-data structures in normal languages (functions, objects,
106+modules, etc) become cores in Hoon. A Hoon battery looks a bit
107+like a method table, but not every arm is a "method" in the OO
108+sense. An arm is a computed attribute. A method is an arm whose
109+product is a Hoon function (or *gate*).
110+
111+A gate is a core with one arm, whose name is the empty symbol
112+`$`, and a payload whose shape is `{sample context}`. The
113+*context* is the subject in which the gate was defined; the
114+*sample* is the argument.
115+
116+To call this function on an argument `x`, replace the sample (at
117+tree address `6` in the core) with `x`, then compute the arm.
118+(Of course, we don't mutate the noun, we make a mutant copy.)
docs/system/hoon/core/twig.mdnew file+48
@@ -0,0 +1,48 @@
1+---
2+sort: 8
3+---
4+
5+# Expression: `twig`
6+
7+A `twig` is an AST node: the noun that the Hoon compiler makes
8+when it parses a source expression.
9+
10+The definition of `twig` is the definition of Hoon. So let's
11+define the syntax and semantics of Hoon, a twig at a time. But
12+first, basic twig anatomy.
13+
14+## Twig anatomy
15+
16+A twig is a tagged union (`book`) with the form `{stem bulb}`,
17+where the `stem` is an atomic symbol. The bulb for each stem has
18+its own type, which varies by stem. (Compare with Lisp, where
19+every AST node is a tag and a list of child nodes.)
20+
21+There are no user-level macros. All stems are built into Hoon.
22+Most stems are implemented as internal macros, however.
23+
24+The bulb is usually a tuple, sometimes a list or map. An element
25+of this structure is a *subexpression*.
26+
27+Usually a subexpression is itself a `twig`; sometimes it's an
28+`@tas` (symbol) or a `wing` (reference path). Solely for
29+clarity, we use the type alias `moss` for twigs meant to produce
30+molds. A `moss` is just a twig, both in syntax and semantics.
31+
32+## Twig categories
33+
34+Fortunately, the twigs fit neatly into clear categories which
35+match their rune prefix. Read forward by category:
36+
37+<div><list/></div>
38+
39+## Structures
40+
41+The whole Crash twig system, as a
42+
43+```
44+|%
45+++
46+--
47+```
48+
docs/system/hoon/core/twig/atom.mdnew file+107
@@ -0,0 +1,107 @@
1+---
2+sort: 2
3+---
4+
5+# Constants and interpolations
6+
7+A constant is a twig whose product does not depend on the
8+subject. If you know Nock, the formula produced is always
9+is always `[1 constant]`.
10+
11+(Some of the "constant" syntax below can interpolate dynamic
12+twigs. When it does, it obviously isn't constant at all.)
13+
14+## Twigs
15+
16+```
17+|%
18+++ twig
19+ {$rock p/@tas q/@}
20+ {$sand p/@tas q/@}
21+ {$knit p/(list $@(@ {$~ p/twig}))}
22+ {$path p/(list (each @tas twig))
23+--
24+```
25+
26+## Syntax
27+
28+All Hoon constants are irregular; they have no rune form. The
29+stems described below are `$rock` (cold / constant), `$sand`
30+(warm / open), `$knit` (iterative string), and `$path` (Unix
31+style path).
32+
33+### Atoms
34+
35+Recall the `$atom` span, `{$atom p/aura q/(unit @)}`.
36+
37+Each atom constant syntax implies an aura. Note that the aura is
38+used indiscriminately to convey units, interpretations, parsing
39+syntax, and/or printing syntax.
40+
41+### Hardcoded auras
42+
43+### Cold or warm, single or arbitrary
44+
45+A span is a set of nouns; an `$atom` span contains either one
46+atom (*cold*) or all atoms (a *warm*).
47+
48+In general, the `%` prefix is added to indicate coldness. `42`
49+is warm and `%42` is cold. `@tas` symbols (which start with `%`
50+already, see below) are always cold.
51+
52+### Unsigned integer: `@ud`, `@ux`, `@uw`.
53+
54+Unsigned integers are broken into groups of 3 for decimals, and 4
55+for non-decimals, separated German style by `.`; `420` plus `999`
56+is `1.419`, a `@ud`.
57+
58+A hex (`@ux`) favorite is `0xcafe.babe`.
59+
60+`0w` is base64: `0-9`, `a-z` + 10, `A-Z` + 36, `-` and `~`. For
61+giant numbers, you can put whitespace/newlines after the `.`.
62+
63+### Boolean and null: `@f`, `@n`.
64+
65+Booleans in Hoon (`@f`) are `&` for yes (`@f`) and `|` for no.
66+Remember that `&` is `0` and `|` is `1` (which is why we say
67+"yes" and "no" rather than "true" and "false").
68+
69+Nil (aura `@n`) is `~` (with the value `0`).
70+
71+### Atomic string
72+
73+`'text'` in single quotes, `@t`, is a UTF-8 string LSB first.
74+
75+`%symbol`, `@tas`, containing only `a-z`, `0-9` and `-`, starting
76+with `a-z`, and ending with `a-z0-9`, is a valid symbolic name.
77+
78+`%$` is an empty `@tas`, ie, `0` with span `@tas`.
79+
80+### Signed integer: `@sd`
81+
82+Signed integers (`@sd`) are encoded with sign bit *low*. This
83+means we need a special syntax for positive signed integers,
84+since their atomic value can't be their unsigned value. For
85+example, `-3` is the atom `7`, whereas `--3` encodes to `6`.
86+
87+### Iterative string
88+
89+Hoon also has list-shaped strings (less compact, more editable).
90+Use double quotes: `"hello, world"`. The mold is `tape` or
91+`(list char)`, where `char` is a UTF-8 byte.
92+
93+Within a quoted string, interpolate with `{}`: `"hello, {(weld
94+"wo" "rld")}"`. It's also worth noting that `<`, `gar`, and `>`,
95+`gal` (angle brackets) stringify any twig: `"hello, {<mul 6
96+7>}"`. (Obviously, an interpolated string is not a constant.)
97+
98+### Path
99+
100+The path `/foo/bar/baz` is the constant `[%foo %bar %baz ~]`.
101+A path can be dynamically interpolated with `[]`:
102+
103+```
104+/foo/[:(if & %bar %rab)]/baz`
105+```
106+
107+equals `/foo/bar/baz`.
docs/system/hoon/core/twig/call.mdnew file+121
@@ -0,0 +1,121 @@
1+---
2+sort: 7
3+---
4+
5+# Full make (`%` runes)
6+
7+We've already covered the irregular-only twigs `$wing` and
8+`$limb`. These are simple forms of the *invocation* family of
9+twigs, `%`, whose general form is `$make`, `%=`.
10+
11+## Regular forms
12+
13+The rune prefix is `%`. Suffixes: `=` for `:make`, `~` for
14+`:open`, `-` for `:call`, `+` for `:calt`, `^` for `:calq`, `*`
15+for `:calp`.
16+
17+### `:make`, `%=`, "centis", `{$make p/wing q/(list (pair wing twig))}`
18+
19+Syntax: *1-fixed*, then *jogging*.
20+
21+The product: `p`, modified by the change list `q`.
22+
23+If `p` resolves to a leg, `q` is a list of changes to that leg.
24+If `p` resolves to an arm, `q` is a list of changes to the core
25+containing that arm. We compute the arm on the modified core.
26+
27+### `:open`, `%~`, "censig", `{$open p/wing q/twig r/twig}`
28+
29+Syntax: *3-fixed*.
30+
31+Expands to:
32+
33+```
34+ :pin q
35+ :make(p.+2 +6 :per(+3 r))
36+```
37+
38+We pin `q`, making our subject `[q subject]`. We make arm `p` on
39+`q`, changing leg `6` to `r` (per the original subject).
40+
41+Wut? Why? `$open` is a general case of `$call`; see below.
42+
43+### `:call`, `%-`, "cenhep", `{$call p/twig q/twig}`/
44+
45+Syntax: *2-fixed*.
46+
47+Expands to: `:open($ p q)`.
48+
49+`$call` is a function call; `p` is the function (`gate`), `q` the
50+argument. `$call` is a special case of `$open`, and a gate is a
51+special case of a `door` (see the [core](../core) twigs).
52+
53+In a gate, the modified core has only one anonymous arm; in a
54+door it gets a full battery. Intuitively, a gate defines one
55+algorithm it can compute upon its sample, `+6`. A door defines
56+many such algorithms.
57+
58+In classical languages, doors correspond to groups of functions
59+with the same argument list, or at least sharing a prefix. In
60+Hoon, this shared sample is likely to be pulled into a door.
61+
62+### `:calt`, `%+`, "cenlus", `{$calt p/twig q/twig r/twig}`
63+
64+Syntax: *3-fixed*.
65+
66+Expands to: `:(call p [q r])`.
67+
68+### `:calq`, `%^`, "cenket", `{$cnkt p/twig q/twig r/twig s/twig}`
69+
70+Syntax: *4-fixed*.
71+
72+Expands to: `:(call p [q r s])`.
73+
74+### `:calp`, `%*`, "centar", `{$cntr p/twig q/(list twig)}`
75+
76+Syntax: *4-fixed*.
77+
78+Expands to: `:(call p [q])`.
79+
80+## Irregular forms
81+
82+### Classic call, `(p q r s)`
83+
84+Translation:
85+
86+```
87+(p) :per(p $)
88+(p q) :call(p q)
89+(p q r s) :call(p [q r s])
90+```
91+
92+### Modified wing, `p.q(r s, t u, v w)`
93+
94+Translation:
95+
96+```
97+p.q(r s, t u, v w) :make(p.q r s, t u, v w)
98+```
99+
100+### Anonymous recursion, `:moar*`.
101+
102+Translation:
103+
104+```
105+:moar $
106+:moar(a b, c d, e f) $(a b, c d, e f)
107+:moarr ^$
108+:moarrrr ^^^$
109+```
110+
111+`:moar` has tall and wide form like a regular stem, though it has
112+no rune and is not a regular stem.
113+
114+`$` is a label like any other. But loops, gates, and traps all
115+hardcode this label. `$` thus implies recursing back to the
116+nearest `:loop` (`|-)`, `:gate` (`|=`), or `:trap` (`|.`). (Or
117+`^$` for the second nearest, `^^$` for the third, etc.
118+
119+`$` *seems* like a language primitive (eg, Clojure's `recur`), so
120+we made it look like one. Keyword enthusiasts and cats who love
121+cheeseburgers will appreciate `:moar`. Others can use `$`.
docs/system/hoon/core/twig/cast.mdnew file+53
@@ -0,0 +1,53 @@
1+---
2+sort: 10
3+---
4+
5+# Type manipulation (`^` runes).
6+
7+`$cast`, `$like`, and `$name` let us adjust spans without
8+violating type constraints.
9+
10+The `nest` algorithm which tests span subtyping is conservative;
11+it never allows invalid nests, it sometimes rejects valid nests.
12+
13+## Regular forms
14+
15+### `:like`, `^+`, "ketlus", `{$like p/twig q/twig}`
16+
17+Syntax: *2-fixed*.
18+
19+The product is the formula of `q` with the span of `p`, provided
20+nouns within the span of `q` can be shown to nest within the span
21+of `p`.
22+
23+### `:cast`, `^-`, "ketlus", `{$like p/moss q/twig}`
24+
25+Syntax: *2-fixed*.
26+
27+Expands to: `:like($.p q)`.
28+
29+`$like` is a typecheck by example; `$cast` is a typecheck by
30+mold.
31+
32+### `:name`, `^=`, "kettis", `{$name p/@tas q/twig}
33+
34+Syntax: *2-fixed*.
35+
36+The product: the formula of `q`, with the span of `q` labeled by
37+symbol `p`.
38+
39+### Irregular forms
40+
41+### Backtick cast: `\`foo\`bar`
42+
43+Translation:
44+```
45+`foo`bar ^-(foo bar)
46+```
47+
48+### Infix name: `foo=bar`
49+
50+Translation:
51+```
52+foo=bar ^=(foo bar)
53+```
docs/system/hoon/core/twig/cell.mdnew file+81
@@ -0,0 +1,81 @@
1+---
2+sort: 4
3+---
4+
5+# Cell construction (`:` runes)
6+
7+The cell twigs, `$cons` and friends, are simple and regular.
8+All `:` twigs expand to `$cons`.
9+
10+## Twigs
11+
12+```
13+|%
14+++ twig
15+ {$scon p/twig q/twig}
16+ {$conq p/twig q/twig r/twig s/twig}
17+ {$cons p/twig q/twig}
18+ {$cont p/twig q/twig r/twig}
19+ {$conl p/(list twig)}
20+ {$conp p/(list twig)}
21+--
22+```
23+
24+All construction stems expand to one natural stem, `$cons`, the
25+pair constructor, named for the Lisp special form.
26+
27+Synthetic stems change the last letter to indicate the bulb type:
28+`$cont` for triple, `$conq` for quad, `$conp` for tuple, `$conl`
29+for list. `$scon` is the reverse.
30+
31+## Regular forms
32+
33+The rune prefix is `:`. Suffixes: `-` for pair, `+` for triple,
34+`^` for quad, `*` for tuple, `~` for list, `_` for reverse.
35+
36+### `:cons`, `:-`, "colhep", `{$cons p/twig q/twig}`, "construct"
37+
38+Syntax: *2-fixed*.
39+
40+The product: the cell of `p` and `q`, each compiled against
41+the subject.
42+
43+### `:cont`, `:+`, "collus", `{$cont p/twig q/twig r/twig}`, "cons-3"
44+
45+Syntax: *3-fixed*.
46+
47+Expands to: `:cons(p :cons(q r))`.
48+
49+### `:conq`, `:^`, "colket", `{$cont p/twig q/twig r/twig s/twig}`, "cons-4"
50+
51+Syntax: *4-fixed*.
52+
53+Expands to: `:cons(p :cont(q r s))`.
54+
55+### `:conp`, `:*`, "coltar", `{$conp p/(list twig)}`, "construct tuple"
56+
57+Syntax: *running*.
58+
59+Expands by: `|-(?~(p ~ ?~(t.p i.p [%cons i.p $(p t.p)])))`.
60+
61+### `:conl`, `:~`, "colsig", `{$conl p/(list twig)}`, "construct list"
62+
63+Syntax: *running*.
64+
65+Expands by: `|-(?~(p [%rock %n ~] [%cons i.p $(p t.p)]))`.
66+
67+### `:scon`, `:_`, "colcab", `{$scon p/twig q/twig}`, "construct backward"
68+
69+Syntax: *running*.
70+
71+Expands to: `[%cons q p]`.
72+
73+## Irregular forms
74+
75+### Bracket tuple, `[p q r s]`
76+
77+Translation:
78+
79+```
80+[p q r s] :conp(p q r s)
81+```
docs/system/hoon/core/twig/core.mdnew file+90
@@ -0,0 +1,90 @@
1+---
2+sort: 6
3+---
4+
5+# Cores (`|` runes)
6+
7+Core twigs are flow twigs. The compiler essentially pins a Nock
8+formula, or battery of formulas, to the subject.
9+
10+All `|` twigs are macros around `$core`. (See the `$core`
11+section in [`span`](../span) above.) `$core` uses the subject as
12+the payload of a battery, whose arms are compiled with the core
13+itself as the subject.
14+
15+## Regular forms
16+
17+The rune prefix is `|`. Suffixes: `%` for `:core`, `=` for
18+`:gate`, `-` for `:loop`, `.` for `:trap`, `_` for `:door`.
19+
20+### `:core`, `|%`, "barcen", `{$core p/(map term twig)}`
21+
22+Syntax: *battery*
23+
24+The product: a core with battery `p`. Payload is the subject.
25+
26+### `:gate`, `|=`, "bartis", `{$gate p/moss q/twig}
27+
28+Syntax: *2-fixed*.
29+
30+Expands to:
31+
32+```
33+:new p
34+:core
35+++ $
36+ q
37+--
38+```
39+
40+A `$gate` produces a function from `p` to `q`. `p` is the
41+*sample*, or argument. The core has one formula, named `$` (the
42+empty name). The payload is of the form `{sample context}`,
43+where `context` is the subject of the gate.
44+
45+### `:loop`, `|-`, "barhep", `{$loop p/twig}`
46+
47+Syntax: *1-fixed*.
48+
49+Expands to:
50+
51+```
52+ :rap $
53+ :core
54+ ++ $
55+ p
56+ --
57+```
58+
59+A `$loop` makes a core with one anonymous arm `p`, then takes
60+that arm.
61+
62+### `:trap`, `|.`, "bardot", `{$trap p/twig}`
63+
64+Syntax: *1-fixed*.
65+
66+Expands to:
67+
68+```
69+ :core
70+ ++ $ p
71+ --
72+```
73+
74+A `$trap` is a deferred value.
75+
76+### `:door`, `|_`, "barcab", `{$door p/moss q/(map term twig)}`
77+
78+Syntax: *1-fixed*, then *battery*.
79+
80+Expands to:
81+
82+```
83+ :new p
84+ :core
85+ q
86+ ==
87+```
88+
89+A `gate` is a function; a `door` is the general case of a
90+function. Wut? We'll look at this again from the caller's side.
docs/system/hoon/core/twig/flow.mdnew file+143
@@ -0,0 +1,143 @@
1+---
2+sort: 5
3+---
4+
5+# Subject flow (`=` runes)
6+
7+Flow twigs change the subject. (Or more precisely, a flow twig
8+compiles at least one of its subtwigs with a different subject.)
9+All non-flow twigs (except cores) pass the subject down unchanged.
10+
11+## Overview
12+
13+The simplest way to change the subject is to compose two twigs,
14+`p` and `q`. Let `x` be `(mint subject p)`, with product span
15+`p.x` and nock formula `q.x`. Let `y` be `(mint p.x q)`. Then
16+their composition is `[p.y [7 q.x q.y]]`.
17+
18+This composition is the `$per` twig. A close relative is `$pin`,
19+which is `$per` over `[p .]`. The new subject is a cell of `p`
20+and the old subject. `$pin` is the simplest Hoon equivalent of
21+"declaring a variable" (introducing new data into the subject).
22+
23+Another way to change the subject is to mutate it. With the
24+`$set` twig, given a wing that resolves to a leg, we can write
25+instead of reading, *installing* a new value at that leg. Of
26+course, we are creating a copy, not modifying the original.
27+
28+## Structures
29+
30+### `taco`: name with optional filling
31+
32+A `taco` is either a symbol or a symbol-mold cell. The mold is a
33+typecheck and cast. For instance, when "initializing a variable"
34+with `:var`, we can cast the inferred type of the initial value
35+to match an explicit `taco` mold, or just state the symbol and
36+use the inferred type.
37+
38+The `taco` syntax is `foo` for the symbol foo, or `foo/bar` for
39+symbol `foo` and mold `bar`.
40+
41+## Definitions
42+
43+The rune prefix is `=`. Suffixes: `>` for `:per`, `<` for
44+`:rap`, `+` for `:pin`, `-` for `:nip`, `|` for `:new`, `/` for
45+`:var`, `;` for `:rev`, `.` for `:set`, and `^` for `:sip`.
46+
47+### `:per`, `=>`, "tisgar", `{$per p/twig q/twig}`, "compose"
48+
49+The product: `q`, compiled against the product of `p`.
50+
51+Intuitively: uses `p` as the subject of `q`.
52+
53+### `:rap`, `=<`, "tisgal", `{$rap p/twig q/twig}`, "reverse compose"
54+
55+Expands to: `:per(q p)`
56+
57+Intuitively: reverse of `:per`.
58+
59+### `:pin`, `=+`, "tislus", `{$pin p/twig q/twig}`, "work with"
60+
61+Expands to: `:per(:cons(p .) q)`
62+
63+Intuitively: uses `[p subject]` as the subject of `q`.
64+
65+### `:nip`, `=-`, "tishep", `{$nip p/twig q/twig}`, "work over"
66+
67+Expands to: `:pin(q p)`
68+
69+Intuitively: reverse of `:pin`.
70+
71+### `:var`, `=/`, "tisfas", `{$var p/taco q/twig r/twig}, "with variable"
72+
73+Expands to: `?@(p :pin(:name(p q) r) :pin(:cast(:(coat p) q) r)`
74+
75+Intuitively: uses `[p=q subject]` as the subject of `r`. If `p`
76+contains a mold, cast `q` to that mold.
77+
78+### `:rev`, `=;`, "tissem", `{$var p/taco q/twig r/twig}, "over variable"
79+
80+Expands to: `:var(p r q)`
81+
82+Intuitively: reverse of `:var`.
83+
84+### `:new`, `=|`, "tisbar", `{$new p/moss q/twig}`, "with blank"
85+
86+Expands to: `:pin(:per($ p) q)`
87+
88+Intuitively: pin the default value of `p`.
89+
90+### `:set`, `=.`, "tisdot", `{$set p/wing q/twig r/twig}`, "mutate"
91+
92+The product: `r`, compiled against a version of the subject
93+with wing `p` modified to the product of `q`.
94+
95+Intuitively: `r` with `p` set to `q`. Almost an assignment.
96+
97+### `:sip`, `=^`, "tisket", `{$sip p/taco q/wing r/twig s/twig}`, "advance"
98+
99+The product is `s`, compiled against a version of the subject
100+in which the head of `r` is bound to variable `p`, and the tail
101+of `r` is assigned into the wing `q`.
102+
103+Intuitively: `r` produces a cell; we pin the head and install the
104+tail.
105+
106+Whyuppose we have a state machine with a function that
107+produces a cell, whose head is a result and whose tail is a new
108+state. We want to use the head as a new variable, and stuff the
109+tail back into wherever we stored the old state. This may also
110+remind you of Haskell's State monad.
111+
112+## Irregular forms
113+
114+### Infix colon, p:q
115+
116+Not to be confused with the wing `p.q`. Translation:
117+```
118+p:q:r :rap(p :rap(q r))
119+```
120+
121+## Structures
122+
123+Using a mold syntax we haven't learned yet:
124+
125+```
126+|%
127+++ taco
128+ ?@(term {term moss})
129+::
130+++ twig
131+ {$per p/twig q/twig}
132+ {$rap p/twig q/twig}
133+
134+ {$pin p/twig q/twig}
135+ {$nip p/twig q/twig}
136+
137+ {$new p/moss q/twig}
138+ {$var p/taco q/twig r/twig}
139+ {$rev p/taco q/twig r/twig}
140+ {$set p/wing q/twig r/twig}
141+ {$sip p/taco q/wing r/twig s/twig}
142+--
143+```
docs/system/hoon/core/twig/limb.mdnew file+103
@@ -0,0 +1,103 @@
1+---
2+sort: 3
3+---
4+
5+# Limbs and wings
6+
7+One feature Hoon lacks: a context that isn't a first-class value.
8+Hoon has no concept of scope, environment, etc. A twig has one
9+data source, the *subject*, a noun like any other.
10+
11+In most languages "variable" and "attribute" are different
12+things. They are both symbols, but a variable is in "the
13+environment" and a attribute is on "an object." In Hoon, "the
14+environment" is "an object" -- the subject.
15+
16+`$limb` and `$wing` are two basic twig stems that extract
17+information from the subject. A `limb` is an attribute; a `wing`
18+is an attribute path, ie, a list of limbs.
19+
20+## Twigs
21+
22+Using a mold
23+```
24+++ limb
25+ $% {$& p/@ud}
26+ {$| p/@ud q/@tas}
27+ ==
28+++ twig
29+ $% {$limb p/limb}
30+ {$wing p/wing}
31+ ==
32+++ wing (list limb)
33+```
34+
35+The basic reference twigs are `$limb` and `$wing`. `$limb`
36+is a single reference step into the subject. `$wing` is a path
37+of reference steps.
38+
39+## Limbs and wings
40+
41+A `limb` is either *geometric*, `{$& p/@ud}`, or *symbolic*,
42+`{$| p/@ud q/@tas}`.
43+
44+The result of compiling a limb is either an *arm* or a *leg*. A
45+leg is a subtree of the subject. An arm is a computed attribute
46+on a core which is a subtree of the subject. (See `$core` in
47+[span](../span).)
48+
49+A geometric limb always compiles to a leg. A symbolic limb may
50+compile to an arm or a leg, depending on the subject.
51+
52+### Geometric limb, `{$& p/@ud}`
53+
54+`p` is a Nock tree address in the subject. If you don't know
55+Nock, tree addresses are a way of designating a subtree of a noun
56+with an atom. The root is `1`, the left child of any node `n` is
57+`(mul 2 n)`, the right child is `(add 1 (mul 2 n))`.
58+
59+### Symbolic limb
60+
61+A symbolic limb has a name `q` and a *skip count* `p`.
62+
63+To resolve the limb to arm or leg, we search the subject
64+headfirst and depth-first. If we descend to a `$face` span whose
65+label matches the limb symbol, the descent address is a leg; the
66+span is the span beneath the label. But if the `$face` label
67+differs, the search ignores this leg.
68+
69+If we descend into a `$core` span in which the limb symbol is an
70+arm, we produce that arm. If the limb symbol is not bound, we
71+descend into the payload (data) of the core.
72+
73+If the skip count `p` is nonzero, we pretend our first `p`
74+matches are actually mismatches. This lets the programmer "look
75+through" an overriding label. No label anywhere is inaccessible.
76+
77+### Wing
78+
79+A `wing` is a symbolic reference path, `(list limb)`. Taking a
80+wing is not quite the same as composing each of these limbs,
81+though; the product of a wing is still either an arm or a leg.
82+
83+This is trivial if each step in the wing is a leg. If an
84+intermediate step in a wing compiles to an arm, this arm is
85+rewritten; it becomes a leg to the arm's core.
86+
87+### Syntax
88+
89+All limb references are irregular.
90+
91+A geometric limb `x` is `+x`. `.` means `+1`.
92+
93+A symbolic limb `foo` is `foo`; the symbol is naked. To set a
94+nonzero skip count, use a unary `^` prefix; thus `^foo` skips one
95+match, and `^^^foo` skips three.
96+
97+The empty name `$` is the label whose value is 0. By convention,
98+`$` is always an arm, usually on a one-armed core (such as a
99+function or loop).
100+
101+A wing is written outside-in with `.` as a separator. So
102+`foo.bar.baz` is "foo, in bar, in baz." Yes, this is the
103+opposite of what you're used to.
docs/system/hoon/core/twig/mold.mdnew file+136
@@ -0,0 +1,136 @@
1+---
2+sort: 8
3+---
4+
5+# Molds (`$` runes).
6+
7+A *mold* is a `gate` (function) that helps us build simple and
8+rigorous data structures. (In fact, since "mold" sounds nasty,
9+molds are often called "structures.")
10+
11+## Overview
12+
13+While Hoon can't check this property statically, any true mold
14+is a *rectifier*: an idempotent function across all nouns. If
15+the sample of a gate has span `%noun`, and its body obeys the
16+constraint that for any x, `=((mold x) (mold (mold x)))`, it's a
17+rectifier and can be used as a mold.
18+
19+Twigs in the `$` family are macros designed for making molds.
20+But any Hoon twig may produce a mold. (This is why `moss` is a
21+synonym for `twig`).
22+
23+Many macros *bunt* a mold, producing `:per(mold $)`. This value,
24+simply the result of executing the gate on the default sample,
25+is a constant by definition and normally can be compiled as such.
26+The range of a mold (the span of its bunt) is called its *icon*.
27+
28+Molds have two uses: defining simple and rigorous structures, and
29+validating untrusted input data. Validation, though very
30+important, is a rare use case. Except for direct raw input,
31+it's generally a faux pas to rectify nouns at runtime -- or even
32+in userspace.
33+
34+As a structure definition, a mold has three common uses. One,
35+its bunt is a default value (such as the sample in a gate.) Two,
36+the product of some computation is cast to its icon, both
37+checking the type and regularizing it. Three, it's used as a
38+building block in other molds.
39+
40+## Regular forms
41+
42+The rune prefix is `$`. Suffixes:
43+
44+### `:bank`, `$:`, "buccol", `{$bank p/(list moss)}`
45+
46+Syntax: *running*.
47+
48+The product: a rectifier gate producing the tuple `p`.
49+
50+Where `a`, `b` and `c` produce molds, `:bank(a b c)` produces a
51+mold whose icon is the span `[$.a $.b $.c]`.
52+
53+### `:coat`, `$=`, "buctis", `{$coat p/@tas q/moss}`
54+
55+Syntax: *2-fixed*.
56+
57+The product: a rectifier gate producing mold `q` under label `p`.
58+
59+Where `q` produces a mold, `:coat(p q)` produces a mold whose
60+icon matches the span of `:name(p $.q)`.
61+
62+### `:pick`, `$?`, "bucwut", `{$pick p/(list moss)}`
63+
64+Syntax: *running*.
65+
66+The product: a rectifier gate producing the union of the molds in
67+`p`.
68+
69+Where `a`, `b`, and `c` produce molds, `:pick(a b c)` produces a
70+mold whose icon matches the span of `?:(& $.a ?:(& $.b $.c))`.
71+
72+The default mold is the first item in `p`. To avoid an infinite
73+loop, it has to be a termination case (such as a constant).
74+
75+### `:book`, `$%`, "buccen", `{$book p/(list moss)}`
76+
77+Syntax: *running*.
78+
79+The product: a rectifier gate producing the tagged union of the
80+molds in `p`, all of which must be of the form `:bank(stem
81+bulb)`, where `stem` is an atomic mold.
82+
83+`$book` has the same icon as `$pick`, but rectifies better.
84+
85+The default mold is the first item in `p`. To avoid an infinite
86+loop, it has to be a termination case (such as a constant).
87+
88+### `:shoe`, `$_`, "buccab", "{$shoe p/twig}"
89+
90+Syntax: *1-fixed*.
91+
92+Expands to: `:gate(* p)`.
93+
94+A `$shoe` is not useful for rectification; it ignores its input.
95+It is only useful for defaults and typechecks. Sometimes we have
96+no choice but to describe by example.
97+
98+### `:lamb`, `$-`, `"buchep"`, `{$lamb p/moss q/moss}`
99+
100+Syntax: *1-fixed*.
101+
102+Expands to: `:shoe(:gate(p $.q))`.
103+
104+`$lamb` is a lambda. We shoe a trivial function from `p` to `q`.
105+Like any `$shoe`, a `$lamb` is not useful for rectification (eg,
106+you can't use it to typecheck cores sent over the network).
107+
108+## Irregular forms
109+
110+### Primitives
111+
112+`*` means any noun; `@` with an aura means an atom, such as `@ud`
113+for unsigned decimal, or just `@` for a generic noun; `?` for
114+boolean; `^` for a cell (of `*`).
115+
116+### Constants
117+
118+For a mold producing a cold atom, replace the `%` of the constant
119+syntax with `$`. `%42` is the constant number `42`; `$42` is a
120+function that, passed 42 or any other argument, produces `%42`.
121+
122+Similarly, `%foo` is the number `7.303.014` or `0x6f.6f66`;
123+`$foo` is a function that produces `%foo`.
124+
125+`$~` produces `~`.
126+
127+### Miscellaneous
128+
129+Translation:
130+
131+```
132+{a b c}` :bank(a b c)
133+a/b :coat(a b)
134+?(a b c) :pick(a b c)
135+_a :shoe(a)
136+```
docs/system/hoon/core/twig/nock.mdnew file+36
@@ -0,0 +1,36 @@
1+---
2+sort: 11
3+---
4+
5+# Intrinsics (`.` runes)
6+
7+Anything Nock can do, Hoon can do.
8+
9+## Regular forms
10+
11+### `:bump`, `.+`, "dotlus", `{$bump p/twig}`
12+
13+Syntax: *1-fixed*
14+
15+The product: the product of `p`, which must be an atom, plus 1.
16+
17+### `:same`, `.=`, "dottis", `{$same p/twig q/twig}`
18+
19+Syntax: *2-fixed*.
20+
21+The product: yes iff `p` and `q` produce the same value. The span
22+of `p` must nest within the span of `q`, or vice versa.
23+
24+### `:nock`, `.*`, "dottar", `{$nock p/twig q/twig}`
25+
26+The product: Nock of the formula produced by `q`, with the
27+subject produced by `p`. Typeless.
28+
29+### `:wish`, `.^`, "dotket", `{$wish p/moss q/twig}`
30+
31+The product: the noun `q` dereferenced in the Urbit global
32+namespace. The product must nest within the icon of `p`.
33+
34+Only available in user-level code. Not blocking except in
35+dojo-level code (blocks for a generator, fails if it would block
36+for an app).
docs/system/hoon/core/twig/syntax.mdnew file+20
@@ -0,0 +1,20 @@
1+---
2+sort: 1
3+---
4+
5+# Hoon syntax
6+
7+Hoon's semantics are simple, but unusual. Hoon's syntax is
8+complex, and unusual. Sorry.
9+
10+An excuse: the normal human brain doesn't have hardware support
11+for math, but it does have hardware support for syntax. Learning
12+math is harder than it looks. Learning syntax is easier.
13+
14+An explanation: the Hoon syntax is trying to solve three serious
15+problems in functional syntax design.
16+
17+Read the [motivation](motivation) if you care; or go straight to
18+the actual [design](design).
19+
20+<list></list>
docs/system/hoon/core/twig/syntax/design.mdnew file+297
@@ -0,0 +1,297 @@
1+# Design
2+
3+Because each twig stem has its own bulb, each has its own parser
4+rule. We'll describe these grammars as we go through the stems.
5+
6+But Hoon has a general syntax design with common principles and
7+regularities. We'll cover those here.
8+
9+## Glyphs and characters
10+
11+Hoon is a heavy punctuation user. To make ASCII great again,
12+we've mapped each punctuation glyph to a syllable:
13+
14+```
15+ ace [1 space] gal < pal (
16+ bar | gap [>1 space, nl] par )
17+ bas \ gar > sel [
18+ buc $ hax # sem ;
19+ cab _ hep - ser ]
20+ cen % kel { sig ~
21+ col : ker } soq '
22+ com , ket ^ tar *
23+ doq " lus + tec `
24+ dot . pam & tis =
25+ fas / pat @ wut ?
26+ zap !
27+```
28+
29+You don't need to memorize these glyph names, but it helps. Code
30+is often vocalized or subvocalized. "pal" is easier to say,
31+aloud or silently, then "left paren."
32+
33+Note that the list includes two separate whitespace forms: `ace`
34+for a single space, `gap` for 2+, comment or newline. Hoon
35+Besides `ace` versus `gap`, whitespace is not significant.
36+
37+Comments start with `::` and run to the end of the line. Hard
38+tab characters are illegal, and an 80-column right margin is
39+strongly encouraged. Really well-groomed Hoon uses a 55-column
40+code margin and puts a standard line comment at column 57.
41+
42+Hoon does not accept non-ASCII text in source files, except UTF-8
43+in quoted strings.
44+
45+## Tall and flat forms
46+
47+There are two kinds of Hoon expression syntax: *tall* and *flat*.
48+Most stems have both tall and flat forms. Tall twigs can contain
49+flat twigs, but not vice versa.
50+
51+Visually, a tall twig looks like a "statement" and a flat twig
52+like an "expression," preserving the attractive visual shape of
53+procedural code without the nasty side effects.
54+
55+## Regular and irregular forms
56+
57+Most stems have *regular forms*, which share a common design.
58+There is a regular flat form and a regular tall form; most stems
59+implement both. All tall forms are regular.
60+
61+Some twigs also have *irregular forms*, which follow no
62+principles at all. All irregular forms are flat.
63+
64+Some twigs (simple leafy ones) have *only* irregular forms.
65+
66+## Keywords versus runes
67+
68+A regular form starts with a *sigil*, which is either a
69+*keyword* or a *rune* -- at the programmer's choice.
70+
71+A *keyword* is `:` and then the stem label - eg, `:cons`.
72+
73+A *rune* is a pair of ASCII punctuation marks (a digraph) - eg,
74+`:-`. The first glyph in the rune indicates the category - eg,
75+`:` runes make cells. Runes can be pronounced by their glyphs or
76+by their stem -- for `:-`, you can say either "colhep" or "cons".
77+
78+Keywords may be less challenging for early learners. Rune style
79+is less cluttered and distracting for experienced programmers;
80+the system codebase is all in rune style. Beginners can start
81+with keywords and move to runes; start with runes and stick
82+with runes; or start with keywords and stick with keywords.
83+
84+Here's the FizzBuzz demo code, in idiomatic rune syntax. Compare
85+with the [original](../../demo).
86+
87+```
88+ |= end/atom
89+ =/ count 1
90+ |- ^- (list tape)
91+ ?: =(100 count) ~
92+ :_ $(count (add 1 count))
93+ ?: =(0 (mod count 15))
94+ "FizzBuzz"
95+ ?: =(0 (mod count 5))
96+ "Fizz"
97+ ?: =(0 (mod count 3))
98+ "Buzz"
99+ (text !>(count))
100+```
101+
102+## Tall regular form
103+
104+Tall regular form starts with the sigil, followed by a `gap`
105+(any whitespace except `ace`), followed by a bulb whose twigs are
106+separated by `gap`.
107+
108+There are four body subtypes: *fixed*, *running*, *jogging*, and
109+*battery*. Stems with a *fixed* number of subexpressions
110+self-terminate. For instance, `:if` has three subexpressions and
111+is self-terminating. Otherwise the twig is terminated by a
112+`gap`, then either `==` (*running* or *jogging*, most twigs) or
113+`--` (*battery*).
114+
115+The *running* body is a list of twigs. The *jogging* body is a
116+list of twig pairs, separated by a `gap`. The *battery* body is
117+a list of symbol-twig pairs, separated by a gap, prefixed by `++`
118+and then a gap.
119+
120+This definition is enough to parse. But the proper shape of the
121+whitespace gaps demands an informal convention.
122+
123+Whitespace design in Hoon is an art, not a science. It involves
124+both tall/flat mode switches and well-shaped gaps. (Hoon layout
125+could probably be done automatically with reasonable quality.
126+But it would at least take machine learning, not a rule engine.)
127+
128+There only two real *rules* in Hoon whitespace design: don't
129+go past 80 characters, and don't use (completely) blank lines.
130+Otherwise, if it looks good and is easy to read, it's good. But
131+the best way to learn the art is to do everything by convention
132+until you know what you're doing. Here are the conventions:
133+
134+### Conventions: *fixed*
135+
136+Bulbs with *fixed* fanout use "backstep" indentation, which slopes
137+backward and to the right by two spaces per line. The first
138+child is two spaces after the end of the sigil.
139+
140+Some *1-fixed*, *2-fixed*, *3-fixed* and *4-fixed* examples:
141+
142+```
143+|.
144+p
145+
146+=| p
147+q
148+
149+?: p
150+ q
151+r
152+
153+%^ p
154+ q
155+ r
156+s
157+```
158+
159+The hope of backstep indentation is that the heaviest twigs are
160+at the bottom, keeping code flow vertical rather than diagonal.
161+Alternate, reversing
162+
163+### Conventions: *running*
164+
165+A *running* bulb (a simple child list) puts the first child two
166+spaces after the end of the sigil, and the following children
167+straight down:
168+
169+A *running* example:
170+
171+```
172+:* p
173+ q
174+ r
175+ s
176+ t
177+==
178+```
179+
180+### Conventions: *jogging*
181+
182+A *jogging* bulb (a list of child pairs) is like a running bulb,
183+but backsteps the head of the pair above the tail. Most jogging
184+twigs start with a *fixed* sequence; the first jogging pair is
185+below and two steps backward from the last fixed child.
186+
187+There are two jogging conventions: *flat* (pair on one line) and
188+*tall* (pair split across lines).
189+
190+A *flat jogging* example (preceded by *1-fixed* `p`)
191+
192+```
193+?- p
194+ q r
195+ s t
196+ u v
197+==
198+```
199+
200+A *tall jogging* example (preceded by *1-fixed* `p`):
201+
202+```
203+?- p
204+ q
205+ r
206+ s
207+ t
208+ u
209+ v
210+==
211+```
212+
213+### Conventions: *battery*
214+
215+A *battery* bulb is a list of symbol-twig pairs, for the battery
216+of a core. A conventional example:
217+
218+```
219+|%
220+++ foo
221+ p
222+++ bar
223+ q
224+--
225+```
226+
227+## Flat regular form
228+
229+Flat regular form starts with the sigil, followed by `pal`
230+(`(`, left parenthesis), followed by a bulb whose subexpressions
231+are separated by `ace` (one space), followed by `par` (`)`, right
232+parenthesis).
233+
234+A twig in flat form, `:if`, `?:`, `{$if p/twig q/twig r/twig}`:
235+
236+```
237+:if(p q r)
238+
239+?:(p q r)
240+```
241+
242+The only exception is *jogging* bodies, in which subexpression
243+pairs are separated by commas:
244+
245+```
246+:make(foo bar 42, baz 55, moo 17)
247+```
248+
249+There is no flat regular form for *battery* bodies. Be tall.
250+
251+## Naming conventions
252+
253+Hoon does not enforce any rule on symbols, except that capitals
254+are not allowed (use kebab-case). However, a lot of system code
255+is written in using "lapidary" conventions that need explanation.
256+
257+Naming things is one of the hard problems in CS. Dodging this
258+problem is one of the reasons mathematicians use Greek letters,
259+not variable names. Meaningful names also interpose a verbal
260+interpretation, distracting at best and confusing at worst, on
261+the formula or algorithm. Greek letters are not *meaningful*,
262+but they are *memorable*. And their interpretation is defined by
263+the formula and nothing else.
264+
265+### Lapidary and ultralapidary
266+
267+In the *lapidary* naming style, labels are pronounceable
268+three-letter strings, usually CVC (consonant-vowel-consonant).
269+Sometimes they encode a mnemonic, but usually they are just
270+memorable. Labels are reused wherever the analogy seems
271+appropriate.
272+
273+In the *ultralapidary* naming style, labels are single letters,
274+starting in order of construction from `a`, or within a tuple
275+mold `p`. Hoon uses single-letter names for the same reason
276+Algol style languages pass arguments by order, rather than
277+keyword. Naming items by order makes sense when there are no
278+more than three or four; five is stretching it; six is too many.
279+
280+For example, when defining `add`, we want to name the operands
281+`a` and `b`. It's silly to call them `foo` and `bar`, let alone
282+`left-operand` and `right-operand`. The smaller the scale of an
283+algorithm, the simpler its names should be.
284+
285+### When in doubt, don't be lapidary
286+
287+This works in the other direction: namelessness doesn't scale.
288+Most normal code shouldn't use lapidary naming at all. (There is
289+too much lapidary Hoon in Urbit.)
290+
291+Lapidary naming is only for *inherently simple code*: code that
292+both aspires to high elegance and clarity, and *is solving a
293+simple and elegant problem*.
294+
295+Given an ugly or complex problem, lapidary naming is a liability,
296+no matter the excellence of the programmer. When in doubt, use
297+long names and/or kebab-case.
docs/system/hoon/core/twig/syntax/motivation.mdnew file+56
@@ -0,0 +1,56 @@
1+# Motivation
2+
3+The three problems are *terminator piles*, *indentation creep*,
4+and *feature/label confusion*.
5+
6+## Terminator piles
7+
8+*Terminator piles* are like Lisp's stacks of right parens. If a
9+syntax uses matching glyphs besides `)`, they get truly ugly.
10+Significant whitespace solves this problem but introduces others.
11+
12+Hoon has no terminator piles. Except for a 1-space / more-space
13+distinction, it has no significant whitespace.
14+
15+## Indentation creep
16+
17+*Indentation creep* is a problem caused by indentation conventions
18+where the indentation point is a function of expression tree
19+depth. It's true that short functions are better than long ones,
20+but long ones sometimes need to be written.
21+
22+A procedural block has a backbone of statements which flows
23+straight down. Most expressions are flat and of limited depth.
24+With some bulging, a long function flows *down* the page.
25+
26+A functional language lacks the expression/statement distinction.
27+So a long function means a deep tree. Given normal indentation
28+conventions, a long function wants to flow *down and across*.
29+This *diagonal* shape fits poorly into most editor windows.
30+
31+Thanks to backstep indentation (see below), Hoon programs are
32+shaped more or less like procedural programs.
33+
34+## Feature/label confusion
35+
36+*Feature/label confusion* is any syntax which makes it hard for
37+the eye to tell whether a token on the screen is a feature of the
38+language, or a label in the program. For example, in Lisp a
39+special form has the same syntax as a function call.
40+
41+The worst-case result of FLC is "DSL cancer". Every source file
42+is effectively written in its own domain-specific language. To
43+read a new file is to learn a new language -- "write-only code."
44+
45+A fixed reserved-word set, especially with syntax highlighting,
46+and especially with orthogonal grammar (in C, you don't write
47+`for(a b c)`), may not be too bad. User-level macros, operator
48+overloading, even excessive use of higher-order programming,
49+can all lead quickly to the tragedy of write-only code.
50+
51+Hoon has very weak FLC in keyword style, none in rune style.
52+It has no user-level macros or overloading. It does support
53+higher-order programming; write-only Hoon can certainly be
54+(and has been) written. But good Hoon style is to avoid it.
55+
56+
docs/system/hoon/core/twig/test.mdnew file+143
@@ -0,0 +1,143 @@
1+---
2+sort: 9
3+---
4+
5+# Tests (`?` runes)
6+
7+Hoon has the usual branches and logical tests. For pattern
8+matching, it also has a `$fits` twig that tests whether a value
9+matches the icon of a mold. And it has branch inference,
10+learning from `$fits` tests in the condition of `:if` twigs.
11+
12+## Overview
13+
14+All `?` runes expand to `$if` (`?:`) and/or `$fits` (`?=`).
15+
16+If the condition of an `$if` is a `$fits`, *and* the `$fits` is
17+testing a leg of the subject, the compile specializes the subject
18+span for the branches of the `$if`. Branch inference also works
19+for twigs which expand to `$if`.
20+
21+The test does not have to be a single `$fits`; the compiler can
22+analyze arbitrary boolean logic (`$and`, `$or`, `$not`) with full
23+short-circuiting. Equality tests (`=`) are *not* analyzed.
24+
25+If the compiler detects that the branch is degenerate (only one
26+side is taken), it fails with an error.
27+
28+## Regular forms
29+
30+The rune prefix is `?`. Suffixes: `=` for `:fits`, `:` for
31+`:if`, `.` for `:lest`, `-` for `:case`, `+` for `:deft`, `|` for
32+`:or`, `&` for `:and`, `!` for `:not`, `>` for `$sure`, `<` for
33+`$deny`, `^` for `:ifcl`, `@` for `:ifat`, `~` for `:ifno`.
34+
35+### `:fits`, `?=`, "wuttis", `{$fits p/moss q/twig}`
36+
37+Syntax: *2-fixed*.
38+
39+The product: `&` if the product of `q` is in the icon of `p`,
40+`|` otherwise.
41+
42+The icon of `p` must be finite / nonrecursive. In general,
43+always match one layer of a data structure at a time.
44+
45+### `:if`, `?:`, "wutcol", `{$if p/twig q/twig r/twig}`
46+
47+Syntax: *3-fixed*.
48+
49+The product: `q` if `p` has the value `&` (0), `r` for `|` (1).
50+`p` must be statically boolean.
51+
52+### `:lest`, `?.`, "wutdot", `{$lest p/twig q/twig r/twig}`
53+
54+Syntax: *3-fixed*.
55+
56+Expands to: `:if(p r q)`.
57+
58+### `:case`, `?-`, "wuthep", `{$case p/twig q/(list (pair moss twig))}`
59+
60+Syntax: *1-fixed*, then *jogging*.
61+
62+Expands by:
63+
64+```
65+|-(?~(q [%lost p] [%if [%fits p.i.q p] q.i.q $(q t.q)]))
66+```
67+
68+A pattern-matching switch. Fails to compile if the pattern is
69+incomplete or irrelevant.
70+
71+### `:deft`, `?+`, "wutlus", `{$case p/twig q/twig r/(list (pair moss twig))}`
72+
73+Syntax: *1-fixed*, then *jogging*.
74+
75+Expands by: `[%case p (weld r [[%base %noun] q])]`
76+
77+A pattern-matching switch, with default.
78+
79+### `:or`, `?|`, "wutbar", `{$or p/(list twig)}`
80+
81+Syntax: *running*.
82+
83+Expands by: `|-(?~(p [%rock %f |] [%if i.p [%rock %f &]] $(p t.p)))`
84+
85+Logical or (`&` (`0`) is yes, `|` (`1`) is no).
86+
87+### `:and`, `?&`, "wutpam", `{$and p/(list twig)}`
88+
89+Syntax: *running*.
90+
91+Expands by: `|-(?~(p [%rock %f &] [%if i.p $(p t.p) [%rock %f |]]))`
92+
93+Logical and (`&` (`0`) is yes, `|` (`1`) is no).
94+
95+### `:not`, `?!`, "wutzap", `{$not p/twig}`
96+
97+Syntax: *1-fixed*.
98+
99+Expands to: `:if(p %| %&)`.
100+
101+Logical not (`&` (`0`) is yes, `|` (`1`) is no).
102+
103+### `:sure`, `?>`, "wutgar", `{$sure p/twig q/twig}`
104+
105+Expands to: `:if(p q !!)`.
106+
107+An assertion.
108+
109+### `:deny`, `?<`, "wutgal", `{$deny p/twig q/twig}`
110+
111+Expands to: `:if(p !! q)`.
112+
113+A negative assertion.
114+
115+### `:ifno`, `?~`, "wutsig", `{$ifno p/twig q/twig r/twig}`
116+
117+Expands to: `:if(:fits($~ p) q r)`.
118+
119+Branches on whether `p` is null.
120+
121+### `:ifat`, `?@`, "wutpat", `{$ifat p/twig q/twig r/twig}`
122+
123+Expands to: `:if(:fits(@ p) q r)`.
124+
125+Branches on whether `p` is atomic.
126+
127+### `:ifcl`, `?^`, "wutket", `{$ifat p/twig q/twig r/twig}`
128+
129+Expands to: `:if(:fits(^ p) q r)`.
130+
131+Branches on whether `p` is cellular.
132+
133+## Irregular forms
134+
135+### Light logic
136+
137+Translations:
138+
139+```
140+&(a b c) ?&(a b c)
141+|(a b c) ?|(a b c)
142+!a ?!(a)
143+```
docs/system/hoon/library/src/1a/gate/add.md+1−1
@@ -7,7 +7,7 @@ Produces the sum of `a` and `b`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12`b` is an atom.
12`b` is an atom.
13
13
docs/system/hoon/library/src/1a/gate/dec.md+2−3
@@ -7,7 +7,7 @@ Decrements `a` by `1`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12Produces
12Produces
13--------
13--------
@@ -19,14 +19,13 @@ Source
19
19
20 ++ dec :: decrement
20 ++ dec :: decrement
21 ~/ %dec
21 ~/ %dec
22− |= a=@
22+ |= a/@
23 ~| %decrement-underflow
23 ~| %decrement-underflow
24 ?< =(0 a)
24 ?< =(0 a)
25 =+ b=0
25 =+ b=0
26 |- ^- @
26 |- ^- @
27 ?: =(a +(b)) b
27 ?: =(a +(b)) b
28 $(b +(b))
28 $(b +(b))
29− ::
30
29
31Examples
30Examples
32--------
31--------
docs/system/hoon/library/src/1a/gate/div.md+2−2
@@ -7,9 +7,9 @@ Computes `a` divided by `b`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12−`b` is an [atom]().
12+`b` is an atom.
13
13
14Produces
14Produces
15--------
15--------
docs/system/hoon/library/src/1a/gate/gte.md+3−3
@@ -7,7 +7,7 @@ Tests whether `a` is greater than a number `b`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -21,10 +21,10 @@ Source
21
21
22 ++ gte :: greater-equal
22 ++ gte :: greater-equal
23 ~/ %gte
23 ~/ %gte
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
25 ^- ?
25 ^- ?
26 !(lth a b)
26 !(lth a b)
27− ::
27+
28
28
29Examples
29Examples
30--------
30--------
docs/system/hoon/library/src/1a/gate/gth.md+4−3
@@ -7,7 +7,7 @@ Tests whether `a` is greater than `b`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -21,10 +21,11 @@ Source
21
21
22 ++ gth :: greater-than
22 ++ gth :: greater-than
23 ~/ %gth
23 ~/ %gth
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
25 ^- ?
25 ^- ?
26 !(lte a b)
26 !(lte a b)
27− ::
27+
28+
28
29
29Examples
30Examples
30--------
31--------
docs/system/hoon/library/src/1a/gate/lte.md+3−2
@@ -7,7 +7,7 @@ Tests whether `a` is less than or equal to `b`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -21,8 +21,9 @@ Source
21
21
22 ++ lte :: less-equal
22 ++ lte :: less-equal
23 ~/ %lte
23 ~/ %lte
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
25 |(=(a b) (lth a b))
25 |(=(a b) (lth a b))
26+
26 ::
27 ::
27
28
28Examples
29Examples
docs/system/hoon/library/src/1a/gate/lth.md+5−6
@@ -21,15 +21,14 @@ Source
21
21
22 ++ lth :: less-than
22 ++ lth :: less-than
23 ~/ %lth
23 ~/ %lth
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
25 ^- ?
25 ^- ?
26− ?& !=(a b)
26+ ?& !=(a b)
27− |-
27+ |-
28− ?| =(0 a)
28+ ?| =(0 a)
29− ?& !=(0 b)
29+ ?& !=(0 b)
30 $(a (dec a), b (dec b))
30 $(a (dec a), b (dec b))
31 == == ==
31 == == ==
32− ::
33
32
34Examples
33Examples
35--------
34--------
docs/system/hoon/library/src/1a/gate/max.md+2−3
@@ -7,7 +7,7 @@ Computes the greater of `a` and `b`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -21,11 +21,10 @@ Source
21
21
22 ++ max :: maximum
22 ++ max :: maximum
23 ~/ %max
23 ~/ %max
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
25 ^- @
25 ^- @
26 ?: (gth a b) a
26 ?: (gth a b) a
27 b
27 b
28− ::
29
28
30Examples
29Examples
31--------
30--------
docs/system/hoon/library/src/1a/gate/min.md+3−4
@@ -7,7 +7,7 @@ Computes the lesser of `a` and `b`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -21,12 +21,11 @@ Source
21
21
22 ++ min :: minimum
22 ++ min :: minimum
23 ~/ %min
23 ~/ %min
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
25 ^- @
25 ^- @
26 ?: (lth a b) a
26 ?: (lth a b) a
27 b
27 b
28− ::
28+
29−
30Examples
29Examples
31--------
30--------
32
31
docs/system/hoon/library/src/1a/gate/mod.md+3−3
@@ -7,7 +7,7 @@ Computes the remainder of dividing `a` by `b`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -21,11 +21,11 @@ Source
21
21
22 ++ mod :: remainder
22 ++ mod :: remainder
23 ~/ %mod
23 ~/ %mod
24− |= [a=@ b=@]
24+ |: [a=`@`1 b=`@`1]
25 ^- @
25 ^- @
26 ?< =(0 b)
26 ?< =(0 b)
27 (sub a (mul b (div a b)))
27 (sub a (mul b (div a b)))
28− ::
28+
29
29
30Examples
30Examples
31--------
31--------
docs/system/hoon/library/src/1a/gate/mul.md+3−4
@@ -7,7 +7,7 @@ Multiplies `a` by `b`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -21,14 +21,13 @@ Source
21
21
22 ++ mul :: multiply
22 ++ mul :: multiply
23 ~/ %mul
23 ~/ %mul
24− |= [a=@ b=@]
24+ |: [a=`@`1 b=`@`1]
25 ^- @
25 ^- @
26 =+ c=0
26 =+ c=0
27 |-
27 |-
28 ?: =(0 a) c
28 ?: =(0 a) c
29 $(a (dec a), c (add b c))
29 $(a (dec a), c (add b c))
30− ::
30+
31−
32Examples
31Examples
33--------
32--------
34
33
docs/system/hoon/library/src/1a/gate/sub.md+9−9
@@ -7,9 +7,9 @@ Subtracts `b` from `a`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12−`b` is an [atom]().
12+`b` is an atom.
13
13
14Produces
14Produces
15--------
15--------
@@ -19,13 +19,13 @@ An atom.
19Source
19Source
20------
20------
21
21
22− ++ sub :: subtract
22+ ++ sub :: subtract
23− ~/ %sub
23+ ~/ %sub
24− |= [a=@ b=@]
24+ |= [a=@ b=@]
25− ~| %subtract-underflow
25+ ~| %subtract-underflow
26− ^- @
26+ ^- @
27− ?: =(0 b) a
27+ ?: =(0 b) a
28− $(a (dec a), b (dec b))
28+ $(a (dec a), b (dec b))
29
29
30Examples
30Examples
31--------
31--------
docs/system/hoon/library/src/1b/gate/cap.md+14−14
@@ -2,8 +2,8 @@
2
2
3Tree head
3Tree head
4
4
5−Tests whether an `a` is in the head or tail of a [noun](). Produces the
5+Tests whether an `a` is in the head or tail of a noun. Produces the
6−[cube]() `%2` if it is within the head, or the cube `%3` if it is
6+cube `%2` if it is within the head, or the cube `%3` if it is
7within the tail.
7within the tail.
8
8
9Accepts
9Accepts
@@ -14,22 +14,22 @@ Accepts
14Produces
14Produces
15--------
15--------
16
16
17−A [cube]().
17+A cube.
18
18
19Source
19Source
20------
20------
21
21
22− ++ cap :: tree head
22+ ++ cap :: tree head
23− ~/ %cap
23+ ~/ %cap
24− |= a=@
24+ |= a=@
25− ^- ?(%2 %3)
25+ ^- ?(%2 %3)
26− ?- a
26+ ?- a
27− %2 %2
27+ %2 %2
28− %3 %3
28+ %3 %3
29− ?(%0 %1) !!
29+ ?(%0 %1) !!
30− * $(a (div a 2))
30+ * $(a (div a 2))
31− ==
31+ ==
32− ::
32+ ::
33
33
34Examples
34Examples
35--------
35--------
docs/system/hoon/library/src/1b/gate/mas.md+11−11
@@ -17,17 +17,17 @@ An atom.
17Source
17Source
18------
18------
19
19
20− ++ mas :: tree body
20+ ++ mas :: tree body
21− ~/ %mas
21+ ~/ %mas
22− |= a=@
22+ |= a=@
23− ^- @
23+ ^- @
24− ?- a
24+ ?- a
25− 1 !!
25+ 1 !!
26− 2 1
26+ 2 1
27− 3 1
27+ 3 1
28− * (add (mod a 2) (mul $(a (div a 2)) 2))
28+ * (add (mod a 2) (mul $(a (div a 2)) 2))
29− ==
29+ ==
30− ::
30+ ::
31
31
32Examples
32Examples
33--------
33--------
docs/system/hoon/library/src/1b/gate/peg.md+5−6
@@ -7,7 +7,7 @@ Computes the axis of `b` within axis `a`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -21,15 +21,14 @@ Source
21
21
22 ++ peg :: tree connect
22 ++ peg :: tree connect
23 ~/ %peg
23 ~/ %peg
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
25 ^- @
25 ^- @
26 ?- b
26 ?- b
27− 1 a
27+ $1 a
28− 2 (mul a 2)
28+ $2 (mul a 2)
29− 3 +((mul a 2))
29+ $3 +((mul a 2))
30 * (add (mod b 2) (mul $(b (div b 2)) 2))
30 * (add (mod b 2) (mul $(b (div b 2)) 2))
31 ==
31 ==
32− ::
33
32
34Examples
33Examples
35--------
34--------
docs/system/hoon/library/src/1c/mold/bloq.md+1−2
@@ -4,11 +4,10 @@ Blocksize
4
4
5Atom representing a blocksize, by convention expressed as a power of 2.
5Atom representing a blocksize, by convention expressed as a power of 2.
6
6
7−
8Source
7Source
9------
8------
10
9
11− ++ bloq ,@ :: blockclass
10+ ++ bloq @ :: blockclass
12
11
13Examples
12Examples
14--------
13--------
docs/system/hoon/library/src/1c/mold/each.md+7−6
@@ -2,20 +2,21 @@
2
2
3Mold of fork between two
3Mold of fork between two
4
4
5−[mold]() generator: produces a dicriminated [fork]() between two types.
5+mold generator: produces a dicriminated fork between two types.
6
6
7Source
7Source
8------
8------
9
9
10− ++ each |*([a=$+(* *) b=$+(* *)] $%([& p=a] [| p=b])) :: either a or b
10+ ++ each
11+ |* {a/$-(* *) b/$-(* *)} :: either a or b
12+ $%({$& p/a} {$| p/b}) :: a default
13+
11
14
12Examples
15Examples
13--------
16--------
14
17
15− ~zod/try=> :type; *(each cord time)
18+ > ? *(each cord time)
19+ ?({$.y p/@t} {$.n p/@da})
16 [%.y p='']
20 [%.y p='']
17− {[%.y p=@t] [%.n p=@da]}
18−
19−
20
21
21***
22***
docs/system/hoon/library/src/1c/mold/gate.md+9−11
@@ -3,28 +3,26 @@
3Function
3Function
4
4
5A core with one arm, `$`--the empty name--which transforms a sample noun into a product
5A core with one arm, `$`--the empty name--which transforms a sample noun into a product
6−noun. If used [dryly]() as a type, the [subject]() must have a sample type of [`*`]().
6+noun. If used dryly as a type, the subject must have a sample type of `*`.
7
7
8
8
9Source
9Source
10------
10------
11
11
12− ++ gate $+(* *) :: general gate
12+ ++ gate $-(* *) :: general gate
13+
13
14
14Examples
15Examples
15--------
16--------
16
17
17−See also: [`++lift`](), [`++cork`]()
18+See also: `++lift`, `++cork`
18
19
19− ~zod/try=> *gate
20+ > ? gate
20− <1|mws [* <101.jzo 1.ypj %164>]>
21+ <1.ybc {* <110.jyx 1.ztu $151>}>
21− ~zod/try=> `gate`|=(* 0)
22+ <1.ybc {* <110.jyx 1.ztu $151>}>
22− <1|mws [* <101.jzo 1.ypj %164>]>
23
23
24− ~zod/try=> (|=(a=* [a 'b']) 'c')
25− [99 'b']
26− ~zod/try=> (`gate`|=(a=* [a 'b']) 'c')
24+ > (`gate`|=(a/* [a 'b']) 1)
27− [99 98]
25+ [1 'b']
28
26
29
27
30
28
docs/system/hoon/library/src/1c/mold/list.md+9−7
@@ -2,26 +2,28 @@
2
2
3List
3List
4
4
5−[mold]() generator. `++list` generates a mold of a null-termanated list of a
5+mold generator. `++list` generates a mold of a null-termanated list of a
6homogenous type.
6homogenous type.
7
7
8
8
9Source
9Source
10------
10------
11
11
12− ++ list |* a=_,* :: null-term list
12+ ++ list |* a/$-(* *) :: null-term list
13+ $@($~ {i/a t/(list a)}) ::
14+
13
15
14Examples
16Examples
15--------
17--------
16
18
17−See also: [`++turn`](), [`++snag`]()
19+See also: `++turn`, `++snag`
18
20
19− ~zod/try=> *(list)
21+ > *(list)
20 ~
22 ~
21− ~zod/try=> `(list ,@)`"abc"
23+ > `(list @)`"abc"
22 ~[97 98 99]
24 ~[97 98 99]
23− ~zod/try=> (snag 0 "abc")
25+ > (snag 0 "abc")
24− ~~a
26+ 'a'
25
27
26
28
27
29
docs/system/hoon/library/src/1c/mold/lone.md+2−4
@@ -1,14 +1,12 @@
1### `++lone`
1### `++lone`
2
2
3−Tile generator. `++lone` puts face of `p` on something.
3+`++lone` puts face of `p` on something.
4
4
5XX unused
5XX unused
6
6
7Source
7Source
8------
8------
9
9
10− ++ lone |*(a=$+(* *) ,p=a) :: just one thing
10+ ++ lone |*(a/$-(* *) p/a) :: just one thing
11−
12−
13
11
14***
12***
docs/system/hoon/library/src/1c/mold/pair.md+3−2
@@ -2,13 +2,14 @@
2
2
3Mold of pair of types
3Mold of pair of types
4
4
5−[mold]() generator. Produces a tuple of two of the types passed in.
5+mold generator. Produces a tuple of two of the types passed in.
6
6
7
7
8Source
8Source
9------
9------
10
10
11− ++ pair |*([a=$+(* *) b=$+(* *)] ,[p=a q=b]) :: just a pair
11+ ++ pair |*({a/$-(* *) b/$-(* *)} {p/a q/b}) :: just a pair
12+
12
13
13
14
14Examples
15Examples
docs/system/hoon/library/src/1c/mold/pole.md+5−2
@@ -2,12 +2,15 @@
2
2
3Faceless list
3Faceless list
4
4
5−A [`++list`]() without the [face]()s `i` and `t`.
5+A `++list` without the faces `i` and `t`.
6
6
7Source
7Source
8------
8------
9
9
10− ++ pole |* a=_,* :: nameless list
10+ ++ pole |* a/$-(* *) :: nameless list
11+ $@($~ {a (pole a)}) ::
12+
13+
11
14
12Examples
15Examples
13--------
16--------
docs/system/hoon/library/src/1c/mold/qual.md+3−2
@@ -7,7 +7,8 @@ A `++qual` is a tuple of four of the types passed in.
7Source
7Source
8------
8------
9
9
10− ++ qual |* [a=$+(* *) b=$+(* *) c=$+(* *) d=$+(* *)] :: just a quadruple
10+ ++ qual |* {a/$-(* *) b/$-(* *) c/$-(* *) d/$-(* *)} :: just a quadruple
11+ {p/a q/b r/c s/d} ::
11
12
12Examples
13Examples
13--------
14--------
@@ -17,4 +18,4 @@ Examples
17
18
18
19
19
20
20−***
21+ ***
docs/system/hoon/library/src/1c/mold/trap.md+3−4
@@ -2,18 +2,17 @@
2
2
3Core with one arm `$`
3Core with one arm `$`
4
4
5−A trap is a core with one arm `++$`. Used when XX
5+A trap is a core with one arm `++$`.
6
6
7Source
7Source
8------
8------
9
9
10− ++ trap ,_|.(_*) :: makes perfect sense
10+ ++ trap |*(a/_* _|?(*a)) :: makes perfect sense
11+
11
12
12Examples
13Examples
13--------
14--------
14
15
15−See also: `|.`
16−
17 ~zod/try=> *trap
16 ~zod/try=> *trap
18 <1.mws 101.jzo 1.ypj %164>
17 <1.mws 101.jzo 1.ypj %164>
19 ~zod/try=> (*trap)
18 ~zod/try=> (*trap)
docs/system/hoon/library/src/1c/mold/tree.md+4−2
@@ -8,12 +8,14 @@ left/right sub `++tree` of the same type. Pretty-printed with `{}`.
8Source
8Source
9------
9------
10
10
11− ++ tree |* a=_,* :: binary tree
11+ ++ tree |* a/$-(* *) :: binary tree
12+ $@($~ {n/a l/(tree a) r/(tree a)}) ::
13+
12
14
13Examples
15Examples
14--------
16--------
15
17
16− ~zod/try=> `(tree ,[@ tape])`[[1 "hi"] [[2 "bye"] ~ ~] ~]
18+ ~zod/try=> `(tree {@ tape})`[[1 "hi"] [[2 "bye"] ~ ~] ~]
17 {[2 "bye"] [1 "hi"]}
19 {[2 "bye"] [1 "hi"]}
18
20
19
21
docs/system/hoon/library/src/1c/mold/trel.md+5−3
@@ -2,17 +2,19 @@
2
2
3Mold of three types
3Mold of three types
4
4
5−[`++mold`]() of the tuple of the three types passed in.
5+`++mold` of the tuple of the three types passed in.
6
6
7Source
7Source
8------
8------
9
9
10− ++ trel |* [a=$+(* *) b=$+(* *) c=$+(* *)] :: just a triple
10+ ++ trel |* {a/$-(* *) b/$-(* *) c/$-(* *)} :: just a triple
11+ {p/a q/b r/c} ::
12+
11
13
12Examples
14Examples
13--------
15--------
14
16
15− ~zod/try=> *(trel ,@ud ,@t ,@s)
17+ ~zod/try=> *(trel @ud @t @s)
16 [p=0 q='' r=--0]
18 [p=0 q='' r=--0]
17
19
18
20
docs/system/hoon/library/src/1c/mold/unit.md+13−7
@@ -2,26 +2,32 @@
2
2
3Maybe
3Maybe
4
4
5−[mold]() generator. A `++unit` is either `~` or `[~ u=a]` where `a` is the
5+mold generator. A `++unit` is either `~` or `[~ u=a]` where `a` is the
6type that was passed in.
6type that was passed in.
7
7
8
8
9Source
9Source
10------
10------
11
11
12− ++ unit |* a=_,* :: maybe
12+ ++ unit |* a/$-(* *) :: maybe
13+ $@($~ {$~ u/a}) ::
14+
13
15
14Examples
16Examples
15--------
17--------
16
18
17−See also: [`++bind`]()
19+See also: `++bind`
18
20
19− ~zod/try=> :type; *(unit time)
21+ ~zod/try=> ? *(unit time)
22+ ?({$~ u/@da} $~)
20 ~
23 ~
21− u(@da)
22− ~zod/try=> `(unit time)`[~ -<-]
23− [~ ~2014.9.24..19.25.10..7dd5]
24
24
25+ ~zod/try=> > =a |= a/@
26+ ^- (unit @)
27+ ?~ a ~
28+ [~ a]
29+ > (a 2)
30+ [~ u=2]
25
31
26
32
27***
33***
docs/system/hoon/library/src/2a/gate/biff.md+5−4
@@ -2,7 +2,7 @@
2
2
3Unit as argument
3Unit as argument
4
4
5−Applies a function `b` that produces a unit to the unwrapped value of [++unit]()
5+Applies a function `b` that produces a unit to the unwrapped value of ++unit
6`a` (`u.a`). If `a` is empty, `~` is produced.
6`a` (`u.a`). If `a` is empty, `~` is produced.
7
7
8Accepts
8Accepts
@@ -21,16 +21,17 @@ Source
21------
21------
22
22
23 ++ biff :: apply
23 ++ biff :: apply
24− |* [a=(unit) b=$+(* (unit))]
24+ |* {a/(unit) b/$-(* (unit))}
25 ?~ a ~
25 ?~ a ~
26 (b u.a)
26 (b u.a)
27
27
28+
28Examples
29Examples
29--------
30--------
30
31
31− ~zod/try=> (biff (some 5) |=(a=@ (some (add a 2))))
32+ ~zod/try=> (biff (some 5) |=(a/@ (some (add a 2))))
32 [~ u=7]
33 [~ u=7]
33− ~zod/try=> (biff ~ |=(a=@ (some (add a 2))))
34+ ~zod/try=> (biff ~ |=(a/@ (some (add a 2))))
34 ~
35 ~
35
36
36
37
docs/system/hoon/library/src/2a/gate/bind.md+6−5
@@ -2,7 +2,7 @@
2
2
3Non-unit function to unit, producing unit
3Non-unit function to unit, producing unit
4
4
5−Applies a function `b` to the value (`u.a`) of a [++unit]() `a`, producing
5+Applies a function `b` to the value (`u.a`) of a ++unit `a`, producing
6a unit. Used when you want a function that does not accept or produce a
6a unit. Used when you want a function that does not accept or produce a
7unit to both accept and produce a unit.
7unit to both accept and produce a unit.
8
8
@@ -22,17 +22,18 @@ Source
22------
22------
23
23
24 ++ bind :: argue
24 ++ bind :: argue
25− |* [a=(unit) b=gate]
25+ |* {a/(unit) b/gate}
26 ?~ a ~
26 ?~ a ~
27 [~ u=(b u.a)]
27 [~ u=(b u.a)]
28
28
29+
29Examples
30Examples
30--------
31--------
31
32
32− ~zod/try=> (bind ((unit ,@) [~ 97]) ,@t)
33+ ~zod/try=> (bind ((unit @) [~ 97]) ,@t)
33 [~ `a`]
34 [~ `a`]
34− ~zod/try=> =a |=(a=@ (add a 1))
35+ ~zod/try=> =a |=(a/@ (add a 1))
35− ~zod/try=> (bind ((unit ,@) [~ 2]) a)
36+ ~zod/try=> (bind ((unit @) [~ 2]) a)
36 [~ 3]
37 [~ 3]
37
38
38
39
docs/system/hoon/library/src/2a/gate/bond.md+4−3
@@ -2,7 +2,7 @@
2
2
3Replace null
3Replace null
4
4
5−Replaces an empty [++unit]() `b` with the product of a called [trap]()
5+Replaces an empty ++unit `b` with the product of a called trap
6`a`. If the unit is not empty, then the original unit is produced.
6`a`. If the unit is not empty, then the original unit is produced.
7
7
8Accepts
8Accepts
@@ -21,11 +21,12 @@ Source
21------
21------
22
22
23 ++ bond :: replace
23 ++ bond :: replace
24− |* a=trap
24+ |* a/(trap)
25− |* b=(unit)
25+ |* b/(unit)
26 ?~ b $:a
26 ?~ b $:a
27 u.b
27 u.b
28
28
29+
29Examples
30Examples
30--------
31--------
31
32
docs/system/hoon/library/src/2a/gate/both.md+3−2
@@ -3,7 +3,7 @@
3Group unit values into pair
3Group unit values into pair
4
4
5Produces `~` if either `a` or `b` are empty. Otherwise, produces a
5Produces `~` if either `a` or `b` are empty. Otherwise, produces a
6−[++unit]() whose value is a cell of the values of two input units `a` and
6+++unit whose value is a cell of the values of two input units `a` and
7`b`.
7`b`.
8
8
9Accepts
9Accepts
@@ -22,11 +22,12 @@ Source
22------
22------
23
23
24 ++ both :: all the above
24 ++ both :: all the above
25− |* [a=(unit) b=(unit)]
25+ |* {a/(unit) b/(unit)}
26 ?~ a ~
26 ?~ a ~
27 ?~ b ~
27 ?~ b ~
28 [~ u=[u.a u.b]]
28 [~ u=[u.a u.b]]
29
29
30+
30Examples
31Examples
31--------
32--------
32
33
docs/system/hoon/library/src/2a/gate/clap.md+7−6
@@ -2,7 +2,7 @@
2
2
3Apply function to two units
3Apply function to two units
4
4
5−Applies a binary function `c`--which does not usually accept or produce a [`++unit`]()--
5+Applies a binary function `c`--which does not usually accept or produce a `++unit`--
6to the values of two units, `a` and `b`, producing a unit.
6to the values of two units, `a` and `b`, producing a unit.
7
7
8Accepts
8Accepts
@@ -23,20 +23,21 @@ Source
23------
23------
24
24
25 ++ clap :: combine
25 ++ clap :: combine
26− |* [a=(unit) b=(unit) c=_|=(^ +<-)]
26+ |* {a/(unit) b/(unit) c/_|=(^ +<-)}
27 ?~ a b
27 ?~ a b
28 ?~ b a
28 ?~ b a
29 [~ u=(c u.a u.b)]
29 [~ u=(c u.a u.b)]
30
30
31+
31Examples
32Examples
32--------
33--------
33
34
34− ~zod/try=> =u ((unit ,@t) [~ 'a'])
35+ ~zod/try=> =u ((unit @t) [~ 'a'])
35− ~zod/try=> =v ((unit ,@t) [~ 'b'])
36+ ~zod/try=> =v ((unit @t) [~ 'b'])
36 ~zod/try=> (clap u v |=([a=@t b=@t] (welp (trip a) (trip b))))
37 ~zod/try=> (clap u v |=([a=@t b=@t] (welp (trip a) (trip b))))
37 [~ u="ab"]
38 [~ u="ab"]
38− ~zod/try=> =a ((unit ,@u) [~ 1])
39+ ~zod/try=> =a ((unit @u) [~ 1])
39− ~zod/try=> =b ((unit ,@u) [~ 2])
40+ ~zod/try=> =b ((unit @u) [~ 2])
40 ~zod/try=> =c |=([a=@ b=@] (add a b))
41 ~zod/try=> =c |=([a=@ b=@] (add a b))
41 ~zod/try=> (clap a b c)
42 ~zod/try=> (clap a b c)
42 [~ 3]
43 [~ 3]
docs/system/hoon/library/src/2a/gate/drop.md+5−4
@@ -2,7 +2,7 @@
2
2
3Unit to list
3Unit to list
4
4
5−Makes a [++list]() of the unwrapped value (`u.a`) of a [`++unit`]() `a`.
5+Makes a ++list of the unwrapped value (`u.a`) of a `++unit` `a`.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -18,17 +18,18 @@ Source
18------
18------
19
19
20 ++ drop :: enlist
20 ++ drop :: enlist
21− |* a=(unit)
21+ |* a/(unit)
22 ?~ a ~
22 ?~ a ~
23 [i=u.a t=~]
23 [i=u.a t=~]
24
24
25+
25Examples
26Examples
26--------
27--------
27
28
28− ~zod/try=> =a ((unit ,@) [~ 97])
29+ ~zod/try=> =a ((unit @) [~ 97])
29 ~zod/try=> (drop a)
30 ~zod/try=> (drop a)
30 [i=97 t=~]
31 [i=97 t=~]
31− ~zod/try=> =a ((unit ,@) [~])
32+ ~zod/try=> =a ((unit @) [~])
32 ~zod/try=> (drop a)
33 ~zod/try=> (drop a)
33 ~
34 ~
34
35
docs/system/hoon/library/src/2a/gate/fall.md+4−3
@@ -2,14 +2,14 @@
2
2
3Give unit a default value
3Give unit a default value
4
4
5−Produces a default value `b` for a [`++unit`]() `a` in cases where `a` is null.
5+Produces a default value `b` for a `++unit` `a` in cases where `a` is null.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10`a` is a unit.
10`a` is a unit.
11
11
12−`b` is a [noun]() that's used as the default value.
12+`b` is a noun that's used as the default value.
13
13
14Produces
14Produces
15--------
15--------
@@ -20,9 +20,10 @@ Source
20------
20------
21
21
22 ++ fall :: default
22 ++ fall :: default
23− |* [a=(unit) b=*]
23+ |* {a/(unit) b/*}
24 ?~(a b u.a)
24 ?~(a b u.a)
25
25
26+
26Examples
27Examples
27--------
28--------
28
29
docs/system/hoon/library/src/2a/gate/lift.md+6−5
@@ -2,7 +2,7 @@
2
2
3Curried bind
3Curried bind
4
4
5−Accepts a [`++gate`]() `a` and produces a function that accepts [`++unit`]()
5+Accepts a `++gate` `a` and produces a function that accepts `++unit`
6`b` to which it applies `a`. Used when you want a function that does not accept
6`b` to which it applies `a`. Used when you want a function that does not accept
7or produce a unit to both accept and produce a unit.
7or produce a unit to both accept and produce a unit.
8
8
@@ -22,16 +22,17 @@ Source
22------
22------
23
23
24 ++ lift :: lift gate (fmap)
24 ++ lift :: lift gate (fmap)
25− |* a=gate :: flipped
25+ |* a/gate :: flipped
26− |* b=(unit) :: curried
26+ |* b/(unit) :: curried
27 (bind b a) :: bind
27 (bind b a) :: bind
28
28
29+
29Examples
30Examples
30--------
31--------
31
32
32− ~zod/try=> ((lift dec) `(unit ,@)`~)
33+ ~zod/try=> ((lift dec) `(unit @)`~)
33 ~
34 ~
34− ~zod/try=> ((lift dec) `(unit ,@)`[~ 20])
35+ ~zod/try=> ((lift dec) `(unit @)`[~ 20])
35 [~ 19]
36 [~ 19]
36
37
37
38
docs/system/hoon/library/src/2a/gate/mate.md+12−11
@@ -23,25 +23,26 @@ A unit or crash.
23Source
23Source
24------
24------
25
25
26−++ mate :: choose
26+ ++ mate :: choose
27− |* [a=(unit) b=(unit)]
27+ |* {a/(unit) b/(unit)}
28− ?~ b a
28+ ?~ b a
29− ?~ a b
29+ ?~ a b
30− ?.(=(u.a u.b) ~|('mate' !!) a)
30+ ?.(=(u.a u.b) ~|('mate' !!) a)
31+
31
32
32Examples
33Examples
33--------
34--------
34
35
35− ~zod/try=> =a ((unit ,@) [~ 97])
36+ ~zod/try=> =a ((unit @) [~ 97])
36− ~zod/try=> =b ((unit ,@) [~ 97])
37+ ~zod/try=> =b ((unit @) [~ 97])
37 ~zod/try=> (mate a b)
38 ~zod/try=> (mate a b)
38 [~ 97]
39 [~ 97]
39− ~zod/try=> =a ((unit ,@) [~ 97])
40+ ~zod/try=> =a ((unit @) [~ 97])
40− ~zod/try=> =b ((unit ,@) [~])
41+ ~zod/try=> =b ((unit @) [~])
41 ~zod/try=> (mate a b)
42 ~zod/try=> (mate a b)
42 [~ 97]
43 [~ 97]
43− ~zod/try=> =a ((unit ,@) [~ 97])
44+ ~zod/try=> =a ((unit @) [~ 97])
44− ~zod/try=> =b ((unit ,@) [~ 98])
45+ ~zod/try=> =b ((unit @) [~ 98])
45 ~zod/try=> (mate a b)
46 ~zod/try=> (mate a b)
46 ! 'mate'
47 ! 'mate'
47 ! exit
48 ! exit
docs/system/hoon/library/src/2a/gate/need.md+7−6
@@ -2,7 +2,7 @@
2
2
3Unwrap unit
3Unwrap unit
4
4
5−Retrieve the value from a [`++unit`]() and crash if the unit is null.
5+Retrieve the value from a `++unit` and crash if the unit is null.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -18,20 +18,21 @@ Source
18------
18------
19
19
20 ++ need :: demand
20 ++ need :: demand
21− |* a=(unit)
21+ |* a/(unit)
22− ?~ a !!
22+ ?~ a ~|(%need !!)
23 u.a
23 u.a
24
24
25+
25Examples
26Examples
26--------
27--------
27
28
28− ~zod/try=> =a ((unit ,[@t @t]) [~ ['a' 'b']])
29+ ~zod/try=> =a ((unit [@t @t]) [~ ['a' 'b']])
29 ~zod/try=> (need a)
30 ~zod/try=> (need a)
30 ['a' 'b']
31 ['a' 'b']
31− ~zod/try=> =a ((unit ,@ud) [~ 17])
32+ ~zod/try=> =a ((unit @ud) [~ 17])
32 ~zod/try=> (need a)
33 ~zod/try=> (need a)
33 17
34 17
34− ~zod/try=> =a ((unit ,@) [~])
35+ ~zod/try=> =a ((unit @) [~])
35 ~zod/try=> (need a)
36 ~zod/try=> (need a)
36 ! exit
37 ! exit
37
38
docs/system/hoon/library/src/2b/gate/flop.md+2−1
@@ -19,7 +19,7 @@ Source
19
19
20 ++ flop :: reverse
20 ++ flop :: reverse
21 ~/ %flop
21 ~/ %flop
22− |* a=(list)
22+ |* a/(list)
23 => .(a (homo a))
23 => .(a (homo a))
24 ^+ a
24 ^+ a
25 =+ b=`_a`~
25 =+ b=`_a`~
@@ -28,6 +28,7 @@ Source
28 $(a t.a, b [i.a b])
28 $(a t.a, b [i.a b])
29
29
30
30
31+
31Examples
32Examples
32--------
33--------
33
34
docs/system/hoon/library/src/2b/gate/homo.md+4−3
@@ -2,7 +2,7 @@
2
2
3Homogenize
3Homogenize
4
4
5−Produces a [`++list`]() whose type is a fork of all the contained types in the
5+Produces a `++list` whose type is a fork of all the contained types in the
6list `a`. Used when you want to make all the types of the elements of a list the same.
6list `a`. Used when you want to make all the types of the elements of a list the same.
7
7
8Accepts
8Accepts
@@ -19,12 +19,13 @@ Source
19------
19------
20
20
21 ++ homo :: homogenize
21 ++ homo :: homogenize
22− |* a=(list)
22+ |* a/(list)
23 ^+ =< $
23 ^+ =< $
24− |% +- $ ?:(_? ~ [i=(snag 0 a) t=$])
24+ |% +- $ ?:(*? ~ [i=(snag 0 a) t=$])
25 --
25 --
26 a
26 a
27
27
28+
28Examples
29Examples
29--------
30--------
30
31
docs/system/hoon/library/src/2b/gate/lent.md+4−3
@@ -2,7 +2,7 @@
2
2
3List length
3List length
4
4
5−Produces the length of any [`++list`]() `a` as an atom.
5+Produces the length of any `++list` `a` as an atom.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -19,13 +19,14 @@ Source
19
19
20 ++ lent :: length
20 ++ lent :: length
21 ~/ %lent
21 ~/ %lent
22− |= a=(list)
22+ |= a/(list)
23 ^- @
23 ^- @
24 =+ b=0
24 =+ b=0
25 |-
25 |-
26− ?~ a b
26+ ?~ a b
27 $(a t.a, b +(b))
27 $(a t.a, b +(b))
28
28
29+
29Examples
30Examples
30--------
31--------
31
32
docs/system/hoon/library/src/2b/gate/levy.md+7−4
@@ -2,7 +2,7 @@
2
2
3Logical "and" on list
3Logical "and" on list
4
4
5−Computes the Boolean logical "and" on the results of [gate]() `b` applied to each individual element in [`++list`]() `a`.
5+Computes the Boolean logical "and" on the results of gate `b` applied to each individual element in `++list` `a`.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -14,24 +14,27 @@ Accepts
14Produces
14Produces
15--------
15--------
16
16
17+A boolean.
18+
17Source
19Source
18------
20------
19
21
20 ++ levy
22 ++ levy
21 ~/ %levy :: all of
23 ~/ %levy :: all of
22− |* [a=(list) b=_|=(p=* .?(p))]
24+ |* {a/(list) b/$-(* ?)}
23 |- ^- ?
25 |- ^- ?
24 ?~ a &
26 ?~ a &
25 ?. (b i.a) |
27 ?. (b i.a) |
26 $(a t.a)
28 $(a t.a)
27
29
30+
28Examples
31Examples
29--------
32--------
30
33
31− ~zod/try=> =a |=(a=@ (lte a 1))
34+ ~zod/try=> =a |=(a/@ (lte a 1))
32 ~zod/try=> (levy (limo [0 1 2 1 ~]) a)
35 ~zod/try=> (levy (limo [0 1 2 1 ~]) a)
33 %.n
36 %.n
34− ~zod/try=> =a |=(a=@ (lte a 3))
37+ ~zod/try=> =a |=(a/@ (lte a 3))
35 ~zod/try=> (levy (limo [0 1 2 1 ~]) a)
38 ~zod/try=> (levy (limo [0 1 2 1 ~]) a)
36 %.y
39 %.y
37
40
docs/system/hoon/library/src/2b/gate/lien.md+16−7
@@ -2,19 +2,28 @@
2
2
3Logical "or" on list
3Logical "or" on list
4
4
5+Computes the Boolean logical "or" on the results of applying [gate]() `b` to every element of [`++list`]() `a`.
6+
7+Accepts
8+-------
9+
10+`a` is a list.
11+
12+`b` is a gate.
13+
14+Source
15+------
16+
5 ++ lien :: some of
17 ++ lien :: some of
6 ~/ %lien
18 ~/ %lien
7− |* [a=(list) b=$+(* ?)]
19+ |* {a/(list) b/$-(* ?)}
8 |- ^- ?
20 |- ^- ?
9 ?~ a |
21 ?~ a |
10 ?: (b i.a) &
22 ?: (b i.a) &
11 $(a t.a)
23 $(a t.a)
12−
24+
13−Computes the Boolean logical "or" on the results of applying [gate]() `b` to every element of [`++list`]() `a`.
25+Examples
14−
26+--------
15−`a` is a list.
16−
17−`b` is a gate.
18
27
19 ~zod/try=> =a |=(a=@ (gte a 1))
28 ~zod/try=> =a |=(a=@ (gte a 1))
20 ~zod/try=> (lien (limo [0 1 2 1 ~]) a)
29 ~zod/try=> (lien (limo [0 1 2 1 ~]) a)
docs/system/hoon/library/src/2b/gate/limo.md+1−1
@@ -12,7 +12,7 @@ Accepts
12Produces
12Produces
13--------
13--------
14
14
15−A list
15+A `++list`.
16
16
17Source
17Source
18------
18------
docs/system/hoon/library/src/2b/gate/murn.md+6−5
@@ -2,16 +2,16 @@
2
2
3Maybe transform
3Maybe transform
4
4
5−Passes each member of [`++list`]() `a` to [gate]() `b`, which must produce a
5+Passes each member of `++list` `a` to gate `b`, which must produce a
6−[`++unit`](). Produces a new list with all the results that do not produce
6+`++unit`. Produces a new list with all the results that do not produce
7`~`.
7`~`.
8
8
9Accepts
9Accepts
10-------
10-------
11
11
12−`a` is a [list]().
12+`a` is a list.
13
13
14−`b` is a [gate]() that produces a [unit]().
14+`b` is a gate that produces a unit.
15
15
16Produces
16Produces
17--------
17--------
@@ -22,7 +22,8 @@ Source
22------
22------
23
23
24 ++ murn :: maybe transform
24 ++ murn :: maybe transform
25+ ~/ %murn
25− |* [a=(list) b=$+(* (unit))]
26+ |* {a/(list) b/$-(* (unit))}
26 |-
27 |-
27 ?~ a ~
28 ?~ a ~
28 =+ c=(b i.a)
29 =+ c=(b i.a)
docs/system/hoon/library/src/2b/gate/reap.md+5−4
@@ -2,12 +2,12 @@
2
2
3Replicate
3Replicate
4
4
5−Replicate: produces a [`++list`]() containing `a` copies of `b`.
5+Replicate: produces a `++list` containing `a` copies of `b`.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`b` is a [noun]()
10+`b` is a noun.
11
11
12Produces
12Produces
13--------
13--------
@@ -18,8 +18,9 @@ Source
18------
18------
19
19
20 ++ reap :: replicate
20 ++ reap :: replicate
21+ ~/ %reap
21− |* [a=@ b=*]
22+ |* {a/@ b/*}
22− |- ^- (list ,_b)
23+ |- ^- (list _b)
23 ?~ a ~
24 ?~ a ~
24 [b $(a (dec a))]
25 [b $(a (dec a))]
25
26
docs/system/hoon/library/src/2b/gate/reel.md+6−5
@@ -2,8 +2,8 @@
2
2
3Right fold
3Right fold
4
4
5−Right fold: moves right to left across a [`++list`]() `a`, recursively slamming
5+Right fold: moves right to left across a `++list` `a`, recursively slamming
6−a binary [gate]() `b` with an element from `a` and an accumulator, producing
6+a binary gate `b` with an element from `a` and an accumulator, producing
7the final value of the accumulator.
7the final value of the accumulator.
8
8
9Accepts
9Accepts
@@ -14,19 +14,20 @@ Accepts
14Produces
14Produces
15--------
15--------
16
16
17−The accumulator, which is a [noun]().
17+The accumulator, which is a noun.
18
18
19Source
19Source
20------
20------
21
21
22− ++ reel :: right fold
22+ ++ reel :: right fold
23 ~/ %reel
23 ~/ %reel
24− |* [a=(list) b=_|=([* *] +<+)]
24+ |* {a/(list) b/_|=({* *} +<+)}
25 |- ^+ +<+.b
25 |- ^+ +<+.b
26 ?~ a
26 ?~ a
27 +<+.b
27 +<+.b
28 (b i.a $(a t.a))
28 (b i.a $(a t.a))
29
29
30+
30Examples
31Examples
31--------
32--------
32
33
docs/system/hoon/library/src/2b/gate/skid.md+6−4
@@ -2,8 +2,8 @@
2
2
3Separate
3Separate
4
4
5−Separates a [`++list`]() `a` into two lists - Those elements of `a` who produce
5+Separates a `++list` `a` into two lists - Those elements of `a` who produce
6−true when slammed to [gate]() `b` and those who produce `%.n`.
6+true when slammed to gate `b` and those who produce `%.n`.
7
7
8Accepts
8Accepts
9-------
9-------
@@ -19,17 +19,19 @@ Source
19------
19------
20
20
21 ++ skid :: separate
21 ++ skid :: separate
22+ ~/ %skid
22− |* [a=(list) b=$+(* ?)]
23+ |* {a/(list) b/$-(* ?)}
23 |- ^+ [p=a q=a]
24 |- ^+ [p=a q=a]
24 ?~ a [~ ~]
25 ?~ a [~ ~]
25 =+ c=$(a t.a)
26 =+ c=$(a t.a)
26 ?:((b i.a) [[i.a p.c] q.c] [p.c [i.a q.c]])
27 ?:((b i.a) [[i.a p.c] q.c] [p.c [i.a q.c]])
27
28
28
29
30+
29Examples
31Examples
30--------
32--------
31
33
32− ~zod/try=> =a |=(a=@ (gth a 1))
34+ ~zod/try=> =a |=(a/@ (gth a 1))
33 ~zod/try=> (skid (limo [0 1 2 3 ~]) a)
35 ~zod/try=> (skid (limo [0 1 2 3 ~]) a)
34 [p=[i=2 t=[i=3 t=~]] q=[i=0 t=[i=1 t=~]]]
36 [p=[i=2 t=[i=3 t=~]] q=[i=0 t=[i=1 t=~]]]
35
37
docs/system/hoon/library/src/2b/gate/skim.md+12−9
@@ -9,26 +9,29 @@ producing a list of all of the members that produce `%.y`. Inverse of
9Accepts
9Accepts
10-------
10-------
11
11
12−`b` is a [gate]() that accepts one argument and produces a loobean.
12+`b` is a gate that accepts one argument and produces a boolean.
13
13
14Produces
14Produces
15--------
15--------
16
16
17+A boolean
18+
17Source
19Source
18------
20------
19
21
20−++ skim :: only
22+ ++ skim :: only
21− ~/ %skim
23+ ~/ %skim
22− |* [a=(list) b=_|=(p=* .?(p))]
24+ |* {a/(list) b/$-(* ?)}
23− |-
25+ |-
24− ^+ a`
26+ ^+ a
25− ?~ a ~
27+ ?~ a ~
26− ?:((b i.a) [i.a $(a t.a)] $(a t.a))
28+ ?:((b i.a) [i.a $(a t.a)] $(a t.a))
29+
27
30
28Examples
31Examples
29--------
32--------
30
33
31− ~zod/try=> =a |=(a=@ (gth a 1))
34+ ~zod/try=> =a |=(a/@ (gth a 1))
32 ~zod/try=> (skim (limo [0 1 2 3 ~]) a)
35 ~zod/try=> (skim (limo [0 1 2 3 ~]) a)
33 [i=2 t=[i=3 t=~]]
36 [i=2 t=[i=3 t=~]]
34
37
docs/system/hoon/library/src/2b/gate/skip.md+5−4
@@ -2,14 +2,14 @@
2
2
3Except
3Except
4
4
5−Cycles through the members of [`++list`]() `a`, passing them to a [gate]() `b`.
5+Cycles through the members of `++list` `a`, passing them to a gate `b`.
6Produces a list of all of the members that produce `%.n`. Inverse of
6Produces a list of all of the members that produce `%.n`. Inverse of
7`++skim`.
7`++skim`.
8
8
9Accepts
9Accepts
10-------
10-------
11
11
12−`b` is a [gate]() that accepts one argument and produces a loobean.
12+`b` is a gate that accepts one argument and produces a loobean.
13
13
14Produces
14Produces
15--------
15--------
@@ -21,16 +21,17 @@ Source
21
21
22 ++ skip :: except
22 ++ skip :: except
23 ~/ %skip
23 ~/ %skip
24− |* [a=(list) b=_|=(p=* .?(p))]
24+ |* {a/(list) b/$-(* ?)}
25 |-
25 |-
26 ^+ a
26 ^+ a
27 ?~ a ~
27 ?~ a ~
28 ?:((b i.a) $(a t.a) [i.a $(a t.a)])
28 ?:((b i.a) $(a t.a) [i.a $(a t.a)])
29
29
30+
30Examples
31Examples
31--------
32--------
32
33
33− ~zod/try=> =a |=(a=@ (gth a 1))
34+ ~zod/try=> =a |=(a/@ (gth a 1))
34 ~zod/try=> (skip (limo [0 1 2 3 ~]) a)
35 ~zod/try=> (skip (limo [0 1 2 3 ~]) a)
35 [i=0 t=[i=1 t=~]]
36 [i=0 t=[i=1 t=~]]
36
37
docs/system/hoon/library/src/2b/gate/slag.md+3−2
@@ -8,7 +8,7 @@ Accepts an atom `a` and list `b`, producing the remaining elements from
8Accepts
8Accepts
9-------
9-------
10
10
11−`b` is a [list]().
11+`b` is a list.
12
12
13Produces
13Produces
14--------
14--------
@@ -20,12 +20,13 @@ Source
20
20
21 ++ slag :: suffix
21 ++ slag :: suffix
22 ~/ %slag
22 ~/ %slag
23− |* [a=@ b=(list)]
23+ |* {a/@ b/(list)}
24 |- ^+ b
24 |- ^+ b
25 ?: =(0 a) b
25 ?: =(0 a) b
26 ?~ b ~
26 ?~ b ~
27 $(b t.b, a (dec a))
27 $(b t.b, a (dec a))
28
28
29+
29Examples
30Examples
30--------
31--------
31
32
docs/system/hoon/library/src/2b/gate/snag.md+4−3
@@ -2,13 +2,13 @@
2
2
3Index
3Index
4
4
5−Accepts an atom `a` and a [`++list`]() `b`, producing the element at the index
5+Accepts an atom `a` and a `++list` `b`, producing the element at the index
6of `a`and failing if the list is null. Lists are 0-indexed.
6of `a`and failing if the list is null. Lists are 0-indexed.
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`b` is a [list]().
11+`b` is a list.
12
12
13Produces
13Produces
14--------
14--------
@@ -20,13 +20,14 @@ Source
20
20
21 ++ snag :: index
21 ++ snag :: index
22 ~/ %snag
22 ~/ %snag
23− |* [a=@ b=(list)]
23+ |* {a/@ b/(list)}
24 |-
24 |-
25 ?~ b
25 ?~ b
26 ~|('snag-fail' !!)
26 ~|('snag-fail' !!)
27 ?: =(0 a) i.b
27 ?: =(0 a) i.b
28 $(b t.b, a (dec a))
28 $(b t.b, a (dec a))
29
29
30+
30Examples
31Examples
31--------
32--------
32
33
docs/system/hoon/library/src/2b/gate/sort.md+7−6
@@ -2,7 +2,7 @@
2
2
3Quicksort
3Quicksort
4
4
5−Quicksort: accepts a [`++list`]() `a` and a [gate]() `b` which accepts two nouns and
5+Quicksort: accepts a `++list` `a` and a gate `b` which accepts two nouns and
6produces a loobean. `++sort` then produces a list of the elements of `a`,
6produces a loobean. `++sort` then produces a list of the elements of `a`,
7sorted according to `b`.
7sorted according to `b`.
8
8
@@ -19,21 +19,22 @@ A list
19Source
19Source
20------
20------
21
21
22− ++ sort :: quicksort
22+ ++ sort !. :: quicksort
23 ~/ %sort
23 ~/ %sort
24− |* [a=(list) b=$+([* *] ?)]
24+ |* {a/(list) b/$-([* *] ?)}
25 => .(a ^.(homo a))
25 => .(a ^.(homo a))
26 |- ^+ a
26 |- ^+ a
27 ?~ a ~
27 ?~ a ~
28 %+ weld
28 %+ weld
29− $(a (skim t.a |=(c=_i.a (b c i.a))))
29+ $(a (skim t.a |=(c/_i.a (b c i.a))))
30 ^+ t.a
30 ^+ t.a
31− [i.a $(a (skim t.a |=(c=_i.a !(b c i.a))))]
31+ [i.a $(a (skim t.a |=(c/_i.a !(b c i.a))))]
32+
32
33
33Examples
34Examples
34--------
35--------
35
36
36− ~zod/try=> =a =|([p=@ q=@] |.((gth p q)))
37+ ~zod/try=> =a =|({p=@ q=@} |.((gth p q)))
37 ~zod/try=> (sort (limo [0 1 2 3 ~]) a)
38 ~zod/try=> (sort (limo [0 1 2 3 ~]) a)
38 ~[3 2 1 0]
39 ~[3 2 1 0]
39
40
docs/system/hoon/library/src/2b/gate/swag.md+4−3
@@ -8,7 +8,7 @@ inclusive index `a`, producing `b` number of characters.
8Accepts
8Accepts
9-------
9-------
10
10
11−`c` is a [list]().
11+`c` is a list.
12
12
13Produces
13Produces
14--------
14--------
@@ -19,8 +19,9 @@ Source
19------
19------
20
20
21 ++ swag :: infix
21 ++ swag :: infix
22− |* [[a=@ b=@] c=(list)]
22+ |* {{a/@ b/@} c/(list)}
23− (scag b (slag a c))
23+ (scag +<-> (slag +<-< c))
24+
24
25
25Examples
26Examples
26--------
27--------
docs/system/hoon/library/src/2b/gate/turn.md+4−3
@@ -2,7 +2,7 @@
2
2
3Gate to list
3Gate to list
4
4
5−Accepts a [`++list`]() `a` and a [gate]() `b`. Produces a list with the gate applied
5+Accepts a `++list` `a` and a gate `b`. Produces a list with the gate applied
6to each element of the original list.
6to each element of the original list.
7
7
8Accepts
8Accepts
@@ -20,17 +20,18 @@ Source
20
20
21 ++ turn :: transform
21 ++ turn :: transform
22 ~/ %turn
22 ~/ %turn
23− |* [a=(list) b=_,*]
23+ |* {a/(list) b/$-(* *)}
24 |-
24 |-
25 ?~ a ~
25 ?~ a ~
26 [i=(b i.a) t=$(a t.a)]
26 [i=(b i.a) t=$(a t.a)]
27
27
28+
28Examples
29Examples
29--------
30--------
30
31
31 ~zod/try=> (turn (limo [104 111 111 110 ~]) ,@t)
32 ~zod/try=> (turn (limo [104 111 111 110 ~]) ,@t)
32 <|h o o n|>
33 <|h o o n|>
33− ~zod/try=> =a |=(a=@ (add a 4))
34+ ~zod/try=> =a |=(a/@ (add a 4))
34 ~zod/try=> (turn (limo [1 2 3 4 ~]) a)
35 ~zod/try=> (turn (limo [1 2 3 4 ~]) a)
35 ~[5 6 7 8]
36 ~[5 6 7 8]
36
37
docs/system/hoon/library/src/2b/gate/weld.md+4−3
@@ -2,24 +2,25 @@
2
2
3Concatenate
3Concatenate
4
4
5−Concatenate two [`++list`]()s `a` and `b`.
5+Concatenate two `++list`s `a` and `b`.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` and `b` are [list]()s.
10+`a` and `b` are lists.
11
11
12Source
12Source
13------
13------
14
14
15 ++ weld :: concatenate
15 ++ weld :: concatenate
16 ~/ %weld
16 ~/ %weld
17− |* [a=(list) b=(list)]
17+ |* {a/(list) b/(list)}
18 => .(a ^.(homo a), b ^.(homo b))
18 => .(a ^.(homo a), b ^.(homo b))
19 |- ^+ b
19 |- ^+ b
20 ?~ a b
20 ?~ a b
21 [i.a $(a t.a)]
21 [i.a $(a t.a)]
22
22
23+
23Examples
24Examples
24--------
25--------
25
26
docs/system/hoon/library/src/2b/gate/welp.md+5−4
@@ -2,7 +2,7 @@
2
2
3Perfect weld
3Perfect weld
4
4
5−Concatenate two [`++list`]()s `a` and `b` without losing their type information
5+Concatenate two `++list`s `a` and `b` without losing their type information
6to homogenization.
6to homogenization.
7
7
8Accepts
8Accepts
@@ -21,7 +21,7 @@ Source
21------
21------
22
22
23 ++ welp :: perfect weld
23 ++ welp :: perfect weld
24− =| [* *]
24+ =| {* *}
25 |%
25 |%
26 +- $
26 +- $
27 ?~ +<-
27 ?~ +<-
@@ -29,6 +29,7 @@ Source
29 +<-(+ $(+<- +<->))
29 +<-(+ $(+<- +<->))
30 --
30 --
31
31
32+
32Examples
33Examples
33--------
34--------
34
35
@@ -36,10 +37,10 @@ Examples
36 "foobar"
37 "foobar"
37 ~zod/arvo=/hoon/hoon> (welp ~[60 61 62] ~[%a %b %c])
38 ~zod/arvo=/hoon/hoon> (welp ~[60 61 62] ~[%a %b %c])
38 [60 61 62 %a %b %c ~]
39 [60 61 62 %a %b %c ~]
39− ~zod/arvo=/hoon/hoon> :type; (welp ~[60 61 62] ~[%a %b %c])
40+ ~zod/arvo=/hoon/hoon>? (welp ~[60 61 62] ~[%a %b %c])
40 [60 61 62 %a %b %c ~]
41 [60 61 62 %a %b %c ~]
41 [@ud @ud @ud %a %b %c %~]
42 [@ud @ud @ud %a %b %c %~]
42− ~zod/arvo=/hoon/hoon> (welp [sa/1 so/2 ~] si/3)
43+ ~zod/arvo=/hoon/hoon> (welp [sa+1 so+2 ~] si/3)
43 [[%sa 1] [%so 2] %si 3]
44 [[%sa 1] [%so 2] %si 3]
44
45
45
46
docs/system/hoon/library/src/2b/gate/zing.md+3−1
@@ -2,7 +2,7 @@
2
2
3Cons
3Cons
4
4
5−Turns a [`++list`]() of lists into a single list by promoting the elements of
5+Turns a `++list` of lists into a single list by promoting the elements of
6each sublist into the higher.
6each sublist into the higher.
7
7
8Accepts
8Accepts
@@ -27,6 +27,8 @@ Source
27 (welp +<- $(+< +<+))
27 (welp +<- $(+< +<+))
28 --
28 --
29
29
30+
31+
30Examples
32Examples
31--------
33--------
32
34
docs/system/hoon/library/src/2c/gate/bex.md+2−2
@@ -2,7 +2,7 @@
2
2
3Binary exponent
3Binary exponent
4
4
5−Computes the result of `2^a`, producing an [atom]().
5+Computes the result of `2^a`, producing an atom.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -19,7 +19,7 @@ Source
19
19
20 ++ bex :: binary exponent
20 ++ bex :: binary exponent
21 ~/ %bex
21 ~/ %bex
22− |= a=@
22+ |= a/@
23 ^- @
23 ^- @
24 ?: =(0 a) 1
24 ?: =(0 a) 1
25 (mul 2 $(a (dec a)))
25 (mul 2 $(a (dec a)))
docs/system/hoon/library/src/2c/gate/can.md+4−4
@@ -3,16 +3,16 @@
3
3
4Assemble
4Assemble
5
5
6−Produces an [atom]() from a list `b` of length-value pairs `p` and `q`,
6+Produces an atom from a list `b` of length-value pairs `p` and `q`,
7where `p` is the length in bloqs of size `a`, and `q` is an atomic
7where `p` is the length in bloqs of size `a`, and `q` is an atomic
8value.
8value.
9
9
10Accepts
10Accepts
11-------
11-------
12
12
13−`a` is a block size (see [`++bloq`]()).
13+`a` is a block size (see `++bloq`).
14
14
15−`b` is a [`++list`]() of length value pairs, `p` and `q`.
15+`b` is a `++list` of length value pairs, `p` and `q`.
16
16
17Produces
17Produces
18--------
18--------
@@ -24,7 +24,7 @@ Source
24
24
25 ++ can :: assemble
25 ++ can :: assemble
26 ~/ %can
26 ~/ %can
27− |= [a=bloq b=(list ,[p=@ q=@])]
27+ |= [a/bloq b/(list [p=@ q=@])]
28 ^- @
28 ^- @
29 ?~ b 0
29 ?~ b 0
30 (mix (end a p.i.b q.i.b) (lsh a p.i.b $(b t.b)))
30 (mix (end a p.i.b q.i.b) (lsh a p.i.b $(b t.b)))
docs/system/hoon/library/src/2c/gate/cat.md+4−3
@@ -2,13 +2,13 @@
2
2
3Concatenate
3Concatenate
4
4
5−Concatenates two [atom]()s, `b` and `c`, according to bloq size `a`, producing an
5+Concatenates two atoms, `b` and `c`, according to bloq size `a`, producing an
6atom.
6atom.
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`a` is a block size (see [`++bloq`]()).
11+`a` is a block size (see `++bloq`).
12
12
13`b` is an atom.
13`b` is an atom.
14
14
@@ -24,9 +24,10 @@ Source
24
24
25 ++ cat :: concatenate
25 ++ cat :: concatenate
26 ~/ %cat
26 ~/ %cat
27− |= [a=bloq b=@ c=@]
27+ |= {a/bloq b/@ c/@}
28 (add (lsh a (met a b) c) b)
28 (add (lsh a (met a b) c) b)
29
29
30+
30Examples
31Examples
31--------
32--------
32
33
docs/system/hoon/library/src/2c/gate/cut.md+3−3
@@ -7,9 +7,9 @@ Slices `c` blocks of size `a` that are `b` blocks from the end of `d`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a block size (see [++bloq]()).
10+`a` is a block size (see ++bloq).
11
11
12−`b` is an [atom]().
12+`b` is an atom.
13
13
14`c` is an atom.
14`c` is an atom.
15
15
@@ -23,7 +23,7 @@ Source
23
23
24 ++ cut :: slice
24 ++ cut :: slice
25 ~/ %cut
25 ~/ %cut
26− |= [a=bloq [b=@ c=@] d=@]
26+ |= {a/bloq {b/@u c/@u} d/@}
27 (end a c (rsh a b d))
27 (end a c (rsh a b d))
28
28
29Examples
29Examples
docs/system/hoon/library/src/2c/gate/end.md+5−4
@@ -2,16 +2,16 @@
2
2
3Tail
3Tail
4
4
5−Produces an [atom]() by taking the last `b` blocks of size `a` from `c`.
5+Produces an atom by taking the last `b` blocks of size `a` from `c`.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
11
11
12`b` is an atom.
12`b` is an atom.
13
13
14−`c` is an [atom]().
14+`c` is an atom.
15
15
16Produces
16Produces
17--------
17--------
@@ -24,9 +24,10 @@ Source
24
24
25 ++ end :: tail
25 ++ end :: tail
26 ~/ %end
26 ~/ %end
27− |= [a=bloq b=@ c=@]
27+ |= {a/bloq b/@u c/@}
28 (mod c (bex (mul (bex a) b)))
28 (mod c (bex (mul (bex a) b)))
29
29
30+
30Examples
31Examples
31--------
32--------
32
33
docs/system/hoon/library/src/2c/gate/fil.md+5−4
@@ -2,16 +2,16 @@
2
2
3Fill bloqstream
3Fill bloqstream
4
4
5−Produces an [atom]() by repeating `c` for `b` blocks of size `a`.
5+Produces an atom by repeating `c` for `b` blocks of size `a`.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
11
11
12`b` is an atom.
12`b` is an atom.
13
13
14−`c` is an [atom]().
14+`c` is an atom.
15
15
16Produces
16Produces
17--------
17--------
@@ -22,7 +22,7 @@ Source
22------
22------
23
23
24 ++ fil :: fill bloqstream
24 ++ fil :: fill bloqstream
25− |= [a=bloq b=@ c=@]
25+ |= {a/bloq b/@u c/@}
26 =+ n=0
26 =+ n=0
27 =+ d=c
27 =+ d=c
28 |- ^- @
28 |- ^- @
@@ -30,6 +30,7 @@ Source
30 (rsh a 1 d)
30 (rsh a 1 d)
31 $(d (add c (lsh a 1 d)), n +(n))
31 $(d (add c (lsh a 1 d)), n +(n))
32
32
33+
33Examples
34Examples
34--------
35--------
35
36
docs/system/hoon/library/src/2c/gate/lsh.md+4−3
@@ -2,12 +2,12 @@
2
2
3Left-shift
3Left-shift
4
4
5−Produces an [atom]() by left-shifting `c` by `b` blocks of size `a`.
5+Produces an atom by left-shifting `c` by `b` blocks of size `a`.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -23,9 +23,10 @@ Source
23
23
24 ++ lsh :: left-shift
24 ++ lsh :: left-shift
25 ~/ %lsh
25 ~/ %lsh
26− |= [a=bloq b=@ c=@]
26+ |= {a/bloq b/@u c/@}
27 (mul (bex (mul (bex a) b)) c)
27 (mul (bex (mul (bex a) b)) c)
28
28
29+
29Examples
30Examples
30--------
31--------
31
32
docs/system/hoon/library/src/2c/gate/met.md+3−3
@@ -2,9 +2,9 @@
2
2
3Measure
3Measure
4
4
5−Computes the number of blocks of size `a` in `b`, producing an [atom]().
5+Computes the number of blocks of size `a` in `b`, producing an atom.
6
6
7−`a` is a block size (see [`++bloq`]()).
7+`a` is a block size (see `++bloq`).
8
8
9`b` is an atom.
9`b` is an atom.
10
10
@@ -13,7 +13,7 @@ Source
13
13
14 ++ met :: measure
14 ++ met :: measure
15 ~/ %met
15 ~/ %met
16− |= [a=bloq b=@]
16+ |= {a/bloq b/@}
17 ^- @
17 ^- @
18 =+ c=0
18 =+ c=0
19 |-
19 |-
docs/system/hoon/library/src/2c/gate/rap.md+4−4
@@ -2,14 +2,14 @@
2
2
3Assemble non-zero
3Assemble non-zero
4
4
5−Concatenates a list of [atom]()s `b` using blocksize `a`, producing an atom.
5+Concatenates a list of atoms `b` using blocksize `a`, producing an atom.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
11
11
12−`b` is a [`++list`]() of [atom]()s.
12+`b` is a `++list` of atoms.
13
13
14Produces
14Produces
15--------
15--------
@@ -21,7 +21,7 @@ Source
21
21
22 ++ rap :: assemble nonzero
22 ++ rap :: assemble nonzero
23 ~/ %rap
23 ~/ %rap
24− |= [a=bloq b=(list ,@)]
24+ |= {a/bloq b/(list @)}
25 ^- @
25 ^- @
26 ?~ b 0
26 ?~ b 0
27 (cat a i.b $(b t.b))
27 (cat a i.b $(b t.b))
docs/system/hoon/library/src/2c/gate/rep.md+3−3
@@ -2,12 +2,12 @@
2
2
3Assemble single
3Assemble single
4
4
5−Produces an [atom]() by assembling a list of atoms `b` using block size `a`.
5+Produces an atom by assembling a list of atoms `b` using block size `a`.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
11
11
12`b` is a list of atoms.
12`b` is a list of atoms.
13
13
@@ -21,7 +21,7 @@ Source
21
21
22 ++ rep :: assemble single
22 ++ rep :: assemble single
23 ~/ %rep
23 ~/ %rep
24− |= [a=bloq b=(list ,@)]
24+ |= {a/bloq b/(list @)}
25 ^- @
25 ^- @
26 =+ c=0
26 =+ c=0
27 |-
27 |-
docs/system/hoon/library/src/2c/gate/rip.md+4−4
@@ -2,12 +2,12 @@
2
2
3Disassemble
3Disassemble
4
4
5−Produces a list of [atom]()s from the bits of `b` using block size `a`.
5+Produces a list of atoms from the bits of `b` using block size `a`.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -21,8 +21,8 @@ Source
21
21
22 ++ rip :: disassemble
22 ++ rip :: disassemble
23 ~/ %rip
23 ~/ %rip
24− |= [a=bloq b=@]
24+ |= {a/bloq b/@}
25− ^- (list ,@)
25+ ^- (list @)
26 ?: =(0 b) ~
26 ?: =(0 b) ~
27 [(end a 1 b) $(b (rsh a 1 b))]
27 [(end a 1 b) $(b (rsh a 1 b))]
28
28
docs/system/hoon/library/src/2c/gate/rsh.md+3−3
@@ -2,12 +2,12 @@
2
2
3Right-shift
3Right-shift
4
4
5−Right-shifts `c` by `b` blocks of size `a`, producing an [atom]().
5+Right-shifts `c` by `b` blocks of size `a`, producing an atom.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a block size (see [`++bloq`]()).
10+`a` is a block size (see `++bloq`).
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -23,7 +23,7 @@ Source
23
23
24 ++ rsh :: right-shift
24 ++ rsh :: right-shift
25 ~/ %rsh
25 ~/ %rsh
26− |= [a=bloq b=@ c=@]
26+ |= {a/bloq b/@u c/@}
27 (div c (bex (mul (bex a) b)))
27 (div c (bex (mul (bex a) b)))
28
28
29Examples
29Examples
docs/system/hoon/library/src/2c/gate/swp.md+3−3
@@ -2,14 +2,14 @@
2
2
3Reverse block order
3Reverse block order
4
4
5−Switches little endian to big and vice versa: produces an [atom]() by
5+Switches little endian to big and vice versa: produces an atom by
6reversing the block order of `b` using block size `a`.
6reversing the block order of `b` using block size `a`.
7
7
8
8
9Accepts
9Accepts
10-------
10-------
11
11
12−`a` is a block size (see [`++bloq`]()).
12+`a` is a block size (see `++bloq`).
13
13
14`b` is an atom.
14`b` is an atom.
15
15
@@ -21,7 +21,7 @@ An atom
21Source
21Source
22------
22------
23
23
24− ++ swap |=([a=bloq b=@] (rep a (flop (rip a b)))) :: reverse bloq order
24+ ++ swap |=({a/bloq b/@} (rep a (flop (rip a b)))) :: reverse bloq order
25
25
26Examples
26Examples
27--------
27--------
docs/system/hoon/library/src/2c/gate/xeb.md+3−3
@@ -2,7 +2,7 @@
2
2
3Binary logarithm
3Binary logarithm
4
4
5−Computes the base-2 logarithm of `a`, producing an [atom]().
5+Computes the base-2 logarithm of `a`, producing an atom.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -18,8 +18,8 @@ Source
18------
18------
19
19
20 ++ xeb :: binary logarithm
20 ++ xeb :: binary logarithm
21− :: ~/ %xeb
21+ ~/ %xeb
22− |= a=@
22+ |= a/@
23 ^- @
23 ^- @
24 (met 0 a)
24 (met 0 a)
25
25
docs/system/hoon/library/src/2d/gate/con.md+4−4
@@ -22,7 +22,7 @@ Source
22
22
23 ++ con :: binary or
23 ++ con :: binary or
24 ~/ %con
24 ~/ %con
25− |= [a=@ b=@]
25+ |= {a/@ b/@}
26 =+ [c=0 d=0]
26 =+ [c=0 d=0]
27 |- ^- @
27 |- ^- @
28 ?: ?&(=(0 a) =(0 b)) d
28 ?: ?&(=(0 a) =(0 b)) d
@@ -30,9 +30,9 @@ Source
30 a (rsh 0 1 a)
30 a (rsh 0 1 a)
31 b (rsh 0 1 b)
31 b (rsh 0 1 b)
32 c +(c)
32 c +(c)
33− d %+ add d
33+ d %+ add d
34− %^ lsh 0 c
34+ %^ lsh 0 c
35− ?& =(0 (end 0 1 a))
35+ ?& =(0 (end 0 1 a))
36 =(0 (end 0 1 b))
36 =(0 (end 0 1 b))
37 ==
37 ==
38 ==
38 ==
docs/system/hoon/library/src/2d/gate/dis.md+6−6
@@ -2,7 +2,7 @@
2
2
3Binary AND
3Binary AND
4
4
5−Computes the bit-wise logical AND of two [atom]()s `a` and `b`, producing an
5+Computes the bit-wise logical AND of two atoms `a` and `b`, producing an
6atom.
6atom.
7
7
8Accepts
8Accepts
@@ -22,17 +22,17 @@ Source
22
22
23 ++ dis :: binary and
23 ++ dis :: binary and
24 ~/ %dis
24 ~/ %dis
25− |= [a=@ b=@]
25+ |= {a/@ b/@}
26− =| [c=@ d=@]
26+ =| {c/@ d/@}
27 |- ^- @
27 |- ^- @
28 ?: ?|(=(0 a) =(0 b)) d
28 ?: ?|(=(0 a) =(0 b)) d
29 %= $
29 %= $
30 a (rsh 0 1 a)
30 a (rsh 0 1 a)
31 b (rsh 0 1 b)
31 b (rsh 0 1 b)
32 c +(c)
32 c +(c)
33− d %+ add d
33+ d %+ add d
34− %^ lsh 0 c
34+ %^ lsh 0 c
35− ?| =(0 (end 0 1 a))
35+ ?| =(0 (end 0 1 a))
36 =(0 (end 0 1 b))
36 =(0 (end 0 1 b))
37 ==
37 ==
38 ==
38 ==
docs/system/hoon/library/src/2d/gate/mix.md+2−2
@@ -2,7 +2,7 @@
2
2
3Binary XOR
3Binary XOR
4
4
5−Produces the bit-wise logical XOR of `a` and `b`, producing an [atom]().
5+Produces the bit-wise logical XOR of `a` and `b`, producing an atom.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -21,7 +21,7 @@ Source
21
21
22 ++ mix :: binary xor
22 ++ mix :: binary xor
23 ~/ %mix
23 ~/ %mix
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
25 ^- @
25 ^- @
26 =+ [c=0 d=0]
26 =+ [c=0 d=0]
27 |-
27 |-
docs/system/hoon/library/src/2d/gate/not.md+4−3
@@ -8,9 +8,9 @@ of `c`.
8Accepts
8Accepts
9-------
9-------
10
10
11−`a` is a block size (see [`++bloq`]()).
11+`a` is a block size (see `++bloq`).
12
12
13−`b` is an [atom]().
13+`b` is an atom.
14
14
15`c` is an atom.
15`c` is an atom.
16
16
@@ -22,9 +22,10 @@ An atom.
22Source
22Source
23------
23------
24
24
25− ++ not |= [a=bloq b=@ c=@] :: binary not (sized)
25+ ++ not |= {a/bloq b/@ c/@} :: binary not (sized)
26 (mix c (dec (bex (mul b (bex a)))))
26 (mix c (dec (bex (mul b (bex a)))))
27
27
28+
28Examples
29Examples
29--------
30--------
30
31
docs/system/hoon/library/src/2e/gate/fnv.md+2−2
@@ -2,7 +2,7 @@
2
2
3Hashes an atom with the 32-bit FNV non-cryptographic hash algorithm.
3Hashes an atom with the 32-bit FNV non-cryptographic hash algorithm.
4Multiplies `a` by the prime number 16,777,619 and then takes the block
4Multiplies `a` by the prime number 16,777,619 and then takes the block
5−of size 5 off the product's end, producing an [atom]().
5+of size 5 off the product's end, producing an atom.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -18,7 +18,7 @@ An atom.
18Source
18Source
19------
19------
20
20
21− ++ fnv |=(a=@ (end 5 1 (mul 16.777.619 a))) :: FNV scrambler
21+ ++ fnv |=(a/@ (end 5 1 (mul 16.777.619 a))) :: FNV scrambler
22
22
23Examples
23Examples
24--------
24--------
docs/system/hoon/library/src/2e/gate/mug.md+4−3
@@ -1,12 +1,12 @@
1### `++mug`
1### `++mug`
2
2
3Hashes `a` with the 31-bit nonzero FNV-1a non-cryptographic hash
3Hashes `a` with the 31-bit nonzero FNV-1a non-cryptographic hash
4−algorithm, producing an [atom]().
4+algorithm, producing an atom.
5
5
6Accepts
6Accepts
7-------
7-------
8
8
9−A is a [noun]().
9+A is a noun.
10
10
11Produces
11Produces
12--------
12--------
@@ -18,7 +18,7 @@ Source
18
18
19 ++ mug :: 31bit nonzero FNV1a
19 ++ mug :: 31bit nonzero FNV1a
20 ~/ %mug
20 ~/ %mug
21− |= a=*
21+ |= a/*
22 ?^ a
22 ?^ a
23 =+ b=[p=$(a -.a) q=$(a +.a)]
23 =+ b=[p=$(a -.a) q=$(a +.a)]
24 |- ^- @
24 |- ^- @
@@ -37,6 +37,7 @@ Source
37 ^$(b +(b))
37 ^$(b +(b))
38 $(c (fnv (mix c (cut 3 [d 1] a))), d +(d))
38 $(c (fnv (mix c (cut 3 [d 1] a))), d +(d))
39
39
40+
40Examples
41Examples
41--------
42--------
42
43
docs/system/hoon/library/src/2e/gate/mum.md+6−15
@@ -13,15 +13,15 @@ Source
13
13
14 ++ mum :: mug with murmur3
14 ++ mum :: mug with murmur3
15 ~/ %mum
15 ~/ %mum
16− |= a=*
16+ |= a/*
17 |^ (trim ?@(a a (mix $(a -.a) (mix 0x7fff.ffff $(a +.a)))))
17 |^ (trim ?@(a a (mix $(a -.a) (mix 0x7fff.ffff $(a +.a)))))
18 ++ spec :: standard murmur3
18 ++ spec :: standard murmur3
19− |= [syd=@ key=@]
19+ |= {syd/@ key/@}
20 ?> (lte (met 5 syd) 1)
20 ?> (lte (met 5 syd) 1)
21 =+ ^= row
21 =+ ^= row
22− |= [a=@ b=@]
22+ |= {a/@ b/@}
23 (con (end 5 1 (lsh 0 a b)) (rsh 0 (sub 32 a) b))
23 (con (end 5 1 (lsh 0 a b)) (rsh 0 (sub 32 a) b))
24− =+ mow=|=([a=@ b=@] (end 5 1 (mul a b)))
24+ =+ mow=|=({a/@ b/@} (end 5 1 (mul a b)))
25 =+ len=(met 5 key)
25 =+ len=(met 5 key)
26 =- =. goc (mix goc len)
26 =- =. goc (mix goc len)
27 =. goc (mix goc (rsh 4 1 goc))
27 =. goc (mix goc (rsh 4 1 goc))
@@ -35,22 +35,13 @@ Source
35 ?: =(inx len) goc
35 ?: =(inx len) goc
36 =+ kop=(cut 5 [inx 1] key)
36 =+ kop=(cut 5 [inx 1] key)
37 =. kop (mow kop 0xcc9e.2d51)
37 =. kop (mow kop 0xcc9e.2d51)
38− =. kop (row 15 kop)
38+ =. kop (row 15 kop)
39 =. kop (mow kop 0x1b87.3593)
39 =. kop (mow kop 0x1b87.3593)
40 =. goc (mix kop goc)
40 =. goc (mix kop goc)
41 =. goc (row 13 goc)
41 =. goc (row 13 goc)
42 =. goc (end 5 1 (add 0xe654.6b64 (mul 5 goc)))
42 =. goc (end 5 1 (add 0xe654.6b64 (mul 5 goc)))
43 $(inx +(inx))
43 $(inx +(inx))
44− ::
44+
45− ++ trim :: 31-bit nonzero
46− |= key=@
47− =+ syd=0xcafe.babe
48− |- ^- @
49− =+ haz=(spec syd key)
50− =+ ham=(mix (rsh 0 31 haz) (end 0 31 haz))
51− ?.(=(0 ham) ham $(syd +(syd)))
52− --
53− ::
54
45
55Examples
46Examples
56--------
47--------
docs/system/hoon/library/src/2f/gate/aor.md+4−3
@@ -8,7 +8,7 @@ boolean.
8Accepts
8Accepts
9-------
9-------
10
10
11−`a` is a [noun]().
11+`a` is a noun.
12
12
13`b` is a noun.
13`b` is a noun.
14
14
@@ -21,9 +21,9 @@ A boolean atom.
21Source
21Source
22------
22------
23
23
24− ++ aor :: alphabetic-order
24+ ++ aor :: a-order
25 ~/ %aor
25 ~/ %aor
26− |= [a=* b=*]
26+ |= {a/* b/*}
27 ^- ?
27 ^- ?
28 ?: =(a b) &
28 ?: =(a b) &
29 ?. ?=(@ a)
29 ?. ?=(@ a)
@@ -38,6 +38,7 @@ Source
38 $(a (rsh 3 1 a), b (rsh 3 1 b))
38 $(a (rsh 3 1 a), b (rsh 3 1 b))
39 (lth c d)
39 (lth c d)
40
40
41+
41Examples
42Examples
42--------
43--------
43
44
docs/system/hoon/library/src/2f/gate/dor.md+3−2
@@ -8,7 +8,7 @@ boolean.
8Accepts
8Accepts
9-------
9-------
10
10
11−`a` is a [noun]().
11+`a` is a noun.
12
12
13`b` is a noun.
13`b` is a noun.
14
14
@@ -22,7 +22,7 @@ Source
22
22
23 ++ dor :: d-order
23 ++ dor :: d-order
24 ~/ %dor
24 ~/ %dor
25− |= [a=* b=*]
25+ |= {a/* b/*}
26 ^- ?
26 ^- ?
27 ?: =(a b) &
27 ?: =(a b) &
28 ?. ?=(@ a)
28 ?. ?=(@ a)
@@ -33,6 +33,7 @@ Source
33 ?. ?=(@ b) &
33 ?. ?=(@ b) &
34 (lth a b)
34 (lth a b)
35
35
36+
36Examples
37Examples
37--------
38--------
38
39
docs/system/hoon/library/src/2f/gate/gor.md+4−3
@@ -7,27 +7,28 @@ XX revisit
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a [noun]().
10+`a` is a noun.
11
11
12`b` is a noun.
12`b` is a noun.
13
13
14Produces
14Produces
15--------
15--------
16
16
17−A boolean [atom]().
17+A boolean atom.
18
18
19Source
19Source
20------
20------
21
21
22 ++ gor :: g-order
22 ++ gor :: g-order
23 ~/ %gor
23 ~/ %gor
24− |= [a=* b=*]
24+ |= {a/* b/*}
25 ^- ?
25 ^- ?
26 =+ [c=(mug a) d=(mug b)]
26 =+ [c=(mug a) d=(mug b)]
27 ?: =(c d)
27 ?: =(c d)
28 (dor a b)
28 (dor a b)
29 (lth c d)
29 (lth c d)
30
30
31+
31Examples
32Examples
32--------
33--------
33
34
docs/system/hoon/library/src/2f/gate/hor.md+5−3
@@ -9,14 +9,14 @@ Recursive hash comparator gate.
9Accepts
9Accepts
10-------
10-------
11
11
12−`a` is a [noun]().
12+`a` is a noun.
13
13
14`b` is a noun.
14`b` is a noun.
15
15
16Produces
16Produces
17--------
17--------
18
18
19−A boolean [atom]().
19+A boolean atom.
20
20
21
21
22Source
22Source
@@ -24,7 +24,7 @@ Source
24
24
25 ++ hor :: h-order
25 ++ hor :: h-order
26 ~/ %hor
26 ~/ %hor
27− |= [a=* b=*]
27+ |= {a/* b/*}
28 ^- ?
28 ^- ?
29 ?: ?=(@ a)
29 ?: ?=(@ a)
30 ?. ?=(@ b) &
30 ?. ?=(@ b) &
@@ -33,6 +33,8 @@ Source
33 ?: =(-.a -.b)
33 ?: =(-.a -.b)
34 (gor +.a +.b)
34 (gor +.a +.b)
35 (gor -.a -.b)
35 (gor -.a -.b)
36+ ::
37+
36
38
37Examples
39Examples
38--------
40--------
docs/system/hoon/library/src/2f/gate/vor.md+3−2
@@ -7,7 +7,7 @@ XX revisit
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a [noun]()
10+`a` is a noun
11
11
12`b` is a noun
12`b` is a noun
13
13
@@ -19,13 +19,14 @@ Source
19
19
20 ++ vor :: v-order
20 ++ vor :: v-order
21 ~/ %vor
21 ~/ %vor
22− |= [a=* b=*]
22+ |= {a/* b/*}
23 ^- ?
23 ^- ?
24 =+ [c=(mug (mug a)) d=(mug (mug b))]
24 =+ [c=(mug (mug a)) d=(mug (mug b))]
25 ?: =(c d)
25 ?: =(c d)
26 (dor a b)
26 (dor a b)
27 (lth c d)
27 (lth c d)
28
28
29+
29Examples
30Examples
30--------
31--------
31
32
docs/system/hoon/library/src/2h/core/in.md+75−66
@@ -3,7 +3,7 @@
3
3
4Set operations
4Set operations
5
5
6−Core whose [arm]()s contain a variety of functions that operate on [`++set`]()s. Its [sample]() accepts the input [`++set`]() to be manipulated.
6+Core whose arms contain a variety of functions that operate on `++set`s. Its sample accepts the input `++set` to be manipulated.
7
7
8Accepts
8Accepts
9-------
9-------
@@ -15,7 +15,7 @@ Source
15
15
16 ++ in :: set engine
16 ++ in :: set engine
17 ~/ %in
17 ~/ %in
18− |/ a=(set)
18+ |_ a/(set)
19
19
20Examples
20Examples
21--------
21--------
@@ -33,9 +33,9 @@ producing a boolean.
33Accepts
33Accepts
34-------
34-------
35
35
36−`a` is a [`++set`]().
36+`a` is a `++set`.
37
37
38−`b` is a [wet]() [gate]() that accepts a [noun]() and produces a boolean.
38+`b` is a wet gate that accepts a noun and produces a boolean.
39
39
40Produces
40Produces
41--------
41--------
@@ -47,21 +47,21 @@ Source
47
47
48 +- all :: logical AND
48 +- all :: logical AND
49 ~/ %all
49 ~/ %all
50− |* b=$+(* ?)
50+ |* b/$-(* ?)
51 |- ^- ?
51 |- ^- ?
52 ?~ a
52 ?~ a
53 &
53 &
54 ?&((b n.a) $(a l.a) $(a r.a))
54 ?&((b n.a) $(a l.a) $(a r.a))
55− ::
55+
56
56
57Examples
57Examples
58--------
58--------
59
59
60− ~zod/try=> =b (sa `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
60+ ~zod/try=> =b (sa `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
61− ~zod/try=> (~(all in b) |=(a=* ?@(+.a & |)))
61+ ~zod/try=> (~(all in b) |=(a/* ?@(+.a & |)))
62 %.n
62 %.n
63− ~zod/try=> =b (sa `(list ,@t)`['john' 'bonita' 'daniel' 'madeleine' ~])
63+ ~zod/try=> =b (sa `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
64− ~zod/try=> (~(all in b) |=(a=@t (gte a 100)))
64+ ~zod/try=> (~(all in b) |=(a/@t (gte a 100)))
65 %.y
65 %.y
66
66
67------------------------------------------------------------------------
67------------------------------------------------------------------------
@@ -75,9 +75,9 @@ Computes the logical OR on every element of `a` slammed with `b`.
75Accepts
75Accepts
76-------
76-------
77
77
78−`a` is a [`++set`]().
78+`a` is a `++set`.
79
79
80−`b` is a [gate]() that accepts a noun and produces a boolean.
80+`b` is a gate that accepts a noun and produces a boolean.
81
81
82Produces
82Produces
83--------
83--------
@@ -89,21 +89,22 @@ Source
89
89
90 +- any :: logical OR
90 +- any :: logical OR
91 ~/ %any
91 ~/ %any
92− |* b=$+(* ?)
92+ |* b/$-(* ?)
93 |- ^- ?
93 |- ^- ?
94 ?~ a
94 ?~ a
95 |
95 |
96 ?|((b n.a) $(a l.a) $(a r.a))
96 ?|((b n.a) $(a l.a) $(a r.a))
97 ::
97 ::
98
98
99+
99Examples
100Examples
100--------
101--------
101
102
102− ~zod/try=> =b (sa `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
103+ ~zod/try=> =b (sa `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
103− ~zod/try=> (~(any in b) |=(a=* ?@(+.a & |)))
104+ ~zod/try=> (~(any in b) |=(a/* ?@(+.a & |)))
104 %.y
105 %.y
105− ~zod/try=> =b (sa `(list ,@t)`['john' 'bonita' 'daniel' 'madeleine' ~])
106+ ~zod/try=> =b (sa `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
106− ~zod/try=> (~(any in b) |=(a=@t (lte a 100)))
107+ ~zod/try=> (~(any in b) |=(a/@t (lte a 100)))
107 %.n
108 %.n
108
109
109------------------------------------------------------------------------
110------------------------------------------------------------------------
@@ -112,14 +113,14 @@ Examples
112
113
113Remove noun
114Remove noun
114
115
115−Removes `b` from the [`++set`]() `a`.
116+Removes `b` from the `++set` `a`.
116
117
117Accepts
118Accepts
118-------
119-------
119
120
120`a` is a set.
121`a` is a set.
121
122
122−`b` is a [noun]().
123+`b` is a noun.
123
124
124Produces
125Produces
125--------
126--------
@@ -131,7 +132,7 @@ Source
131
132
132 +- del :: b without any a
133 +- del :: b without any a
133 ~/ %del
134 ~/ %del
134− |* b=*
135+ |* b/*
135 |- ^+ a
136 |- ^+ a
136 ?~ a
137 ?~ a
137 ~
138 ~
@@ -139,7 +140,7 @@ Source
139 ?: (hor b n.a)
140 ?: (hor b n.a)
140 [n.a $(a l.a) r.a]
141 [n.a $(a l.a) r.a]
141 [n.a l.a $(a r.a)]
142 [n.a l.a $(a r.a)]
142− |- ^- ?(~ _a)
143+ |- ^- {$?($~ _a)}
143 ?~ l.a r.a
144 ?~ l.a r.a
144 ?~ r.a l.a
145 ?~ r.a l.a
145 ?: (vor n.l.a n.r.a)
146 ?: (vor n.l.a n.r.a)
@@ -151,10 +152,10 @@ Source
151Examples
152Examples
152--------
153--------
153
154
154− ~zod/try=> =b (sa `(list ,@t)`['a' 'b' 'c' ~])
155+ ~zod/try=> =b (sa `(list @t)`['a' 'b' 'c' ~])
155 ~zod/try=> (~(del in b) 'a')
156 ~zod/try=> (~(del in b) 'a')
156 {'c' 'b'}
157 {'c' 'b'}
157− ~zod/try=> =b (sa `(list ,@t)`['john' 'bonita' 'daniel' 'madeleine' ~])
158+ ~zod/try=> =b (sa `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
158 ~zod/try=> (~(del in b) 'john')
159 ~zod/try=> (~(del in b) 'john')
159 {'bonita' 'madeleine' 'daniel'}
160 {'bonita' 'madeleine' 'daniel'}
160 ~zod/try=> (~(del in b) 'susan')
161 ~zod/try=> (~(del in b) 'susan')
@@ -171,34 +172,35 @@ Produce the axis of `b` within `a`.
171Accepts
172Accepts
172-------
173-------
173
174
174−`a` is a [`++set`]().
175+`a` is a `++set`.
175
176
176−`b` is a [noun]().
177+`b` is a noun.
177
178
178Produces
179Produces
179--------
180--------
180
181
181−The [`++unit`]() of an atom.
182+The `++unit` of an atom.
182
183
183Source
184Source
184------
185------
185
186
186 +- dig :: axis of a in b
187 +- dig :: axis of a in b
187− |= b=*
188+ |= b/*
188 =+ c=1
189 =+ c=1
189− |- ^- (unit ,@)
190+ |- ^- (unit @)
190 ?~ a ~
191 ?~ a ~
191 ?: =(b n.a) [~ u=(peg c 2)]
192 ?: =(b n.a) [~ u=(peg c 2)]
192− ?: (gor b n.a)
193+ ?: (hor b n.a)
193 $(a l.a, c (peg c 6))
194 $(a l.a, c (peg c 6))
194 $(a r.a, c (peg c 7))
195 $(a r.a, c (peg c 7))
195 ::
196 ::
196
197
197
198
199+
198Examples
200Examples
199--------
201--------
200
202
201− ~zod/try=> =a (sa `(list ,@)`[1 2 3 4 5 6 7 ~])
203+ ~zod/try=> =a (sa `(list @)`[1 2 3 4 5 6 7 ~])
202 ~zod/try=> a
204 ~zod/try=> a
203 {5 4 7 6 1 3 2}
205 {5 4 7 6 1 3 2}
204 ~zod/try=> -.a
206 ~zod/try=> -.a
@@ -216,7 +218,7 @@ Examples
216
218
217Concatenate
219Concatenate
218
220
219−Insert the elements of a [`++list`]() `b` into a [`++set`]() `a`.
221+Insert the elements of a `++list` `b` into a `++set` `a`.
220
222
221Accepts
223Accepts
222-------
224-------
@@ -235,11 +237,11 @@ Source
235
237
236 +- gas :: concatenate
238 +- gas :: concatenate
237 ~/ %gas
239 ~/ %gas
238− |= b=(list ,_?>(?=(^ a) n.a))
240+ |= b/(list _?>(?=(^ a) n.a))
239 |- ^+ a
241 |- ^+ a
240 ?~ b
242 ?~ b
241 a
243 a
242− $(b t.b, a (put(+< a) i.b))
244+ $(b t.b, a (put i.b))
243 ::
245 ::
244
246
245
247
@@ -248,7 +250,7 @@ Examples
248
250
249 ~zod/try=> b
251 ~zod/try=> b
250 {'bonita' 'madeleine' 'rudolf' 'john'}
252 {'bonita' 'madeleine' 'rudolf' 'john'}
251− ~zod/try=> (~(gas in b) `(list ,@t)`['14' 'things' 'number' '1.337' ~])
253+ ~zod/try=> (~(gas in b) `(list @t)`['14' 'things' 'number' '1.337' ~])
252 {'1.337' '14' 'number' 'things' 'bonita' 'madeleine' 'rudolf' 'john'}
254 {'1.337' '14' 'number' 'things' 'bonita' 'madeleine' 'rudolf' 'john'}
253 ~zod/try=> (~(gas in s) `(list ,@t)`['1' '2' '3' ~])
255 ~zod/try=> (~(gas in s) `(list ,@t)`['1' '2' '3' ~])
254 {'1' '3' '2' 'e' 'd' 'a' 'c' 'b'}
256 {'1' '3' '2' 'e' 'd' 'a' 'c' 'b'}
@@ -278,7 +280,7 @@ Source
278
280
279 +- has :: b exists in a check
281 +- has :: b exists in a check
280 ~/ %has
282 ~/ %has
281− |* b=*
283+ |* b/*
282 |- ^- ?
284 |- ^- ?
283 ?~ a
285 ?~ a
284 |
286 |
@@ -293,7 +295,7 @@ Source
293Examples
295Examples
294--------
296--------
295
297
296− ~zod/try=> =a (~(gas in `(set ,@t)`~) `(list ,@t)`[`a` `b` `c` ~])
298+ ~zod/try=> =a (~(gas in `(set @t)`~) `(list @t)`[`a` `b` `c` ~])
297 ~zod/try=> (~(has in a) `a`)
299 ~zod/try=> (~(has in a) `a`)
298 %.y
300 %.y
299 ~zod/try=> (~(has in a) 'z')
301 ~zod/try=> (~(has in a) 'z')
@@ -305,7 +307,7 @@ Examples
305
307
306Intersection
308Intersection
307
309
308−Produces a set of the intersection between two [`++set`]()s of the same type,
310+Produces a set of the intersection between two `++set`s of the same type,
309`a` and `b`.
311`a` and `b`.
310
312
311Accepts
313Accepts
@@ -318,14 +320,14 @@ Accepts
318Produces
320Produces
319--------
321--------
320
322
321−A [`++set`]().
323+A `++set`.
322
324
323Source
325Source
324------
326------
325
327
326− +- int :: intersection
328+ +- int :: intersection
327 ~/ %int
329 ~/ %int
328− |* b=_a
330+ |* b/_a
329 |- ^+ a
331 |- ^+ a
330 ?~ b
332 ?~ b
331 ~
333 ~
@@ -336,8 +338,10 @@ Source
336 ?: =(n.b n.a)
338 ?: =(n.b n.a)
337 [n.a $(a l.a, b l.b) $(a r.a, b r.b)]
339 [n.a $(a l.a, b l.b) $(a r.a, b r.b)]
338 ?: (hor n.b n.a)
340 ?: (hor n.b n.a)
339− %- uni(+< $(a l.a, b [n.b l.b ~])) $(b r.b)
341+ %- uni(a $(a l.a, b [n.b l.b ~])) $(b r.b)
340− %- uni(+< $(a r.a, b [n.b ~ r.b])) $(b l.b)
342+ %- uni(a $(a r.a, b [n.b ~ r.b])) $(b l.b)
343+ ::
344+
341
345
342
346
343Examples
347Examples
@@ -358,26 +362,26 @@ Examples
358
362
359Put b in a
363Put b in a
360
364
361−Add an element `b` to the [`++set`]() `a`.
365+Add an element `b` to the `++set` `a`.
362
366
363Accepts
367Accepts
364-------
368-------
365
369
366`a` is a set.
370`a` is a set.
367
371
368−`b` is a [noun]().
372+`b` is a noun.
369
373
370Produces
374Produces
371--------
375--------
372
376
373−A [`++set`]().
377+A `++set`.
374
378
375Source
379Source
376------
380------
377
381
378− +- put :: puts b in a
382+ +- put :: puts b in a, sorted
379 ~/ %put
383 ~/ %put
380− |* b=*
384+ |* b/*
381 |- ^+ a
385 |- ^+ a
382 ?~ a
386 ?~ a
383 [b ~ ~]
387 [b ~ ~]
@@ -400,7 +404,7 @@ Source
400Examples
404Examples
401--------
405--------
402
406
403− ~zod/try=> =a (~(gas in `(set ,@t)`~) `(list ,@t)`[`a` `b` `c` ~])
407+ ~zod/try=> =a (~(gas in `(set @t)`~) `(list @t)`[`a` `b` `c` ~])
404 ~zod/try=> =b (~(put in a) `d`)
408 ~zod/try=> =b (~(put in a) `d`)
405 ~zod/try=> b
409 ~zod/try=> b
406 {`d` `a` `c` `b`}
410 {`d` `a` `c` `b`}
@@ -413,14 +417,14 @@ Examples
413
417
414Accumulate
418Accumulate
415
419
416−Accumulate the elements of `a` using a [gate]() `c` and an accumulator `b`.
420+Accumulate the elements of `a` using a gate `c` and an accumulator `b`.
417
421
418Accepts
422Accepts
419--------
423--------
420
424
421−`a` is a [`++set`]().
425+`a` is a `++set`.
422
426
423−`b` is a [noun]().
427+`b` is a noun.
424
428
425`c` is a gate.
429`c` is a gate.
426
430
@@ -432,21 +436,21 @@ A noun.
432Source
436Source
433------
437------
434
438
435− +- rep :: replace by tile
439+ +- rep :: replace by product
436− |* [b=* c=_,*]
440+ |* b/_|=({* *} +<+)
437− |-
441+ |-
438− ?~ a b
442+ ?~ a +<+.b
439− $(a r.a, b $(a l.a, b (c n.a b)))
443+ $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
440− ::
444+
441
445
442
446
443Examples
447Examples
444--------
448--------
445
449
446− ~zod/try=> =a (~(gas in *(set ,@)) [1 2 3 ~])
450+ ~zod/try=> =a (~(gas in *(set @)) [1 2 3 ~])
447 ~zod/try=> a
451 ~zod/try=> a
448 {1 3 2}
452 {1 3 2}
449− ~zod/try=> (~(rep in a) 0 |=([a=@ b=@] (add a b)))
453+ ~zod/try=> (~(rep in a) 0 |=([a/@ b/@] (add a b)))
450 6
454 6
451
455
452------------------------------------------------------------------------
456------------------------------------------------------------------------
@@ -455,7 +459,7 @@ Examples
455
459
456Set to list
460Set to list
457
461
458−Flattens the [`++set`]() `a` into a [`++list`]().
462+Flattens the `++set` `a` into a `++list`.
459
463
460Accepts
464Accepts
461-------
465-------
@@ -470,23 +474,24 @@ A list.
470Source
474Source
471------
475------
472
476
473− +- tap :: list tiles a set
477+ +- tap :: convert to list
474 ~/ %tap
478 ~/ %tap
475− |= b=(list ,_?>(?=(^ a) n.a))
479+ |= b/(list _?>(?=(^ a) n.a))
476 ^+ b
480 ^+ b
477 ?~ a
481 ?~ a
478 b
482 b
479− $(a r.a, b [n.a $(a l.a)])
483+ $(a r.a b [n.a $(a l.a)])
480 ::
484 ::
481
485
482
486
487+
483Examples
488Examples
484--------
489--------
485
490
486− ~zod/try=> =s (sa `(list ,@t)`['a' 'b' 'c' 'd' 'e' ~])
491+ ~zod/try=> =s (sa `(list @t)`['a' 'b' 'c' 'd' 'e' ~])
487 ~zod/try=> s
492 ~zod/try=> s
488 {'e' 'd' 'a' 'c' 'b'}
493 {'e' 'd' 'a' 'c' 'b'}
489− ~zod/try=> (~(tap in s) `(list ,@t)`['1' '2' '3' ~])
494+ ~zod/try=> (~(tap in s) `(list @t)`['1' '2' '3' ~])
490 ~['b' 'c' 'a' 'd' 'e' '1' '2' '3']
495 ~['b' 'c' 'a' 'd' 'e' '1' '2' '3']
491 ~zod/try=> b
496 ~zod/try=> b
492 {'bonita' 'madeleine' 'daniel' 'john'}
497 {'bonita' 'madeleine' 'daniel' 'john'}
@@ -519,7 +524,8 @@ Source
519
524
520 +- uni :: union
525 +- uni :: union
521 ~/ %uni
526 ~/ %uni
522− |* b=_a
527+ |* b/_a
528+ ?: =(a b) a
523 |- ^+ a
529 |- ^+ a
524 ?~ b
530 ?~ b
525 a
531 a
@@ -536,6 +542,7 @@ Source
536 ?: (hor n.a n.b)
542 ?: (hor n.a n.b)
537 $(b [n.b $(b l.b, a [n.a l.a ~]) r.b], a r.a)
543 $(b [n.b $(b l.b, a [n.a l.a ~]) r.b], a r.a)
538 $(b [n.b l.b $(b r.b, a [n.a ~ r.a])], a l.a)
544 $(b [n.b l.b $(b r.b, a [n.a ~ r.a])], a l.a)
545+ ::
539
546
540
547
541Examples
548Examples
@@ -574,6 +581,8 @@ Source
574 +- wyt :: size of set
581 +- wyt :: size of set
575 |- ^- @
582 |- ^- @
576 ?~(a 0 +((add $(a l.a) $(a r.a))))
583 ?~(a 0 +((add $(a l.a) $(a r.a))))
584+ --
585+
577
586
578
587
579Examples
588Examples
docs/system/hoon/library/src/2i/core/by.md+99−87
@@ -4,12 +4,13 @@ Map operations
4
4
5 ++ by :: map engine
5 ++ by :: map engine
6 ~/ %by
6 ~/ %by
7− |/ a=(map)
7+ |_ a/(map)
8+
8
9
9Container arm for map operation arms. A map is a set of key, value
10Container arm for map operation arms. A map is a set of key, value
10−pairs. The contained arms inherit it's [sample]() [map](), `a`.
11+pairs. The contained arms inherit it's sample map, `a`.
11
12
12−`a` is a [map]().
13+`a` is a map.
13
14
14 ~zod/try=> ~(. by (mo (limo [%a 1] [%b 2] ~)))
15 ~zod/try=> ~(. by (mo (limo [%a 1] [%b 2] ~)))
15 <19.irb [nlr([p={%a %b} q=@ud]) <414.rvm 101.jzo 1.ypj %164>]>
16 <19.irb [nlr([p={%a %b} q=@ud]) <414.rvm 101.jzo 1.ypj %164>]>
@@ -22,26 +23,28 @@ Logical AND
22
23
23 +- all :: logical AND
24 +- all :: logical AND
24 ~/ %all
25 ~/ %all
25− |* b=$+(* ?)
26+ |* b/$-(* ?)
26 |- ^- ?
27 |- ^- ?
27 ?~ a
28 ?~ a
28 &
29 &
29 ?&((b q.n.a) $(a l.a) $(a r.a))
30 ?&((b q.n.a) $(a l.a) $(a r.a))
31+ ::
32+
30
33
31Computes the logical AND on the results of slamming every element in map
34Computes the logical AND on the results of slamming every element in map
32`a` with gate `b`. Produces a loobean.
35`a` with gate `b`. Produces a loobean.
33
36
34−`a` is a [map]().
37+`a` is a map.
35
38
36−`b` is a [wet gate]().
39+`b` is a wet gate.
37
40
38− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
41+ ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
39− ~zod/try=> (~(all by b) |=(a=* ?@(a & |)))
42+ ~zod/try=> (~(all by b) |=(a/* ?@(a & |)))
40 %.n
43 %.n
41− ~zod/try=> =a (mo `(list ,[@t @u])`[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
44+ ~zod/try=> =a (mo `(list {@t @u})`[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
42− ~zod/try=> (~(all by a) |=(a=@ (lte a 6)))
45+ ~zod/try=> (~(all by a) |=(a/@ (lte a 6)))
43 %.y
46 %.y
44− ~zod/try=> (~(all by a) |=(a=@ (lte a 4)))
47+ ~zod/try=> (~(all by a) |=(a/@ (lte a 4)))
45 %.n
48 %.n
46
49
47------------------------------------------------------------------------
50------------------------------------------------------------------------
@@ -61,14 +64,14 @@ Logical OR
61Computes the logical OR on the results of slamming every element with
64Computes the logical OR on the results of slamming every element with
62gate `b`. Produces a loobean.
65gate `b`. Produces a loobean.
63
66
64−`a` is a [map]().
67+`a` is a map.
65
68
66−`b` is a [wet gate]().
69+`b` is a wet gate.
67
70
68− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
71+ ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
69− ~zod/try=> (~(all by b) |=(a=* ?@(a & |)))
72+ ~zod/try=> (~(all by b) |=(a/* ?@(a & |)))
70 %.y
73 %.y
71− ~zod/try=> =a (mo `(list ,[@t @u])`[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
74+ ~zod/try=> =a (mo `(list {@t @u})`[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
72 ~zod/try=> (~(any by a) |=(a=@ (lte a 4)))
75 ~zod/try=> (~(any by a) |=(a=@ (lte a 4)))
73 %.y
76 %.y
74
77
@@ -80,7 +83,7 @@ Delete
80
83
81 +- del :: delete at key b
84 +- del :: delete at key b
82 ~/ %del
85 ~/ %del
83− |* b=*
86+ |* b/*
84 |- ^+ a
87 |- ^+ a
85 ?~ a
88 ?~ a
86 ~
89 ~
@@ -88,20 +91,21 @@ Delete
88 ?: (gor b p.n.a)
91 ?: (gor b p.n.a)
89 [n.a $(a l.a) r.a]
92 [n.a $(a l.a) r.a]
90 [n.a l.a $(a r.a)]
93 [n.a l.a $(a r.a)]
91− |- ^- ?(~ _a)
94+ |- ^- {$?($~ _a)}
92 ?~ l.a r.a
95 ?~ l.a r.a
93 ?~ r.a l.a
96 ?~ r.a l.a
94 ?: (vor p.n.l.a p.n.r.a)
97 ?: (vor p.n.l.a p.n.r.a)
95 [n.l.a l.l.a $(l.a r.l.a)]
98 [n.l.a l.l.a $(l.a r.l.a)]
96 [n.r.a $(r.a l.r.a) r.r.a]
99 [n.r.a $(r.a l.r.a) r.r.a]
100+ ::
97
101
98Produces map `a` with the element located at key `b` removed.
102Produces map `a` with the element located at key `b` removed.
99
103
100−`a` is a [map]().
104+`a` is a map.
101
105
102−`b` is a key as a [noun]().
106+`b` is a key as a noun.
103
107
104− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
108+ ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
105 ~zod/try=> (~(del by b) `a`)
109 ~zod/try=> (~(del by b) `a`)
106 {[p=`b` q=[2 3]]}
110 {[p=`b` q=[2 3]]}
107
111
@@ -111,23 +115,25 @@ Produces map `a` with the element located at key `b` removed.
111
115
112Axis of key
116Axis of key
113
117
114− +- dig :: axis of key
118+ +- dig :: axis of b key
115− |= b=*
119+ |= b/*
116 =+ c=1
120 =+ c=1
117− |- ^- (unit ,@)
121+ |- ^- (unit @)
118 ?~ a ~
122 ?~ a ~
119 ?: =(b p.n.a) [~ u=(peg c 2)]
123 ?: =(b p.n.a) [~ u=(peg c 2)]
120 ?: (gor b p.n.a)
124 ?: (gor b p.n.a)
121 $(a l.a, c (peg c 6))
125 $(a l.a, c (peg c 6))
122 $(a r.a, c (peg c 7))
126 $(a r.a, c (peg c 7))
127+ ::
128+
123
129
124Produce the axis of key `b` within map `a`.
130Produce the axis of key `b` within map `a`.
125
131
126−`a` is a [map]().
132+`a` is a map.
127
133
128−`b` is a key as a [noun]().
134+`b` is a key as a noun.
129
135
130− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
136+ ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
131 ~zod/try=> (~(dig by b) `b`)
137 ~zod/try=> (~(dig by b) `b`)
132 [~ 2]
138 [~ 2]
133
139
@@ -139,21 +145,22 @@ Concatenate
139
145
140 +- gas :: concatenate
146 +- gas :: concatenate
141 ~/ %gas
147 ~/ %gas
142− |* b=(list ,[p=* q=*])
143− => .(b `(list ,_?>(?=(^ a) n.a))`b)
148+ |= b/(list _?>(?=(^ a) n.a))
144 |- ^+ a
149 |- ^+ a
145 ?~ b
150 ?~ b
146 a
151 a
147− $(b t.b, a (put(+< a) p.i.b q.i.b))
152+ $(b t.b, a (put i.b))
153+ ::
154+
148
155
149Insert a list of key-value pairs `b` into map `a`.
156Insert a list of key-value pairs `b` into map `a`.
150
157
151−`a` is a [map]().
158+`a` is a map.
152
159
153−`b` is a [list]() of [cells]() of key-value nouns `p` and `q`.
160+`b` is a list of cells of key-value nouns `p` and `q`.
154
161
155− ~zod/try=> =a (mo `(list ,[@t *])`[[`a` 1] [`b` 2] ~])
162+ ~zod/try=> =a (mo `(list {@t *})`[[`a` 1] [`b` 2] ~])
156− ~zod/try=> =b `(list ,[@t *])`[[`c` 3] [`d` 4] ~]
163+ ~zod/try=> =b `(list {@t *})`[[`c` 3] [`d` 4] ~]
157 ~zod/try=> (~(gas by a) b)
164 ~zod/try=> (~(gas by a) b)
158 {[p=`d` q=4] [p=`a` q=1] [p=`c` q=3] [p=`b` q=2]}
165 {[p=`d` q=4] [p=`a` q=1] [p=`c` q=3] [p=`b` q=2]}
159
166
@@ -177,11 +184,11 @@ Grab unit value
177
184
178Produce the unit value of the value located at key `b` within map `a`.
185Produce the unit value of the value located at key `b` within map `a`.
179
186
180−`a` is a [map]()
187+`a` is a map
181
188
182−`b` is a [key]() as a [noun]()
189+`b` is a key as a noun
183
190
184− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
191+ ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
185 ~zod/try=> (~(get by b) `b`)
192 ~zod/try=> (~(get by b) `b`)
186 [~ [2 3]]
193 [~ [2 3]]
187
194
@@ -192,18 +199,17 @@ Produce the unit value of the value located at key `b` within map `a`.
192Assert
199Assert
193
200
194 +- got
201 +- got
195− |* b=*
202+ |* b/*
196− %- need
203+ (need (get b))
197− %- get(+< a) b
198
204
199Produce the value located at key `b` within map `a`. Crash if key `b`
205Produce the value located at key `b` within map `a`. Crash if key `b`
200does not exist.
206does not exist.
201
207
202−`a` is a [map]().
208+`a` is a map.
203
209
204−`b` is a [key]().
210+`b` is a key.
205
211
206− ~zod/try=> =m (mo `(list ,[@t *])`[['a' 1] ['b' 2] ~])
212+ ~zod/try=> =m (mo `(list {@t *})`[['a' 1] ['b' 2] ~])
207 ~zod/try=> m
213 ~zod/try=> m
208 {[p='a' q=1] [p='b' q=2]}
214 {[p='a' q=1] [p='b' q=2]}
209 ~zod/try=> (~(get by m) 'a')
215 ~zod/try=> (~(get by m) 'a')
@@ -221,17 +227,18 @@ Key existence check
221
227
222 +- has :: key existence check
228 +- has :: key existence check
223 ~/ %has
229 ~/ %has
224− |* b=*
230+ |* b/*
225− !=(~ (get(+< a) b))
231+ !=(~ (get b))
232+
226
233
227Checks whether map `a` contains an element with key `b`, producing a
234Checks whether map `a` contains an element with key `b`, producing a
228loobean.
235loobean.
229
236
230−`a` is a [map]().
237+`a` is a map.
231
238
232−`b` is a key as a [noun]().
239+`b` is a key as a noun.
233
240
234− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
241+ ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
235 ~zod/try=> (~(has by b) `b`)
242 ~zod/try=> (~(has by b) `b`)
236 %.y
243 %.y
237 ~zod/try=> (~(has by b) `c`)
244 ~zod/try=> (~(has by b) `c`)
@@ -245,7 +252,7 @@ Intersection
245
252
246 +- int :: intersection
253 +- int :: intersection
247 ~/ %int
254 ~/ %int
248− |* b=_a
255+ |* b/_a
249 |- ^+ a
256 |- ^+ a
250 ?~ b
257 ?~ b
251 ~
258 ~
@@ -254,41 +261,42 @@ Intersection
254 ?: (vor p.n.a p.n.b)
261 ?: (vor p.n.a p.n.b)
255 ?: =(p.n.b p.n.a)
262 ?: =(p.n.b p.n.a)
256 [n.b $(a l.a, b l.b) $(a r.a, b r.b)]
263 [n.b $(a l.a, b l.b) $(a r.a, b r.b)]
257− ?: (hor p.n.b p.n.a)
264+ ?: (gor p.n.b p.n.a)
258− %- uni(+< $(a l.a, b [n.b l.b ~])) $(b r.b)
265+ %- uni(a $(a l.a, b [n.b l.b ~])) $(b r.b)
259− %- uni(+< $(a r.a, b [n.b ~ r.b])) $(b l.b)
266+ %- uni(a $(a r.a, b [n.b ~ r.b])) $(b l.b)
260 ?: =(p.n.a p.n.b)
267 ?: =(p.n.a p.n.b)
261 [n.b $(b l.b, a l.a) $(b r.b, a r.a)]
268 [n.b $(b l.b, a l.a) $(b r.b, a r.a)]
262− ?: (hor p.n.a p.n.b)
269+ ?: (gor p.n.a p.n.b)
263− %- uni(+< $(b l.b, a [n.a l.a ~])) $(a r.a)
270+ %- uni(a $(b l.b, a [n.a l.a ~])) $(a r.a)
264− %- uni(+< $(b r.b, a [n.a ~ r.a])) $(a l.a)
271+ %- uni(a $(b r.b, a [n.a ~ r.a])) $(a l.a)
272+ ::
265
273
266Produces a map of the (key) intersection between two maps of the same
274Produces a map of the (key) intersection between two maps of the same
267type, `a` and `b`. If both maps have an identical key that point to
275type, `a` and `b`. If both maps have an identical key that point to
268different values, the element from map `b` is used.
276different values, the element from map `b` is used.
269
277
270−`a` is a [map]().
278+`a` is a map.
271
279
272−`b` is a [map]().
280+`b` is a map.
273
281
274− ~zod/try=> =n (mo `(list ,[@t *])`[['a' 1] ['c' 3] ~])
282+ ~zod/try=> =n (mo `(list {@t *})`[['a' 1] ['c' 3] ~])
275 ~zod/try=> n
283 ~zod/try=> n
276 {[p='a' q=1] [p='c' q=3]}
284 {[p='a' q=1] [p='c' q=3]}
277 ~zod/try=> m
285 ~zod/try=> m
278 {[p='a' q=1] [p='b' q=2]}
286 {[p='a' q=1] [p='b' q=2]}
279 ~zod/try=> (~(int by m) n)
287 ~zod/try=> (~(int by m) n)
280 {[p='a' q=1]}
288 {[p='a' q=1]}
281− ~ravpel-holber/try=> =p (mo `(list ,[@t *])`[['a' 2] ['b' 2] ~])
289+ ~ravpel-holber/try=> =p (mo `(list {@t *})`[['a' 2] ['b' 2] ~])
282 ~zod/try=> p
290 ~zod/try=> p
283 {[p='a' q=2] [p='b' q=2]}
291 {[p='a' q=2] [p='b' q=2]}
284 ~zod/try=> (~(int by p) n)
292 ~zod/try=> (~(int by p) n)
285 {[p='a' q=2]}
293 {[p='a' q=2]}
286− ~zod/try=> =q (mo `(list ,[@t *])`[['a' 2] ['c' 2] ~])
294+ ~zod/try=> =q (mo `(list {@t *})`[['a' 2] ['c' 2] ~])
287 ~zod/try=> q
295 ~zod/try=> q
288 {[p='a' q=2] [p='b' q=2]}
296 {[p='a' q=2] [p='b' q=2]}
289 ~zod/try=> (~(int by p) q)
297 ~zod/try=> (~(int by p) q)
290 {[p='a' q=2] [p='b' q=2]}
298 {[p='a' q=2] [p='b' q=2]}
291− ~zod/try=> =o (mo `(list ,[@t *])`[['c' 3] ['d' 4] ~])
299+ ~zod/try=> =o (mo `(list {@t *})`[['c' 3] ['d' 4] ~])
292 ~zod/try=> (~(int by m) o)
300 ~zod/try=> (~(int by m) o)
293 {}
301 {}
294
302
@@ -337,7 +345,7 @@ Add key-value pair
337
345
338 +- put :: adds key-value pair
346 +- put :: adds key-value pair
339 ~/ %put
347 ~/ %put
340− |* [b=* c=*]
348+ |* {b/* c/*}
341 |- ^+ a
349 |- ^+ a
342 ?~ a
350 ?~ a
343 [[b c] ~ ~]
351 [[b c] ~ ~]
@@ -356,10 +364,11 @@ Add key-value pair
356 ?: (vor p.n.a p.n.d)
364 ?: (vor p.n.a p.n.d)
357 [n.a l.a d]
365 [n.a l.a d]
358 [n.d [n.a l.a l.d] r.d]
366 [n.d [n.a l.a l.d] r.d]
367+ ::
359
368
360Produces `a` with the addition of the key-value pair of `b` and `c`.
369Produces `a` with the addition of the key-value pair of `b` and `c`.
361
370
362−`a` is a [map]().
371+`a` is a map.
363
372
364`b` is a key of the same type as the keys in `a`.
373`b` is a key of the same type as the keys in `a`.
365
374
@@ -380,10 +389,11 @@ Produces `a` with the addition of the key-value pair of `b` and `c`.
380### `+-rep:by`
389### `+-rep:by`
381
390
382 +- rep :: replace by product
391 +- rep :: replace by product
383− |* [b=* c=_,*]
392+ |* b/_|=({* *} +<+)
384 |-
393 |-
385− ?~ a b
394+ ?~ a +<+.b
386− $(a r.a, b $(a l.a, b (c q.n.a b)))
395+ $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
396+ ::
387
397
388Accumulate using gate from values in map
398Accumulate using gate from values in map
389
399
@@ -394,7 +404,7 @@ XX interface changing.
394### `+-rib:by`
404### `+-rib:by`
395
405
396 +- rib :: transform + product
406 +- rib :: transform + product
397− |* [b=* c=_,*]
407+ |* {b/* c/$-(* *)}
398 |- ^+ [b a]
408 |- ^+ [b a]
399 ?~ a [b ~]
409 ?~ a [b ~]
400 =+ d=(c n.a b)
410 =+ d=(c n.a b)
@@ -402,6 +412,7 @@ XX interface changing.
402 =+ e=$(a l.a, b -.d)
412 =+ e=$(a l.a, b -.d)
403 =+ f=$(a r.a, b -.e)
413 =+ f=$(a r.a, b -.e)
404 [-.f [n.a +.e +.f]]
414 [-.f [n.a +.e +.f]]
415+ ::
405
416
406Replace values with accumulator
417Replace values with accumulator
407
418
@@ -413,23 +424,23 @@ XX interface changing, possibly disappearing
413
424
414Transform values
425Transform values
415
426
416− +- run :: turns to tuples
427+ +- run :: apply gate to values
417− |* b=_,*
428+ |* b/$-(* *)
418− |-
429+ |-
419 ?~ a a
430 ?~ a a
420− a(n (b q.n.a), l $(a l.a), r $(a r.a))
431+ [n=[p=p.n.a q=(b q.n.a)] l=$(a l.a) r=$(a r.a)]
421
432
422Iterates over every value in set `a` using gate `b`. Produces a map.
433Iterates over every value in set `a` using gate `b`. Produces a map.
423
434
424−`a` is a [map]().
435+`a` is a map.
425
436
426−`b` is a [wet gate]().
437+`b` is a wet gate.
427
438
428 ~zod/try=> m
439 ~zod/try=> m
429 {[p='a' q=1] [p='b' q=2]}
440 {[p='a' q=1] [p='b' q=2]}
430 ~zod/try=> ^+(m (~(run by m) dec))
441 ~zod/try=> ^+(m (~(run by m) dec))
431 {[p='a' q=0] [p='b' q=1]}
442 {[p='a' q=0] [p='b' q=1]}
432− ~zod/try=> `(map ,@tas ,@t)`(~(run by m) (cury scot %ux))
443+ ~zod/try=> `(map @tas @t)`(~(run by m) (cury scot %ux))
433 {[p=%a q='0x1'] [p=%b q='0x2']}
444 {[p=%a q='0x1'] [p=%b q='0x2']}
434
445
435------------------------------------------------------------------------
446------------------------------------------------------------------------
@@ -440,18 +451,19 @@ Listify pairs
440
451
441 +- tap :: listify pairs
452 +- tap :: listify pairs
442 ~/ %tap
453 ~/ %tap
443− |= b=(list ,_?>(?=(^ a) n.a))
454+ |= b/(list _?>(?=(^ a) n.a))
444 ^+ b
455 ^+ b
445 ?~ a
456 ?~ a
446 b
457 b
447 $(a r.a, b [n.a $(a l.a)])
458 $(a r.a, b [n.a $(a l.a)])
459+ ::
448
460
449Produces the list of all elements in map `a` that is prepended to list
461Produces the list of all elements in map `a` that is prepended to list
450`b`, which is empty by default.
462`b`, which is empty by default.
451
463
452−`a` is a [map]().
464+`a` is a map.
453
465
454−`b` is a [list]().
466+`b` is a list.
455
467
456 {[p='a' q=1] [p='b' q=2]}
468 {[p='a' q=1] [p='b' q=2]}
457 ~zod/try=> `*`m
469 ~zod/try=> `*`m
@@ -469,7 +481,7 @@ Union
469
481
470 +- uni :: union, merge
482 +- uni :: union, merge
471 ~/ %uni
483 ~/ %uni
472− |* b=_a
484+ |* b/_a
473 |- ^+ a
485 |- ^+ a
474 ?~ b
486 ?~ b
475 a
487 a
@@ -478,21 +490,21 @@ Union
478 ?: (vor p.n.a p.n.b)
490 ?: (vor p.n.a p.n.b)
479 ?: =(p.n.b p.n.a)
491 ?: =(p.n.b p.n.a)
480 [n.b $(a l.a, b l.b) $(a r.a, b r.b)]
492 [n.b $(a l.a, b l.b) $(a r.a, b r.b)]
481− ?: (hor p.n.b p.n.a)
493+ ?: (gor p.n.b p.n.a)
482 $(a [n.a $(a l.a, b [n.b l.b ~]) r.a], b r.b)
494 $(a [n.a $(a l.a, b [n.b l.b ~]) r.a], b r.b)
483 $(a [n.a l.a $(a r.a, b [n.b ~ r.b])], b l.b)
495 $(a [n.a l.a $(a r.a, b [n.b ~ r.b])], b l.b)
484 ?: =(p.n.a p.n.b)
496 ?: =(p.n.a p.n.b)
485 [n.b $(b l.b, a l.a) $(b r.b, a r.a)]
497 [n.b $(b l.b, a l.a) $(b r.b, a r.a)]
486− ?: (hor p.n.a p.n.b)
498+ ?: (gor p.n.a p.n.b)
487 $(b [n.b $(b l.b, a [n.a l.a ~]) r.b], a r.a)
499 $(b [n.b $(b l.b, a [n.a l.a ~]) r.b], a r.a)
488 $(b [n.b l.b $(b r.b, a [n.a ~ r.a])], a l.a)
500 $(b [n.b l.b $(b r.b, a [n.a ~ r.a])], a l.a)
489
501
490Produces a map of the union between the keys of `a` and `b`. If `b`
502Produces a map of the union between the keys of `a` and `b`. If `b`
491shares a key with `a`, the tuple from `a` is preserved.
503shares a key with `a`, the tuple from `a` is preserved.
492
504
493−`a` is a [map]().
505+`a` is a map.
494
506
495−`b` is a [map]().
507+`b` is a map.
496
508
497 ~zod/try=> m
509 ~zod/try=> m
498 {[p='a' q=1] [p='b' q=2]}
510 {[p='a' q=1] [p='b' q=2]}
@@ -518,8 +530,8 @@ shares a key with `a`, the tuple from `a` is preserved.
518
530
519Turn (with key)
531Turn (with key)
520
532
521− +- urn :: turn
533+ +- urn :: apply gate to nodes
522− |* b=$+([* *] *)
534+ |* b/$-({* *} *)
523 |-
535 |-
524 ?~ a ~
536 ?~ a ~
525 [n=[p=p.n.a q=(b p.n.a q.n.a)] l=$(a l.a) r=$(a r.a)]
537 [n=[p=p.n.a q=(b p.n.a q.n.a)] l=$(a l.a) r=$(a r.a)]
@@ -527,9 +539,9 @@ Turn (with key)
527Iterates over every value in map `a` using gate `b`, which accepts both
539Iterates over every value in map `a` using gate `b`, which accepts both
528the key and the value of each element as its sample.
540the key and the value of each element as its sample.
529
541
530−`a` is a [map]().
542+`a` is a map.
531
543
532−`b` is a [wet gate]() that accepts two nouns (a key and a value) and
544+`b` is a wet gate that accepts two nouns (a key and a value) and
533produces a noun (the new value).
545produces a noun (the new value).
534
546
535 ~zod/try=> m
547 ~zod/try=> m
@@ -553,7 +565,7 @@ Depth
553
565
554Produce the depth of the tree map `a`.
566Produce the depth of the tree map `a`.
555
567
556−`a` is a [map]().
568+`a` is a map.
557
569
558 ~zod/try=> m
570 ~zod/try=> m
559 {[p='a' q=1] [p='b' q=2]}
571 {[p='a' q=1] [p='b' q=2]}
docs/system/hoon/library/src/2j/core/ja.md+11−166
@@ -2,13 +2,12 @@
2
2
3Jar engine
3Jar engine
4
4
5− ++ ja :: jar engine
6− |/ a=(jar)
5+ |_ a/(jar)
7
6
8A container arm for `++jar` operation arms. A `++jar` is a `++map` of
7A container arm for `++jar` operation arms. A `++jar` is a `++map` of
9−`++list`s. The contained arms inherit the [sample]() jar.
8+`++list`s. The contained arms inherit the sample jar.
10
9
11−`a` is a [jar]().
10+`a` is a jar.
12
11
13 ~zod/try=> ~(. ja (mo (limo a/"ho" b/"he" ~)))
12 ~zod/try=> ~(. ja (mo (limo a/"ho" b/"he" ~)))
14 <2.dgz [nlr([p={%a %b} q=""]) <414.fvk 101.jzo 1.ypj %164>]>
13 <2.dgz [nlr([p={%a %b} q=""]) <414.fvk 101.jzo 1.ypj %164>]>
@@ -19,14 +18,15 @@ A container arm for `++jar` operation arms. A `++jar` is a `++map` of
19
18
20Grab value by key
19Grab value by key
21
20
22− +- get :: grab value by key
21+ +- get :: gets list by key
23− |* b=*
22+ |* b/*
24 =+ c=(~(get by a) b)
23 =+ c=(~(get by a) b)
25 ?~(c ~ u.c)
24 ?~(c ~ u.c)
25+ ::
26
26
27Produces a list retrieved from jar `a` using the key `b`.
27Produces a list retrieved from jar `a` using the key `b`.
28
28
29−`a` is a [`++jar`](/doc/hoon/library/1#++jar).
29+`a` is a `++jar`.
30
30
31`b` is a key of the same type as the keys in `a`.
31`b` is a key of the same type as the keys in `a`.
32
32
@@ -47,14 +47,14 @@ Produces a list retrieved from jar `a` using the key `b`.
47Prepend to list
47Prepend to list
48
48
49 +- add :: adds key-list pair
49 +- add :: adds key-list pair
50− |* [b=* c=*]
50+ |* {b/* c/*}
51− =+ d=(get(+< a) b)
51+ =+ d=(get b)
52 (~(put by a) b [c d])
52 (~(put by a) b [c d])
53
53
54Produces jar `a` with value `c` prepended to the list located at key
54Produces jar `a` with value `c` prepended to the list located at key
55`b`.
55`b`.
56
56
57−`a` is a [jar]().
57+`a` is a jar.
58
58
59`b` is a key of the same type as the keys in `a`.
59`b` is a key of the same type as the keys in `a`.
60
60
@@ -73,159 +73,4 @@ Produces jar `a` with value `c` prepended to the list located at key
73 ! type-fail
73 ! type-fail
74 ! exit
74 ! exit
75
75
76−------------------------------------------------------------------------
76+**
77−
78−### `++ju`
79−
80−Jug operations
81−
82− ++ ju :: jug engine
83− |/ a=(jug)
84−
85−Container arm for jug operation arms. A `++jug` is a `++map` of
86−`++sets`. The contained arms inherit its [sample]() jug, `a`.
87−
88−`a` is a [jug]().
89−
90− ~zod/try=> ~(. ju (mo (limo a/(sa "ho") b/(sa "he") ~)))
91− <2.dgz [nlr([p={%a %b} q={nlr(^$1{@tD $1}) nlr(^$3{@tD $3})}]) <414.fvk 101.jzo 1.ypj %164>]>
92−
93−### `+-del:ju`
94−
95−Remove
96−
97− +- del :: delete at key b
98− |* [b=* c=*]
99− ^+ a
100− =+ d=(get(+< a) b)
101− =+ e=(~(del in d) c)
102− ?~ e
103− (~(del by a) b)
104− (~(put by a) b e)
105−
106−Produces jug `a` with value `c` removed from set located at key `b`.
107−
108−`a` is a [jug]().
109−
110−`b` is a key of the same type as the keys in `a`.
111−
112−`c` is the value of the same type of the keys in `a` that is to be
113−removed.
114−
115− ~zod/try=> s
116− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
117− ~zod/try=> (~(del ju s) 'a' 1)
118− {[p='a' q={3 2}] [p='b' q={5 4 6}]}
119− ~zod/try=> (~(del ju s) 'c' 7)
120− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
121−
122−------------------------------------------------------------------------
123−
124−### `+-get:ju`
125−
126−Retrieve set
127−
128− +- get :: gets set by key
129− |* b=*
130− =+ c=(~(get by a) b)
131− ?~(c ~ u.c)
132−
133−Produces a set retrieved from jar `a` using key `b`.
134−
135−`a` is a [jar]().
136−
137−`b` is a key of the same type as the keys in `a`.
138−
139− ~zod/try=> s
140− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
141− ~zod/try=> (~(get ju s) 'a')
142− {1 3 2}
143− ~zod/try=> (~(get ju s) 'b')
144− {5 4 6}
145− ~zod/try=> (~(get ju s) 'c')
146− ~
147−
148−------------------------------------------------------------------------
149−
150−### `+-has:ju`
151−
152−Check contents
153−
154− +- has :: existence check
155− |* [b=* c=*]
156− ^- ?
157− (~(has in (get(+< a) b)) c)
158−
159−Computes whether a value `c` exists within the set located at key `b`
160−with jar `a`. Produces a loobean.
161−
162−`a` is a [set]().
163−
164−`b` is a key as a [noun]().
165−
166−`c` is a value as a [noun]().
167−
168− ~zod/try=> s
169− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
170− ~zod/try=> (~(has ju s) 'a' 3)
171− %.y
172− ~zod/try=> (~(has ju s) 'b' 6)
173− %.y
174− ~zod/try=> (~(has ju s) 'a' 7)
175− %.n
176− ~zod/try=> (~(has jus s) 'c' 7)
177− ! -find-limb.jus
178− ! find-none
179− ! exit
180− ~zod/try=> (~(has ju s) 'c' 7)
181− %.n
182−
183−------------------------------------------------------------------------
184−
185−### `+-put:ju`
186−
187−Add key-set pair
188−
189− +- put :: adds key-element pair
190− |* [b=* c=*]
191− ^+ a
192− =+ d=(get(+< a) b)
193− (~(put by a) b (~(put in d) c))
194−
195−Produces jar `a` with `c` added to the set value located at key `b`.
196−
197−`a` is a [set]().
198−
199−`b` is a key as a [noun]().
200−
201−`c` is a [value]().
202−
203− ~zod/try=> s
204− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
205− ~zod/try=> (~(put ju s) 'a' 7)
206− {[p='a' q={7 1 3 2}] [p='b' q={5 4 6}]}
207− ~zod/try=> (~(put ju s) 'a' 1)
208− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
209− ~zod/try=> (~(put ju s) 'c' 7)
210− {[p='a' q={1 3 2}] [p='c' q={7}] [p='b' q={5 4 6}]}
211−
212−------------------------------------------------------------------------
213−
214−### `++by`
215−
216−Map operations
217−
218− ++ by :: map engine
219− ~/ %by
220− |/ a=(map)
221−
222−Container arm for map operation arms. A map is a set of key, value
223−pairs. The contained arms inherit it's [sample]() [map](), `a`.
224−
225−`a` is a [map]().
226−
227− ~zod/try=> ~(. by (mo (limo [%a 1] [%b 2] ~)))
228− <19.irb [nlr([p={%a %b} q=@ud]) <414.rvm 101.jzo 1.ypj %164>]>
229−
230−
231−***
docs/system/hoon/library/src/2j/core/ju.md+25−20
@@ -3,12 +3,12 @@
3Jug operations
3Jug operations
4
4
5 ++ ju :: jug engine
5 ++ ju :: jug engine
6− |/ a=(jug)
6+ |/ a/(jug)
7
7
8Container arm for jug operation arms. A `++jug` is a `++map` of
8Container arm for jug operation arms. A `++jug` is a `++map` of
9−`++sets`. The contained arms inherit its [sample]() jug, `a`.
9+`++sets`. The contained arms inherit its sample jug, `a`.
10
10
11−`a` is a [jug]().
11+`a` is a jug.
12
12
13 ~zod/try=> ~(. ju (mo (limo a/(sa "ho") b/(sa "he") ~)))
13 ~zod/try=> ~(. ju (mo (limo a/(sa "ho") b/(sa "he") ~)))
14 <2.dgz [nlr([p={%a %b} q={nlr(^$1{@tD $1}) nlr(^$3{@tD $3})}]) <414.fvk 101.jzo 1.ypj %164>]>
14 <2.dgz [nlr([p={%a %b} q={nlr(^$1{@tD $1}) nlr(^$3{@tD $3})}]) <414.fvk 101.jzo 1.ypj %164>]>
@@ -17,18 +17,20 @@ Container arm for jug operation arms. A `++jug` is a `++map` of
17
17
18Remove
18Remove
19
19
20− +- del :: delete at key b
20+ +- del :: del key-set pair
21− |* [b=* c=*]
21+ |* {b/* c/*}
22 ^+ a
22 ^+ a
23− =+ d=(get(+< a) b)
23+ =+ d=(get b)
24 =+ e=(~(del in d) c)
24 =+ e=(~(del in d) c)
25 ?~ e
25 ?~ e
26 (~(del by a) b)
26 (~(del by a) b)
27 (~(put by a) b e)
27 (~(put by a) b e)
28+ ::
29+
28
30
29Produces jug `a` with value `c` removed from set located at key `b`.
31Produces jug `a` with value `c` removed from set located at key `b`.
30
32
31−`a` is a [jug]().
33+`a` is a jug.
32
34
33`b` is a key of the same type as the keys in `a`.
35`b` is a key of the same type as the keys in `a`.
34
36
@@ -49,13 +51,14 @@ removed.
49Retrieve set
51Retrieve set
50
52
51 +- get :: gets set by key
53 +- get :: gets set by key
52− |* b=*
54+ |* b/*
53 =+ c=(~(get by a) b)
55 =+ c=(~(get by a) b)
54 ?~(c ~ u.c)
56 ?~(c ~ u.c)
57+ ::
55
58
56Produces a set retrieved from jar `a` using key `b`.
59Produces a set retrieved from jar `a` using key `b`.
57
60
58−`a` is a [jar]().
61+`a` is a jar.
59
62
60`b` is a key of the same type as the keys in `a`.
63`b` is a key of the same type as the keys in `a`.
61
64
@@ -75,18 +78,20 @@ Produces a set retrieved from jar `a` using key `b`.
75Check contents
78Check contents
76
79
77 +- has :: existence check
80 +- has :: existence check
78− |* [b=* c=*]
81+ |* {b/* c/*}
79 ^- ?
82 ^- ?
80− (~(has in (get(+< a) b)) c)
83+ (~(has in (get b)) c)
84+ ::
85+
81
86
82Computes whether a value `c` exists within the set located at key `b`
87Computes whether a value `c` exists within the set located at key `b`
83with jar `a`. Produces a loobean.
88with jar `a`. Produces a loobean.
84
89
85−`a` is a [set]().
90+`a` is a set.
86
91
87−`b` is a key as a [noun]().
92+`b` is a key as a noun.
88
93
89−`c` is a value as a [noun]().
94+`c` is a value as a noun.
90
95
91 ~zod/try=> s
96 ~zod/try=> s
92 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
97 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
@@ -109,19 +114,19 @@ with jar `a`. Produces a loobean.
109
114
110Add key-set pair
115Add key-set pair
111
116
112− +- put :: adds key-element pair
117+ +- put :: add key-set pair
113− |* [b=* c=*]
118+ |* {b/* c/*}
114 ^+ a
119 ^+ a
115− =+ d=(get(+< a) b)
120+ =+ d=(get b)
116 (~(put by a) b (~(put in d) c))
121 (~(put by a) b (~(put in d) c))
117
122
118Produces jar `a` with `c` added to the set value located at key `b`.
123Produces jar `a` with `c` added to the set value located at key `b`.
119
124
120−`a` is a [set]().
125+`a` is a set.
121
126
122−`b` is a key as a [noun]().
127+`b` is a key as a noun.
123
128
124−`c` is a [value]().
129+`c` is a value.
125
130
126 ~zod/try=> s
131 ~zod/try=> s
127 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
132 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
docs/system/hoon/library/src/2k/core/to.md+40−36
@@ -3,18 +3,18 @@
3Queue operations
3Queue operations
4
4
5Container arm for queue operation arms. The contained arms inherit its
5Container arm for queue operation arms. The contained arms inherit its
6−[sample]() `++qeu` `a`.
6+sample `++qeu` `a`.
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`a` is a queue, [++qeu]().
11+`a` is a queue, ++qeu.
12
12
13Source
13Source
14------
14------
15
15
16 ++ to :: queue engine
16 ++ to :: queue engine
17− |/ a=(qeu)
17+ |/ a/(qeu)
18
18
19### `+-bal:to`
19### `+-bal:to`
20
20
@@ -25,12 +25,12 @@ Vertically rebalances queue `a`.
25Accepts
25Accepts
26-------
26-------
27
27
28−`a` is a [queue]().
28+`a` is a queue.
29
29
30Produces
30Produces
31--------
31--------
32
32
33−A [queue]().
33+A queue.
34
34
35Source
35Source
36------
36------
@@ -38,13 +38,14 @@ Source
38 +- bal
38 +- bal
39 |- ^+ a
39 |- ^+ a
40 ?~ a ~
40 ?~ a ~
41− ?. |(?=(~ l.a) (vor n.a n.l.a))
41+ ?. |(?=($~ l.a) (vor n.a n.l.a))
42 $(a [n.l.a l.l.a $(a [n.a r.l.a r.a])])
42 $(a [n.l.a l.l.a $(a [n.a r.l.a r.a])])
43− ?. |(?=(~ r.a) (vor n.a n.r.a))
43+ ?. |(?=($~ r.a) (vor n.a n.r.a))
44 $(a [n.r.a $(a [n.a l.a l.r.a]) r.r.a])
44 $(a [n.r.a $(a [n.a l.a l.r.a]) r.r.a])
45 a
45 a
46 ::
46 ::
47
47
48+
48Examples
49Examples
49--------
50--------
50
51
@@ -68,7 +69,7 @@ Produces the maximum depth of leaves (r.a and l.a) in queue `a`.
68Accepts
69Accepts
69-------
70-------
70
71
71−`a` is a [queue]().
72+`a` is a queue.
72
73
73Produces
74Produces
74--------
75--------
@@ -84,16 +85,17 @@ Source
84 +((max $(a l.a) $(a r.a)))
85 +((max $(a l.a) $(a r.a)))
85 ::
86 ::
86
87
88+
87Examples
89Examples
88--------
90--------
89
91
90− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 5 6 7 ~])
92+ ~zod/try=> =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 7 ~])
91 ~zod/try=> ~(dep to a)
93 ~zod/try=> ~(dep to a)
92 4
94 4
93− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 ~])
95+ ~zod/try=> =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 ~])
94 ~zod/try=> ~(dep to a)
96 ~zod/try=> ~(dep to a)
95 3
97 3
96− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 ~])
98+ ~zod/try=> =a (~(gas to `(qeu @)`~) `(list @)`[1 2 ~])
97 ~zod/try=> ~(dep to a)
99 ~zod/try=> ~(dep to a)
98 2
100 2
99 ~zod/try=> ~(dep to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~])
101 ~zod/try=> ~(dep to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~])
@@ -107,7 +109,7 @@ Examples
107
109
108Push list
110Push list
109
111
110−Push all elements of [`++list`]() `b` into the [`++queue`]().
112+Push all elements of `++list` `b` into the `++queue`.
111
113
112Accepts
114Accepts
113-------
115-------
@@ -146,7 +148,7 @@ Examples
146
148
147Pop
149Pop
148
150
149−Produces the head and tail [`++queue`]() of `a`.
151+Produces the head and tail `++queue` of `a`.
150
152
151Accepts
153Accepts
152-------
154-------
@@ -162,14 +164,14 @@ Source
162------
164------
163
165
164 +- get :: head-tail pair
166 +- get :: head-tail pair
165− |- ^+ [p=?>(?=(^ a) n.a) q=a]
167+ |- ^+ ?>(?=(^ a) [p=n.a q=*(qeu _n.a)])
166 ?~ a
168 ?~ a
167 !!
169 !!
168 ?~ r.a
170 ?~ r.a
169 [n.a l.a]
171 [n.a l.a]
170 =+ b=$(a r.a)
172 =+ b=$(a r.a)
171 :- p.b
173 :- p.b
172− ?: |(?=(~ q.b) (vor n.a n.q.b))
174+ ?: |(?=($~ q.b) (vor n.a n.q.b))
173 [n.a l.a q.b]
175 [n.a l.a q.b]
174 [n.q.b [n.a l.a l.q.b] r.q.b]
176 [n.q.b [n.a l.a l.q.b] r.q.b]
175 ::
177 ::
@@ -177,7 +179,7 @@ Source
177Examples
179Examples
178--------
180--------
179
181
180− ~zod/try=> =s (~(gas to *(qeu ,@)) `(list ,@)`~[1 2 3])
182+ ~zod/try=> =s (~(gas to *(qeu @)) `(list @)`~[1 2 3])
181 ~zod/try=> ~(get to s)
183 ~zod/try=> ~(get to s)
182 [p=1 q={3 2}]
184 [p=1 q={3 2}]
183 ~zod/try=> ~(get to ~)
185 ~zod/try=> ~(get to ~)
@@ -189,12 +191,12 @@ Examples
189
191
190Remove last element
192Remove last element
191
193
192−Removes the head of [`++queue`]() `a`, producing the resulting queue.
194+Removes the head of `++queue` `a`, producing the resulting queue.
193
195
194Accepts
196Accepts
195-------
197-------
196
198
197−`a` is a [queue]().
199+`a` is a queue.
198
200
199Produces
201Produces
200--------
202--------
@@ -207,14 +209,14 @@ Source
207 +- nap :: removes head
209 +- nap :: removes head
208 ?> ?=(^ a)
210 ?> ?=(^ a)
209 ?: =(~ l.a) r.a
211 ?: =(~ l.a) r.a
210− =+ b=get(+< l.a)
212+ =+ b=get(a l.a)
211− bal(+< ^+(a [p.b q.b r.a]))
213+ bal(a ^+(a [p.b q.b r.a]))
212 ::
214 ::
213
215
214Examples
216Examples
215--------
217--------
216
218
217− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 5 6 ~])
219+ ~zod/try=> =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 ~])
218 ~zod/try=> -.a
220 ~zod/try=> -.a
219 n=6
221 n=6
220 ~zod/try=> =b ~(nap to a)
222 ~zod/try=> =b ~(nap to a)
@@ -231,13 +233,13 @@ Examples
231
233
232Insert
234Insert
233
235
234−Accept any [noun]() `b` and adds to [`++queue`]() `a` as the head, producing the
236+Accept any noun `b` and adds to `++queue` `a` as the head, producing the
235resulting queue.
237resulting queue.
236
238
237Accepts
239Accepts
238-------
240-------
239
241
240−`a` is a [queue]().
242+`a` is a queue.
241
243
242`b` is any noun.
244`b` is any noun.
243
245
@@ -250,17 +252,18 @@ Source
250------
252------
251
253
252 +- put :: insert new tail
254 +- put :: insert new tail
253− |* b=*
255+ |* b/*
254 |- ^+ a
256 |- ^+ a
255 ?~ a
257 ?~ a
256 [b ~ ~]
258 [b ~ ~]
257− bal(+< a(l $(a l.a)))
259+ bal(a a(l $(a l.a)))
258 ::
260 ::
259
261
262+
260Examples
263Examples
261--------
264--------
262
265
263− ~zod/try=> (~(gas to `(qeu ,@)`~) `(list ,@)`[3 1 2 4 5 6 ~])
266+ ~zod/try=> (~(gas to `(qeu @)`~) `(list @)`[3 1 2 4 5 6 ~])
264 ~zod/try=> (~(put to a) 7)
267 ~zod/try=> (~(put to a) 7)
265 {7 6 5 4 2 1 3}
268 {7 6 5 4 2 1 3}
266
269
@@ -270,18 +273,19 @@ Examples
270
273
271Queue to list
274Queue to list
272
275
273−Produces [`++queue`]() `a` as a [`++list`]() from front to back.
276+Produces `++queue` `a` as a `++list` from front to back.
274
277
275Accepts
278Accepts
276-------
279-------
277
280
278−`a` is a [queue]().
281+`a` is a queue.
279
282
280Source
283Source
281------
284------
282
285
283− +- tap :: queue to list
286+ +- tap :: adds list to end
284− |= b=(list ,_?>(?=(^ a) n.a))
287+ |= b/(list _?>(?=(^ a) n.a))
288+ =+ z=0 :: XX breaks jet match
285 ^+ b
289 ^+ b
286 ?~ a
290 ?~ a
287 b
291 b
@@ -291,22 +295,22 @@ Source
291Examples
295Examples
292--------
296--------
293
297
294− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[3 1 2 4 5 6 ~])
298+ ~zod/try=> =a (~(gas to `(qeu @)`~) `(list @)`[3 1 2 4 5 6 ~])
295 ~zod/try=> `*`a
299 ~zod/try=> `*`a
296 [6 0 2 [4 [5 0 0] 0] 1 0 3 0 0]
300 [6 0 2 [4 [5 0 0] 0] 1 0 3 0 0]
297− ~zod/try=> (~(tap to a) `(list ,@)`[99 100 101 ~])
301+ ~zod/try=> (~(tap to a) `(list @)`[99 100 101 ~])
298 ~[3 1 2 4 5 6 99 100 101]
302 ~[3 1 2 4 5 6 99 100 101]
299
303
300------------------------------------------------------------------------
304------------------------------------------------------------------------
301
305
302### `+-top:to`
306### `+-top:to`
303
307
304−Produces the head of [`++queue`]() `a` as a [`++unit`]() (an empty queue has no head).
308+Produces the head of `++queue` `a` as a `++unit` (an empty queue has no head).
305
309
306Accepts
310Accepts
307-------
311-------
308
312
309−`a` is a [queue]().
313+`a` is a queue.
310
314
311Produces
315Produces
312--------
316--------
@@ -317,14 +321,14 @@ Source
317------
321------
318
322
319 +- top :: produces head
323 +- top :: produces head
320− |- ^- (unit ,_?>(?=(^ a) n.a))
324+ |- ^- (unit _?>(?=(^ a) n.a))
321 ?~ a ~
325 ?~ a ~
322 ?~(r.a [~ n.a] $(a r.a))
326 ?~(r.a [~ n.a] $(a r.a))
323
327
324Examples
328Examples
325--------
329--------
326
330
327− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 5 6 ~])
331+ ~zod/try=> =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 ~])
328 ~zod/try=> ~(top to a)
332 ~zod/try=> ~(top to a)
329 [~ 1]
333 [~ 1]
330
334
docs/system/hoon/library/src/2n/gate/cork.md+3−2
@@ -9,14 +9,15 @@ Build `f` such that `(f x) .= (b (a x))`.
9Source
9Source
10------
10------
11
11
12− ++ cork |*([a=_,* b=gate] (corl b a)) :: compose forward
12+ ++ cork |*({a/_|=(* **) b/gate} (corl b a)) :: compose forward
13+
13
14
14Examples
15Examples
15--------
16--------
16
17
17 ~zod/try=> (:(cork dec dec dec) 20)
18 ~zod/try=> (:(cork dec dec dec) 20)
18 17
19 17
19− ~zod/try=> =mal (mo (limo a/15 b/23 ~))
20+ ~zod/try=> =mal (mo (limo a+15 b+23 ~))
20 ~zod/try=> ((cork ~(got by mal) dec) %a)
21 ~zod/try=> ((cork ~(got by mal) dec) %a)
21 14
22 14
22 ~zod/try=> ((cork ~(got by mal) dec) %b)
23 ~zod/try=> ((cork ~(got by mal) dec) %b)
docs/system/hoon/library/src/2n/gate/corl.md+4−2
@@ -12,9 +12,11 @@ Source
12------
12------
13
13
14 ++ corl :: compose backwards
14 ++ corl :: compose backwards
15− |* [a=gate b=_,*]
15+ |* {a/gate b/_|=(* **)}
16+ =< +:|.((a (b))) :: span check
16− |= c=_+<.b
17+ |* c/_+<.b
17 (a (b c))
18 (a (b c))
19+ ::
18
20
19Examples
21Examples
20--------
22--------
docs/system/hoon/library/src/2n/gate/curr.md+6−5
@@ -7,9 +7,9 @@ Right curry a gate, binding the tail of its sample
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a [gate]().
10+`a` is a gate.
11
11
12−`c` is a [noun]().
12+`c` is a noun.
13
13
14Produces
14Produces
15--------
15--------
@@ -18,10 +18,11 @@ Produces
18Source
18Source
19------
19------
20
20
21− ++ curr
21+ ++ curr :: curry right
22− |* [a=_|=(^ _*) c=*]
22+ |* {a/_|=(^ **) c/*}
23− |* b=_+<+.a
23+ |* b/_+<+.a
24 (a b c)
24 (a b c)
25+ ::
25
26
26Examples
27Examples
27--------
28--------
docs/system/hoon/library/src/2n/gate/cury.md+8−6
@@ -5,22 +5,24 @@ Curry a gate, binding the head of its sample
5Accepts
5Accepts
6-------
6-------
7
7
8−`a` is a [gate]().
8+`a` is a gate.
9
9
10−`b` is a [noun]().
10+`b` is a noun.
11
11
12Produces
12Produces
13--------
13--------
14
14
15−A [gate]().
15+A gate.
16
16
17Source
17Source
18------
18------
19
19
20− ++ cury
20+ ++ cury :: curry left
21− |* [a=_|=(^ _*) b=*]
21+ |* {a/_|=(^ **) b/*}
22− |* c=_+<+.a
22+ |* c/_+<+.a
23 (a b c)
23 (a b c)
24+ ::
25+
24
26
25Examples
27Examples
26--------
28--------
docs/system/hoon/library/src/2n/gate/hard.md+7−8
@@ -6,21 +6,20 @@ not.
6Source
6Source
7------
7------
8
8
9− ++ hard
9+ ++ cury :: curry left
10− |* han=$+(* *)
10+ |* {a/_|=(^ **) b/*}
11− |= fud=* ^- han
11+ |* c/_+<+.a
12− ~| %hard
12+ (a b c)
13− =+ gol=(han fud)
13+ ::
14− ?>(=(gol fud) gol)
15
14
16Examples
15Examples
17--------
16--------
18
17
19 ~zod/try=> ((hard (list)) (limo [1 2 3 ~]))
18 ~zod/try=> ((hard (list)) (limo [1 2 3 ~]))
20 ~[1 2 3]
19 ~[1 2 3]
21− ~zod/try=> ((hard ,@) (add 2 2))
20+ ~zod/try=> ((hard @) (add 2 2))
22 4
21 4
23− ~zod/try=> ((hard ,@t) (crip "Tape to cord, bro!"))
22+ ~zod/try=> ((hard @t) (crip "Tape to cord, bro!"))
24 'Tape to cord, bro'
23 'Tape to cord, bro'
25 ~zod/try=> ((hard tape) (crip "...Tape to cord, bro?..."))
24 ~zod/try=> ((hard tape) (crip "...Tape to cord, bro?..."))
26 ! hard
25 ! hard
docs/system/hoon/library/src/2n/gate/soft.md+9−8
@@ -6,24 +6,25 @@ is not.
6Source
6Source
7------
7------
8
8
9− ++ soft
9+ ++ soft :: maybe coerce to span
10− |* han=$+(* *)
10+ |* han/$-(* *)
11− |= fud=* ^- (unit han)
11+ |= fud/* ^- (unit han)
12 =+ gol=(han fud)
12 =+ gol=(han fud)
13 ?.(=(gol fud) ~ [~ gol])
13 ?.(=(gol fud) ~ [~ gol])
14+ ::
14
15
15Examples
16Examples
16--------
17--------
17
18
18− ~zod/try=> ((soft ,%4) (add 2 2))
19+ ~zod/try=> ((soft %4) (add 2 2))
19 [~ %4]
20 [~ %4]
20− ~zod/try=> ((soft ,@) (add 2 2))
21+ ~zod/try=> ((soft @) (add 2 2))
21 [~ 4]
22 [~ 4]
22− ~zod/try=> ((soft ,%5) (add 2 2))
23+ ~zod/try=> ((soft %5) (add 2 2))
23 ~
24 ~
24− ~zod/try=> ((soft ,@t) (crip "Tape to cord, Woohoo!"))
25+ ~zod/try=> ((soft @t) (crip "Tape to cord, Woohoo!"))
25 [~ 'Tape to cord, Woohoo!']
26 [~ 'Tape to cord, Woohoo!']
26− ~zod/try=> ((soft ,@t) (trip 'Cmon man... Tape to cord? Please?!'))
27+ ~zod/try=> ((soft @t) (trip 'Cmon man... Tape to cord? Please?!'))
27 ~
28 ~
28
29
29
30
docs/system/hoon/library/src/2o/mold/jar.md+4−3
@@ -1,17 +1,18 @@
1### `++jar`
1### `++jar`
2
2
3
3
4−Tile generator. A [`++jar`]() is a [`++map`]() of [`++list`]().
4+Tile generator. A `++jar` is a `++map` of `++list`.
5
5
6Source
6Source
7------
7------
8
8
9− ++ jar |*([a=_,* b=_,*] (map a (list b))) :: map of lists
9+ ++ jar |*({a/$-(* *) b/$-(* *)} (map a (list b))) :: map of lists
10+
10
11
11Examples
12Examples
12--------
13--------
13
14
14−See also: [`++ja`](), [`++by`](), [`++map`](), [`++list`]()
15+See also: `++ja`, `++by`, `++map`, `++list`
15
16
16 ~zod/try=> =a (limo [1 2 ~])
17 ~zod/try=> =a (limo [1 2 ~])
17 ~zod/try=> a
18 ~zod/try=> a
docs/system/hoon/library/src/2o/mold/jug.md+3−2
@@ -1,11 +1,12 @@
1### `++jug`
1### `++jug`
2
2
3−[mold]() generator. A `++jug` is a [`++map`]() of [`++set`]()s.
3+mold generator. A `++jug` is a `++map` of `++set`s.
4
4
5Source
5Source
6------
6------
7
7
8− ++ jug |*([a=_,* b=_,*] (map a (set b))) :: map of sets
8+ ++ jug |*({a/$-(* *) b/$-(* *)} (map a (set b))) :: map of sets
9+
9
10
10Examples
11Examples
11--------
12--------
docs/system/hoon/library/src/2o/mold/map.md+12−11
@@ -2,26 +2,27 @@
2
2
3Map
3Map
4
4
5−[mold]() generator. A `++map` is a [treap](http://en.wikipedia.org/wiki/Treap) of
5+mold generator. A `++map` is a treap of
6−key, value pairs.
6+key-value pairs.
7
7
8
8
9Source
9Source
10------
10------
11
11
12− ++ map |* [a=_,* b=_,*] :: associative tree
12+ ++ map |* {a/$-(* *) b/$-(* *)} :: associative tree
13+ $@($~ {n/{p/a q/b} l/(map a b) r/(map a b)}) ::
14+
13
15
14Examples
16Examples
15--------
17--------
16
18
17−See also: [`++by`]()
19+See also: `++by`
18−
19− ~zod/try=> :type; *(map ,@t ,@u)
20− {}
21− nlr([p=@t q=@u])
22− ~zod/try=> `(map ,@ta ,@ud)`(mo (limo a/1 b/2 ~))
23− {[p=~.a q=1] [p=~.b q=2]}
24−
25
20
21+ ~zod/try=>? *(map @t @u)
22+ nlr({p/@t q/@u})
23+ {}
24+ ~zod/try=> (molt `(list (pair * *))`[[a+1 b+2] ~])
25+ {[p=[97 1] q=[98 2]]}
26+
26
27
27***
28***
docs/system/hoon/library/src/2o/mold/qeu.md+3−4
@@ -2,16 +2,15 @@
2
2
3Queue
3Queue
4
4
5−[mold]() generator. An ordered [treap](http://en.wikipedia.org/wiki/Treap) of
5+mold generator. An ordered [treap](http://en.wikipedia.org/wiki/Treap) of
6items.
6items.
7
7
8Source
8Source
9------
9------
10
10
11− ++ qeu |* a=_,* :: queue
11+ ++ qeu |* a/$-(* *) :: queue
12− $|(~ [n=a l=(qeu a) r=(qeu a)]) ::
12+ $@($~ {n/a l/(qeu a) r/(qeu a)}) ::
13
13
14−See also: [`++to`]()
15
14
16Examples
15Examples
17--------
16--------
docs/system/hoon/library/src/2o/mold/set.md+5−5
@@ -2,19 +2,19 @@
2
2
3Set
3Set
4
4
5−[mold]() generator. A `++set` is a
5+mold generator. A `++set` is a treap with unique values.
6−[treap](http://en.wikipedia.org/wiki/Treap) with unique values.
7
6
8Source
7Source
9------
8------
10
9
11− ++ set |* a=_,* :: set
10+ ++ set |* a/$-(* *) :: set
12− $|(~ [n=a l=(set a) r=(set a)]) ::
11+ $@($~ {n/a l/(set a) r/(set a)}) ::
12+
13
13
14Examples
14Examples
15--------
15--------
16
16
17−See also: [`++in`]()
17+See also: `++in`
18
18
19 ~zod/try=> (sa "abc")
19 ~zod/try=> (sa "abc")
20 {~~a ~~c ~~b}
20 {~~a ~~c ~~b}
docs/system/hoon/library/src/2p/gate/cue.md+6−6
@@ -7,24 +7,24 @@ Produces a noun unpacked from atom `a`. The inverse of jam.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12Produces
12Produces
13--------
13--------
14
14
15−A [`++noun`]().
15+A `++noun`.
16
16
17Source
17Source
18------
18------
19
19
20− ++ cue :: unpack atom to noun
20+ ++ cue :: unpack
21 ~/ %cue
21 ~/ %cue
22− |= a=@
22+ |= a/@
23 ^- *
23 ^- *
24 =+ b=0
24 =+ b=0
25− =+ m=`(map ,@ ,*)`~
25+ =+ m=`(map @ *)`~
26 =< q
26 =< q
27− |- ^- [p=@ q=* r=_m]
27+ |- ^- {p/@ q/* r/(map @ *)}
28 ?: =(0 (cut 0 [b 1] a))
28 ?: =(0 (cut 0 [b 1] a))
29 =+ c=(rub +(b) a)
29 =+ c=(rub +(b) a)
30 [+(p.c) q.c (~(put by m) b q.c)]
30 [+(p.c) q.c (~(put by m) b q.c)]
docs/system/hoon/library/src/2p/gate/jam.md+4−4
@@ -7,7 +7,7 @@ Produces an atom unpacked from noun `a`. The inverse of cue.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a [noun]().
10+`a` is a noun.
11
11
12Produces
12Produces
13--------
13--------
@@ -19,12 +19,12 @@ Source
19
19
20 ++ jam :: pack
20 ++ jam :: pack
21 ~/ %jam
21 ~/ %jam
22− |= a=*
22+ |= a/*
23 ^- @
23 ^- @
24 =+ b=0
24 =+ b=0
25− =+ m=`(map ,* ,@)`~
25+ =+ m=`(map * @)`~
26 =< q
26 =< q
27− |- ^- [p=@ q=@ r=_m]
27+ |- ^- {p/@ q/@ r/(map * @)}
28 =+ c=(~(get by m) a)
28 =+ c=(~(get by m) a)
29 ?~ c
29 ?~ c
30 => .(m (~(put by m) a b))
30 => .(m (~(put by m) a b))
docs/system/hoon/library/src/2p/gate/mat.md+4−3
@@ -19,16 +19,17 @@ A cell of two atoms, `p` and `q`.
19Source
19Source
20------
20------
21
21
22− ++ mat :: length-encode
22+ ++ mat :: length-encode
23 ~/ %mat
23 ~/ %mat
24− |= a=@
24+ |= a/@
25− ^- [p=@ q=@]
25+ ^- {p/@ q/@}
26 ?: =(0 a)
26 ?: =(0 a)
27 [1 1]
27 [1 1]
28 =+ b=(met 0 a)
28 =+ b=(met 0 a)
29 =+ c=(met 0 b)
29 =+ c=(met 0 b)
30 :- (add (add c c) b)
30 :- (add (add c c) b)
31 (cat 0 (bex c) (mix (end 0 (dec c) b) (lsh 0 (dec c) a)))
31 (cat 0 (bex c) (mix (end 0 (dec c) b) (lsh 0 (dec c) a)))
32+ ::
32
33
33
34
34Examples
35Examples
docs/system/hoon/library/src/2p/gate/rub.md+2−2
@@ -24,8 +24,8 @@ Source
24
24
25 ++ rub :: length-decode
25 ++ rub :: length-decode
26 ~/ %rub
26 ~/ %rub
27− |= [a=@ b=@]
27+ |= {a/@ b/@}
28− ^- [p=@ q=@]
28+ ^- {p/@ q/@}
29 =+ ^= c
29 =+ ^= c
30 =+ [c=0 m=(met 0 b)]
30 =+ [c=0 m=(met 0 b)]
31 |- ?< (gth c m)
31 |- ?< (gth c m)
docs/system/hoon/library/src/2q/mold/char.md+3−3
@@ -2,14 +2,14 @@
2
2
3Char
3Char
4
4
5−A single character. [odor]() [`@tD`]() designates a single unicode byte. All
5+A single character. odor `@tD` designates a single unicode byte. All
6−parsers consume [`++tape`]()s, which are lists of `++char`.
6+parsers consume `++tape`s, which are lists of `++char`.
7
7
8
8
9Source
9Source
10------
10------
11
11
12− ++ char ,@tD :: UTF-8 byte
12+ ++ char @tD :: UTF-8 byte
13
13
14Examples
14Examples
15--------
15--------
docs/system/hoon/library/src/2q/mold/cord.md+4−4
@@ -2,19 +2,19 @@
2
2
3UTF-8 text
3UTF-8 text
4
4
5−One of Hoon's two string types (the other being [`++tape`]()). A cord is an
5+One of Hoon's two string types (the other being `++tape`). A cord is an
6−atom of UTF-8 text. [`++trip`]() and [`++crip`]() convert between cord and
6+atom of UTF-8 text. `++trip` and `++crip` convert between cord and
7`++tape`.
7`++tape`.
8
8
9Source
9Source
10------
10------
11
11
12− ++ cord ,@t :: text atom (UTF-8)
12+ ++ cord @t :: text atom (UTF-8)
13
13
14Examples
14Examples
15--------
15--------
16
16
17−Odor [`@t`]() designates a Unicode atom, little-endian: the first character
17+Odor `@t` designates a Unicode atom, little-endian: the first character
18in the text is the low byte.
18in the text is the low byte.
19
19
20 ~zod/try=> `@ux`'foobar'
20 ~zod/try=> `@ux`'foobar'
docs/system/hoon/library/src/2q/mold/date.md+4−3
@@ -3,17 +3,18 @@
3Point in time
3Point in time
4
4
5A boolean designating AD or BC, a year atom, a month
5A boolean designating AD or BC, a year atom, a month
6−atom, and a [`++tarp`](), which is a day atom and a time.
6+atom, and a `++tarp`, which is a day atom and a time.
7
7
8Source
8Source
9------
9------
10
10
11− ++ date ,[[a=? y=@ud] m=@ud t=tarp] :: parsed date
11+ ++ date {{a/? y/@ud} m/@ud t/tarp} :: parsed date
12+
12
13
13Examples
14Examples
14--------
15--------
15
16
16−See also: [`++year`](), [`++yore`]() [`++stud`](), [`++dust`]()
17+See also: `++year`, `++yore` `++stud`, `++dust`
17
18
18 ~zod/try=> `date`(yore ~2014.6.6..21.09.15..0a16)
19 ~zod/try=> `date`(yore ~2014.6.6..21.09.15..0a16)
19 [[a=%.y y=2.014] m=6 t=[d=6 h=21 m=9 s=15 f=~[0xa16]]]
20 [[a=%.y y=2.014] m=6 t=[d=6 h=21 m=9 s=15 f=~[0xa16]]]
docs/system/hoon/library/src/2q/mold/tank.md+8−8
@@ -10,16 +10,16 @@ list of `++tank` delimted by the strings in `p`.
10Source
10Source
11------
11------
12
12
13− ++ tank $% [%leaf p=tape] :: printing formats
13+ ++ tank $% {$leaf p/tape} :: printing formats
14− $: %palm :: backstep list
14+ $: $palm :: backstep list
15− p=[p=tape q=tape r=tape s=tape] ::
15+ p/{p/tape q/tape r/tape s/tape} ::
16− q=(list tank) ::
16+ q/(list tank) ::
17 == ::
17 == ::
18− $: %rose :: flat list
18+ $: $rose :: flat list
19− p=[p=tape q=tape r=tape] :: mid open close
19+ p/{p/tape q/tape r/tape} :: mid open close
20− q=(list tank) ::
20+ q/(list tank) ::
21 == ::
21 == ::
22− ==
22+ == ::
23
23
24Examples
24Examples
25--------
25--------
docs/system/hoon/library/src/2q/mold/tape.md+1−1
@@ -3,7 +3,7 @@
3
3
4List of chars
4List of chars
5
5
6−One of Hoon's two string types, the other being [`++cord`](). A tape is a
6+One of Hoon's two string types, the other being `++cord`. A tape is a
7list of chars.
7list of chars.
8
8
9Source
9Source
docs/system/hoon/library/src/2q/mold/tarp.md+4−4
@@ -2,18 +2,18 @@
2
2
3Day through second
3Day through second
4
4
5−The remaining part of a [`++date`](): day, hour, minute, second and a list
5+The remaining part of a `++date`: day, hour, minute, second and a list
6−of [`@ux`]() for precision.
6+of `@ux` for precision.
7
7
8Source
8Source
9------
9------
10
10
11− @ud h=@ud m=@ud s=@ud f=(list ,@ux)] :: parsed time
11+ ++ tarp {d/@ud h/@ud m/@ud s/@ud f/(list @ux)} :: parsed time
12+
12
13
13Examples
14Examples
14--------
15--------
15
16
16−See also: [`++date`](), [`++yell`[]()/`++yule`]()
17
17
18 ~zod/try=> -<-
18 ~zod/try=> -<-
19 ~2014.9.20..00.43.33..b52a
19 ~2014.9.20..00.43.33..b52a
docs/system/hoon/library/src/2q/mold/term.md+3−3
@@ -4,15 +4,15 @@ Hoon constants
4
4
5A restricted text atom for Hoon constants. The only characters permitted are
5A restricted text atom for Hoon constants. The only characters permitted are
6lowercase ASCII, `-`, and `0-9`, the latter two of which can neither be the first or last
6lowercase ASCII, `-`, and `0-9`, the latter two of which can neither be the first or last
7−character. The syntax for [`@tas`]() is the text itself, always preceded by `%`.
7+character. The syntax for `@tas` is the text itself, always preceded by `%`.
8−This means a term is always [cubical](). The empty `@tas` has a special syntax,
8+This means a term is always cubical. The empty `@tas` has a special syntax,
9`$`.
9`$`.
10
10
11
11
12Source
12Source
13------
13------
14
14
15− ++ term ,@tas :: Hoon ASCII subset
15+ ++ term @tas :: Hoon ASCII subset
16
16
17Examples
17Examples
18--------
18--------
docs/system/hoon/library/src/2q/mold/wain.md+2−22
@@ -2,33 +2,13 @@
2
2
3 ++ wain (list cord) :: text lines (no \n)
3 ++ wain (list cord) :: text lines (no \n)
4
4
5−A list of lines. A `++wain` is used instead of a single [`++cord`]() with
5+A list of lines. A `++wain` is used instead of a single `++cord` with
6`\n`.
6`\n`.
7
7
8−See also: [`++lore`](), [`++role`]()
8+See also: `++lore`, `++role`
9
9
10 ~zod/try=> `wain`/som/del/rok
10 ~zod/try=> `wain`/som/del/rok
11 <|som del rok|>
11 <|som del rok|>
12− ~zod/try=> `wain`(lore ^:@t/=main=/bin/tree/hoon)
13− <|
14− !:
15− :: /===/bin/tree/hoon
16− |= ^
17− |= [pax=path fla=$|(~ [%full ~])]
18− =- ~[te/-]~
19− =+ len=(lent pax)
20− =+ rend=?~(fla |=(a=path +:(spud (slag len a))) spud)
21− |- ^- wain
22− =+ ark=;;(arch .^(cy/pax))
23− =- ?~ q.ark -
24− [(crip (rend pax)) -]
25− %- zing
26− %- turn :_ |=(a=@t ^$(pax (weld pax `path`/[a])))
27− %- sort :_ aor
28− %- turn :_ |=([a=@t ~] a)
29− (~(tap by r.ark))
30− |>
31−
32
12
33
13
34***
14***
docs/system/hoon/library/src/2q/mold/wall.md+5−11
@@ -3,7 +3,7 @@
3List of lines
3List of lines
4
4
5
5
6−A `++wall` is used instead of a single [`++tape`]() with
6+A `++wall` is used instead of a single `++tape` with
7`\n`.
7`\n`.
8
8
9Source
9Source
@@ -14,20 +14,14 @@ Source
14Examples
14Examples
15--------
15--------
16
16
17−See also: [`++wash`]()
17+See also: `++wash`
18
18
19− ~zod/try=> `wall`(wash [0 20] leaf/<(bex 256)>)
19+ ~zod/try=> `wall`(wash [0 20] leaf+<(bex 256)>)
20 <<
20 <<
21− "\/115.792.089.237.\/"
21+ "115.792.089.237.316.195.423.570.985.008.687.907.853.269.984.665.640.564.039.457.584.007.913.129.639.936"
22− " 316.195.423.570."
23− " 985.008.687.907."
24− " 853.269.984.665."
25− " 640.564.039.457."
26− " 584.007.913.129."
27− " 639.936"
28− "\/ \/"
29 >>
22 >>
30
23
31
24
32
25
26+
33***
27***
docs/system/hoon/library/src/3a/core/fe.md+25−24
@@ -7,22 +7,22 @@ Core containing XX
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a [`++bloq`]().
10+`a` is a `++bloq`.
11
11
12Source
12Source
13------
13------
14
14
15− |_ a=bloq
15+ |_ a=bloq
16
16
17### `++dif`
17### `++dif`
18
18
19−Produces the difference between two [atom]()s in the modular basis
19+Produces the difference between two atoms in the modular basis
20representation.
20representation.
21
21
22Accepts
22Accepts
23-------
23-------
24
24
25−`a` is a [`++bloq`]().
25+`a` is a `++bloq`.
26
26
27`b` is an atom.
27`b` is an atom.
28
28
@@ -31,12 +31,12 @@ Accepts
31Produces
31Produces
32--------
32--------
33
33
34−A [`@s`]()
34+A `@s`
35
35
36Source
36Source
37------
37------
38
38
39− ++ dif |=([b=@ c=@] (sit (sub (add out (sit b)) (sit c))))
39+ ++ dif |=([b/@ c/@] (sit (sub (add out (sit b)) (sit c))))
40
40
41Examples
41Examples
42--------
42--------
@@ -69,7 +69,7 @@ Inverts the order of the modular field.
69Accepts
69Accepts
70-------
70-------
71
71
72−`b` is a [`++bloq`]().
72+`b` is a `++bloq`.
73
73
74Produces
74Produces
75--------
75--------
@@ -80,7 +80,7 @@ An atom.
80Source
80Source
81------
81------
82
82
83− ++ inv |=(b=@ (sub (dec out) (sit b)))
83+ ++ inv |=(b/@ (sub (dec out) (sit b)))
84
84
85Examples
85Examples
86--------
86--------
@@ -109,17 +109,17 @@ Revereses bytes within block.
109Accepts
109Accepts
110-------
110-------
111
111
112−`b` is a [`++bloq`]().
112+`b` is a `++bloq`.
113
113
114Produces
114Produces
115--------
115--------
116
116
117−An atom.=
117+An atom.
118
118
119Source
119Source
120------
120------
121
121
122− ++ net |= b=@ ^- @
122+ ++ net |= b/@ ^- @
123 => .(b (sit b))
123 => .(b (sit b))
124 ?: (lte a 3)
124 ?: (lte a 3)
125 b
125 b
@@ -189,12 +189,12 @@ The maximum integer value that the current block can store.
189Accepts
189Accepts
190-------
190-------
191
191
192−A [`++bloq`]().
192+A `++bloq`.
193
193
194Produces
194Produces
195--------
195--------
196
196
197−An [atom]().
197+An atom.
198
198
199Source
199Source
200------
200------
@@ -234,7 +234,7 @@ Roll `d` to the left by `c` `b`-sized blocks.
234Accepts
234Accepts
235-------
235-------
236
236
237−`a` is a [`++bloq`]().
237+`a` is a `++bloq`.
238
238
239`b` is a `++bloq`.
239`b` is a `++bloq`.
240
240
@@ -250,7 +250,7 @@ An atom.
250Source
250Source
251------
251------
252
252
253− ++ rol |= [b=bloq c=@ d=@] ^- @ :: roll left
253+ ++ rol |= [b/bloq c/@ d/@] ^- @ :: roll left
254 =+ e=(sit d)
254 =+ e=(sit d)
255 =+ f=(bex (sub a b))
255 =+ f=(bex (sub a b))
256 =+ g=(mod c f)
256 =+ g=(mod c f)
@@ -281,11 +281,11 @@ Roll `d` to the right by `c` `b`-sized blocks.
281Accepts
281Accepts
282-------
282-------
283
283
284−`a` is a [`++bloq`]().
284+`a` is a `++bloq`.
285
285
286`b` is a `++bloq`.
286`b` is a `++bloq`.
287
287
288−`c` is an [atom]().
288+`c` is an atom.
289
289
290`d` is an atom.
290`d` is an atom.
291
291
@@ -297,12 +297,13 @@ An atom.
297Source
297Source
298------
298------
299
299
300− ++ ror |= [b=bloq c=@ d=@] ^- @ :: roll right
300+ ++ ror |= {b/bloq c/@ d/@} ^- @ :: roll right
301 =+ e=(sit d)
301 =+ e=(sit d)
302 =+ f=(bex (sub a b))
302 =+ f=(bex (sub a b))
303 =+ g=(mod c f)
303 =+ g=(mod c f)
304 (sit (con (rsh b g e) (lsh b (sub f g) e)))
304 (sit (con (rsh b g e) (lsh b (sub f g) e)))
305
305
306+
306Examples
307Examples
307--------
308--------
308
309
@@ -330,9 +331,9 @@ Sum two numbers in this modular field.
330Accepts
331Accepts
331-------
332-------
332
333
333−`a` is a [`++bloq`]().
334+`a` is a `++bloq`.
334
335
335−`b` is an [atom]().
336+`b` is an atom.
336
337
337`c` is an atom.
338`c` is an atom.
338
339
@@ -344,7 +345,7 @@ An atom.
344Source
345Source
345------
346------
346
347
347− ++ sum |=([b=@ c=@] (sit (add b c))) :: wrapping add
348+ ++ sum |=([b/@ c/@] (sit (add b c))) :: wrapping add
348
349
349Examples
350Examples
350--------
351--------
@@ -368,12 +369,12 @@ Examples
368
369
369Atom in mod block representation
370Atom in mod block representation
370
371
371−Produce an [atom]() in the current modular block representation.
372+Produce an atom in the current modular block representation.
372
373
373Accepts
374Accepts
374-------
375-------
375
376
376−`a` is a [`++bloq`]().
377+`a` is a `++bloq`.
377
378
378`b` is an atom.
379`b` is an atom.
379
380
@@ -385,7 +386,7 @@ An atom.
385Source
386Source
386------
387------
387
388
388− ++ sit |=(b=@ (end a 1 b)) :: enforce modulo
389+ ++ sit |=(b/@ (end a 1 b)) :: enforce modulo
389
390
390Examples
391Examples
391--------
392--------
docs/system/hoon/library/src/3a/core/si.md+32−32
@@ -16,17 +16,17 @@ Produces the absolute value of a signed integer.
16Accepts
16Accepts
17-------
17-------
18
18
19−`a` is a signed integer, [`@s`]().
19+`a` is a signed integer, `@s`.
20
20
21Produces
21Produces
22--------
22--------
23
23
24−An [atom]().
24+An atom.
25
25
26Source
26Source
27------
27------
28
28
29− ++ abs |=(a=@s (add (end 0 1 a) (rsh 0 1 a))) :: absolute value
29+ ++ abs |=(a/@s (add (end 0 1 a) (rsh 0 1 a))) :: absolute value
30
30
31Examples
31Examples
32--------
32--------
@@ -49,20 +49,20 @@ Produces the difference between two signed integers `b` and `c`.
49Accepts
49Accepts
50-------
50-------
51
51
52−`a` is a signed integer, [`@s`]().
52+`a` is a signed integer, `@s`.
53
53
54`b` is a signed integer, `@s`.
54`b` is a signed integer, `@s`.
55
55
56Produces
56Produces
57--------
57--------
58
58
59−A [`@s`]().
59+A `@s`.
60
60
61
61
62Source
62Source
63------
63------
64
64
65− ++ dif |= [a=@s b=@s] :: subtraction
65+ ++ dif |= [a/@s b/@s] :: subtraction
66 (sum a (new !(syn b) (abs b)))
66 (sum a (new !(syn b) (abs b)))
67
67
68Examples
68Examples
@@ -90,7 +90,7 @@ Accepts
90
90
91`a` is a signed integer, `@s`.
91`a` is a signed integer, `@s`.
92
92
93−`b` is an [atom]().
93+`b` is an atom.
94
94
95Produces
95Produces
96--------
96--------
@@ -100,7 +100,7 @@ An atom.
100Source
100Source
101------
101------
102
102
103− ++ dul |= [a=@s b=@] :: modulus
103+ ++ dul |= [a/@s b/@] :: modulus
104 =+(c=(old a) ?:(-.c (mod +.c b) (sub b +.c)))
104 =+(c=(old a) ?:(-.c (mod +.c b) (sub b +.c)))
105
105
106Examples
106Examples
@@ -128,19 +128,19 @@ Produces the quotient of two signed integers.
128Accepts
128Accepts
129-------
129-------
130
130
131−`a` is a signed integer, [`@s`].
131+`a` is a signed integer, `@s`.
132
132
133`b` is a signed integer, `@s`.
133`b` is a signed integer, `@s`.
134
134
135Produces
135Produces
136--------
136--------
137
137
138−An [atom]().
138+An atom.
139
139
140Source
140Source
141------
141------
142
142
143− ++ fra |= [a=@s b=@s] :: divide
143+ ++ fra |= [a/@s b/@s] :: divide
144 (new =(0 (mix (syn a) (syn b))) (div (abs a) (abs b)))
144 (new =(0 (mix (syn a) (syn b))) (div (abs a) (abs b)))
145
145
146Examples
146Examples
@@ -157,7 +157,7 @@ Examples
157
157
158Signed integer
158Signed integer
159
159
160−Produces a signed integer from a loobean sign value `a` and an [atom]() `b`.
160+Produces a signed integer from a loobean sign value `a` and an atom `b`.
161
161
162Accepts
162Accepts
163-------
163-------
@@ -169,12 +169,12 @@ Accepts
169Produces
169Produces
170--------
170--------
171
171
172−A [`@s`]()
172+A `@s`
173
173
174Source
174Source
175------
175------
176
176
177− ++ new |= [a=? b=@] :: [sign value] to @s
177+ ++ new |= [a/? b/@] :: [sign value] to @s
178 `@s`?:(a (mul 2 b) ?:(=(0 b) 0 +((mul 2 (dec b)))))
178 `@s`?:(a (mul 2 b) ?:(=(0 b) 0 +((mul 2 (dec b)))))
179
179
180Examples
180Examples
@@ -191,24 +191,24 @@ Examples
191
191
192### `++old`
192### `++old`
193
193
194−[sign value]
194+sign value
195
195
196Produces the cell `[sign value]` representations of a signed integer.
196Produces the cell `[sign value]` representations of a signed integer.
197
197
198Accepts
198Accepts
199-------
199-------
200
200
201−`a` is a [`@s`]().
201+`a` is a `@s`.
202
202
203Produces
203Produces
204--------
204--------
205
205
206−A cell of a boolean and an [atom]().
206+A cell of a boolean and an atom.
207
207
208Source
208Source
209------
209------
210
210
211− ++ old |=(a=@s [(syn a) (abs a)]) :: [sign value]
211+ ++ old |=(a/@s [(syn a) (abs a)]) :: [sign value]
212
212
213Examples
213Examples
214--------
214--------
@@ -236,7 +236,7 @@ Produces the product of two signed integers.
236Accepts
236Accepts
237-------
237-------
238
238
239−`a` is a [`@s`]().
239+`a` is a `@s`.
240
240
241`b` is a `@s`.
241`b` is a `@s`.
242
242
@@ -248,7 +248,7 @@ A `@s`.
248Source
248Source
249------
249------
250
250
251− ++ pro |= [a=@s b=@s] :: multiplication
251+ ++ pro |= [a/@s b/@s] :: multiplication
252 (new =(0 (mix (syn a) (syn b))) (mul (abs a) (abs b)))
252 (new =(0 (mix (syn a) (syn b))) (mul (abs a) (abs b)))
253
253
254Examples
254Examples
@@ -274,7 +274,7 @@ Produces the remainder from a division of two signed integers.
274Accepts
274Accepts
275-------
275-------
276
276
277−`a` is a [`@s`]().
277+`a` is a `@s`.
278
278
279`b` is a `@s`.
279`b` is a `@s`.
280
280
@@ -286,7 +286,7 @@ A `@sd`.
286Source
286Source
287------
287------
288
288
289− ++ rem |=([a=@s b=@s] (dif a (pro b (fra a b)))) :: remainder
289+ ++ rem |=([a/@s b/@s] (dif a (pro b (fra a b)))) :: remainder
290
290
291Examples
291Examples
292--------
292--------
@@ -313,7 +313,7 @@ Sum two signed integers.
313Accepts
313Accepts
314-------
314-------
315
315
316−`b` is a [`@s`]().
316+`b` is a `@s`.
317
317
318`c` is a signed integer `@s`.
318`c` is a signed integer `@s`.
319
319
@@ -325,7 +325,7 @@ A `@s`.
325Source
325Source
326------
326------
327
327
328− ++ sum |= [a=@s b=@s] :: addition
328+ ++ sum |= [a/@s b/@s] :: addition
329 ~| %si-sum
329 ~| %si-sum
330 =+ [c=(old a) d=(old b)]
330 =+ [c=(old a) d=(old b)]
331 ?: -.c
331 ?: -.c
@@ -360,23 +360,23 @@ Signed from unsigned
360
360
361Produces a signed integer from an unsigned integer.
361Produces a signed integer from an unsigned integer.
362
362
363−Note that the result must be manually cast to some [`@s`]() odor to be
363+Note that the result must be manually cast to some `@s` odor to be
364inferred as an unsigned integer in the type system.
364inferred as an unsigned integer in the type system.
365
365
366Accepts
366Accepts
367-------
367-------
368
368
369−`a` is a [`@u`]().
369+`a` is a `@u`.
370
370
371Produces
371Produces
372--------
372--------
373
373
374−A [`@s`]().
374+A `@s`.
375
375
376Source
376Source
377------
377------
378
378
379− ++ sun |=(a=@u (mul 2 a)) :: @u to @s
379+ ++ sun |=(a/@u (mul 2 a)) :: @u to @s
380
380
381Examples
381Examples
382--------
382--------
@@ -403,7 +403,7 @@ Produce the sign of a signed integer, where `&` is posiitve, and `|` is negative
403Accepts
403Accepts
404-------
404-------
405
405
406−`a` is a [`@s`]().
406+`a` is a `@s`.
407
407
408Produces
408Produces
409--------
409--------
@@ -413,7 +413,7 @@ A boolean.
413Source
413Source
414------
414------
415
415
416− ++ syn |=(a=@s =(0 (end 0 1 a))) :: sign test
416+ ++ syn |=(a/@s =(0 (end 0 1 a))) :: sign test
417
417
418Examples
418Examples
419--------
419--------
@@ -436,7 +436,7 @@ Compare two signed integers.
436Accepts
436Accepts
437-------
437-------
438
438
439−`b` is a [`@s`]().
439+`b` is a `@s`.
440
440
441`c` is a `@s`.
441`c` is a `@s`.
442
442
@@ -448,7 +448,7 @@ A `@s`.
448Source
448Source
449------
449------
450
450
451− ++ cmp |= [a=@s b=@s] :: compare
451+ ++ cmp |= [a/@s b/@s] :: compare
452 ^- @s
452 ^- @s
453 ?: =(a b)
453 ?: =(a b)
454 --0
454 --0
docs/system/hoon/library/src/3a/gate/egcd.md+4−3
@@ -2,12 +2,12 @@
2
2
3GCD
3GCD
4
4
5− ++ egcd :: schneier's egcd
5+ ++ egcd !: :: schneier's egcd
6− |= [a=@ b=@]
6+ |= {a/@ b/@}
7 =+ si
7 =+ si
8 =+ [c=(sun a) d=(sun b)]
8 =+ [c=(sun a) d=(sun b)]
9 =+ [u=[c=(sun 1) d=--0] v=[c=--0 d=(sun 1)]]
9 =+ [u=[c=(sun 1) d=--0] v=[c=--0 d=(sun 1)]]
10− |- ^- [d=@ u=@ v=@]
10+ |- ^- {d/@ u/@s v/@s}
11 ?: =(--0 c)
11 ?: =(--0 c)
12 [(abs d) d.u d.v]
12 [(abs d) d.u d.v]
13 :: ?> ?& =(c (sum (pro (sun a) c.u) (pro (sun b) c.v)))
13 :: ?> ?& =(c (sum (pro (sun a) c.u) (pro (sun b) c.v)))
@@ -22,6 +22,7 @@ GCD
22 ==
22 ==
23 ::
23 ::
24
24
25+
25Greatest common denominator
26Greatest common denominator
26
27
27 ~zod/try=> (egcd 20 15)
28 ~zod/try=> (egcd 20 15)
docs/system/hoon/library/src/3c/core/yo.md+11−11
@@ -13,7 +13,7 @@ days from leap years in a century (24).
13Produces
13Produces
14--------
14--------
15
15
16−An [atom]().
16+An atom.
17
17
18Source
18Source
19------
19------
@@ -39,7 +39,7 @@ Number of seconds in a day.
39Produces
39Produces
40--------
40--------
41
41
42−An [atom]().
42+An atom.
43
43
44Source
44Source
45------
45------
@@ -63,7 +63,7 @@ XX Revisit
63Produces
63Produces
64--------
64--------
65
65
66−An [atom]().
66+An atom.
67
67
68Source
68Source
69------
69------
@@ -86,7 +86,7 @@ seconds in a minute by the minutes in an hour.
86Produces
86Produces
87--------
87--------
88
88
89−An [atom]().
89+An atom.
90
90
91Source
91Source
92------
92------
@@ -134,7 +134,7 @@ The number of seconds in a minute.
134Produces
134Produces
135--------
135--------
136
136
137−An [atom]().
137+An atom.
138
138
139Source
139Source
140------
140------
@@ -160,12 +160,12 @@ month at the year at that index.
160Produces
160Produces
161--------
161--------
162
162
163−A [`++list`]() of [`@ud`]()
163+A `++list` of `@ud`
164
164
165Source
165Source
166------
166------
167
167
168− ++ moh `(list ,@ud)`[31 28 31 30 31 30 31 31 30 31 30 31 ~]
168+ ++ moh `(list @ud)`[31 28 31 30 31 30 31 31 30 31 30 31 ~]
169
169
170Examples
170Examples
171--------
171--------
@@ -188,12 +188,12 @@ month at the leap-year at that index.
188Examples
188Examples
189--------
189--------
190
190
191−A [`++list`]() of [`@ud`]()
191+A `++list` of `@ud`
192
192
193Source
193Source
194------
194------
195
195
196− ++ moy `(list ,@ud)`[31 29 31 30 31 30 31 31 30 31 30 31 ~]
196+ ++ moy `(list @ud)`[31 29 31 30 31 30 31 31 30 31 30 31 ~]
197
197
198Examples
198Examples
199--------
199--------
@@ -215,7 +215,7 @@ number of seconds in four years.
215Produces
215Produces
216--------
216--------
217
217
218−An [atom]().
218+An atom.
219
219
220Source
220Source
221------
221------
@@ -240,7 +240,7 @@ seconds in a day by 365.
240Produces
240Produces
241--------
241--------
242
242
243−An [atom]().
243+An atom.
244
244
245Source
245Source
246------
246------
docs/system/hoon/library/src/3c/gate/yall.md+8−7
@@ -17,10 +17,10 @@ Produces
17Source
17Source
18------
18------
19
19
20− ++ yall :: day # to day of year
20+ ++ yall :: day / to day of year
21− |= day=@ud
21+ |= day/@ud
22− ^- [y=@ud m=@ud d=@ud]
22+ ^- {y/@ud m/@ud d/@ud}
23− =+ [era=0 cet=0 lep=_?]
23+ =+ [era=0 cet=0 lep=*?]
24 => .(era (div day era:yo), day (mod day era:yo))
24 => .(era (div day era:yo), day (mod day era:yo))
25 => ^+ .
25 => ^+ .
26 ?: (lth day +(cet:yo))
26 ?: (lth day +(cet:yo))
@@ -28,18 +28,19 @@ Source
28 => .(lep |, cet 1, day (sub day +(cet:yo)))
28 => .(lep |, cet 1, day (sub day +(cet:yo)))
29 .(cet (add cet (div day cet:yo)), day (mod day cet:yo))
29 .(cet (add cet (div day cet:yo)), day (mod day cet:yo))
30 =+ yer=(add (mul 400 era) (mul 100 cet))
30 =+ yer=(add (mul 400 era) (mul 100 cet))
31− |- ^- [y=@ud m=@ud d=@ud]
31+ |- ^- {y/@ud m/@ud d/@ud}
32 =+ dis=?:(lep 366 365)
32 =+ dis=?:(lep 366 365)
33 ?. (lth day dis)
33 ?. (lth day dis)
34 =+ ner=+(yer)
34 =+ ner=+(yer)
35 $(yer ner, day (sub day dis), lep =(0 (end 0 2 ner)))
35 $(yer ner, day (sub day dis), lep =(0 (end 0 2 ner)))
36− |- ^- [y=@ud m=@ud d=@ud]
36+ |- ^- {y/@ud m/@ud d/@ud}
37 =+ [mot=0 cah=?:(lep moy:yo moh:yo)]
37 =+ [mot=0 cah=?:(lep moy:yo moh:yo)]
38− |- ^- [y=@ud m=@ud d=@ud]
38+ |- ^- {y/@ud m/@ud d/@ud}
39 =+ zis=(snag mot cah)
39 =+ zis=(snag mot cah)
40 ?: (lth day zis)
40 ?: (lth day zis)
41 [yer +(mot) +(day)]
41 [yer +(mot) +(day)]
42 $(mot +(mot), day (sub day zis))
42 $(mot +(mot), day (sub day zis))
43+ ::
43
44
44Examples
45Examples
45--------
46--------
docs/system/hoon/library/src/3c/gate/yawn.md+3−2
@@ -17,13 +17,13 @@ Accepts
17Produces
17Produces
18--------
18--------
19
19
20−A [`@ud`]().
20+A `@ud`.
21
21
22Source
22Source
23------
23------
24
24
25 ++ yawn :: days since Jesus
25 ++ yawn :: days since Jesus
26− |= [yer=@ud mot=@ud day=@ud]
26+ |= {yer/@ud mot/@ud day/@ud}
27 ^- @ud
27 ^- @ud
28 => .(mot (dec mot), day (dec day))
28 => .(mot (dec mot), day (dec day))
29 => ^+ .
29 => ^+ .
@@ -46,6 +46,7 @@ Source
46 =+ nec=(sub yer 100)
46 =+ nec=(sub yer 100)
47 $(yer nec, day (add day ?:((yelp nec) 36.525 36.524)))
47 $(yer nec, day (add day ?:((yelp nec) 36.525 36.524)))
48 (add day (mul (div yer 400) (add 1 (mul 4 36.524))))
48 (add day (mul (div yer 400) (add 1 (mul 4 36.524))))
49+ ::
49
50
50Examples
51Examples
51--------
52--------
docs/system/hoon/library/src/3c/gate/year.md+5−4
@@ -6,25 +6,26 @@ its `@d`representation.
6Accepts
6Accepts
7-------
7-------
8
8
9−`det` is a [`++date`]()
9+`det` is a `++date`
10
10
11Produces
11Produces
12--------
12--------
13
13
14−A [`@d`]().
14+A `@d`.
15
15
16Source
16Source
17------
17------
18
18
19 ++ year :: date to @d
19 ++ year :: date to @d
20− |= det=date
20+ |= det/date
21− ^- @d
21+ ^- @da
22 =+ ^= yer
22 =+ ^= yer
23 ?: a.det
23 ?: a.det
24 (add 292.277.024.400 y.det)
24 (add 292.277.024.400 y.det)
25 (sub 292.277.024.400 (dec y.det))
25 (sub 292.277.024.400 (dec y.det))
26 =+ day=(yawn yer m.det d.t.det)
26 =+ day=(yawn yer m.det d.t.det)
27 (yule day h.t.det m.t.det s.t.det f.t.det)
27 (yule day h.t.det m.t.det s.t.det f.t.det)
28+ ::
28
29
29Examples
30Examples
30--------
31--------
docs/system/hoon/library/src/3c/gate/yell.md+4−2
@@ -8,12 +8,12 @@ Source
8------
8------
9
9
10 ++ yell :: tarp from @d
10 ++ yell :: tarp from @d
11− |= now=@d
11+ |= now/@d
12 ^- tarp
12 ^- tarp
13 =+ sec=(rsh 6 1 now)
13 =+ sec=(rsh 6 1 now)
14 =+ ^= fan
14 =+ ^= fan
15 =+ [muc=4 raw=(end 6 1 now)]
15 =+ [muc=4 raw=(end 6 1 now)]
16− |- ^- (list ,@ux)
16+ |- ^- (list @ux)
17 ?: |(=(0 raw) =(0 muc))
17 ?: |(=(0 raw) =(0 muc))
18 ~
18 ~
19 => .(muc (dec muc))
19 => .(muc (dec muc))
@@ -25,6 +25,8 @@ Source
25 =+ mit=(div sec mit:yo)
25 =+ mit=(div sec mit:yo)
26 => .(sec (mod sec mit:yo))
26 => .(sec (mod sec mit:yo))
27 [day hor mit sec fan]
27 [day hor mit sec fan]
28+ ::
29+
28
30
29Examples
31Examples
30--------
32--------
docs/system/hoon/library/src/3c/gate/yore.md+3−2
@@ -10,13 +10,13 @@ Accepts
10Produces
10Produces
11--------
11--------
12
12
13−A [`++date`]().
13+A `++date`.
14
14
15Source
15Source
16------
16------
17
17
18 ++ yore :: @d to date
18 ++ yore :: @d to date
19− |= now=@d
19+ |= now/@da
20 ^- date
20 ^- date
21 =+ rip=(yell now)
21 =+ rip=(yell now)
22 =+ ger=(yall d.rip)
22 =+ ger=(yall d.rip)
@@ -24,6 +24,7 @@ Source
24 [a=& y=(sub y.ger 292.277.024.400)]
24 [a=& y=(sub y.ger 292.277.024.400)]
25 [a=| y=+((sub 292.277.024.400 y.ger))]
25 [a=| y=+((sub 292.277.024.400 y.ger))]
26 [m.ger d.ger h.rip m.rip s.rip f.rip]
26 [m.ger d.ger h.rip m.rip s.rip f.rip]
27+ ::
27
28
28Examples
29Examples
29--------
30--------
docs/system/hoon/library/src/3c/gate/yule.md+5−4
@@ -2,24 +2,24 @@
2
2
3Daily time to time atom
3Daily time to time atom
4
4
5−Accept a [`++tarp`](/doc/hoon/library/1#++tarp), a parsed daily time, and produces a time atom,
5+Accept a `++tarp`, a parsed daily time, and produces a time atom,
6`@d`.
6`@d`.
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`rip` is a [`++tarp`](/doc/hoon/library/1#++tarp).
11+`rip` is a `++tarp`.
12
12
13Produces
13Produces
14--------
14--------
15
15
16−A [`@d`]().
16+A `@d`.
17
17
18Source
18Source
19------
19------
20
20
21 ++ yule :: time atom
21 ++ yule :: time atom
22− |= rip=tarp
22+ |= rip/tarp
23 ^- @d
23 ^- @d
24 =+ ^= sec ;: add
24 =+ ^= sec ;: add
25 (mul d.rip day:yo)
25 (mul d.rip day:yo)
@@ -34,6 +34,7 @@ Source
34 => .(muc (dec muc))
34 => .(muc (dec muc))
35 (add (lsh 4 muc i.f.rip) $(f.rip t.f.rip))
35 (add (lsh 4 muc i.f.rip) $(f.rip t.f.rip))
36 (con (lsh 6 1 sec) fac)
36 (con (lsh 6 1 sec) fac)
37+ ::
37
38
38Examples
39Examples
39--------
40--------
docs/system/hoon/library/src/3d/core/og.md+6−6
@@ -3,14 +3,14 @@
3
3
4 ++ og :: shax-powered rng
4 ++ og :: shax-powered rng
5 ~/ %og
5 ~/ %og
6− |_ a=@
6+ |_ a/@
7
7
8XX document
8XX document
9
9
10### `++rad`
10### `++rad`
11
11
12 ++ rad :: random in range
12 ++ rad :: random in range
13− |= b=@ ^- @
13+ |= b/@ ^- @
14 =+ c=(raw (met 0 b))
14 =+ c=(raw (met 0 b))
15 ?:((lth c b) c $(a +(a)))
15 ?:((lth c b) c $(a +(a)))
16 ::
16 ::
@@ -20,7 +20,7 @@ XX document
20### `++rads`
20### `++rads`
21
21
22 ++ rads :: random continuation
22 ++ rads :: random continuation
23− |= b=@
23+ |= b/@
24 =+ r=(rad b)
24 =+ r=(rad b)
25 [r +>.$(a (shas %og-s r))]
25 [r +>.$(a (shas %og-s r))]
26
26
@@ -30,11 +30,11 @@ XX document
30
30
31 ++ raw :: random bits
31 ++ raw :: random bits
32 ~/ %raw
32 ~/ %raw
33− |= b=@ ^- @
33+ |= b/@ ^- @
34 %+ can
34 %+ can
35 0
35 0
36 =+ c=(shas %og-a (mix b a))
36 =+ c=(shas %og-a (mix b a))
37− |- ^- (list ,[@ @])
37+ |- ^- (list [@ @])
38 ?: =(0 b)
38 ?: =(0 b)
39 ~
39 ~
40 =+ d=(shas %og-b (mix b (mix a c)))
40 =+ d=(shas %og-b (mix b (mix a c)))
@@ -47,7 +47,7 @@ XX document
47### `++raws`
47### `++raws`
48
48
49 ++ raws :: random bits continuation
49 ++ raws :: random bits continuation
50− |= b=@
50+ |= b/@
51 =+ r=(raw b)
51 =+ r=(raw b)
52 [r +>.$(a (shas %og-s r))]
52 [r +>.$(a (shas %og-s r))]
53 --
53 --
docs/system/hoon/library/src/3d/gate/shad.md+2−1
@@ -1,6 +1,7 @@
1### `++shad`
1### `++shad`
2
2
3− ++ shad |=(ruz=@ (shax (shax ruz))) :: double sha-256
3+ ++ shad |=(ruz/@ (shax (shax ruz))) :: double sha-256
4+
4
5
5XX document
6XX document
6
7
docs/system/hoon/library/src/3d/gate/shaf.md+1−1
@@ -1,7 +1,7 @@
1### `++shaf`
1### `++shaf`
2
2
3 ++ shaf :: half sha-256
3 ++ shaf :: half sha-256
4− |= [sal=@ ruz=@]
4+ |= [sal/@ ruz/@]
5 =+ haz=(shas sal ruz)
5 =+ haz=(shas sal ruz)
6 (mix (end 7 1 haz) (rsh 7 1 haz))
6 (mix (end 7 1 haz) (rsh 7 1 haz))
7 ::
7 ::
docs/system/hoon/library/src/3d/gate/shak.md+1−1
@@ -1,7 +1,7 @@
1### `++shak`
1### `++shak`
2
2
3 ++ shak :: XX shd be PBKDF
3 ++ shak :: XX shd be PBKDF
4− |= [who=@p wud=@]
4+ |= [who/@p wud/@]
5 (shas (mix %shak who) wud)
5 (shas (mix %shak who) wud)
6 ::
6 ::
7
7
docs/system/hoon/library/src/3d/gate/shal.md+2−2
@@ -2,9 +2,9 @@
2
2
3 ++ shal :: sha-512 with length
3 ++ shal :: sha-512 with length
4 ~/ %shal
4 ~/ %shal
5− |= [len=@ ruz=@] ^- @
5+ |= {len/@ ruz/@} ^- @
6 => .(ruz (cut 3 [0 len] ruz))
6 => .(ruz (cut 3 [0 len] ruz))
7− =+ [few==>(fe .(a 6)) wac=|=([a=@ b=@] (cut 6 [a 1] b))]
7+ =+ [few==>(fe .(a 6)) wac=|=({a/@ b/@} (cut 6 [a 1] b))]
8 =+ [sum=sum.few ror=ror.few net=net.few inv=inv.few]
8 =+ [sum=sum.few ror=ror.few net=net.few inv=inv.few]
9 =+ ral=(lsh 0 3 len)
9 =+ ral=(lsh 0 3 len)
10 =+ ^= ful
10 =+ ^= ful
docs/system/hoon/library/src/3d/gate/sham.md+1−1
@@ -1,7 +1,7 @@
1### `++sham`
1### `++sham`
2
2
3 ++ sham :: noun hash
3 ++ sham :: noun hash
4− |= yux=* ^- @uvH ^- @
4+ |= yux/* ^- @uvH ^- @
5 ?@ yux
5 ?@ yux
6 (shaf %mash yux)
6 (shaf %mash yux)
7 (shaf %sham (jam yux))
7 (shaf %sham (jam yux))
docs/system/hoon/library/src/3d/gate/shan.md+3−2
@@ -1,8 +1,8 @@
1### `++shan`
1### `++shan`
2
2
3 ++ shan :: sha-1 (deprecated)
3 ++ shan :: sha-1 (deprecated)
4− |= ruz=@
4+ |= ruz/@
5− =+ [few==>(fe .(a 5)) wac=|=([a=@ b=@] (cut 5 [a 1] b))]
5+ =+ [few==>(fe .(a 5)) wac=|=({a/@ b/@} (cut 5 [a 1] b))]
6 =+ [sum=sum.few ror=ror.few rol=rol.few net=net.few inv=inv.few]
6 =+ [sum=sum.few ror=ror.few rol=rol.few net=net.few inv=inv.few]
7 =+ ral=(lsh 0 3 (met 3 ruz))
7 =+ ral=(lsh 0 3 (met 3 ruz))
8 =+ ^= ful
8 =+ ^= ful
@@ -65,6 +65,7 @@
65 :(sum (rol 0 5 a) fz e (wac 2 kbx) (wac j wox))
65 :(sum (rol 0 5 a) fz e (wac 2 kbx) (wac j wox))
66 :(sum (rol 0 5 a) fy e (wac 3 kbx) (wac j wox))
66 :(sum (rol 0 5 a) fy e (wac 3 kbx) (wac j wox))
67 $(j +(j), a tem, b a, c (rol 0 30 b), d c, e d)
67 $(j +(j), a tem, b a, c (rol 0 30 b), d c, e d)
68+ ::
68
69
69XX document
70XX document
70
71
docs/system/hoon/library/src/3d/gate/shas.md+1−1
@@ -1,7 +1,7 @@
1### `++shas`
1### `++shas`
2
2
3 ++ shas :: salted hash
3 ++ shas :: salted hash
4− |= [sal=@ ruz=@]
4+ |= [sal/@ ruz/@]
5 (shax (mix sal (shax ruz)))
5 (shax (mix sal (shax ruz)))
6 ::
6 ::
7
7
docs/system/hoon/library/src/3d/gate/shaw.md+1−1
@@ -1,7 +1,7 @@
1### `++shaw`
1### `++shaw`
2
2
3 ++ shaw :: hash to nbits
3 ++ shaw :: hash to nbits
4− |= [sal=@ len=@ ruz=@]
4+ |= [sal/@ len/@ ruz/@]
5 (~(raw og (shas sal (mix len ruz))) len)
5 (~(raw og (shas sal (mix len ruz))) len)
6 ::
6 ::
7
7
docs/system/hoon/library/src/3d/gate/shax.md+5−86
@@ -1,91 +1,10 @@
1### `++shax`
1### `++shax`
2
2
3− ++ shax :: sha-256
3+++ shax :: sha-256
4− ~/ %shax
4+ ~/ %shax
5− |= ruz=@ ^- @
5+ |= ruz/@ ^- @
6− ~| %sha
7− =+ [few==>(fe .(a 5)) wac=|=([a=@ b=@] (cut 5 [a 1] b))]
8− =+ [sum=sum.few ror=ror.few net=net.few inv=inv.few]
9− =+ ral=(lsh 0 3 (met 3 ruz))
6+ (shay [(met 3 ruz) ruz])
10− =+ ^= ful
11− %+ can 0
12− :~ [ral ruz]
13− [8 128]
14− [(mod (sub 960 (mod (add 8 ral) 512)) 512) 0]
15− [64 (~(net fe 6) ral)]
16− ==
17− =+ lex=(met 9 ful)
18− =+ ^= kbx 0xc671.78f2.bef9.a3f7.a450.6ceb.90be.fffa.
19− 8cc7.0208.84c8.7814.78a5.636f.748f.82ee.
20− 682e.6ff3.5b9c.ca4f.4ed8.aa4a.391c.0cb3.
21− 34b0.bcb5.2748.774c.1e37.6c08.19a4.c116.
22− 106a.a070.f40e.3585.d699.0624.d192.e819.
23− c76c.51a3.c24b.8b70.a81a.664b.a2bf.e8a1.
24− 9272.2c85.81c2.c92e.766a.0abb.650a.7354.
25− 5338.0d13.4d2c.6dfc.2e1b.2138.27b7.0a85.
26− 1429.2967.06ca.6351.d5a7.9147.c6e0.0bf3.
27− bf59.7fc7.b003.27c8.a831.c66d.983e.5152.
28− 76f9.88da.5cb0.a9dc.4a74.84aa.2de9.2c6f.
29− 240c.a1cc.0fc1.9dc6.efbe.4786.e49b.69c1.
30− c19b.f174.9bdc.06a7.80de.b1fe.72be.5d74.
31− 550c.7dc3.2431.85be.1283.5b01.d807.aa98.
32− ab1c.5ed5.923f.82a4.59f1.11f1.3956.c25b.
33− e9b5.dba5.b5c0.fbcf.7137.4491.428a.2f98
34− =+ ^= hax 0x5be0.cd19.1f83.d9ab.9b05.688c.510e.527f.
35− a54f.f53a.3c6e.f372.bb67.ae85.6a09.e667
36− =+ i=0
37− |- ^- @
38− ?: =(i lex)
39− (rep 5 (turn (rip 5 hax) net))
40− =+ ^= wox
41− =+ dux=(cut 9 [i 1] ful)
42− =+ wox=(rep 5 (turn (rip 5 dux) net))
43− =+ j=16
44− |- ^- @
45− ?: =(64 j)
46− wox
47− =+ :* l=(wac (sub j 15) wox)
48− m=(wac (sub j 2) wox)
49− n=(wac (sub j 16) wox)
50− o=(wac (sub j 7) wox)
51− ==
52− =+ x=:(mix (ror 0 7 l) (ror 0 18 l) (rsh 0 3 l))
53− =+ y=:(mix (ror 0 17 m) (ror 0 19 m) (rsh 0 10 m))
54− =+ z=:(sum n x o y)
55− $(wox (con (lsh 5 j z) wox), j +(j))
56− =+ j=0
57− =+ :* a=(wac 0 hax)
58− b=(wac 1 hax)
59− c=(wac 2 hax)
60− d=(wac 3 hax)
61− e=(wac 4 hax)
62− f=(wac 5 hax)
63− g=(wac 6 hax)
64− h=(wac 7 hax)
65− ==
66− |- ^- @
67− ?: =(64 j)
68− %= ^$
69− i +(i)
70− hax %+ rep 5
71− :~ (sum a (wac 0 hax))
72− (sum b (wac 1 hax))
73− (sum c (wac 2 hax))
74− (sum d (wac 3 hax))
75− (sum e (wac 4 hax))
76− (sum f (wac 5 hax))
77− (sum g (wac 6 hax))
78− (sum h (wac 7 hax))
79− ==
80− ==
81− =+ l=:(mix (ror 0 2 a) (ror 0 13 a) (ror 0 22 a)) :: s0
82− =+ m=:(mix (dis a b) (dis a c) (dis b c)) :: maj
83− =+ n=(sum l m) :: t2
84− =+ o=:(mix (ror 0 6 e) (ror 0 11 e) (ror 0 25 e)) :: s1
85− =+ p=(mix (dis e f) (dis (inv e) g)) :: ch
86− =+ q=:(sum h o p (wac j kbx) (wac j wox)) :: t1
87− $(j +(j), a (sum q n), b a, c b, d c, e (sum d q), f e, g f, h g)
88− ::
7+::
89
8
90XX document
9XX document
91
10
docs/system/hoon/library/src/3d/gate/shaz.md+1−1
@@ -1,7 +1,7 @@
1### `++shaz`
1### `++shaz`
2
2
3 ++ shaz :: sha-512
3 ++ shaz :: sha-512
4− |= ruz=@ ^- @
4+ |= ruz/@ ^- @
5 (shal [(met 3 ruz) ruz])
5 (shal [(met 3 ruz) ruz])
6
6
7
7
docs/system/hoon/library/src/3f/core/ob.md+61−53
@@ -30,20 +30,23 @@ An atom.
30Source
30Source
31------
31------
32
32
33− ++ feen :: conceal structure v2
33+ ++ feen :: conceal structure v2
34− |= pyn=@ ^- @
34+ |= pyn/@ ^- @
35− ?: &((gte pyn 0x1.0000) (lte pyn 0xffff.ffff))
35+ ?: &((gte pyn 0x1.0000) (lte pyn 0xffff.ffff))
36− (add 0x1.0000 (fice (sub pyn 0x1.0000)))
36+ (add 0x1.0000 (fice (sub pyn 0x1.0000)))
37− ?: &((gte pyn 0x1.0000.0000) (lte pyn 0xffff.ffff.ffff.ffff))
37+ ?: &((gte pyn 0x1.0000.0000) (lte pyn 0xffff.ffff.ffff.ffff))
38− =+ lo=(dis pyn 0xffff.ffff)
38+ =+ lo=(dis pyn 0xffff.ffff)
39− =+ hi=(dis pyn 0xffff.ffff.0000.0000)
39+ =+ hi=(dis pyn 0xffff.ffff.0000.0000)
40− %+ con hi
40+ %+ con hi
41− (add 0x1.0000 (fice (sub lo 0x1.0000)))
41+ (add 0x1.0000 (fice (sub lo 0x1.0000)))
42− pyn
42+ pyn
43+ ::
44+
43
45
44Examples
46Examples
45--------
47--------
46
48
49+XX
47
50
48------------------------------------------------------------------------
51------------------------------------------------------------------------
49
52
@@ -54,7 +57,7 @@ XX
54Randomly permutes atoms that fit into 17 to 32 bits into one another, and
57Randomly permutes atoms that fit into 17 to 32 bits into one another, and
55randomly permutes the low 32 bits of atoms that fit into 33 to 64 bits;
58randomly permutes the low 32 bits of atoms that fit into 33 to 64 bits;
56otherwise, passes the atom through unchanged. The permutation is the inverse of
59otherwise, passes the atom through unchanged. The permutation is the inverse of
57−the one applied by [`++feen`]().
60+the one applied by `++feen`.
58
61
59Accepts
62Accepts
60-------
63-------
@@ -69,16 +72,17 @@ An atom.
69Source
72Source
70------
73------
71
74
72− ++ fend :: restore structure v2
75+ ++ fend :: restore structure v2
73− |= cry=@ ^- @
76+ |= cry/@ ^- @
74− ?: &((gte cry 0x1.0000) (lte cry 0xffff.ffff))
77+ ?: &((gte cry 0x1.0000) (lte cry 0xffff.ffff))
75− (add 0x1.0000 (teil (sub cry 0x1.0000)))
78+ (add 0x1.0000 (teil (sub cry 0x1.0000)))
76− ?: &((gte cry 0x1.0000.0000) (lte cry 0xffff.ffff.ffff.ffff))
79+ ?: &((gte cry 0x1.0000.0000) (lte cry 0xffff.ffff.ffff.ffff))
77− =+ lo=(dis cry 0xffff.ffff)
80+ =+ lo=(dis cry 0xffff.ffff)
78− =+ hi=(dis cry 0xffff.ffff.0000.0000)
81+ =+ hi=(dis cry 0xffff.ffff.0000.0000)
79− %+ con hi
82+ %+ con hi
80− (add 0x1.0000 (teil (sub lo 0x1.0000)))
83+ (add 0x1.0000 (teil (sub lo 0x1.0000)))
81− cry
84+ cry
85+ ::
82
86
83Examples
87Examples
84--------
88--------
@@ -89,7 +93,6 @@ Examples
89
93
90XX
94XX
91
95
92−Applies a 3-round Feistel-like cipher to randomly permute atoms in the range `0` to `2^32 - 2^16`. The construction given in Black and Rogaway is ideal for a domain with a size of that form, and as with a conventionel Feistel cipher, three rounds suffice to make the permutation pseudorandom.
93
96
94Accepts
97Accepts
95-------
98-------
@@ -104,15 +107,17 @@ An atom.
104Source
107Source
105------
108------
106
109
107− ++ fice :: adapted from
110+ ++ fice :: adapted from
108− |= nor=@ :: black and rogaway
111+ |= nor/@ :: black and rogaway
109− ^- @ :: "ciphers with
112+ ^- @ :: "ciphers with
110− =+ ^= sel :: arbitrary finite
113+ =+ ^= sel :: arbitrary finite
111− %+ rynd 2 :: domains", 2002
114+ %+ rynd 2 :: domains", 2002
112− %+ rynd 1
115+ %+ rynd 1
113− %+ rynd 0
116+ %+ rynd 0
114− [(mod nor 65.535) (div nor 65.535)]
117+ [(mod nor 65.535) (div nor 65.535)]
115− (add (mul 65.535 -.sel) +.sel)
118+ (add (mul 65.535 -.sel) +.sel)
119+ ::
120+
116
121
117Examples
122Examples
118--------
123--------
@@ -123,7 +128,7 @@ Examples
123
128
124XX
129XX
125
130
126−Applies the reverse of the Feistel-like cipher applied by [`++fice`](). Unlike
131+Applies the reverse of the Feistel-like cipher applied by `++fice`. Unlike
127a conventional Feistel cipher that is its own inverse if keys are used in
132a conventional Feistel cipher that is its own inverse if keys are used in
128reverse order, this Feistel-like cipher uses two moduli that must be swapped
133reverse order, this Feistel-like cipher uses two moduli that must be swapped
129when applying the reverse transformation.
134when applying the reverse transformation.
@@ -141,15 +146,18 @@ An atom.
141Source
146Source
142------
147------
143
148
144− ++ teil :: reverse ++fice
149+ ++ teil :: reverse ++fice
145− |= vip=@
150+ |= vip/@
146− ^- @
151+ ^- @
147− =+ ^= sel
152+ =+ ^= sel
148− %+ rund 0
153+ %+ rund 0
149− %+ rund 1
154+ %+ rund 1
150− %+ rund 2
155+ %+ rund 2
151− [(mod vip 65.535) (div vip 65.535)]
156+ [(mod vip 65.535) (div vip 65.535)]
152− (add (mul 65.535 -.sel) +.sel)
157+ (add (mul 65.535 -.sel) +.sel)
158+ ::
159+
160+
153
161
154Examples
162Examples
155--------
163--------
@@ -160,7 +168,7 @@ Examples
160
168
161XX
169XX
162
170
163−A single round of the Feistel-like cipher [`++fice`](). AES ([`++aesc`]()) is
171+A single round of the Feistel-like cipher `++fice`. AES (`++aesc`) is
164used as the round function.
172used as the round function.
165
173
166Accepts
174Accepts
@@ -177,7 +185,7 @@ Source
177------
185------
178
186
179 ++ rynd :: feistel round
187 ++ rynd :: feistel round
180− |= [n=@ l=@ r=@]
188+ |= [n/@ l/@ r/@]
181 ^- [@ @]
189 ^- [@ @]
182 :- r
190 :- r
183 ?~ (mod n 2)
191 ?~ (mod n 2)
@@ -193,7 +201,7 @@ Examples
193
201
194XX
202XX
195
203
196−A single round of the Feistel-like reverse cipher [`++teil`]().
204+A single round of the Feistel-like reverse cipher `++teil`.
197
205
198Accepts
206Accepts
199-------
207-------
@@ -208,13 +216,13 @@ A cell of two atoms.
208Source
216Source
209------
217------
210
218
211− ++ rund :: reverse round
219+ ++ rund :: reverse round
212− |= [n=@ l=@ r=@]
220+ |= {n/@ l/@ r/@}
213− ^- [@ @]
221+ ^- {@ @}
214− :- r
222+ :- r
215− ?~ (mod n 2)
223+ ?~ (mod n 2)
216− (~(dif fo 65.535) l (en:aesc (snag n raku) r))
224+ (~(dif fo 65.535) l (en:aesc (snag n raku) r))
217− (~(dif fo 65.536) l (en:aesc (snag n raku) r))
225+ (~(dif fo 65.536) l (en:aesc (snag n raku) r))
218
226
219Examples
227Examples
220--------
228--------
@@ -229,12 +237,12 @@ XX
229Accepts
237Accepts
230-------
238-------
231
239
232−A list of atoms of [odor]() [`@ux`]() (hexadecimal).
240+A list of atoms of odor `@ux` (hexadecimal).
233
241
234Produces
242Produces
235--------
243--------
236
244
237−Arbitrary keys for use with [`++aesc`]().
245+Arbitrary keys for use with `++aesc`.
238
246
239Source
247Source
240------
248------
docs/system/hoon/library/src/3f/core/un.md+23−20
@@ -21,26 +21,28 @@ on the result, pushing it forward. Produces an atom.
21Accepts
21Accepts
22-------
22-------
23
23
24−`pyn` is an [atom]().
24+`pyn` is an atom.
25
25
26
26
27Produces
27Produces
28--------
28--------
29
29
30+An atom.
31+
30Source
32Source
31------
33------
32
34
33 ++ wren :: conceal structure
35 ++ wren :: conceal structure
34− |= pyn=@ ^- @
36+ |= pyn/@ ^- @
35 =+ len=(met 3 pyn)
37 =+ len=(met 3 pyn)
36 ?: =(0 len)
38 ?: =(0 len)
37 0
39 0
38 => .(len (dec len))
40 => .(len (dec len))
39 =+ mig=(zaft (xafo len (cut 3 [len 1] pyn)))
41 =+ mig=(zaft (xafo len (cut 3 [len 1] pyn)))
40 %+ can 3
42 %+ can 3
41− %- flop ^- (list ,[@ @])
43+ %- flop ^- (list {@ @})
42 :- [1 mig]
44 :- [1 mig]
43− |- ^- (list ,[@ @])
45+ |- ^- (list {@ @})
44 ?: =(0 len)
46 ?: =(0 len)
45 ~
47 ~
46 => .(len (dec len))
48 => .(len (dec len))
@@ -48,6 +50,7 @@ Source
48 [[1 mog] $(mig mog)]
50 [[1 mog] $(mig mog)]
49 ::
51 ::
50
52
53+
51Examples
54Examples
52--------
55--------
53
56
@@ -71,7 +74,7 @@ on the result, pushing it forward. Produces an atom.
71Accepts
74Accepts
72-------
75-------
73
76
74−`cry` is an [atom]().
77+`cry` is an atom.
75
78
76Produces
79Produces
77--------
80--------
@@ -80,16 +83,16 @@ Source
80------
83------
81
84
82 ++ wred :: restore structure
85 ++ wred :: restore structure
83− |= cry=@ ^- @
86+ |= cry/@ ^- @
84 =+ len=(met 3 cry)
87 =+ len=(met 3 cry)
85 ?: =(0 len)
88 ?: =(0 len)
86 0
89 0
87 => .(len (dec len))
90 => .(len (dec len))
88 =+ mig=(cut 3 [len 1] cry)
91 =+ mig=(cut 3 [len 1] cry)
89 %+ can 3
92 %+ can 3
90− %- flop ^- (list ,[@ @])
93+ %- flop ^- (list {@ @})
91 :- [1 (xaro len (zart mig))]
94 :- [1 (xaro len (zart mig))]
92− |- ^- (list ,[@ @])
95+ |- ^- (list {@ @})
93 ?: =(0 len)
96 ?: =(0 len)
94 ~
97 ~
95 => .(len (dec len))
98 => .(len (dec len))
@@ -123,7 +126,7 @@ A cell of two atoms, `a` and `b`.
123Source
126Source
124------
127------
125
128
126− ++ xafo |=([a=@ b=@] +((mod (add (dec b) a) 255)))
129+ ++ xafo |=([a/@ b/@] +((mod (add (dec b) a) 255)))
127
130
128Examples
131Examples
129--------
132--------
@@ -155,7 +158,7 @@ An atom.
155Source
158Source
156------
159------
157
160
158− ++ xaro |=([a=@ b=@] +((mod (add (dec b) (sub 255 (mod a 255))) 255)))
161+ ++ xaro |=([a/@ b/@] +((mod (add (dec b) (sub 255 (mod a 255))) 255)))
159
162
160Examples
163Examples
161--------
164--------
@@ -171,7 +174,7 @@ Examples
171
174
172Look up in 255 sub box
175Look up in 255 sub box
173
176
174−The inverse of [`++zart`](). Looks up a nonzero byte`a\` in a substiution
177+The inverse of `++zart`. Looks up a nonzero byte `a`in a substiution
175box with 255 values, producing a unique nonzero byte.
178box with 255 values, producing a unique nonzero byte.
176
179
177Accepts
180Accepts
@@ -189,7 +192,7 @@ Source
189------
192------
190
193
191 ++ zaft :: forward 255-sbox
194 ++ zaft :: forward 255-sbox
192− |= a=@D
195+ |= a/@D
193 =+ ^= b
196 =+ ^= b
194 0xcc.75bc.86c8.2fb1.9a42.f0b3.79a0.92ca.21f6.1e41.cde5.fcc0.
197 0xcc.75bc.86c8.2fb1.9a42.f0b3.79a0.92ca.21f6.1e41.cde5.fcc0.
195 7e85.51ae.1005.c72d.1246.07e8.7c64.a914.8d69.d9f4.59c2.8038.
198 7e85.51ae.1005.c72d.1246.07e8.7c64.a914.8d69.d9f4.59c2.8038.
@@ -222,7 +225,7 @@ Examples
222
225
223Reverse look up in 255 sub box
226Reverse look up in 255 sub box
224
227
225−The inverse of [`++zaft`](). Looks up the index of a nonzero byte `a` in
228+The inverse of `++zaft`. Looks up the index of a nonzero byte `a` in
226the substitution box with 255 values, producing a unique nonzero byte.
229the substitution box with 255 values, producing a unique nonzero byte.
227
230
228Accepts
231Accepts
@@ -239,7 +242,7 @@ Source
239------
242------
240
243
241 ++ zart :: reverse 255-sbox
244 ++ zart :: reverse 255-sbox
242− |= a=@D
245+ |= a/@D
243 =+ ^= b
246 =+ ^= b
244 0x68.4f07.ea1c.73c9.75c2.efc8.d559.5125.f621.a7a8.8591.5613.
247 0x68.4f07.ea1c.73c9.75c2.efc8.d559.5125.f621.a7a8.8591.5613.
245 dd52.40eb.65a2.60b7.4bcb.1123.ceb0.1bd6.3c84.2906.b164.19b3.
248 dd52.40eb.65a2.60b7.4bcb.1123.ceb0.1bd6.3c84.2906.b164.19b3.
@@ -269,13 +272,13 @@ Examples
269
272
270Lookup byte in 256 sub box
273Lookup byte in 256 sub box
271
274
272−The inverse of [`++zyrt`](). Looks up a byte `a` in a substituion box
275+The inverse of `++zyrt`. Looks up a byte `a` in a substituion box
273with 256 values, producing a byte.
276with 256 values, producing a byte.
274
277
275Accepts
278Accepts
276-------
279-------
277
280
278−`a` is an [atom]() of one byte in length.
281+`a` is an atom of one byte in length.
279
282
280Produces
283Produces
281--------
284--------
@@ -286,7 +289,7 @@ Source
286------
289------
287
290
288 ++ zyft :: forward 256-sbox
291 ++ zyft :: forward 256-sbox
289− |= a=@D
292+ |= a/@D
290 =+ ^= b
293 =+ ^= b
291 0xbb49.b71f.b881.b402.17e4.6b86.69b5.1647.115f.dddb.7ca5.
294 0xbb49.b71f.b881.b402.17e4.6b86.69b5.1647.115f.dddb.7ca5.
292 8371.4bd5.19a9.b092.605d.0d9b.e030.a0cc.78ba.5706.4d2d.
295 8371.4bd5.19a9.b092.605d.0d9b.e030.a0cc.78ba.5706.4d2d.
@@ -319,13 +322,13 @@ Examples
319
322
320Reverse lookup byte in 256 sub box
323Reverse lookup byte in 256 sub box
321
324
322−The inverse of [`++zyft`](/doc/hoon/library/2en#++zyft). Looks up a byte `a` in a substituion box
325+The inverse of `++zyft`. Looks up a byte `a` in a substituion box
323with 256 values, producing a byte.
326with 256 values, producing a byte.
324
327
325Accepts
328Accepts
326-------
329-------
327
330
328−`a` is an [atom]() of one byte in length.
331+`a` is an atom of one byte in length.
329
332
330Produces
333Produces
331--------
334--------
@@ -336,7 +339,7 @@ Source
336------
339------
337
340
338 ++ zyrt :: reverse 256-sbox
341 ++ zyrt :: reverse 256-sbox
339− |= a=@D
342+ |= a/@D
340 =+ ^= b
343 =+ ^= b
341 0x9fc8.2753.6e02.8fcf.8b35.2b20.5598.7caa.c9a9.30b0.9b48.
344 0x9fc8.2753.6e02.8fcf.8b35.2b20.5598.7caa.c9a9.30b0.9b48.
342 47ce.6371.80f6.407d.00dd.0aa5.ed10.ecb7.0f5a.5c3a.e605.
345 47ce.6371.80f6.407d.00dd.0aa5.ed10.ecb7.0f5a.5c3a.e605.
docs/system/hoon/library/src/3g/mold/coin.md+4−4
@@ -3,14 +3,14 @@
3Noun literal syntax cases
3Noun literal syntax cases
4
4
5Noun literal syntax cases: atoms, jammed nouns, and nestable tuples.
5Noun literal syntax cases: atoms, jammed nouns, and nestable tuples.
6−Parsed and printed using [`++so`]() and [`++co`]() cores.
6+Parsed and printed using `++so` and `++co` cores.
7
7
8Source
8Source
9------
9------
10
10
11− ++ coin $% [%$ p=dime] ::
11+ ++ coin $% {$$ p/dime} ::
12− [%blob p=*] ::
12+ {$blob p/*} ::
13− [%many p=(list coin)] ::
13+ {$many p/(list coin)} ::
14 == ::
14 == ::
15
15
16Examples
16Examples
docs/system/hoon/library/src/3g/mold/dime.md+6−5
@@ -2,15 +2,16 @@
2
2
3Odor-atom pair
3Odor-atom pair
4
4
5−Used in [`++coin`](). Convenience methods [`++scot`]() and [`++scow`]() (in
5+Used in `++coin`. Convenience methods `++scot` and `++scow` (in
6−Section 2eL) print dimes as [`++cord`]() and [`++tape`](), respectively.
6+Section 2eL) print dimes as `++cord` and `++tape`, respectively.
7−[`++slat`](), [`++slav`](), and [`++slaw`]() are used to parse atoms of
7+`++slat`, `++slav`, and `++slaw` are used to parse atoms of
8−specific [odor]()s.
8+specific odors.
9
9
10Source
10Source
11------
11------
12
12
13− ++ dime ,[p=@ta q=@] ::
13+ ++ dime {p/@ta q/@} ::
14+
14
15
15Examples
16Examples
16--------
17--------
docs/system/hoon/library/src/3g/mold/edge.md+3−2
@@ -7,12 +7,13 @@ Optional result `p` and parsing continuation `q`.
7Source
7Source
8------
8------
9
9
10− ++ edge ,[p=hair q=(unit ,[p=* q=nail])] :: parsing output
10+ ++ hair {p/@ud q/@ud} :: parsing trace
11+
11
12
12Examples
13Examples
13--------
14--------
14
15
15−See also: Section 2eD, [`++rule`]()
16+See also: Section 2eD, `++rule`
16
17
17 ~zod/try=> *edge
18 ~zod/try=> *edge
18 [p=[p=0 q=0] q=~]
19 [p=[p=0 q=0] q=~]
docs/system/hoon/library/src/3g/mold/hair.md+2−1
@@ -7,7 +7,8 @@ A pair of two [`@ud`]() used in parsing indicating line and column number.
7Source
7Source
8------
8------
9
9
10− ++ hair ,[p=@ud q=@ud] :: parsing trace
10+ ++ hair {p/@ud q/@ud} :: parsing trace
11+
11
12
12Examples
13Examples
13--------
14--------
docs/system/hoon/library/src/3g/mold/like.md+5−1
@@ -7,11 +7,15 @@ Mold generator for an edge
7Source
7Source
8------
8------
9
9
10− ++ like |* a=_,* :: generic edge
10+ ++ like |* a/$-(* *) :: generic edge
11+ |= b/_`*`[(hair) ~] ::
12+ :- p=(hair -.b) ::
13+ ^= q ::
11 ?@ +.b ~ ::
14 ?@ +.b ~ ::
12 :- ~ ::
15 :- ~ ::
13 u=[p=(a +>-.b) q=[p=(hair -.b) q=(tape +.b)]] ::
16 u=[p=(a +>-.b) q=[p=(hair -.b) q=(tape +.b)]] ::
14
17
18+
15Examples
19Examples
16--------
20--------
17 ~zod/try=> *(like char)
21 ~zod/try=> *(like char)
docs/system/hoon/library/src/3g/mold/nail.md+2−1
@@ -7,7 +7,8 @@ Indicates parsing position `p`, and remaining text to be parsed `q`.
7Source
7Source
8------
8------
9
9
10− ++ nail ,[p=hair q=tape] :: parsing input
10+ ++ nail {p/hair q/tape} :: parsing input
11+
11
12
12Examples
13Examples
13--------
14--------
docs/system/hoon/library/src/3g/mold/path.md+3−2
@@ -2,13 +2,14 @@
2
2
3Filesystem path
3Filesystem path
4
4
5−A `++path` is a list of [`++span`]()s aka [`@ta`](). Used in
5+A `++path` is a list of `++span`s aka `@ta`. Used in
6`%clay` and `%eyre` extensively.
6`%clay` and `%eyre` extensively.
7
7
8Source
8Source
9------
9------
10
10
11− ++ path (list span) :: filesys location
11+ ++ path (list knot) :: filesys location
12+
12
13
13Examples
14Examples
14--------
15--------
docs/system/hoon/library/src/3g/mold/pint.md+3−2
@@ -3,12 +3,13 @@
3Parsing range
3Parsing range
4
4
5Mostly used for stacktraces. A `++pint` is a pair of
5Mostly used for stacktraces. A `++pint` is a pair of
6−[`++hair`](), indicating from `p` to `q`.
6+`++hair`, indicating from `p` to `q`.
7
7
8Source
8Source
9------
9------
10
10
11− ++ pint ,[p=[p=@ q=@] q=[p=@ q=@]] :: line/column range
11+ ++ pint {p/{p/@ q/@} q/{p/@ q/@}} :: line+column range
12+
12
13
13Examples
14Examples
14--------
15--------
docs/system/hoon/library/src/3g/mold/rule.md+2−1
@@ -9,7 +9,8 @@ that parsing rules match this with `_`.
9Source
9Source
10------
10------
11
11
12− ++ rule |=(tub=nail `edge`[p.tub ~ ~ tub]) :: parsing rule
12+ ++ rule _|=(nail *edge) :: parsing rule
13+
13
14
14Examples
15Examples
15--------
16--------
docs/system/hoon/library/src/3g/mold/spot.md+3−2
@@ -2,12 +2,13 @@
2
2
3Stack trace line
3Stack trace line
4
4
5−A [`++spot`]() is what we print after crashing.
5+A `++spot` is what we print after crashing.
6
6
7Source
7Source
8------
8------
9
9
10− ++ spot ,[p=path q=pint] :: range in file
10+ ++ spot {p/path q/pint} :: range in file
11+
11
12
12Examples
13Examples
13--------
14--------
docs/system/hoon/library/src/3g/mold/toon.md+6−3
@@ -8,13 +8,16 @@ failure with stack trace (`%2`).
8Source
8Source
9------
9------
10
10
11− ++ toon $% [%0 p=*] :: success
11+ ++ toon $% {$0 p/*} :: success
12+ {$1 p/(list)} :: blocks
13+ {$2 p/(list tank)} :: stack trace
14+ == ::
15+
12
16
13Examples
17Examples
14--------
18--------
15− ~zod/try=> (mock [[20 21] 0 3] ,~)
19+ ~zod/try=> (mock [[20 21] 0 3] $~)
16 [%0 p=21]
20 [%0 p=21]
17−
18 ~zod/try=> (mock [[0] !=(.^(cy//=main/1))] ,~)
21 ~zod/try=> (mock [[0] !=(.^(cy//=main/1))] ,~)
19 [%1 p=~[[31.075 1.685.027.454 1.852.399.981 49 0]]]
22 [%1 p=~[[31.075 1.685.027.454 1.852.399.981 49 0]]]
20 ~zod/try=> (path [31.075 1.685.027.454 1.852.399.981 49 0])
23 ~zod/try=> (path [31.075 1.685.027.454 1.852.399.981 49 0])
docs/system/hoon/library/src/4a/core/po.md+55−52
@@ -1,42 +1,42 @@
1### `++po`
1### `++po`
2
2
3−++ po
3+ ++ po
4− ~/ %po
4+ ~/ %po
5− =+ :- ^= sis :: prefix syllables
5+ =+ :- ^= sis :: prefix syllables
6− 'dozmarbinwansamlitsighidfidlissogdirwacsabwissib\
6+ 'dozmarbinwansamlitsighidfidlissogdirwacsabwissib\
7− /rigsoldopmodfoglidhopdardorlorhodfolrintogsilmir\
7+ /rigsoldopmodfoglidhopdardorlorhodfolrintogsilmir\
8− /holpaslacrovlivdalsatlibtabhanticpidtorbolfosdot\
8+ /holpaslacrovlivdalsatlibtabhanticpidtorbolfosdot\
9− /losdilforpilramtirwintadbicdifrocwidbisdasmidlop\
9+ /losdilforpilramtirwintadbicdifrocwidbisdasmidlop\
10− /rilnardapmolsanlocnovsitnidtipsicropwitnatpanmin\
10+ /rilnardapmolsanlocnovsitnidtipsicropwitnatpanmin\
11− /ritpodmottamtolsavposnapnopsomfinfonbanporworsip\
11+ /ritpodmottamtolsavposnapnopsomfinfonbanporworsip\
12− /ronnorbotwicsocwatdolmagpicdavbidbaltimtasmallig\
12+ /ronnorbotwicsocwatdolmagpicdavbidbaltimtasmallig\
13− /sivtagpadsaldivdactansidfabtarmonranniswolmispal\
13+ /sivtagpadsaldivdactansidfabtarmonranniswolmispal\
14− /lasdismaprabtobrollatlonnodnavfignomnibpagsopral\
14+ /lasdismaprabtobrollatlonnodnavfignomnibpagsopral\
15− /bilhaddocridmocpacravripfaltodtiltinhapmicfanpat\
15+ /bilhaddocridmocpacravripfaltodtiltinhapmicfanpat\
16− /taclabmogsimsonpinlomrictapfirhasbosbatpochactid\
16+ /taclabmogsimsonpinlomrictapfirhasbosbatpochactid\
17− /havsaplindibhosdabbitbarracparloddosbortochilmac\
17+ /havsaplindibhosdabbitbarracparloddosbortochilmac\
18− /tomdigfilfasmithobharmighinradmashalraglagfadtop\
18+ /tomdigfilfasmithobharmighinradmashalraglagfadtop\
19− /mophabnilnosmilfopfamdatnoldinhatnacrisfotribhoc\
19+ /mophabnilnosmilfopfamdatnoldinhatnacrisfotribhoc\
20− /nimlarfitwalrapsarnalmoslandondanladdovrivbacpol\
20+ /nimlarfitwalrapsarnalmoslandondanladdovrivbacpol\
21− /laptalpitnambonrostonfodponsovnocsorlavmatmipfap'
21+ /laptalpitnambonrostonfodponsovnocsorlavmatmipfap'
22− ^= dex :: suffix syllables
22+ ^= dex :: suffix syllables
23− 'zodnecbudwessevpersutletfulpensytdurwepserwylsun\
23+ 'zodnecbudwessevpersutletfulpensytdurwepserwylsun\
24− /rypsyxdyrnuphebpeglupdepdysputlughecryttyvsydnex\
24+ /rypsyxdyrnuphebpeglupdepdysputlughecryttyvsydnex\
25− /lunmeplutseppesdelsulpedtemledtulmetwenbynhexfeb\
25+ /lunmeplutseppesdelsulpedtemledtulmetwenbynhexfeb\
26− /pyldulhetmevruttylwydtepbesdexsefwycburderneppur\
26+ /pyldulhetmevruttylwydtepbesdexsefwycburderneppur\
27− /rysrebdennutsubpetrulsynregtydsupsemwynrecmegnet\
27+ /rysrebdennutsubpetrulsynregtydsupsemwynrecmegnet\
28− /secmulnymtevwebsummutnyxrextebfushepbenmuswyxsym\
28+ /secmulnymtevwebsummutnyxrextebfushepbenmuswyxsym\
29− /selrucdecwexsyrwetdylmynmesdetbetbeltuxtugmyrpel\
29+ /selrucdecwexsyrwetdylmynmesdetbetbeltuxtugmyrpel\
30− /syptermebsetdutdegtexsurfeltudnuxruxrenwytnubmed\
30+ /syptermebsetdutdegtexsurfeltudnuxruxrenwytnubmed\
31− /lytdusnebrumtynseglyxpunresredfunrevrefmectedrus\
31+ /lytdusnebrumtynseglyxpunresredfunrevrefmectedrus\
32− /bexlebduxrynnumpyxrygryxfeptyrtustyclegnemfermer\
32+ /bexlebduxrynnumpyxrygryxfeptyrtustyclegnemfermer\
33− /tenlusnussyltecmexpubrymtucfyllepdebbermughuttun\
33+ /tenlusnussyltecmexpubrymtucfyllepdebbermughuttun\
34− /bylsudpemdevlurdefbusbeprunmelpexdytbyttyplevmyl\
34+ /bylsudpemdevlurdefbusbeprunmelpexdytbyttyplevmyl\
35− /wedducfurfexnulluclennerlexrupnedlecrydlydfenwel\
35+ /wedducfurfexnulluclennerlexrupnedlecrydlydfenwel\
36− /nydhusrelrudneshesfetdesretdunlernyrsebhulryllud\
36+ /nydhusrelrudneshesfetdesretdunlernyrsebhulryllud\
37− /remlysfynwerrycsugnysnyllyndyndemluxfedsedbecmun\
37+ /remlysfynwerrycsugnysnyllyndyndemluxfedsedbecmun\
38− /lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes'
38+ /lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes'
39− |%
39+ |%
40
40
41Provides the phonetic syllables and name generators for the Urbit naming
41Provides the phonetic syllables and name generators for the Urbit naming
42system. The two faces, `sis` and `dex` are available to the arms
42system. The two faces, `sis` and `dex` are available to the arms
@@ -54,20 +54,20 @@ Produces the byte of the right-hand syllable `a`.
54Accepts
54Accepts
55-------
55-------
56
56
57−`a` is an [atom]().
57+`a` is an atom.
58
58
59Produces
59Produces
60--------
60--------
61
61
62−A [`++unit`]() of an atom.
62+A `++unit` of an atom.
63
63
64Source
64Source
65------
65------
66
66
67− ++ ind ~/ %ind :: parse prefix
67+ ++ ind ~/ %ind :: parse suffix
68− |= a=@
68+ |= a/@tas
69 =+ b=0
69 =+ b=0
70− |- ^- (unit ,@)
70+ |- ^- (unit @)
71 ?:(=(256 b) ~ ?:(=(a (tod b)) [~ b] $(b +(b))))
71 ?:(=(256 b) ~ ?:(=(a (tod b)) [~ b] $(b +(b))))
72
72
73Examples
73Examples
@@ -91,21 +91,22 @@ Produces the byte of the left-hand phonetic syllable `b`.
91Accepts
91Accepts
92-------
92-------
93
93
94−`a` is an [atom]().
94+`a` is an atom.
95
95
96Produces
96Produces
97--------
97--------
98−A [`++unit`]() of an atom.
98+A `++unit` of an atom.
99
99
100Source
100Source
101------
101------
102
102
103− ++ ins ~/ %ins :: parse suffix
103+ ++ ins ~/ %ins :: parse prefix
104− |= a=@
104+ |= a/@tas
105 =+ b=0
105 =+ b=0
106− |- ^- (unit ,@)
106+ |- ^- (unit @)
107 ?:(=(256 b) ~ ?:(=(a (tos b)) [~ b] $(b +(b))))
107 ?:(=(256 b) ~ ?:(=(a (tos b)) [~ b] $(b +(b))))
108
108
109+
109Examples
110Examples
110--------
111--------
111
112
@@ -125,7 +126,7 @@ Examples
125Fetch prefix
126Fetch prefix
126
127
127Produces the phonetic prefix syllable from index `a` within `dex` as an
128Produces the phonetic prefix syllable from index `a` within `dex` as an
128−[atom]().
129+atom.
129
130
130Accepts
131Accepts
131-------
132-------
@@ -141,8 +142,10 @@ An atom.
141Source
142Source
142------
143------
143
144
144− ++ tod ~/ %tod :: fetch prefix
145+ ++ tod ~/ %tod :: fetch suffix
145− |=(a=@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] dex)))
146+ |=(a/@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] dex)))
147+
148+
146
149
147Examples
150Examples
148--------
151--------
@@ -167,7 +170,7 @@ Examples
167Fetch suffix
170Fetch suffix
168
171
169Produces the phonetic prefix syllable from index `a` within `sis` as an
172Produces the phonetic prefix syllable from index `a` within `sis` as an
170−[atom]().
173+atom.
171
174
172Accepts
175Accepts
173-------
176-------
@@ -183,7 +186,7 @@ Source
183------
186------
184
187
185 ++ tos ~/ %tos :: fetch suffix
188 ++ tos ~/ %tos :: fetch suffix
186− |=(a=@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] sis)))
189+ |=(a/@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] sis)))
187
190
188Examples
191Examples
189--------
192--------
docs/system/hoon/library/src/4b/core/at.md+12−10
@@ -1,7 +1,7 @@
1### `++at`
1### `++at`
2
2
3 ++ at
3 ++ at
4− |_ a=@
4+ |_ a/@
5
5
6XX document
6XX document
7
7
@@ -27,25 +27,26 @@ XX document
27
27
28### `++rf`
28### `++rf`
29
29
30− ++ rf `tape`[?-(a & '&', | '|', * !!) ~]
30+ ++ rf `tape`[?-(a $& '&', $| '|', * !!) ~]
31+
31
32
32XX document
33XX document
33
34
34### `++rn`
35### `++rn`
35
36
36− ++ rn `tape`[?>(=(0 a) '~') ~]
37+ ++ rn `tape`[?>(=(0 a) '~') ~]
37
38
38XX document
39XX document
39
40
40### `++rt`
41### `++rt`
41
42
42− ++ rt `tape`['\'' (weld (mesc (trip a)) `tape`['\'' ~])]
43+ ++ rt `tape`['\'' (weld (mesc (trip a)) `tape`['\'' ~])]
43
44
44XX document
45XX document
45
46
46### `++rta`
47### `++rta`
47
48
48− ++ rta rt
49+ ++ rta rt
49
50
50XX document
51XX document
51
52
@@ -57,20 +58,20 @@ XX document
57
58
58### `++rub`
59### `++rub`
59
60
60− ++ rub `tape`['0' 'b' (rum 2 ~ |=(b=@ (add '0' b)))]
61+ ++ rub `tape`['0' 'b' (rum 2 ~ |=(b/@ (add '0' b)))]
61
62
62XX document
63XX document
63
64
64### `++rud`
65### `++rud`
65
66
66− ++ rud (rum 10 ~ |=(b=@ (add '0' b)))
67+ ++ rud (rum 10 ~ |=(b/@ (add '0' b)))
67
68
68XX document
69XX document
69
70
70### `++rum`
71### `++rum`
71
72
72 ++ rum
73 ++ rum
73− |= [b=@ c=tape d=$+(@ @)]
74+ |= {b/@ c/tape d/$-(@ @)}
74 ^- tape
75 ^- tape
75 ?: =(0 a)
76 ?: =(0 a)
76 [(d 0) c]
77 [(d 0) c]
@@ -86,6 +87,7 @@ XX document
86 ==
87 ==
87 ::
88 ::
88
89
90+
89XX document
91XX document
90
92
91### `++rup`
93### `++rup`
@@ -124,7 +126,7 @@ XX document
124 %^ rum
126 %^ rum
125 64
127 64
126 ~
128 ~
127− |= b=@
129+ |= b/@
128 ?: =(63 b)
130 ?: =(63 b)
129 '+'
131 '+'
130 ?: =(62 b)
132 ?: =(62 b)
@@ -136,7 +138,7 @@ XX document
136
138
137### `++rux`
139### `++rux`
138
140
139− ++ rux `tape`['0' 'x' (rum 16 ~ |=(b=@ (add b ?:((lth b 10) 48 87))))]
141+ ++ rux `tape`['0' 'x' (rum 16 ~ |=(b/@ (add b ?:((lth b 10) 48 87))))]
140 --
142 --
141 :::::::::::::::::::::::::::::::::::::::::::::::::::::: ::
143 :::::::::::::::::::::::::::::::::::::::::::::::::::::: ::
142
144
docs/system/hoon/library/src/4b/gate/cass.md+2−3
@@ -19,10 +19,9 @@ Source
19------
19------
20
20
21 ++ cass :: lowercase
21 ++ cass :: lowercase
22− |= vib=tape
22+ |= vib/tape
23 %+ rap 3
23 %+ rap 3
24− (turn vib |=(a=@ ?.(&((gte a 'A') (lte a 'Z')) a (add 32 a))))
24+ (turn vib |=(a/@ ?.(&((gte a 'A') (lte a 'Z')) a (add 32 a))))
25− ::
26
25
27Examples
26Examples
28--------
27--------
docs/system/hoon/library/src/4b/gate/crip.md+1−1
@@ -2,7 +2,7 @@
2
2
3Tape to cord
3Tape to cord
4
4
5−Produce a [`++cord`]() from a [`++tape`]().
5+Produce a `++cord` from a `++tape`.
6
6
7Accepts
7Accepts
8-------
8-------
docs/system/hoon/library/src/4b/gate/cuss.md+2−2
@@ -2,8 +2,8 @@
2
2
3To uppercase
3To uppercase
4
4
5−Turn all occurances of lowercase letters in any [`++tape`]() into uppercase
5+Turn all occurances of lowercase letters in any `++tape` into uppercase
6−letters, as a [`++cord`]().
6+letters, as a `++cord`.
7
7
8Accepts
8Accepts
9-------
9-------
docs/system/hoon/library/src/4b/gate/mesc.md+4−4
@@ -2,12 +2,12 @@
2
2
3Escape special chars
3Escape special chars
4
4
5−Escape special characters, used in [`++show`](/doc/hoon/library/2ez#++show)
5+Escape special characters, used in `++show`.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`vib` is a [`++tape`]().
10+`vib` is a `++tape`.
11
11
12Produces
12Produces
13--------
13--------
@@ -18,13 +18,13 @@ Source
18------
18------
19
19
20 ++ mesc :: ctrl code escape
20 ++ mesc :: ctrl code escape
21− |= vib=tape
21+ |= vib/tape
22 ^- tape
22 ^- tape
23 ?~ vib
23 ?~ vib
24 ~
24 ~
25 ?: =('\\' i.vib)
25 ?: =('\\' i.vib)
26 ['\\' '\\' $(vib t.vib)]
26 ['\\' '\\' $(vib t.vib)]
27− ?: ?|((gth i.vib 126) (lth i.vib 32) =(39 i.vib))
27+ ?: ?|((gth i.vib 126) (lth i.vib 32) =(`@`39 i.vib))
28 ['\\' (welp ~(rux at i.vib) '/' $(vib t.vib))]
28 ['\\' (welp ~(rux at i.vib) '/' $(vib t.vib))]
29 [i.vib $(vib t.vib)]
29 [i.vib $(vib t.vib)]
30 ::
30 ::
docs/system/hoon/library/src/4b/gate/runt.md+2−2
@@ -2,7 +2,7 @@
2
2
3Prepend `n` times
3Prepend `n` times
4
4
5−Add `a` repetitions of character `b` to the head of [`++tape`]() `c`.
5+Add `a` repetitions of character `b` to the head of `++tape` `c`.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -20,7 +20,7 @@ Source
20------
20------
21
21
22 ++ runt :: prepend repeatedly
22 ++ runt :: prepend repeatedly
23− |= [[a=@ b=@] c=tape]
23+ |= [[a/@ b/@] c/tape]
24 ^- tape
24 ^- tape
25 ?: =(0 a)
25 ?: =(0 a)
26 c
26 c
docs/system/hoon/library/src/4b/gate/sand.md+7−7
@@ -2,35 +2,35 @@
2
2
3Soft-cast by odor
3Soft-cast by odor
4
4
5−Soft-cast validity by [odor]().
5+Soft-cast validity by odor.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a [`++span`]() (`@ta`).
10+`a` is a `++span` (`@ta`).
11
11
12`b` is an atom.
12`b` is an atom.
13
13
14Produces
14Produces
15--------
15--------
16
16
17−A `(unit ,@)`.
17+A `(unit @)`.
18
18
19Source
19Source
20------
20------
21
21
22 ++ sand :: atom sanity
22 ++ sand :: atom sanity
23− |= a=@ta
23+ |= a/@ta
24− |= b=@ ^- (unit ,@)
24+ |= b/@ ^- (unit @)
25 ?.(((sane a) b) ~ [~ b])
25 ?.(((sane a) b) ~ [~ b])
26 ::
26 ::
27
27
28Examples
28Examples
29--------
29--------
30
30
31− /~zod/try=> `(unit ,@ta)`((sand %ta) 'sym-som')
31+ /~zod/try=> `(unit @ta)`((sand %ta) 'sym-som')
32 [~ ~.sym-som]
32 [~ ~.sym-som]
33− /~zod/try=> `(unit ,@ta)`((sand %ta) 'err!')
33+ /~zod/try=> `(unit @ta)`((sand %ta) 'err!')
34 ~
34 ~
35
35
36
36
docs/system/hoon/library/src/4b/gate/sane.md+5−5
@@ -2,14 +2,14 @@
2
2
3Check odor validity
3Check odor validity
4
4
5−Check validity by [odor](). Produces a [gate]().
5+Check validity by odor. Produces a gate.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a [`++span`]() (`@ta`).
10+`a` is a `++span` (`@ta`).
11
11
12−`b` is an [atom]().
12+`b` is an atom.
13
13
14Produces
14Produces
15--------
15--------
@@ -20,8 +20,8 @@ Source
20------
20------
21
21
22 ++ sane :: atom sanity
22 ++ sane :: atom sanity
23− |= a=@ta
23+ |= a/@ta
24− |= b=@ ^- ?
24+ |= b/@ ^- ?
25 ?. =(%t (end 3 1 a))
25 ?. =(%t (end 3 1 a))
26 ~|(%sane-stub !!)
26 ~|(%sane-stub !!)
27 =+ [inx=0 len=(met 3 b)]
27 =+ [inx=0 len=(met 3 b)]
docs/system/hoon/library/src/4b/gate/teff.md+4−5
@@ -7,7 +7,7 @@ Produces the number of utf8 bytes.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a [`@t`]().
10+`a` is a `@t`.
11
11
12Produces
12Produces
13--------
13--------
@@ -17,14 +17,13 @@ An atom.
17Source
17Source
18------
18------
19
19
20− ++ teff :: length utf8
21− |= a=@t ^- @
20+ |= a/@t ^- @
22 =+ b=(end 3 1 a)
21 =+ b=(end 3 1 a)
22+ ~| %bad-utf8
23 ?: =(0 b)
23 ?: =(0 b)
24− ?>(=(0 a) 0)
24+ ?>(=(`@`0 a) 0)
25 ?> |((gte b 32) =(10 b))
25 ?> |((gte b 32) =(10 b))
26 ?:((lte b 127) 1 ?:((lte b 223) 2 ?:((lte b 239) 3 4)))
26 ?:((lte b 127) 1 ?:((lte b 223) 2 ?:((lte b 239) 3 4)))
27− ::
28
27
29Examples
28Examples
30--------
29--------
docs/system/hoon/library/src/4b/gate/trim.md+10−10
@@ -2,7 +2,7 @@
2
2
3Tape split
3Tape split
4
4
5−Split first `a` characters off [`++tape`]() `b`.
5+Split first `a` characters off `++tape` `b`.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -19,17 +19,17 @@ A cell of `++tape`s, `p` and `q`.
19Source
19Source
20------
20------
21
21
22− ++ trim :: tape split
22+ ++ trim :: 31-bit nonzero
23− |= [a=@ b=tape]
23+ |= key/@
24− ^- [p=tape q=tape]
24+ =+ syd=0xcafe.babe
25− ?~ b
25+ |- ^- @
26− [~ ~]
26+ =+ haz=(spec syd key)
27− ?: =(0 a)
27+ =+ ham=(mix (rsh 0 31 haz) (end 0 31 haz))
28− [~ b]
28+ ?.(=(0 ham) ham $(syd +(syd)))
29− =+ c=$(a (dec a), b t.b)
29+ --
30− [[i.b p.c] q.c]
31 ::
30 ::
32
31
32+
33Examples
33Examples
34--------
34--------
35
35
docs/system/hoon/library/src/4b/gate/trip.md+3−2
@@ -2,7 +2,7 @@
2
2
3Cord to tape
3Cord to tape
4
4
5−Produce a [`++tape`]() from [`++cord`]().
5+Produce a `++tape` from `++cord`.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -19,12 +19,13 @@ Source
19
19
20 ++ trip :: cord to tape
20 ++ trip :: cord to tape
21 ~/ %trip
21 ~/ %trip
22− |= a=@ ^- tape
22+ |= a/@ ^- tape
23 ?: =(0 (met 3 a))
23 ?: =(0 (met 3 a))
24 ~
24 ~
25 [^-(@ta (end 3 1 a)) $(a (rsh 3 1 a))]
25 [^-(@ta (end 3 1 a)) $(a (rsh 3 1 a))]
26 ::
26 ::
27
27
28+
28Examples
29Examples
29--------
30--------
30
31
docs/system/hoon/library/src/4b/gate/tuba.md+4−4
@@ -2,7 +2,7 @@
2
2
3UTF8 to UTF32 tape
3UTF8 to UTF32 tape
4
4
5−Convert [`++tape`]() to a [`++list`]() of codepoints ([`@c`]()).
5+Convert `++tape` to a `++list` of codepoints (`@c`).
6
6
7Accepts
7Accepts
8-------
8-------
@@ -12,14 +12,14 @@ Accepts
12Produces
12Produces
13--------
13--------
14
14
15−A `++list` of codepoints [`@c`]().
15+A `++list` of codepoints `@c`.
16
16
17Source
17Source
18------
18------
19
19
20 ++ tuba :: utf8 to utf32 tape
20 ++ tuba :: utf8 to utf32 tape
21− |= a=tape
21+ |= a/tape
22− ^- (list ,@c)
22+ ^- (list @c)
23 (rip 5 (turf (rap 3 a))) :: XX horrible
23 (rip 5 (turf (rap 3 a))) :: XX horrible
24 ::
24 ::
25
25
docs/system/hoon/library/src/4b/gate/tufa.md+4−4
@@ -2,12 +2,12 @@
2
2
3UTF32 to UTF8 tape
3UTF32 to UTF8 tape
4
4
5−Wrap a [`++list`]() of utf32 codepoints into a utf8 [`++tape`]().
5+Wrap a `++list` of utf32 codepoints into a utf8 `++tape`.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a `++list` of [`@c`]().
10+`a` is a `++list` of `@c`.
11
11
12Produces
12Produces
13--------
13--------
@@ -18,7 +18,7 @@ Source
18------
18------
19
19
20 ++ tufa :: utf32 to utf8 tape
20 ++ tufa :: utf32 to utf8 tape
21− |= a=(list ,@c)
21+ |= a=(list @c)
22 ^- tape
22 ^- tape
23 ?~ a ""
23 ?~ a ""
24 (weld (rip 3 (tuft i.a)) $(a t.a))
24 (weld (rip 3 (tuft i.a)) $(a t.a))
@@ -29,7 +29,7 @@ Examples
29
29
30 /~zod/try=> (tufa ~[~-~44f. ~-. ~-~442. ~-~443. ~-~442.])
30 /~zod/try=> (tufa ~[~-~44f. ~-. ~-~442. ~-~443. ~-~442.])
31 "я тут"
31 "я тут"
32− /~zod/try=> (tufa ((list ,@c) ~[%a %b 0xb1 %c]))
32+ /~zod/try=> (tufa ((list @c) ~[%a %b 0xb1 %c]))
33 "ab±c"
33 "ab±c"
34
34
35
35
docs/system/hoon/library/src/4b/gate/tuft.md+8−8
@@ -3,12 +3,12 @@
3UTF32 to UTF8 text
3UTF32 to UTF8 text
4
4
5Convert utf32 glyph to
5Convert utf32 glyph to
6−[LSB](http://en.wikipedia.org/wiki/Least_significant_bit) utf8 [`++cord`]().
6+LSB utf8 `++cord`.
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`a` is a codepoint ([`@c`]()).
11+`a` is a codepoint (`@c`).
12
12
13Produces
13Produces
14--------
14--------
@@ -19,22 +19,22 @@ Source
19------
19------
20
20
21 ++ tuft :: utf32 to utf8 text
21 ++ tuft :: utf32 to utf8 text
22− |= a=@c
22+ |= a/@c
23 ^- @t
23 ^- @t
24 %+ rap 3
24 %+ rap 3
25− |- ^- (list ,@)
25+ |- ^- (list @)
26− ?: =(0 a)
26+ ?: =(`@`0 a)
27 ~
27 ~
28 =+ b=(end 5 1 a)
28 =+ b=(end 5 1 a)
29 =+ c=$(a (rsh 5 1 a))
29 =+ c=$(a (rsh 5 1 a))
30− ?: (lth b 0x7f)
30+ ?: (lte b 0x7f)
31 [b c]
31 [b c]
32− ?: (lth b 0x7ff)
32+ ?: (lte b 0x7ff)
33 :* (mix 0b1100.0000 (cut 0 [6 5] b))
33 :* (mix 0b1100.0000 (cut 0 [6 5] b))
34 (mix 0b1000.0000 (end 0 6 b))
34 (mix 0b1000.0000 (end 0 6 b))
35 c
35 c
36 ==
36 ==
37− ?: (lth b 0xffff)
37+ ?: (lte b 0xffff)
38 :* (mix 0b1110.0000 (cut 0 [12 4] b))
38 :* (mix 0b1110.0000 (cut 0 [12 4] b))
39 (mix 0b1000.0000 (cut 0 [6 6] b))
39 (mix 0b1000.0000 (cut 0 [6 6] b))
40 (mix 0b1000.0000 (end 0 6 b))
40 (mix 0b1000.0000 (end 0 6 b))
docs/system/hoon/library/src/4b/gate/turf.md+15−13
@@ -2,39 +2,41 @@
2
2
3UTF8 to UTF32 cord
3UTF8 to UTF32 cord
4
4
5−Convert utf8 ([`++cord`]()) to utf32 codepoints.
5+Convert utf8 (`++cord`) to utf32 codepoints.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a [`@t`]().
10+`a` is a `@t`.
11
11
12Produces
12Produces
13--------
13--------
14
14
15−A [`@c`](), UTF-32 codepoint.
15+A `@c`, UTF-32 codepoint.
16
16
17Source
17Source
18------
18------
19
19
20 ++ turf :: utf8 to utf32
20 ++ turf :: utf8 to utf32
21− |= a=@t
21+ |= a/@t
22 ^- @c
22 ^- @c
23 %+ rap 5
23 %+ rap 5
24− |- ^- (list ,@c)
24+ |- ^- (list @c)
25 =+ b=(teff a)
25 =+ b=(teff a)
26 ?: =(0 b) ~
26 ?: =(0 b) ~
27+ =+ ^= c
27− :- %+ can 0
28+ %+ can 0
28 %+ turn
29 %+ turn
29− ^- (list ,[p=@ q=@])
30+ ^- (list {p/@ q/@})
30 ?+ b !!
31 ?+ b !!
31− 1 [[0 7] ~]
32+ $1 [[0 7] ~]
32− 2 [[8 6] [0 5] ~]
33+ $2 [[8 6] [0 5] ~]
33− 3 [[16 6] [8 6] [0 4] ~]
34+ $3 [[16 6] [8 6] [0 4] ~]
34− 4 [[24 6] [16 6] [8 6] [0 3] ~]
35+ $4 [[24 6] [16 6] [8 6] [0 3] ~]
35 ==
36 ==
36− |=([p=@ q=@] [q (cut 0 [p q] a)])
37+ |=({p/@ q/@} [q (cut 0 [p q] a)])
38+ ?. =((tuft c) (end 3 b a)) ~|(%bad-utf8 !!)
37− $(a (rsh 3 b a))
39+ [c $(a (rsh 3 b a))]
38 ::
40 ::
39
41
40Examples
42Examples
docs/system/hoon/library/src/4b/gate/wack.md+3−3
@@ -2,7 +2,7 @@
2
2
3Coin format encode
3Coin format encode
4
4
5−Escape [`++span`]() `~` as `~~` and `_` as `~-`. Used for printing.
5+Escape `++span` `~` as `~~` and `_` as `~-`. Used for printing.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -12,13 +12,13 @@ Accepts
12Produces
12Produces
13--------
13--------
14
14
15−A [`++span`]() (`@ta`).
15+A `++span` (`@ta`).
16
16
17Source
17Source
18------
18------
19
19
20 ++ wack :: coin format
20 ++ wack :: coin format
21− |= a=@ta
21+ |= a/@ta
22 ^- @ta
22 ^- @ta
23 =+ b=(rip 3 a)
23 =+ b=(rip 3 a)
24 %+ rap 3
24 %+ rap 3
docs/system/hoon/library/src/4b/gate/wick.md+18−14
@@ -2,33 +2,37 @@
2
2
3Coin format decode
3Coin format decode
4
4
5−Unescape [`++span`]() `~~` as `~` and `~-` as `_`.
5+Unescape `++span` `~~` as `~` and `~-` as `_`.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a an [atom]().
10+`a` is a an atom.
11
11
12Produces
12Produces
13--------
13--------
14
14
15−A [`++span`]() `@ta`.
15+A `++span` `@ta`.
16
16
17Source
17Source
18------
18------
19
19
20− ++ wick :: coin format
20+ ++ wick :: knot format
21− |= a=@
21+ |= a/@
22− ^- @ta
22+ ^- (unit @ta)
23 =+ b=(rip 3 a)
23 =+ b=(rip 3 a)
24− %+ rap 3
24+ =- ?^(b ~ (some (rap 3 (flop c))))
25+ =| c/tape
25− |- ^- tape
26+ |- ^- {b/tape c/tape}
26− ?~ b
27+ ?~ b [~ c]
27− ~
28− ?: =('~' i.b)
28+ ?. =('~' i.b)
29+ $(b t.b, c [i.b c])
29− ?~ t.b !!
30+ ?~ t.b [b ~]
30− [?:(=('~' i.t.b) '~' ?>(=('-' i.t.b) '_')) $(b t.t.b)]
31+ ?- i.t.b
31− [i.b $(b t.b)]
32+ $'~' $(b t.t.b, c ['~' c])
33+ $'-' $(b t.t.b, c ['_' c])
34+ @ [b ~]
35+ ==
32 ::
36 ::
33
37
34Examples
38Examples
docs/system/hoon/library/src/4b/gate/woad.md+9−9
@@ -2,27 +2,27 @@
2
2
3Unescape cord
3Unescape cord
4
4
5−Unescape [`++cord`]() codepoints.
5+Unescape `++cord` codepoints.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a [`@ta`]().
10+`a` is a `@ta`.
11
11
12Produces
12Produces
13--------
13--------
14
14
15−A [`++cord`]().
15+A `++cord`.
16
16
17Source
17Source
18------
18------
19
19
20 ++ woad :: cord format
20 ++ woad :: cord format
21− |= a=@ta
21+ |= a/@ta
22 ^- @t
22 ^- @t
23 %+ rap 3
23 %+ rap 3
24− |- ^- (list ,@)
24+ |- ^- (list @)
25− ?: =(0 a)
25+ ?: =(`@`0 a)
26 ~
26 ~
27 =+ b=(end 3 1 a)
27 =+ b=(end 3 1 a)
28 =+ c=(rsh 3 1 a)
28 =+ c=(rsh 3 1 a)
@@ -34,7 +34,7 @@ Source
34 ?+ b =- (weld (rip 3 (tuft p.d)) $(a q.d))
34 ?+ b =- (weld (rip 3 (tuft p.d)) $(a q.d))
35 ^= d
35 ^= d
36 =+ d=0
36 =+ d=0
37− |- ^- [p=@ q=@]
37+ |- ^- {p/@ q/@}
38 ?: =('.' b)
38 ?: =('.' b)
39 [d c]
39 [d c]
40 ?< =(0 c)
40 ?< =(0 c)
@@ -46,8 +46,8 @@ Source
46 ?: &((gte b '0') (lte b '9')) 48
46 ?: &((gte b '0') (lte b '9')) 48
47 ?>(&((gte b 'a') (lte b 'z')) 87)
47 ?>(&((gte b 'a') (lte b 'z')) 87)
48 ==
48 ==
49− %'.' ['.' $(a c)]
49+ $'.' ['.' $(a c)]
50− %'~' ['~' $(a c)]
50+ $'~' ['~' $(a c)]
51 ==
51 ==
52 ::
52 ::
53
53
docs/system/hoon/library/src/4b/gate/wood.md+8−12
@@ -2,50 +2,46 @@
2
2
3Escape cord
3Escape cord
4
4
5−Escape [`++cord`]() codepoints.
5+Escape `++cord` codepoints.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a [`++span`]() (`@ta`).
10+`a` is a `++span` (`@ta`).
11
11
12Produces
12Produces
13--------
13--------
14
14
15−A [`++span`]() (`@ta`).
15+A `++span` (`@ta`).
16
16
17Source
17Source
18------
18------
19
19
20 ++ wood :: cord format
20 ++ wood :: cord format
21− |= a=@t
21+ |= a/@t
22 ^- @ta
22 ^- @ta
23 %+ rap 3
23 %+ rap 3
24− |- ^- (list ,@)
24+ |- ^- (list @)
25− ?: =(0 a)
25+ ?: =(`@`0 a)
26 ~
26 ~
27 =+ b=(teff a)
27 =+ b=(teff a)
28 =+ c=(turf (end 3 b a))
28 =+ c=(turf (end 3 b a))
29 =+ d=$(a (rsh 3 b a))
29 =+ d=$(a (rsh 3 b a))
30 ?: ?| &((gte c 'a') (lte c 'z'))
30 ?: ?| &((gte c 'a') (lte c 'z'))
31 &((gte c '0') (lte c '9'))
31 &((gte c '0') (lte c '9'))
32− =('-' c)
32+ =(`@`'-' c)
33 ==
33 ==
34 [c d]
34 [c d]
35 ?+ c
35 ?+ c
36 :- '~'
36 :- '~'
37 =+ e=(met 2 c)
37 =+ e=(met 2 c)
38 |- ^- tape
38 |- ^- tape
39− ?: =(0 c)
39+ ?: =(0 e)
40 ['.' d]
40 ['.' d]
41 =. e (dec e)
41 =. e (dec e)
42 =+ f=(rsh 2 e c)
42 =+ f=(rsh 2 e c)
43 [(add ?:((lte f 9) 48 87) f) $(c (end 2 e c))]
43 [(add ?:((lte f 9) 48 87) f) $(c (end 2 e c))]
44 ::
44 ::
45− %' ' ['.' d]
46− %'.' ['~' '.' d]
47− %'~' ['~' '~' d]
48− ==
49
45
50Examples
46Examples
51--------
47--------
docs/system/hoon/library/src/4c/core/re.md+30−42
@@ -2,7 +2,7 @@
2
2
3Pretty-printing engine
3Pretty-printing engine
4
4
5−Pretty-printing engine that accepts a [`++tank`](/doc/hoon/library/1#++tank) [sample]() and contains arms that perform computation on it.
5+Pretty-printing engine that accepts a `++tank` sample and contains arms that perform computation on it.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -13,24 +13,24 @@ Produces
13--------
13--------
14
14
15 ++ re
15 ++ re
16− |_ tac=tank
16+ |_ tac/tank
17
17
18Examples
18Examples
19--------
19--------
20
20
21− /~zod/try=> ~(. re leaf/"ham")
21+ /~zod/try=> ~(. re leaf+"ham")
22− <2.ghl [[%leaf ""] <414.gly 100.xkc 1.ypj %164>]>
22+ <2.gdc {tac/{$leaf ""} <402.arm 110.jyx 1.ztu $151>}>
23
23
24### `++ram`
24### `++ram`
25
25
26Flatten to tape
26Flatten to tape
27
27
28−Flatten [`++tank`]() out into a [`++tape`]().
28+Flatten `++tank` out into a `++tape`.
29
29
30Accepts
30Accepts
31-------
31-------
32
32
33−`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
33+`tac` is a `++tank`, taken from sample of `++re` core.
34
34
35Produces
35Produces
36--------
36--------
@@ -43,9 +43,9 @@ Source
43 ++ ram
43 ++ ram
44 ^- tape
44 ^- tape
45 ?- -.tac
45 ?- -.tac
46− %leaf p.tac
46+ $leaf p.tac
47− %palm ram(tac [%rose [p.p.tac (weld q.p.tac r.p.tac) s.p.tac] q.tac])
47+ $palm ram(tac [%rose [p.p.tac (weld q.p.tac r.p.tac) s.p.tac] q.tac])
48− %rose
48+ $rose
49 %+ weld
49 %+ weld
50 q.p.tac
50 q.p.tac
51 |- ^- tape
51 |- ^- tape
@@ -59,9 +59,9 @@ Source
59Examples
59Examples
60--------
60--------
61
61
62− /~zod/try=> ~(ram re leaf/"foo")
62+ /~zod/try=> ~(ram re leaf+"foo")
63 "foo"
63 "foo"
64− /~zod/try=> ~(ram re rose/["." "(" ")"]^~[leaf/"bar" leaf/"baz" leaf/"bam"])
64+ /~zod/try=> ~(ram re rose+["." "(" ")"]^~[leaf+"bar" leaf+"baz" leaf+"bam"])
65 "(bar.baz.bam)"
65 "(bar.baz.bam)"
66
66
67### `++win`
67### `++win`
@@ -73,25 +73,25 @@ Render at indent level `tab` and width `edg`.
73Accepts
73Accepts
74-------
74-------
75
75
76−`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
76+`tac` is a `++tank`, taken from sample of `++re` core.
77
77
78`tab` and `edg` are atoms.
78`tab` and `edg` are atoms.
79
79
80Produces
80Produces
81--------
81--------
82
82
83−A [`++wall`]() ([`++list`]() of [`++tapes`]()).
83+A `++wall` (`++list` of `++tapes`).
84
84
85Source
85Source
86------
86------
87
87
88 ++ win
88 ++ win
89− |= [tab=@ edg=@]
89+ |= {tab/@ edg/@}
90 =+ lug=`wall`~
90 =+ lug=`wall`~
91 |^ |- ^- wall
91 |^ |- ^- wall
92 ?- -.tac
92 ?- -.tac
93− %leaf (rig p.tac)
93+ $leaf (rig p.tac)
94− %palm
94+ $palm
95 ?: fit
95 ?: fit
96 (rig ram)
96 (rig ram)
97 ?~ q.tac
97 ?~ q.tac
@@ -111,30 +111,17 @@ Source
111 ==
111 ==
112 (wig(lug qyr) q.p.tac)
112 (wig(lug qyr) q.p.tac)
113 ::
113 ::
114− %rose
115− ?: fit
116− (rig ram)
117− =+ ^= gyl
118− |- ^- wall
119− ?~ q.tac
120− ?:(=(%$ r.p.tac) lug (rig r.p.tac))
121− ^$(tac i.q.tac, lug $(q.tac t.q.tac), tab din)
122− ?: =(%$ q.p.tac)
123− gyl
124− (wig(lug gyl) q.p.tac)
125− ==
126− ::
127
114
128Examples
115Examples
129--------
116--------
130
117
131− /~zod/try=> (~(win re leaf/"samoltekon-lapdok") 0 20)
118+ /~zod/try=> (~(win re leaf+"samoltekon-lapdok") 0 20)
132 <<"samoltekon-lapdok">>
119 <<"samoltekon-lapdok">>
133− /~zod/try=> (~(win re leaf/"samoltekon-lapdok") 0 10)
120+ /~zod/try=> (~(win re leaf+"samoltekon-lapdok") 0 10)
134 <<"\/samolt\/" " ekon-l" " apdok" "\/ \/">>
121 <<"\/samolt\/" " ekon-l" " apdok" "\/ \/">>
135− /~zod/try=> (~(win re rose/["--" "[" "]"]^~[leaf/"1423" leaf/"2316"]) 0 20)
122+ /~zod/try=> (~(win re rose+["--" "[" "]"]^~[leaf+"1423" leaf+"2316"]) 0 20)
136 <<"[1423--2316]">>
123 <<"[1423--2316]">>
137− /~zod/try=> (~(win re rose/["--" "[" "]"]^~[leaf/"1423" leaf/"2316"]) 0 10)
124+ /~zod/try=> (~(win re rose+["--" "[" "]"]^~[leaf+"1423" leaf+"2316"]) 0 10)
138 <<"[ 1423" " 2316" "]">>
125 <<"[ 1423" " 2316" "]">>
139
126
140### `++din`
127### `++din`
@@ -185,28 +172,28 @@ Examples
185
172
186Wrap in `\/`
173Wrap in `\/`
187
174
188−Wrap [`++tape`]() in `\/` if it doesn't fit at current indentation. Internal to
175+Wrap `++tape` in `\/` if it doesn't fit at current indentation. Internal to
189−[`++win`]()
176+`++win`
190
177
191Accepts
178Accepts
192-------
179-------
193
180
194−`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
181+`tac` is a `++tank`, taken from sample of `++re` core.
195
182
196`hom` is a `++tape`.
183`hom` is a `++tape`.
197
184
198Produces
185Produces
199--------
186--------
200
187
201−A [`++wall`]() (list of `++tape`s).
188+A `++wall` (list of `++tape`s).
202
189
203Source
190Source
204------
191------
205
192
206 ++ rig
193 ++ rig
207− |= hom=tape
194+ |= hom/tape
208 ^- wall
195 ^- wall
209− ?: (lte (lent hom) (sub edg tab))
196+ ?: & ::(lte (lent hom) (sub edg tab))
210 [(runt [tab ' '] hom) lug]
197 [(runt [tab ' '] hom) lug]
211 => .(tab (add tab 2), edg (sub edg 2))
198 => .(tab (add tab 2), edg (sub edg 2))
212 =+ mut=(trim (sub edg tab) hom)
199 =+ mut=(trim (sub edg tab) hom)
@@ -229,12 +216,12 @@ Examples
229
216
230`++win` render tape
217`++win` render tape
231
218
232−Render [`++tape`](). Internal to [`++win`]().
219+Render `++tape`. Internal to `++win`.
233
220
234Accepts
221Accepts
235-------
222-------
236
223
237−`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
224+`tac` is a `++tank`, taken from sample of `++re` core.
238
225
239`hom` is a `++tape`.
226`hom` is a `++tape`.
240
227
@@ -242,7 +229,7 @@ Produces
242--------
229--------
243
230
244 ++ wig
231 ++ wig
245− |= hom=tape
232+ |= hom/tape
246 ^- wall
233 ^- wall
247 ?~ lug
234 ?~ lug
248 (rig hom)
235 (rig hom)
@@ -259,4 +246,5 @@ Produces
259
246
260
247
261
248
249+
262***
250***
docs/system/hoon/library/src/4c/gate/show.md+28−28
@@ -1,49 +1,48 @@
1### `++show`
1### `++show`
2
2
3− ++ show :: XX deprecated, use type
3+ ++ show :: XX deprecated, use span
4− |= vem=*
4+ |= vem/*
5 |^ ^- tank
5 |^ ^- tank
6 ?: ?=(@ vem)
6 ?: ?=(@ vem)
7 [%leaf (mesc (trip vem))]
7 [%leaf (mesc (trip vem))]
8 ?- vem
8 ?- vem
9− [s=~ c=*]
9+ {s/$~ c/*}
10 [%leaf '\'' (weld (mesc (tape +.vem)) `tape`['\'' ~])]
10 [%leaf '\'' (weld (mesc (tape +.vem)) `tape`['\'' ~])]
11 ::
11 ::
12− [s=%a c=@] [%leaf (mesc (trip c.vem))]
12+ {s/$a c/@} [%leaf (mesc (trip c.vem))]
13− [s=%b c=*] (shop c.vem |=(a=@ ~(rub at a)))
13+ {s/$b c/*} (shop c.vem |=(a/@ ~(rub at a)))
14− [s=[%c p=@] c=*]
14+ {s/{$c p/@} c/*}
15 :+ %palm
15 :+ %palm
16 [['.' ~] ['-' ~] ~ ~]
16 [['.' ~] ['-' ~] ~ ~]
17 [[%leaf (mesc (trip p.s.vem))] $(vem c.vem) ~]
17 [[%leaf (mesc (trip p.s.vem))] $(vem c.vem) ~]
18 ::
18 ::
19− [s=%d c=*] (shop c.vem |=(a=@ ~(rud at a)))
19+ {s/$d c/*} (shop c.vem |=(a/@ ~(rud at a)))
20− [s=%k c=*] (tank c.vem)
20+ {s/$k c/*} (tank c.vem)
21− [s=%h c=*]
21+ {s/$h c/*}
22− ?: =(0 c.vem) :: XX remove after 220
23− [%leaf '#' ~]
24 :+ %rose
22 :+ %rose
25 [['/' ~] ['/' ~] ~]
23 [['/' ~] ['/' ~] ~]
26− =+ yol=((list ,@ta) c.vem)
24+ =+ yol=((list @ta) c.vem)
27− (turn yol |=(a=@ta [%leaf (trip a)]))
25+ (turn yol |=(a/@ta [%leaf (trip a)]))
28 ::
26 ::
27+ {s/$l c/*} (shol c.vem)
29− [s=%o c=*]
28+ {s/$o c/*}
30 %= $
29 %= $
31 vem
30 vem
32 :- [%m '%h:<[%d %d].[%d %d]>']
31 :- [%m '%h:<[%d %d].[%d %d]>']
33 [-.c.vem +<-.c.vem +<+.c.vem +>-.c.vem +>+.c.vem ~]
32 [-.c.vem +<-.c.vem +<+.c.vem +>-.c.vem +>+.c.vem ~]
34 ==
33 ==
35 ::
34 ::
36− [s=%p c=*] (shop c.vem |=(a=@ ~(rup at a)))
35+ {s/$p c/*} (shop c.vem |=(a/@ ~(rup at a)))
37− [s=%q c=*] (shop c.vem |=(a=@ ~(r at a)))
36+ {s/$q c/*} (shop c.vem |=(a/@ ~(r at a)))
38− [s=%r c=*] $(vem [[%r ' ' '{' '}'] c.vem])
37+ {s/$r c/*} $(vem [[%r ' ' '{' '}'] c.vem])
39− [s=%t c=*] (shop c.vem |=(a=@ ~(rt at a)))
38+ {s/$t c/*} (shop c.vem |=(a/@ ~(rt at a)))
40− [s=%v c=*] (shop c.vem |=(a=@ ~(ruv at a)))
39+ {s/$v c/*} (shop c.vem |=(a/@ ~(ruv at a)))
41− [s=%x c=*] (shop c.vem |=(a=@ ~(rux at a)))
40+ {s/$x c/*} (shop c.vem |=(a/@ ~(rux at a)))
42− [s=[%m p=@] c=*] (shep p.s.vem c.vem)
41+ {s/{$m p/@} c/*} (shep p.s.vem c.vem)
43− [s=[%r p=@] c=*]
42+ {s/{$r p/@} c/*}
44 $(vem [[%r ' ' (cut 3 [0 1] p.s.vem) (cut 3 [1 1] p.s.vem)] c.vem])
43 $(vem [[%r ' ' (cut 3 [0 1] p.s.vem) (cut 3 [1 1] p.s.vem)] c.vem])
45 ::
44 ::
46− [s=[%r p=@ q=@ r=@] c=*]
45+ {s/{$r p/@ q/@ r/@} c/*}
47 :+ %rose
46 :+ %rose
48 :* p=(mesc (trip p.s.vem))
47 :* p=(mesc (trip p.s.vem))
49 q=(mesc (trip q.s.vem))
48 q=(mesc (trip q.s.vem))
@@ -54,7 +53,7 @@
54 ~
53 ~
55 [^$(vem -.c.vem) $(c.vem +.c.vem)]
54 [^$(vem -.c.vem) $(c.vem +.c.vem)]
56 ::
55 ::
57− [s=%z c=*] $(vem [[%r %$ %$ %$] c.vem])
56+ {s/$z c/*} $(vem [[%r %$ %$ %$] c.vem])
58 * !!
57 * !!
59 ==
58 ==
60
59
@@ -63,7 +62,7 @@ XX document
63### `++shep`
62### `++shep`
64
63
65 ++ shep
64 ++ shep
66− |= [fom=@ gar=*]
65+ |= {fom/@ gar/*}
67 ^- tank
66 ^- tank
68 =+ l=(met 3 fom)
67 =+ l=(met 3 fom)
69 =+ i=0
68 =+ i=0
@@ -84,8 +83,8 @@ XX document
84
83
85### `++shop`
84### `++shop`
86
85
87− ++ shop
86+ ++ shop
88− |= [aug=* vel=$+(a=@ tape)]
87+ |= {aug/* vel/$-(a/@ tape)}
89 ^- tank
88 ^- tank
90 ?: ?=(@ aug)
89 ?: ?=(@ aug)
91 [%leaf (vel aug)]
90 [%leaf (vel aug)]
@@ -96,7 +95,8 @@ XX document
96 ?: ?=(@ aug)
95 ?: ?=(@ aug)
97 [^$ ~]
96 [^$ ~]
98 [^$(aug -.aug) $(aug +.aug)]
97 [^$(aug -.aug) $(aug +.aug)]
99− --
98+ ::
99+
100
100
101XX document
101XX document
102
102
docs/system/hoon/library/src/4d/gate/last.md+4−5
@@ -2,15 +2,15 @@
2
2
3Farther trace
3Farther trace
4
4
5−Compares two line-column pairs, called [`++hair`]()s, `zyc` and `naz`, producing whichever
5+Compares two line-column pairs, called `++hair`s, `zyc` and `naz`, producing whichever
6is further along.
6is further along.
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`naz` is a [hair]().
11+`naz` is a hair.
12
12
13−`zyc` is a [hair]().
13+`zyc` is a hair.
14
14
15Produces
15Produces
16--------
16--------
@@ -20,12 +20,11 @@ a `++hair`.
20Source
20Source
21------
21------
22
22
23− ++ last |= [zyc=hair naz=hair] :: farther trace
23+ ++ last |= {zyc/hair naz/hair} :: farther trace
24 ^- hair
24 ^- hair
25 ?: =(p.zyc p.naz)
25 ?: =(p.zyc p.naz)
26 ?:((gth q.zyc q.naz) zyc naz)
26 ?:((gth q.zyc q.naz) zyc naz)
27 ?:((gth p.zyc p.naz) zyc naz)
27 ?:((gth p.zyc p.naz) zyc naz)
28− ::
29
28
30
29
31Examples
30Examples
docs/system/hoon/library/src/4d/gate/lust.md+4−3
@@ -3,7 +3,7 @@
3
3
4Detect newline
4Detect newline
5
5
6−Advances the [`++hair`]() `naz` by a row if the [`++char`]() `weq` is a newline, or by a
6+Advances the `++hair` `naz` by a row if the `++char` `weq` is a newline, or by a
7column if `weq` is any other character.
7column if `weq` is any other character.
8
8
9Accepts
9Accepts
@@ -21,9 +21,10 @@ A hair.
21Source
21Source
22------
22------
23
23
24− ++ lust |= [weq=char naz=hair] :: detect newline
24+ ++ lust |= {weq/char naz/hair} :: detect newline
25 ^- hair
25 ^- hair
26− ?:(=(10 weq) [+(p.naz) 1] [p.naz +(q.naz)])
26+ ?:(=(`@`10 weq) [+(p.naz) 1] [p.naz +(q.naz)])
27+
27
28
28
29
29Examples
30Examples
docs/system/hoon/library/src/4e/gate/bend.md+14−14
@@ -2,8 +2,8 @@
2
2
3Conditional composer
3Conditional composer
4
4
5−Parsing composer: connects the [`++edge`]() `vex` with the subsequent [`++rule`]() `sab`
5+Parsing composer: connects the `++edge` `vex` with the subsequent `++rule` `sab`
6−as an optional suffix, using [gate]() `raq` to compose or reject its
6+as an optional suffix, using gate `raq` to compose or reject its
7result. If there is no suffix, or if the suffix fails to be composed
7result. If there is no suffix, or if the suffix fails to be composed
8with the current result, the current result is produced. Used to map a
8with the current result, the current result is produced. Used to map a
9group of rules to a specified output.
9group of rules to a specified output.
@@ -11,25 +11,25 @@ group of rules to a specified output.
11Accepts
11Accepts
12-------
12-------
13
13
14−`raq` is a [gate]().
14+`raq` is a gate.
15
15
16−`sab` is a [rule]().
16+`sab` is a rule.
17
17
18−`vex` is an [edge]().
18+`vex` is an edge.
19
19
20Produces
20Produces
21--------
21--------
22
22
23−A [`++rule`]().
23+A `++rule`.
24
24
25Source
25Source
26------
26------
27
27
28 ++ bend :: conditional comp
28 ++ bend :: conditional comp
29 ~/ %bend
29 ~/ %bend
30− |* raq=_|*([a=* b=*] [~ u=[a b]])
30+ |* raq/_|*({a/* b/*} [~ u=[a b]])
31 ~/ %fun
31 ~/ %fun
32− |* [vex=edge sab=_rule]
32+ |* {vex/edge sab/rule}
33 ?~ q.vex
33 ?~ q.vex
34 vex
34 vex
35 =+ yit=(sab q.u.q.vex)
35 =+ yit=(sab q.u.q.vex)
@@ -45,18 +45,18 @@ Source
45Examples
45Examples
46--------
46--------
47
47
48− ~zod/try=> (;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qs")
48+ ~zod/try=> (;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qs")
49 [p=[p=1 q=3] q=[~ u=[p=~~q q=[p=[p=1 q=2] q="s"]]]]
49 [p=[p=1 q=3] q=[~ u=[p=~~q q=[p=[p=1 q=2] q="s"]]]]
50− ~zod/try=> (;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qqq")
50+ ~zod/try=> (;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qqq")
51 [p=[p=1 q=3] q=[~ u=[p=~~r q=[p=[p=1 q=3] q="q"]]]]
51 [p=[p=1 q=3] q=[~ u=[p=~~r q=[p=[p=1 q=3] q="q"]]]]
52− ~zod/try=> (scan "aa" ;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn))
52+ ~zod/try=> (scan "aa" ;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn))
53 ~~b
53 ~~b
54− ~zod/try=> (scan "ba" ;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn))
54+ ~zod/try=> (scan "ba" ;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn))
55 ! {1 3}
55 ! {1 3}
56 ! exit
56 ! exit
57− ~zod/try=> `(unit ,@tas)`(scan "" ;~((bend) (easy ~) sym))
57+ ~zod/try=> `(unit @tas)`(scan "" ;~((bend) (easy ~) sym))
58 ~
58 ~
59− ~zod/try=> `(unit ,@tas)`(scan "sep" ;~((bend) (easy ~) sym))
59+ ~zod/try=> `(unit @tas)`(scan "sep" ;~((bend) (easy ~) sym))
60 [~ %sep]
60 [~ %sep]
61
61
62
62
docs/system/hoon/library/src/4e/gate/comp.md+9−8
@@ -2,14 +2,14 @@
2
2
3Arbitrary compose
3Arbitrary compose
4
4
5−Parsing composer: connects the [`++edge`]() `vex` with a following [`++rule`]() `sab`,
5+Parsing composer: connects the `++edge` `vex` with a following `++rule` `sab`,
6combining the contents of `vex` with the result of `sab` using a binary
6combining the contents of `vex` with the result of `sab` using a binary
7−[gate]() `raq`. Used to fold over the results of several `++rules`.
7+gate `raq`. Used to fold over the results of several `++rules`.
8
8
9Accepts
9Accepts
10-------
10-------
11
11
12−`raq` is a gate that accepts a cell of two [nouns](), `a` and `b`, and
12+`raq` is a gate that accepts a cell of two nouns, `a` and `b`, and
13produces a cell of two nouns.
13produces a cell of two nouns.
14
14
15`sab` is a rule.
15`sab` is a rule.
@@ -19,16 +19,17 @@ produces a cell of two nouns.
19Produces
19Produces
20--------
20--------
21
21
22−A [`++rule`]().
22+A `++rule`.
23
23
24Source
24Source
25------
25------
26
26
27 ++ comp
27 ++ comp
28 ~/ %comp
28 ~/ %comp
29− |* raq=_|*([a=* b=*] [a b]) :: arbitrary compose
29+ |* raq/_|*({a/* b/*} [a b]) :: arbitrary compose
30 ~/ %fun
30 ~/ %fun
31− |* [vex=edge sab=_rule]
31+ |* {vex/edge sab/rule}
32+ ~! +<
32 ?~ q.vex
33 ?~ q.vex
33 vex
34 vex
34 =+ yit=(sab q.u.q.vex)
35 =+ yit=(sab q.u.q.vex)
@@ -41,9 +42,9 @@ Source
41Examples
42Examples
42--------
43--------
43
44
44− ~zod/try=> (scan "123" ;~((comp |=([a=@u b=@u] (add a b))) dit dit dit))
45+ ~zod/try=> (scan "123" ;~((comp |=([a/@u b/@u] (add a b))) dit dit dit))
45 6
46 6
46− ~zod/try=> (scan "12" ;~((comp |=([a=@u b=@u] (add a b))) dit dit dit))
47+ ~zod/try=> (scan "12" ;~((comp |=([a/@u b/@u] (add a b))) dit dit dit))
47 ! {1 3}
48 ! {1 3}
48 ! exit
49 ! exit
49
50
docs/system/hoon/library/src/4e/gate/fail.md+3−3
@@ -2,13 +2,13 @@
2
2
3Never parse
3Never parse
4
4
5−Produces an [`++edge`]() at the same text position ([`++hair`]()) with a failing
5+Produces an `++edge` at the same text position (`++hair`) with a failing
6result (`q=~`).
6result (`q=~`).
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`tub` is a [`++nail`]().
11+`tub` is a `++nail`.
12
12
13Produces
13Produces
14--------
14--------
@@ -18,7 +18,7 @@ An `++edge`.
18Source
18Source
19------
19------
20
20
21− ++ fail |=(tub=nail [p=p.tub q=~]) :: never parse
21+ ++ fail |=(tub/nail [p=p.tub q=~]) :: never parse
22
22
23Examples
23Examples
24--------
24--------
docs/system/hoon/library/src/4e/gate/glue.md+3−3
@@ -2,7 +2,7 @@
2
2
3Skip delimiter
3Skip delimiter
4
4
5−Parsing composer: connects an [`++edge`]() `vex` with a following [`++rule`]() `sab` by
5+Parsing composer: connects an `++edge` `vex` with a following `++rule` `sab` by
6parsing the `++rule` `bus` (the delimiting symbol) and throwing out the
6parsing the `++rule` `bus` (the delimiting symbol) and throwing out the
7result.
7result.
8
8
@@ -25,9 +25,9 @@ Source
25
25
26 ++ glue :: add rule
26 ++ glue :: add rule
27 ~/ %glue
27 ~/ %glue
28− |* bus=_rule
28+ |* bus/rule
29 ~/ %fun
29 ~/ %fun
30− |* [vex=edge sab=_rule]
30+ |* {vex/edge sab/rule}
31 (plug vex ;~(pfix bus sab))
31 (plug vex ;~(pfix bus sab))
32 ::
32 ::
33
33
docs/system/hoon/library/src/4e/gate/less.md+4−4
@@ -2,8 +2,8 @@
2
2
3Parse unless
3Parse unless
4
4
5−Parsing composer: if an [`++edge`]() `vex` reflects a success, fail. Otherwise,
5+Parsing composer: if an `++edge` `vex` reflects a success, fail. Otherwise,
6−connect `vex` with the following [`++rule`]().
6+connect `vex` with the following `++rule`.
7
7
8Accepts
8Accepts
9-------
9-------
@@ -21,11 +21,11 @@ Source
21------
21------
22
22
23 ++ less :: no first and second
23 ++ less :: no first and second
24− |* [vex=edge sab=_rule]
24+ |* {vex/edge sab/rule}
25 ?~ q.vex
25 ?~ q.vex
26 =+ roq=(sab)
26 =+ roq=(sab)
27 [p=(last p.vex p.roq) q=q.roq]
27 [p=(last p.vex p.roq) q=q.roq]
28− vex(q ~)
28+ (fail +<.sab)
29 ::
29 ::
30
30
31Examples
31Examples
docs/system/hoon/library/src/4e/gate/pfix.md+3−4
@@ -2,13 +2,13 @@
2
2
3Discard first rule
3Discard first rule
4
4
5−Parsing composer: connects an [`++edge`]() `vex` with two subsequent [`++rule`]()s,
5+Parsing composer: connects an `++edge` `vex` with two subsequent `++rule`s,
6ignoring the result of the first and producing the result of the second.
6ignoring the result of the first and producing the result of the second.
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`vex` is an [edge]().
11+`vex` is an edge.
12
12
13Produces
13Produces
14--------
14--------
@@ -20,8 +20,7 @@ Source
20
20
21 ++ pfix :: discard first rule
21 ++ pfix :: discard first rule
22 ~/ %pfix
22 ~/ %pfix
23− (comp |*([a=* b=*] b))
23+ (comp |*({a/* b/*} b))
24− ::
25
24
26Examples
25Examples
27--------
26--------
docs/system/hoon/library/src/4e/gate/plug.md+3−3
@@ -2,8 +2,8 @@
2
2
3Parse to tuple
3Parse to tuple
4
4
5−Parsing composer: connects an [`++edge`]() `vex` with a following [`++rule`]() `sab`, producing
5+Parsing composer: connects an `++edge` `vex` with a following `++rule` `sab`, producing
6−a cell of both the results. See also: the monad applicator [;\~]() for a
6+a cell of both the results. See also: the monad applicator ;\~ for a
7more detailed explanation.
7more detailed explanation.
8
8
9Accepts
9Accepts
@@ -23,7 +23,7 @@ Source
23
23
24 ++ plug :: first then second
24 ++ plug :: first then second
25 ~/ %plug
25 ~/ %plug
26− |* [vex=edge sab=_rule]
26+ |* {vex/edge sab/rule}
27 ?~ q.vex
27 ?~ q.vex
28 vex
28 vex
29 =+ yit=(sab q.u.q.vex)
29 =+ yit=(sab q.u.q.vex)
docs/system/hoon/library/src/4e/gate/pose.md+6−4
@@ -3,14 +3,14 @@
3Parse options
3Parse options
4
4
5Parsing composer: if `vex` reflects a failure, connect it with the
5Parsing composer: if `vex` reflects a failure, connect it with the
6−following rule `sab`. See also: the monad applicator [;\~]()
6+following rule `sab`. See also: the monad applicator ;\~
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`sab` is a [`++rule`]().
11+`sab` is a `++rule`.
12
12
13−`vex` is an [`++edge`]().
13+`vex` is an `++edge`.
14
14
15Produces
15Produces
16--------
16--------
@@ -22,11 +22,13 @@ Source
22
22
23 ++ pose :: first or second
23 ++ pose :: first or second
24 ~/ %pose
24 ~/ %pose
25− |* [vex=edge sab=_rule]
25+ |* {vex/edge sab/rule}
26 ?~ q.vex
26 ?~ q.vex
27 =+ roq=(sab)
27 =+ roq=(sab)
28 [p=(last p.vex p.roq) q=q.roq]
28 [p=(last p.vex p.roq) q=q.roq]
29 vex
29 vex
30+ ::
31+
30
32
31Examples
33Examples
32--------
34--------
docs/system/hoon/library/src/4e/gate/sfix.md+3−2
@@ -2,7 +2,7 @@
2
2
3Discard second rule
3Discard second rule
4
4
5−Parsing composer: connects [`++edge`]()s `vex` with two subsequent [`++rule`]()s returning the
5+Parsing composer: connects `++edge`s `vex` with two subsequent `++rule`s returning the
6result of the first and discarding the result of the second.
6result of the first and discarding the result of the second.
7
7
8Accepts
8Accepts
@@ -22,7 +22,8 @@ Source
22
22
23 ++ sfix :: discard second rule
23 ++ sfix :: discard second rule
24 ~/ %sfix
24 ~/ %sfix
25− (comp |*([a=* b=*] a))
25+ (comp |*({a/* b/*} a))
26+
26
27
27Examples
28Examples
28--------
29--------
docs/system/hoon/library/src/4e/gate/simu.md+3−3
@@ -2,8 +2,8 @@
2
2
3First and second
3First and second
4
4
5−Parsing composer: if an [`++edge`]() `vex` reflects a failure, fail. Otherwise,
5+Parsing composer: if an `++edge` `vex` reflects a failure, fail. Otherwise,
6−connect `vex` with the following [`++rule`]().
6+connect `vex` with the following `++rule`.
7
7
8Accepts
8Accepts
9-------
9-------
@@ -21,7 +21,7 @@ Source
21------
21------
22
22
23 ++ simu :: first and second
23 ++ simu :: first and second
24− |* [vex=edge sab=_rule]
24+ |* {vex/edge sab/rule}
25 ?~ q.vex
25 ?~ q.vex
26 vex
26 vex
27 =+ roq=(sab)
27 =+ roq=(sab)
docs/system/hoon/library/src/4f/gate/bass.md+9−7
@@ -1,31 +1,33 @@
1### `++bass`
1### `++bass`
2
2
3−Parser modifier: [LSB](http://en.wikipedia.org/wiki/Least_significant_bit)
3+Parser modifier: LSB
4−ordered [`++list`]() as atom of a [`++base`]().
4+ordered `++list` as atom of a `++base`.
5
5
6Accepts
6Accepts
7-------
7-------
8
8
9`wuc` is an atom.
9`wuc` is an atom.
10
10
11−`tyd` is a [`++rule`]().
11+`tyd` is a `++rule`.
12
12
13Produces
13Produces
14--------
14--------
15
15
16−A [`++rule`]().
16+A `++rule`.
17
17
18Source
18Source
19------
19------
20
20
21 ++ bass
21 ++ bass
22− |* [wuc=@ tyd=_rule]
22+ |* {wuc/@ tyd/rule}
23 %+ cook
23 %+ cook
24− |= waq=(list ,@)
24+ |= waq/(list @)
25 %+ roll
25 %+ roll
26 waq
26 waq
27− =|([p=@ q=@] |.((add p (mul wuc q))))
27+ =|({p/@ q/@} |.((add p (mul wuc q))))
28 tyd
28 tyd
29+ ::
30+
29
31
30Examples
32Examples
31--------
33--------
docs/system/hoon/library/src/4f/gate/boss.md+9−7
@@ -1,32 +1,34 @@
1
1
2### `++boss`
2### `++boss`
3
3
4−Parser modifier: [LSB](http://en.wikipedia.org/wiki/Least_significant_bit)
4+Parser modifier: LSB
5+
5−ordered [`++list`]() as atom of a [`++base`]().
6+Ordered `++list` as atom of a `++base`.
6
7
7Accepts
8Accepts
8-------
9-------
9
10
10`wuc` is an atom.
11`wuc` is an atom.
11
12
12−`tyd` is a [`++rule`]().
13+`tyd` is a `++rule`.
13
14
14Produces
15Produces
15--------
16--------
16
17
17−A [`++rule`]().
18+A `++rule`.
18
19
19Source
20Source
20------
21------
21
22
22 ++ boss
23 ++ boss
23− |* [wuc=@ tyd=_rule]
24+ |* {wuc/@ tyd/rule}
24 %+ cook
25 %+ cook
25− |= waq=(list ,@)
26+ |= waq/(list @)
26 %+ reel
27 %+ reel
27 waq
28 waq
28− =|([p=@ q=@] |.((add p (mul wuc q))))
29+ =|({p/@ q/@} |.((add p (mul wuc q))))
29 tyd
30 tyd
31+ ::
30
32
31Examples
33Examples
32--------
34--------
docs/system/hoon/library/src/4f/gate/cold.md+6−7
@@ -2,34 +2,33 @@
2
2
3Replace with constant
3Replace with constant
4
4
5−Parser modifier. Accepts a [`++rule`]() `sef` and produces a parser that
5+Parser modifier. Accepts a `++rule` `sef` and produces a parser that
6produces a constant `cus`, assuming `sef` is successful.
6produces a constant `cus`, assuming `sef` is successful.
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`cus` is a constant [noun]().
11+`cus` is a constant noun.
12
12
13`sef` is a `++rule`.
13`sef` is a `++rule`.
14
14
15Produces
15Produces
16--------
16--------
17
17
18−An [`++edge`]().
18+An `++edge`.
19
19
20Source
20Source
21------
21------
22
22
23− ++ cold :: replace w/ constant
23+ ++ cold :: replace w+ constant
24 ~/ %cold
24 ~/ %cold
25− |* [cus=* sef=_rule]
25+ |* {cus/* sef/rule}
26 ~/ %fun
26 ~/ %fun
27− |= tub=nail
27+ |= tub/nail
28 =+ vex=(sef tub)
28 =+ vex=(sef tub)
29 ?~ q.vex
29 ?~ q.vex
30 vex
30 vex
31 [p=p.vex q=[~ u=[p=cus q=q.u.q.vex]]]
31 [p=p.vex q=[~ u=[p=cus q=q.u.q.vex]]]
32− ::
33
32
34Examples
33Examples
35--------
34--------
docs/system/hoon/library/src/4f/gate/cook.md+6−6
@@ -3,28 +3,28 @@
3Apply gate
3Apply gate
4
4
5Parser modifier. Produces a parser that takes a (successful) result of a
5Parser modifier. Produces a parser that takes a (successful) result of a
6−[`++rule`]() `sef` and slams it through `poq`.
6+`++rule` `sef` and slams it through `poq`.
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`poq` is a [gate]().
11+`poq` is a gate.
12
12
13−`sef` is a [`++rule`]().
13+`sef` is a `++rule`.
14
14
15Produces
15Produces
16--------
16--------
17
17
18−An [`++rule`]().
18+An `++rule`.
19
19
20Source
20Source
21------
21------
22
22
23 ++ cook :: apply gate
23 ++ cook :: apply gate
24 ~/ %cook
24 ~/ %cook
25− |* [poq=_,* sef=_rule]
25+ |* {poq/$-(* *) sef/rule}
26 ~/ %fun
26 ~/ %fun
27− |= tub=nail
27+ |= tub/nail
28 =+ vex=(sef tub)
28 =+ vex=(sef tub)
29 ?~ q.vex
29 ?~ q.vex
30 vex
30 vex
docs/system/hoon/library/src/4f/gate/easy.md+2−2
@@ -2,7 +2,7 @@
2
2
3Always parse
3Always parse
4
4
5−Parser generator. Produces a parser that succeeds with given [noun]() `huf`
5+Parser generator. Produces a parser that succeeds with given noun `huf`
6without consuming any text.
6without consuming any text.
7
7
8Accepts
8Accepts
@@ -13,7 +13,7 @@ Accepts
13Produces
13Produces
14--------
14--------
15
15
16−A [`++rule`]().
16+A `++rule`.
17
17
18Source
18Source
19------
19------
docs/system/hoon/library/src/4f/gate/full.md+2−2
@@ -2,13 +2,13 @@
2
2
3Parse to end
3Parse to end
4
4
5−Parser modifier. Accepts a [`++rule`]() `sef`, and produces a parser that succeeds only
5+Parser modifier. Accepts a `++rule` `sef`, and produces a parser that succeeds only
6when the of `tub` is fully consumed using `sef`.
6when the of `tub` is fully consumed using `sef`.
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`sef` is a [`++rule`]().
11+`sef` is a `++rule`.
12
12
13Produces
13Produces
14--------
14--------
docs/system/hoon/library/src/4f/gate/funk.md+4−5
@@ -2,14 +2,14 @@
2
2
3Add to tape
3Add to tape
4
4
5−Parser modifier: prepend text to [`++tape`]() before applying parser.
5+Parser modifier: prepend text to `++tape` before applying parser.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10`pre` is a `++tape`
10`pre` is a `++tape`
11
11
12−`sef` is a [`++rule`]()
12+`sef` is a `++rule`
13
13
14Produces
14Produces
15--------
15--------
@@ -20,10 +20,9 @@ Source
20------
20------
21
21
22 ++ funk :: add to tape first
22 ++ funk :: add to tape first
23− |* [pre=tape sef=_rule]
23+ |* {pre/tape sef/rule}
24− |= tub=nail
24+ |= tub/nail
25 (sef p.tub (weld pre q.tub))
25 (sef p.tub (weld pre q.tub))
26− ::
27
26
28Examples
27Examples
29--------
28--------
docs/system/hoon/library/src/4f/gate/here.md+6−6
@@ -2,16 +2,16 @@
2
2
3Place-based apply
3Place-based apply
4
4
5−Parser modifier. Similar to [`++cook`]() in that it produces a parser that takes a
5+Parser modifier. Similar to `++cook` in that it produces a parser that takes a
6(successful) result of `sef` and slams it through `hez`. `hez` accepts a
6(successful) result of `sef` and slams it through `hez`. `hez` accepts a
7−[`++pint`]() `a` and a [noun]() `b`, which is what the parser parsed.
7+`++pint` `a` and a noun `b`, which is what the parser parsed.
8
8
9Accepts
9Accepts
10-------
10-------
11
11
12−`hez` is a [gate]().
12+`hez` is a gate.
13
13
14−`sef` is a [`++rule`]()
14+`sef` is a `++rule`
15
15
16Produces
16Produces
17--------
17--------
@@ -23,9 +23,9 @@ Source
23
23
24 ++ here :: place-based apply
24 ++ here :: place-based apply
25 ~/ %here
25 ~/ %here
26− |* [hez=_|=([a=pint b=*] [a b]) sef=_rule]
26+ |* {hez/_|=({a/pint b/*} [a b]) sef/rule}
27 ~/ %fun
27 ~/ %fun
28− |= tub=nail
28+ |= tub/nail
29 =+ vex=(sef tub)
29 =+ vex=(sef tub)
30 ?~ q.vex
30 ?~ q.vex
31 vex
31 vex
docs/system/hoon/library/src/4f/gate/ifix.md+7−3
@@ -2,7 +2,7 @@
2
2
3Infix
3Infix
4
4
5−Parser modifier: surround with pair of [`++rule`]()s, the output of which is
5+Parser modifier: surround with pair of `++rule`s, the output of which is
6discarded.
6discarded.
7
7
8Accepts
8Accepts
@@ -21,8 +21,12 @@ Source
21------
21------
22
22
23 ++ ifix
23 ++ ifix
24− |* [fel=[p=_rule q=_rule] hof=_rule]
24+ |* {fel/{rule rule} hof/rule}
25+ ~! +<
26+ ~! +<:-.fel
27+ ~! +<:+.fel
25− ;~(pfix p.fel ;~(sfix hof q.fel))
28+ ;~(pfix -.fel ;~(sfix hof +.fel))
29+ ::
26
30
27Examples
31Examples
28--------
32--------
docs/system/hoon/library/src/4f/gate/jest.md+7−7
@@ -7,24 +7,24 @@ Match and consume a cord.
7Accepts
7Accepts
8-------
8-------
9
9
10−`daf` is a [`@t`]().
10+`daf` is a `@t`.
11
11
12Produces
12Produces
13--------
13--------
14
14
15−An [`++edge`]().
15+An `++edge`.
16
16
17Source
17Source
18------
18------
19
19
20 ++ jest :: match a cord
20 ++ jest :: match a cord
21− |= daf=@t
21+ |= daf/@t
22− |= tub=nail
22+ |= tub/nail
23 =+ fad=daf
23 =+ fad=daf
24− |- ^- (like ,@t)
24+ |- ^- (like @t)
25− ?: =(0 daf)
25+ ?: =(`@`0 daf)
26 [p=p.tub q=[~ u=[p=fad q=tub]]]
26 [p=p.tub q=[~ u=[p=fad q=tub]]]
27− ?: |(?=(~ q.tub) !=((end 3 1 daf) i.q.tub))
27+ ?: |(?=($~ q.tub) !=((end 3 1 daf) i.q.tub))
28 (fail tub)
28 (fail tub)
29 $(p.tub (lust i.q.tub p.tub), q.tub t.q.tub, daf (rsh 3 1 daf))
29 $(p.tub (lust i.q.tub p.tub), q.tub t.q.tub, daf (rsh 3 1 daf))
30 ::
30 ::
docs/system/hoon/library/src/4f/gate/just.md+4−4
@@ -7,21 +7,21 @@ Match and consume a single character.
7Accepts
7Accepts
8-------
8-------
9
9
10−`daf` is a [`++char`]()
10+`daf` is a `++char`
11
11
12Produces
12Produces
13--------
13--------
14
14
15−A [`++rule`]().
15+A `++rule`.
16
16
17Source
17Source
18------
18------
19
19
20 ++ just :: XX redundant, jest
20 ++ just :: XX redundant, jest
21 ~/ %just :: match a char
21 ~/ %just :: match a char
22− |= daf=char
22+ |= daf/char
23 ~/ %fun
23 ~/ %fun
24− |= tub=nail
24+ |= tub/nail
25 ^- (like char)
25 ^- (like char)
26 ?~ q.tub
26 ?~ q.tub
27 (fail tub)
27 (fail tub)
docs/system/hoon/library/src/4f/gate/knee.md+5−5
@@ -10,20 +10,20 @@ Accepts
10
10
11`gar` is a noun.
11`gar` is a noun.
12
12
13−`sef` is a [gate]() that accepts a [`++rule`]()
13+`sef` is a gate that accepts a `++rule`
14
14
15Produces
15Produces
16--------
16--------
17
17
18−A [`++rule`]().
18+A `++rule`.
19
19
20Source
20Source
21------
21------
22
22
23 ++ knee :: callbacks
23 ++ knee :: callbacks
24− |* [gar=* sef=_|.(rule)]
24+ |* {gar/* sef/_|.(*rule)}
25− |= tub=nail
25+ |= tub/nail
26− ^- (like ,_gar)
26+ ^- (like _gar)
27 ((sef) tub)
27 ((sef) tub)
28 ::
28 ::
29
29
docs/system/hoon/library/src/4f/gate/mask.md+5−5
@@ -8,25 +8,25 @@ characters.
8Accepts
8Accepts
9-------
9-------
10
10
11−`bud` is a list of [`++char`]()
11+`bud` is a list of `++char`
12
12
13Produces
13Produces
14--------
14--------
15
15
16−A [`++rule`]().
16+A `++rule`.
17
17
18Source
18Source
19------
19------
20
20
21 ++ mask :: match char in set
21 ++ mask :: match char in set
22 ~/ %mask
22 ~/ %mask
23− |= bud=(list char)
23+ |= bud/(list char)
24 ~/ %fun
24 ~/ %fun
25− |= tub=nail
25+ |= tub/nail
26 ^- (like char)
26 ^- (like char)
27 ?~ q.tub
27 ?~ q.tub
28 (fail tub)
28 (fail tub)
29− ?. (lien bud |=(a=char =(i.q.tub a)))
29+ ?. (lien bud |=(a/char =(i.q.tub a)))
30 (fail tub)
30 (fail tub)
31 (next tub)
31 (next tub)
32 ::
32 ::
docs/system/hoon/library/src/4f/gate/more.md+3−2
@@ -2,7 +2,7 @@
2
2
3Parse list with delimiter
3Parse list with delimiter
4
4
5−Parser modifier: Parse a list of matches using a delimiter [`++rule`]().
5+Parser modifier: Parse a list of matches using a delimiter `++rule`.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -20,8 +20,9 @@ Source
20------
20------
21
21
22 ++ more
22 ++ more
23− |* [bus=_rule fel=_rule]
23+ |* {bus/rule fel/rule}
24 ;~(pose (most bus fel) (easy ~))
24 ;~(pose (most bus fel) (easy ~))
25+ ::
25
26
26Examples
27Examples
27--------
28--------
docs/system/hoon/library/src/4f/gate/most.md+3−2
@@ -2,7 +2,7 @@
2
2
3Parse list of at least one match
3Parse list of at least one match
4
4
5−Parser modifier: parse a [`++list`]() of at least one match using a delimiter [`++rule`]().
5+Parser modifier: parse a `++list` of at least one match using a delimiter `++rule`.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -20,8 +20,9 @@ Source
20------
20------
21
21
22 ++ most
22 ++ most
23− |* [bus=_rule fel=_rule]
23+ |* {bus/rule fel/rule}
24 ;~(plug fel (star ;~(pfix bus fel)))
24 ;~(plug fel (star ;~(pfix bus fel)))
25+ ::
25
26
26Examples
27Examples
27--------
28--------
docs/system/hoon/library/src/4f/gate/next.md+3−3
@@ -7,18 +7,18 @@ Consume any character, producing it as a result.
7Accepts
7Accepts
8-------
8-------
9
9
10−`tub` is a [`++nail`]()
10+`tub` is a `++nail`
11
11
12Produces
12Produces
13--------
13--------
14
14
15−An [`++edge`]().
15+An `++edge`.
16
16
17Source
17Source
18------
18------
19
19
20 ++ next :: consume a char
20 ++ next :: consume a char
21− |= tub=nail
21+ |= tub/nail
22 ^- (like char)
22 ^- (like char)
23 ?~ q.tub
23 ?~ q.tub
24 (fail tub)
24 (fail tub)
docs/system/hoon/library/src/4f/gate/plus.md+4−3
@@ -3,12 +3,12 @@
3
3
4List of at least one match.
4List of at least one match.
5
5
6−Parser modifier: parse [`++list`]() of at least one match.
6+Parser modifier: parse `++list` of at least one match.
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`fel` is a [`++rule`]().
11+`fel` is a `++rule`.
12
12
13Produces
13Produces
14--------
14--------
@@ -18,7 +18,8 @@ A `++rule`.
18Source
18Source
19------
19------
20
20
21− ++ plus |*(fel=_rule ;~(plug fel (star fel)))
21+ ++ plus |*(fel/rule ;~(plug fel (star fel)))
22+
22
23
23Examples
24Examples
24--------
25--------
docs/system/hoon/library/src/4f/gate/sear.md+7−7
@@ -2,25 +2,24 @@
2
2
3Conditional `++cook`
3Conditional `++cook`
4
4
5−Conditional [`++cook`](). Slams the result through a gate that produces
5+Conditional `++cook`. Slams the result through a gate that produces
6a unit; if that unit is empty, fail.
6a unit; if that unit is empty, fail.
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`tub` is a [`++nail`](/doc/hoon/library/1#++nail)
11+`tub` is a `++nail`.
12−
13Produces
12Produces
14--------
13--------
15
14
16−A [`++rule`]().
15+A `++rule`.
17
16
18Source
17Source
19------
18------
20
19
21 ++ sear :: conditional cook
20 ++ sear :: conditional cook
22− |* [pyq=_|=(* *(unit)) sef=_rule]
21+ |* {pyq/$-(* (unit)) sef/rule}
23− |= tub=nail
22+ |= tub/nail
24 =+ vex=(sef tub)
23 =+ vex=(sef tub)
25 ?~ q.vex
24 ?~ q.vex
26 vex
25 vex
@@ -30,10 +29,11 @@ Source
30 [p=p.vex q=[~ u=[p=u.gey q=q.u.q.vex]]]
29 [p=p.vex q=[~ u=[p=u.gey q=q.u.q.vex]]]
31 ::
30 ::
32
31
32+
33Examples
33Examples
34--------
34--------
35
35
36− ~zod/try=> ((sear |=(a=* ?@(a (some a) ~)) (just `a`)) [[1 1] "abc"])
36+ ~zod/try=> ((sear |=(a/* ?@(a (some a) ~)) (just `a`)) [[1 1] "abc"])
37 [p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]]
37 [p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]]
38 ~zod/try=> ((sear |=(* ~) (just 'a')) [[1 1] "abc"])
38 ~zod/try=> ((sear |=(* ~) (just 'a')) [[1 1] "abc"])
39 [p=[p=1 q=2] q=~]
39 [p=[p=1 q=2] q=~]
docs/system/hoon/library/src/4f/gate/shim.md+4−4
@@ -2,7 +2,7 @@
2
2
3Char in range
3Char in range
4
4
5−Match characters ([`++char`]()) within a range.
5+Match characters (`++char`) within a range.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -14,16 +14,16 @@ Accepts
14Produces
14Produces
15--------
15--------
16
16
17−A [`++rule`]().
17+A `++rule`.
18
18
19Source
19Source
20------
20------
21
21
22 ++ shim :: match char in range
22 ++ shim :: match char in range
23 ~/ %shim
23 ~/ %shim
24− |= [les=@ mos=@]
24+ |= {les/@ mos/@}
25 ~/ %fun
25 ~/ %fun
26− |= tub=nail
26+ |= tub/nail
27 ^- (like char)
27 ^- (like char)
28 ?~ q.tub
28 ?~ q.tub
29 (fail tub)
29 (fail tub)
docs/system/hoon/library/src/4f/gate/slug.md+7−5
@@ -2,13 +2,13 @@
2
2
3Use gate to parse delimited list
3Use gate to parse delimited list
4
4
5−Parser modifier: By composing with a [gate](), parse a delimited [`++list`]() of
5+Parser modifier: By composing with a gate, parse a delimited `++list` of
6matches.
6matches.
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`bus` is a [`++rule`]().
11+`bus` is a `++rule`.
12
12
13`fel` is a `++rule`.
13`fel` is a `++rule`.
14
14
@@ -21,16 +21,18 @@ Source
21------
21------
22
22
23 ++ slug
23 ++ slug
24− |* raq=_|*([a=* b=*] [a b])
24+ |* raq/_|*({a/* b/*} [a b])
25− |* [bus=_rule fel=_rule]
25+ |* {bus/rule fel/rule}
26 ;~((comp raq) fel (stir +<+.raq raq ;~(pfix bus fel)))
26 ;~((comp raq) fel (stir +<+.raq raq ;~(pfix bus fel)))
27+ ::
28+
27
29
28Examples
30Examples
29--------
31--------
30
32
31 ~zod/try=> (scan "20+5+110" ((slug add) lus dem))
33 ~zod/try=> (scan "20+5+110" ((slug add) lus dem))
32 135
34 135
33− ~zod/try=> `@t`(scan "a b c" ((slug |=(a=[@ @t] (cat 3 a))) ace alp))
35+ ~zod/try=> `@t`(scan "a b c" ((slug |=(a/[@ @t] (cat 3 a))) ace alp))
34 'abc'
36 'abc'
35
37
36
38
docs/system/hoon/library/src/4f/gate/stag.md+3−3
@@ -14,16 +14,16 @@ Accepts
14Produces
14Produces
15--------
15--------
16
16
17−A [`++rule`]().
17+A `++rule`.
18
18
19Source
19Source
20------
20------
21
21
22 ++ stag :: add a label
22 ++ stag :: add a label
23 ~/ %stag
23 ~/ %stag
24− |* [gob=* sef=_rule]
24+ |* {gob/* sef/rule}
25 ~/ %fun
25 ~/ %fun
26− |= tub=nail
26+ |= tub/nail
27 =+ vex=(sef tub)
27 =+ vex=(sef tub)
28 ?~ q.vex
28 ?~ q.vex
29 vex
29 vex
docs/system/hoon/library/src/4f/gate/star.md+4−4
@@ -2,19 +2,19 @@
2
2
3List of matches
3List of matches
4
4
5−Parser modifier: parse [`++list`]() of matches.
5+Parser modifier: parse `++list` of matches.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`fel` is a [`++rule`]().
10+`fel` is a `++rule`.
11
11
12Produces
12Produces
13--------
13--------
14
14
15 ++ star :: 0 or more times
15 ++ star :: 0 or more times
16− |* fel=_rule
16+ |* fel/rule
17− (stir `(list ,_(wonk *fel))`~ |*([a=* b=*] [a b]) fel)
17+ (stir `(list _(wonk *fel))`~ |*({a/* b/*} [a b]) fel)
18
18
19Examples
19Examples
20--------
20--------
docs/system/hoon/library/src/4f/gate/stet.md+1−1
@@ -18,7 +18,7 @@ Source
18------
18------
19
19
20 ++ stet
20 ++ stet
21− |* leh=(list ,[?(@ [@ @]) _rule])
21+ |* leh/(list {?(@ {@ @}) rule})
22 |-
22 |-
23 ?~ leh
23 ?~ leh
24 ~
24 ~
docs/system/hoon/library/src/4f/gate/stew.md+8−6
@@ -4,14 +4,14 @@ Switch by first
4
4
5 ++ stew :: switch by first char
5 ++ stew :: switch by first char
6 ~/ %stew
6 ~/ %stew
7− |* leh=(list ,[p=?(@ [@ @]) q=_rule]) :: char/range keys
7+ |* leh/(list {p/?(@ {@ @}) q/rule}) :: char+range keys
8 =+ ^= wor :: range complete lth
8 =+ ^= wor :: range complete lth
9− |= [ort=?(@ [@ @]) wan=?(@ [@ @])]
9+ |= {ort/?(@ {@ @}) wan/?(@ {@ @})}
10 ?@ ort
10 ?@ ort
11 ?@(wan (lth ort wan) (lth ort -.wan))
11 ?@(wan (lth ort wan) (lth ort -.wan))
12 ?@(wan (lth +.ort wan) (lth +.ort -.wan))
12 ?@(wan (lth +.ort wan) (lth +.ort -.wan))
13 =+ ^= hel :: build parser map
13 =+ ^= hel :: build parser map
14− =+ hel=`(tree $_(?>(?=(^ leh) i.leh)))`~
14+ =+ hel=`(tree _?>(?=(^ leh) i.leh))`~
15 |- ^+ hel
15 |- ^+ hel
16 ?~ leh
16 ?~ leh
17 ~
17 ~
@@ -31,7 +31,7 @@ Switch by first
31 [n.yal l.yal nuc]
31 [n.yal l.yal nuc]
32 [n.nuc [n.yal l.yal l.nuc] r.nuc]
32 [n.nuc [n.yal l.yal l.nuc] r.nuc]
33 ~% %fun ..^$ ~
33 ~% %fun ..^$ ~
34− |= tub=nail
34+ |= tub/nail
35 ?~ q.tub
35 ?~ q.tub
36 (fail tub)
36 (fail tub)
37 |-
37 |-
@@ -47,8 +47,10 @@ Switch by first
47 $(hel r.hel)
47 $(hel r.hel)
48 ::
48 ::
49
49
50+
51+
50−Parser generator. From an associative [`++list`]() of characters or character
52+Parser generator. From an associative `++list` of characters or character
51−ranges to [`++rule`]()s, construct a [`++map`](), and parse [`++tape`]()s only
53+ranges to `++rule`s, construct a `++map`, and parse `++tape`s only
52with `++rules` associated with a range that the `++tape`'s first character falls in.
54with `++rules` associated with a range that the `++tape`'s first character falls in.
53
55
54
56
docs/system/hoon/library/src/4f/gate/stir.md+19−12
@@ -2,7 +2,7 @@
2
2
3Parse repeatedly
3Parse repeatedly
4
4
5−Parse with [`++rule`]() as many times as possible, and fold over results with a
5+Parse with `++rule` as many times as possible, and fold over results with a
6binary gate.
6binary gate.
7
7
8Accepts
8Accepts
@@ -22,19 +22,26 @@ A rule.
22Source
22Source
23------
23------
24
24
25−++ stir :: parse repeatedly
25+ ++ stun :: parse several times
26− ~/ %stir
26+ |* {lig/{@ @} fel/rule}
27− |* [rud=* raq=_|*([a=* b=*] [a b]) fel=_rule]
28− ~/ %fun
29− |= tub=nail
27+ |= tub/nail
30− ^- (like ,_rud)
28+ ^- (like (list _(wonk (fel))))
29+ ?: =(0 +.lig)
30+ [p.tub [~ ~ tub]]
31 =+ vex=(fel tub)
31 =+ vex=(fel tub)
32 ?~ q.vex
32 ?~ q.vex
33+ ?: =(0 -.lig)
33− [p.vex [~ rud tub]]
34+ [p.vex [~ ~ tub]]
35+ vex
36+ =+ ^= wag %= $
37+ -.lig ?:(=(0 -.lig) 0 (dec -.lig))
38+ +.lig ?:(=(0 +.lig) 0 (dec +.lig))
34− =+ wag=$(tub q.u.q.vex)
39+ tub q.u.q.vex
40+ ==
35− ?> ?=(^ q.wag)
41+ ?~ q.wag
42+ wag
36− [(last p.vex p.wag) [~ (raq p.u.q.vex p.u.q.wag) q.u.q.wag]]
43+ [p.wag [~ [p.u.q.vex p.u.q.wag] q.u.q.wag]]
37− ::
44+
38
45
39Examples
46Examples
40--------
47--------
docs/system/hoon/library/src/4f/gate/stun.md+9−9
@@ -9,30 +9,30 @@ Accepts
9
9
10`[les=@ mos=@]` is a cell of atoms indicating the bounds.
10`[les=@ mos=@]` is a cell of atoms indicating the bounds.
11
11
12−`fel` is a [`++rule`]().
12+`fel` is a `++rule`.
13
13
14Produces
14Produces
15--------
15--------
16
16
17−A [`++rule`]().
17+A `++rule`.
18
18
19Source
19Source
20------
20------
21
21
22 ++ stun :: parse several times
22 ++ stun :: parse several times
23− |* [[les=@ mos=@] fel=_rule]
23+ |* {lig/{@ @} fel/rule}
24− |= tub=nail
24+ |= tub/nail
25− ^- (like (list ,_(wonk (fel))))
25+ ^- (like (list _(wonk (fel))))
26− ?: =(0 mos)
26+ ?: =(0 +.lig)
27 [p.tub [~ ~ tub]]
27 [p.tub [~ ~ tub]]
28 =+ vex=(fel tub)
28 =+ vex=(fel tub)
29 ?~ q.vex
29 ?~ q.vex
30− ?: =(0 les)
30+ ?: =(0 -.lig)
31 [p.vex [~ ~ tub]]
31 [p.vex [~ ~ tub]]
32 vex
32 vex
33 =+ ^= wag %= $
33 =+ ^= wag %= $
34− les ?:(=(0 les) 0 (dec les))
34+ -.lig ?:(=(0 -.lig) 0 (dec -.lig))
35− mos ?:(=(0 mos) 0 (dec mos))
35+ +.lig ?:(=(0 +.lig) 0 (dec +.lig))
36 tub q.u.q.vex
36 tub q.u.q.vex
37 ==
37 ==
38 ?~ q.wag
38 ?~ q.wag
docs/system/hoon/library/src/4g/gate/rash.md+3−2
@@ -2,7 +2,7 @@
2
2
3Parse or crash
3Parse or crash
4
4
5−Parse a cord with a given [`++rule`]() and crash if the [`++cord`]() isn't entirely
5+Parse a cord with a given `++rule` and crash if the `++cord` isn't entirely
6parsed.
6parsed.
7
7
8Accepts
8Accepts
@@ -20,7 +20,8 @@ The value of the parse result, or crash.
20Source
20Source
21------
21------
22
22
23− ++ rash |*([naf=@ sab=_rule] (scan (trip naf) sab)) ::
23+ ++ rash |*({naf/@ sab/rule} (scan (trip naf) sab)) ::
24+
24
25
25Examples
26Examples
26--------
27--------
docs/system/hoon/library/src/4g/gate/rush.md+4−3
@@ -8,9 +8,9 @@ entirely parsed.
8Accepts
8Accepts
9-------
9-------
10
10
11−`naf` is an [atom]().
11+`naf` is an atom.
12
12
13−`sab` is a [rule]().
13+`sab` is a rule.
14
14
15Produces
15Produces
16--------
16--------
@@ -20,7 +20,8 @@ The value of the parse result, or null.
20Source
20Source
21------
21------
22
22
23− ++ rush |*([naf=@ sab=_rule] (rust (trip naf) sab))
23+ ++ rush |*({naf/@ sab/rule} (rust (trip naf) sab))
24+
24
25
25Examples
26Examples
26--------
27--------
docs/system/hoon/library/src/4g/gate/rust.md+3−2
@@ -2,7 +2,7 @@
2
2
3Parse tape or null
3Parse tape or null
4
4
5−Parse a [`++tape`]() with a given [`++rule`]() and produce null if the `++tape` isn't
5+Parse a `++tape` with a given `++rule` and produce null if the `++tape` isn't
6entirely parsed.
6entirely parsed.
7
7
8Accepts
8Accepts
@@ -20,10 +20,11 @@ A `(unit ,@t)`
20Source
20Source
21------
21------
22
22
23− ++ rust |* [los=tape sab=_rule]
23+ ++ rust |* {los/tape sab/rule}
24 =+ vex=((full sab) [[1 1] los])
24 =+ vex=((full sab) [[1 1] los])
25 ?~(q.vex ~ [~ u=p.u.q.vex])
25 ?~(q.vex ~ [~ u=p.u.q.vex])
26
26
27+
27Examples
28Examples
28--------
29--------
29
30
docs/system/hoon/library/src/4g/gate/scan.md+4−4
@@ -2,15 +2,15 @@
2
2
3Parse tape or crash
3Parse tape or crash
4
4
5−Parse a [`++tape`]() with a given [`++rule`]() and crash if the `++tape` isn't entirely
5+Parse a `++tape` with a given `++rule` and crash if the `++tape` isn't entirely
6parsed.
6parsed.
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`los` is a [tape]().
11+`los` is a tape.
12
12
13−`sab` is a [rule]().
13+`sab` is a rule.
14
14
15Produces
15Produces
16--------
16--------
@@ -20,7 +20,7 @@ Either a `++tape` or a crash.
20Source
20Source
21------
21------
22
22
23− ++ scan |* [los=tape sab=_rule]
23+ ++ scan |* {los/tape sab/rule}
24 =+ vex=((full sab) [[1 1] los])
24 =+ vex=((full sab) [[1 1] los])
25 ?~ q.vex
25 ?~ q.vex
26 ~_ (show [%m '{%d %d}'] p.p.vex q.p.vex ~)
26 ~_ (show [%m '{%d %d}'] p.p.vex q.p.vex ~)
docs/system/hoon/library/src/4j/core/ab.md+53−53
@@ -22,7 +22,7 @@ Examples
22
22
23Parse hex pair
23Parse hex pair
24
24
25−Parsing [`++rule`](). Parses a pair of base-16 digits. Used in escapes.
25+Parsing `++rule`. Parses a pair of base-16 digits. Used in escapes.
26
26
27Accepts
27Accepts
28-------
28-------
@@ -55,7 +55,7 @@ Examples
55
55
56Parse phonetic pair
56Parse phonetic pair
57
57
58−Parsing [`++rule`](). Parses an atom of [odor]() [`@pE`](), a phrase of two bytes
58+Parsing `++rule`. Parses an atom of odor `@pE`, a phrase of two bytes
59encoded phonetically.
59encoded phonetically.
60
60
61Accepts
61Accepts
@@ -87,7 +87,7 @@ Examples
87
87
88Parse two phonetic pairs
88Parse two phonetic pairs
89
89
90−Parsing [`++rule`](). Parses and unscrambles an atom of odor [@pF](), a phrase
90+Parsing `++rule`. Parses and unscrambles an atom of odor @pF, a phrase
91of two two-byte pairs that are encoded (and scrambled) phonetically.
91of two two-byte pairs that are encoded (and scrambled) phonetically.
92
92
93Accepts
93Accepts
@@ -104,7 +104,7 @@ Source
104------
104------
105
105
106 ++ huf %+ cook
106 ++ huf %+ cook
107− |=([a=@ b=@] (wred:un ~(zug mu ~(zag mu [a b]))))
107+ |=([a/@ b/@] (wred:un ~(zug mu ~(zag mu [a b]))))
108 ;~(plug hif ;~(pfix hep hif))
108 ;~(plug hif ;~(pfix hep hif))
109
109
110Examples
110Examples
@@ -123,13 +123,13 @@ Examples
123
123
124Parse 8 phonetic bytes
124Parse 8 phonetic bytes
125
125
126−Parsing [`++rule`](). Parses an atom of odor [@pG](), a phrase of eight of
126+Parsing `++rule`. Parses an atom of odor @pG, a phrase of eight of
127phonetic bytes.
127phonetic bytes.
128
128
129Accepts
129Accepts
130-------
130-------
131
131
132−An atom of odor [`@pG`]()
132+An atom of odor `@pG`
133
133
134Produces
134Produces
135--------
135--------
@@ -155,12 +155,12 @@ Examples
155
155
156Parse \<= 5 base-32
156Parse \<= 5 base-32
157
157
158−Parsing [`++rule`](). Parses up to five base-32 digits without a leading zero.
158+Parsing `++rule`. Parses up to five base-32 digits without a leading zero.
159
159
160Accepts
160Accepts
161-------
161-------
162
162
163−Up to five [@uv]() (base 64) digits.
163+Up to five @uv (base 64) digits.
164
164
165Produces
165Produces
166--------
166--------
@@ -191,12 +191,12 @@ Examples
191
191
192Parse \<= 5 base-64
192Parse \<= 5 base-64
193
193
194−Parsing [`++rule`](). Parses up to five base-64 digits without a leading zero.
194+Parsing `++rule`. Parses up to five base-64 digits without a leading zero.
195
195
196Accepts
196Accepts
197-------
197-------
198
198
199−Up to five [@uw]() (base 64) digits.
199+Up to five @uw (base 64) digits.
200
200
201Produces
201Produces
202--------
202--------
@@ -230,7 +230,7 @@ Examples
230
230
231Parse 5 base-32
231Parse 5 base-32
232
232
233−Parsing [`++rule`](). Parses exactly five base-32 digits.
233+Parsing `++rule`. Parses exactly five base-32 digits.
234
234
235Accepts
235Accepts
236-------
236-------
@@ -258,7 +258,7 @@ Examples
258
258
259Parse 5 base-64
259Parse 5 base-64
260
260
261−Parsing [`++rule`](). Parses exactly five base-64 digits.
261+Parsing `++rule`. Parses exactly five base-64 digits.
262
262
263Accepts
263Accepts
264-------
264-------
@@ -266,8 +266,6 @@ Accepts
266Produces
266Produces
267--------
267--------
268
268
269−My name henry let's see how fast I can type.
270−
271Source
269Source
272------
270------
273
271
@@ -288,7 +286,7 @@ Examples
288
286
289Parse \<= 4 binary
287Parse \<= 4 binary
290
288
291−Parsing [`++rule`](). Parses a binary number of up to 4 digits in length without
289+Parsing `++rule`. Parses a binary number of up to 4 digits in length without
292a leading zero.
290a leading zero.
293
291
294Accepts
292Accepts
@@ -324,7 +322,7 @@ Examples
324
322
325Parse \<= 4 hex
323Parse \<= 4 hex
326
324
327−Parsing [`++rule`](). Parses a hexadecimal number of up to 4 digits in length
325+Parsing `++rule`. Parses a hexadecimal number of up to 4 digits in length
328without a leading zero.
326without a leading zero.
329
327
330Accepts
328Accepts
@@ -358,7 +356,7 @@ Examples
358
356
359Parse 4 binary
357Parse 4 binary
360
358
361−Parsing [`++rule`](). Parses exactly four binary digits.
359+Parsing `++rule`. Parses exactly four binary digits.
362
360
363Accepts
361Accepts
364-------
362-------
@@ -388,7 +386,7 @@ Examples
388
386
389Parse 4 hex
387Parse 4 hex
390
388
391−Parsing [`++rule`](). Parses exactly four hexadecimal digits.
389+Parsing `++rule`. Parses exactly four hexadecimal digits.
392
390
393Accepts
391Accepts
394-------
392-------
@@ -418,7 +416,7 @@ Examples
418
416
419Parse 1
417Parse 1
420
418
421−Parsing [`++rule`](). Parses the number 1.
419+Parsing `++rule`. Parses the number 1.
422
420
423Accepts
421Accepts
424-------
422-------
@@ -449,7 +447,7 @@ Examples
449
447
450Parse decimal
448Parse decimal
451
449
452−Parsing [`++rule`](). Parses a nonzero decimal digit.
450+Parsing `++rule`. Parses a nonzero decimal digit.
453
451
454Accepts
452Accepts
455-------
453-------
@@ -460,7 +458,7 @@ Produces
460Source
458Source
461------
459------
462
460
463− ++ sed (cook |=(a=@ (sub a '0')) (shim '1' '9'))
461+ ++ sed (cook |=(a/@ (sub a '0')) (shim '1' '9'))
464
462
465Examples
463Examples
466--------
464--------
@@ -477,7 +475,7 @@ Examples
477
475
478Parse base-32
476Parse base-32
479
477
480−Parsing [`++rule`](). Parses a nonzero base-32 digit
478+Parsing `++rule`. Parses a nonzero base-32 digit
481
479
482Accepts
480Accepts
483-------
481-------
@@ -505,7 +503,7 @@ Examples
505
503
506Parse base-64
504Parse base-64
507
505
508−Parsing [`++rule`](). Parses a nonzero base-64 digit
506+Parsing `++rule`. Parses a nonzero base-64 digit
509
507
510Accepts
508Accepts
511-------
509-------
@@ -533,7 +531,7 @@ Examples
533
531
534Parse hex
532Parse hex
535
533
536−Parsing [`++rule`](). Parses a nonzero hexadecimal digit.
534+Parsing `++rule`. Parses a nonzero hexadecimal digit.
537
535
538Accepts
536Accepts
539-------
537-------
@@ -561,7 +559,7 @@ Examples
561
559
562Parse binary
560Parse binary
563
561
564−Parsing [`++rule`](). Parses a binary digit.
562+Parsing `++rule`. Parses a binary digit.
565
563
566Accepts
564Accepts
567-------
565-------
@@ -572,7 +570,7 @@ Produces
572Source
570Source
573------
571------
574
572
575− ++ sib (cook |=(a=@ (sub a '0')) (shim '0' '1'))
573+ ++ sib (cook |=(a/@ (sub a '0')) (shim '0' '1'))
576
574
577Examples
575Examples
578--------
576--------
@@ -588,7 +586,7 @@ Examples
588
586
589Parse decimal
587Parse decimal
590
588
591−Parsing [`++rule`](). Parses a decimal digit.
589+Parsing `++rule`. Parses a decimal digit.
592
590
593Accepts
591Accepts
594-------
592-------
@@ -599,7 +597,7 @@ Produces
599Source
597Source
600------
598------
601
599
602− ++ sid (cook |=(a=@ (sub a '0')) (shim '0' '9'))
600+ ++ sid (cook |=(a/@ (sub a '0')) (shim '0' '9'))
603
601
604Examples
602Examples
605--------
603--------
@@ -613,7 +611,7 @@ Examples
613
611
614Parse base-32
612Parse base-32
615
613
616−Parsing [`++rule`](). Parses a base-32 digit.
614+Parsing `++rule`. Parses a base-32 digit.
617
615
618Accepts
616Accepts
619-------
617-------
@@ -638,7 +636,7 @@ Examples
638
636
639Parse base-64
637Parse base-64
640
638
641−Parsing [`++rule`](). Parses a base-64 digit.
639+Parsing `++rule`. Parses a base-64 digit.
642
640
643Accepts
641Accepts
644-------
642-------
@@ -663,7 +661,7 @@ Examples
663
661
664Parse hex
662Parse hex
665
663
666−Parsing [`++rule`](). Parses a hexadecimal digit.
664+Parsing `++rule`. Parses a hexadecimal digit.
667
665
668Accepts
666Accepts
669-------
667-------
@@ -688,7 +686,7 @@ Examples
688
686
689Parse base-32
687Parse base-32
690
688
691−Parsing [`++rule`](). Parses a base-32 letter.
689+Parsing `++rule`. Parses a base-32 letter.
692
690
693Accepts
691Accepts
694-------
692-------
@@ -699,7 +697,7 @@ Produces
699Source
697Source
700------
698------
701
699
702− ++ sov (cook |=(a=@ (sub a 87)) (shim 'a' 'v'))
700+ ++ sov (cook |=(a/@ (sub a 87)) (shim 'a' 'v'))
703
701
704Examples
702Examples
705--------
703--------
@@ -713,7 +711,7 @@ Examples
713
711
714Parse base-64
712Parse base-64
715
713
716−Parsing [`++rule`](). Parses a base-64 letter/symbol.
714+Parsing `++rule`. Parses a base-64 letter/symbol.
717
715
718Accepts
716Accepts
719-------
717-------
@@ -725,8 +723,8 @@ Source
725------
723------
726
724
727 ++ sow ;~ pose
725 ++ sow ;~ pose
728− (cook |=(a=@ (sub a 87)) (shim 'a' 'z'))
726+ (cook |=(a/@ (sub a 87)) (shim 'a' 'z'))
729− (cook |=(a=@ (sub a 29)) (shim 'A' 'Z'))
727+ (cook |=(a/@ (sub a 29)) (shim 'A' 'Z'))
730 (cold 62 (just '-'))
728 (cold 62 (just '-'))
731 (cold 63 (just '~'))
729 (cold 63 (just '~'))
732 ==
730 ==
@@ -743,7 +741,7 @@ Examples
743
741
744Parse hex letter
742Parse hex letter
745
743
746−Parsing [`++rule`](). Parses a hexadecimal letter.
744+Parsing `++rule`. Parses a hexadecimal letter.
747
745
748Accepts
746Accepts
749-------
747-------
@@ -754,7 +752,7 @@ Produces
754Source
752Source
755------
753------
756
754
757− ++ sox (cook |=(a=@ (sub a 87)) (shim 'a' 'f'))
755+ ++ sox (cook |=(a/@ (sub a 87)) (shim 'a' 'f'))
758
756
759Examples
757Examples
760--------
758--------
@@ -768,7 +766,7 @@ Examples
768
766
769Parse \<= 3 decimal
767Parse \<= 3 decimal
770
768
771−Parsing [`++rule`](). Parses a decimal number of up to 3 digits without a
769+Parsing `++rule`. Parses a decimal number of up to 3 digits without a
772leading zero.
770leading zero.
773
771
774Accepts
772Accepts
@@ -801,7 +799,7 @@ Examples
801
799
802Leading phonetic byte
800Leading phonetic byte
803
801
804−Parsing [`++rule`](). Parses the leading phonetic byte, which represents a
802+Parsing `++rule`. Parses the leading phonetic byte, which represents a
805syllable.
803syllable.
806
804
807Accepts
805Accepts
@@ -813,7 +811,7 @@ Produces
813Source
811Source
814------
812------
815
813
816− ++ tip (sear |=(a=@ (ins:po a)) til)
814+ ++ tip (sear |=(a/@ (ins:po a)) til)
817
815
818Examples
816Examples
819--------
817--------
@@ -829,7 +827,7 @@ Examples
829
827
830Trailing phonetic syllable
828Trailing phonetic syllable
831
829
832−Parsing [`++rule`](). Parses the trailing phonetic byte, which represents a
830+Parsing `++rule`. Parses the trailing phonetic byte, which represents a
833syllable.
831syllable.
834
832
835Accepts
833Accepts
@@ -841,7 +839,7 @@ Produces
841Source
839Source
842------
840------
843
841
844− ++ tiq (sear |=(a=@ (ind:po a)) til)
842+ ++ tiq (sear |=(a/@ (ind:po a)) til)
845
843
846Examples
844Examples
847--------
845--------
@@ -857,7 +855,7 @@ Examples
857
855
858Parse 3 decimal digits
856Parse 3 decimal digits
859
857
860−Parsing [`++rule`](). Parses exactly three decimal digits.
858+Parsing `++rule`. Parses exactly three decimal digits.
861
859
862Accepts
860Accepts
863-------
861-------
@@ -885,7 +883,7 @@ Examples
885
883
886Parse 3 lowercase
884Parse 3 lowercase
887
885
888−Parsing [`++rule`](). Parses exactly three lowercase letters.
886+Parsing `++rule`. Parses exactly three lowercase letters.
889
887
890Accepts
888Accepts
891-------
889-------
@@ -915,7 +913,7 @@ Examples
915
913
916Parse span characters
914Parse span characters
917
915
918−Parsing rule. Parses characters from an atom of the span odor [`@ta`]().
916+Parsing rule. Parses characters from an atom of the span odor `@ta`.
919
917
920Accepts
918Accepts
921-------
919-------
@@ -927,7 +925,7 @@ Source
927------
925------
928
926
929 ++ urs %+ cook
927 ++ urs %+ cook
930− |=(a=tape (rap 3 ^-((list ,@) a)))
928+ |=(a/tape (rap 3 ^-((list @) a)))
931 (star ;~(pose nud low hep dot sig cab))
929 (star ;~(pose nud low hep dot sig cab))
932
930
933Examples
931Examples
@@ -944,7 +942,7 @@ Examples
944
942
945Parse non-`_` span
943Parse non-`_` span
946
944
947−Parsing rule. Parses all characters of the span odor [`@ta`]() except
945+Parsing rule. Parses all characters of the span odor `@ta` except
948for cab, `_`.
946for cab, `_`.
949
947
950Accepts
948Accepts
@@ -957,7 +955,7 @@ Source
957------
955------
958
956
959 ++ urt %+ cook
957 ++ urt %+ cook
960− |=(a=tape (rap 3 ^-((list ,@) a)))
958+ |=(a/tape (rap 3 ^-((list @) a)))
961 (star ;~(pose nud low hep dot sig))
959 (star ;~(pose nud low hep dot sig))
962
960
963Examples
961Examples
@@ -1034,12 +1032,13 @@ Accepts
1034Produces
1032Produces
1035--------
1033--------
1036
1034
1037−`fel` is a [`rule`]().
1035+`fel` is a `rule`.
1038
1036
1039Source
1037Source
1040------
1038------
1041
1039
1042− ++ ape |*(fel=_rule ;~(pose (cold 0 (just '0')) fel))
1040+ ++ ape |*(fel/rule ;~(pose (cold 0 (just '0')) fel))
1041+
1043
1042
1044Examples
1043Examples
1045--------
1044--------
@@ -1078,7 +1077,7 @@ Examples
1078
1077
1079Parse IPv6
1078Parse IPv6
1080
1079
1081−Parsing rule. Parses a [`@is`](), an IPv6 address.
1080+Parsing rule. Parses a `@is`, an IPv6 address.
1082
1081
1083Accepts
1082Accepts
1084-------
1083-------
@@ -1119,6 +1118,7 @@ Source
1119
1118
1120 ++ dem (ape (bass 1.000 ;~(plug ted:ab (star ;~(pfix dog tid:ab)))))
1119 ++ dem (ape (bass 1.000 ;~(plug ted:ab (star ;~(pfix dog tid:ab)))))
1121
1120
1121+
1122Examples
1122Examples
1123--------
1123--------
1124
1124
@@ -1190,7 +1190,7 @@ Examples
1190
1190
1191Parse phonetic base
1191Parse phonetic base
1192
1192
1193−Parsing rule. Parses an atom of odor [`@p`](), the phonetic base.
1193+Parsing rule. Parses an atom of odor `@p`, the phonetic base.
1194
1194
1195Accepts
1195Accepts
1196-------
1196-------
docs/system/hoon/library/src/4j/core/mu.md+12−11
@@ -2,7 +2,7 @@
2
2
3Core used to scramble 16-bit atoms
3Core used to scramble 16-bit atoms
4
4
5−A [door]() that contains arms that are used to scramble two atoms, `top`
5+A door that contains arms that are used to scramble two atoms, `top`
6and `bot`. Used especially in the phonetic base to disguise the
6and `bot`. Used especially in the phonetic base to disguise the
7relationship between a destroyer and its cruiser.
7relationship between a destroyer and its cruiser.
8
8
@@ -12,15 +12,15 @@ Accepts
12Produces
12Produces
13--------
13--------
14
14
15−`bot` is an [atom]().
15+`bot` is an atom.
16
16
17−`top` is an [atom]().
17+`top` is an atom.
18
18
19Source
19Source
20------
20------
21
21
22 ++ mu
22 ++ mu
23− |_ [top=@ bot=@]
23+ |_ [top/@ bot/@]
24
24
25Examples
25Examples
26--------
26--------
@@ -44,15 +44,16 @@ Accepts
44Produces
44Produces
45--------
45--------
46
46
47−`bot` is an [atom]().
47+`bot` is an atom.
48
48
49−`top` is an [atom]().
49+`top` is an atom.
50
50
51Source
51Source
52------
52------
53
53
54 ++ zag [p=(end 4 1 (add top bot)) q=bot]
54 ++ zag [p=(end 4 1 (add top bot)) q=bot]
55
55
56+
56Examples
57Examples
57--------
58--------
58
59
@@ -65,7 +66,7 @@ Examples
65
66
66Subtract bottom from top
67Subtract bottom from top
67
68
68−The inverse of [`++zag`](). Produces the cell of `top` and `bot` with
69+The inverse of `++zag`. Produces the cell of `top` and `bot` with
69`top` unscrambled. The unscrambled `top` is the sum of the sample `top`
70`top` unscrambled. The unscrambled `top` is the sum of the sample `top`
70and the 16-bit complement of `bot`. Used to unscramble the name of the
71and the 16-bit complement of `bot`. Used to unscramble the name of the
71destroyer.
72destroyer.
@@ -76,9 +77,9 @@ Accepts
76Produces
77Produces
77--------
78--------
78
79
79−`bot` is an [atom]().
80+`bot` is an atom.
80
81
81−`top` is an [atom]().
82+`top` is an atom.
82
83
83Source
84Source
84------
85------
@@ -106,9 +107,9 @@ Accepts
106Produces
107Produces
107--------
108--------
108
109
109−`bot` is an [atom]().
110+`bot` is an atom.
110
111
111−`top` is an [atom]().
112+`top` is an atom.
112
113
113Source
114Source
114------
115------
docs/system/hoon/library/src/4j/core/ne.md+6−6
@@ -2,7 +2,7 @@
2
2
3Digit rendering engine
3Digit rendering engine
4
4
5−A [door]() containing arms that render digits at bases 10, 16, 32, and
5+A door containing arms that render digits at bases 10, 16, 32, and
664.
664.
7
7
8Accepts
8Accepts
@@ -11,13 +11,13 @@ Accepts
11Produces
11Produces
12--------
12--------
13
13
14−`tig` is an [`atom`]().
14+`tig` is an `atom`.
15
15
16Source
16Source
17------
17------
18
18
19 ++ ne
19 ++ ne
20− |_ tig=@
20+ |_ tig/@
21
21
22Examples
22Examples
23--------
23--------
@@ -39,7 +39,7 @@ Accepts
39Produces
39Produces
40--------
40--------
41
41
42−`tig` is an [`atom`]().
42+`tig` is an `atom`.
43
43
44Source
44Source
45------
45------
@@ -66,7 +66,7 @@ Accepts
66Produces
66Produces
67--------
67--------
68
68
69−`tig` is an [`atom`]().
69+`tig` is an `atom`.
70
70
71Source
71Source
72------
72------
@@ -124,7 +124,7 @@ Accepts
124Produces
124Produces
125--------
125--------
126
126
127−`tig` is an [`atom`]().
127+`tig` is an `atom`.
128
128
129Source
129Source
130------
130------
docs/system/hoon/library/src/4k/core/co.md+140−214
@@ -2,7 +2,7 @@
2
2
3Literal rendering engine
3Literal rendering engine
4
4
5−A [door]() that contains arms that operate on the sample coin `lot`.
5+A door that contains arms that operate on the sample coin `lot`.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -10,27 +10,24 @@ Accepts
10Produces
10Produces
11--------
11--------
12
12
13−`lot` is a [`++coin`]().
13+`lot` is a `++coin`.
14
14
15Source
15Source
16------
16------
17
17
18− ++ co
18+ ++ co !.
19+ ~% %co ..co ~
19− =< |_ lot=coin
20+ =< |_ lot/coin
21+
20
22
21Examples
23Examples
22--------
24--------
23
25
24− ~zod/try=> ~(. co many/~[`ta/'mo' `ud/5])
26+ ~zod/try=> < 3.nta
25− < 3.dhd
26− [ [ %many
27+ { lot/{$many {$~ $ta @t} {$~ $ud @ud} $~}
27− [%~ %ta @t]
28+ <10.cfg 4.jjn {rep/"" <402.arm 110.jyx 1.ztu $151>}>
28− [%~ %ud @ud]
29+ }
29− %~
30− ]
31− <10.utz 3.zid [rex="" <414.hmb 100.xkc 1.ypj %164>]>
32− ]
33− >
30+ >
34
31
35------------------------------------------------------------------------
32------------------------------------------------------------------------
36
33
@@ -38,7 +35,7 @@ Examples
38
35
39Prepend & render as tape
36Prepend & render as tape
40
37
41−Renders a coin `lot` as a [tape]() prepended to the sample tape `rom`.
38+Renders a coin `lot` as a tape prepended to the sample tape `rom`.
42
39
43Accepts
40Accepts
44-------
41-------
@@ -46,14 +43,14 @@ Accepts
46Produces
43Produces
47--------
44--------
48
45
49−`rom` is a [`pe`]()
46+`rom` is a `pe`
50
47
51−`lot` is a [`++coin`]().
48+`lot` is a `++coin`.
52
49
53Source
50Source
54------
51------
55
52
56− ++ rear |=(rom=tape =>(.(rex rom) rend))
53+ ++ rear |=(rom/tape =>(.(rex rom) rend))
57
54
58Examples
55Examples
59--------
56--------
@@ -75,7 +72,7 @@ Accepts
75Produces
72Produces
76--------
73--------
77
74
78−`lot` is a [`++coin`]().
75+`lot` is a `++coin`.
79
76
80Source
77Source
81------
78------
@@ -104,216 +101,145 @@ Accepts
104Produces
101Produces
105--------
102--------
106
103
107−`lot` is a [`++coin`]().
104+`lot` is a `++coin`.
108
105
109Source
106Source
110------
107------
111
108
112− ++ rend
109+ ++ rend
113− ^- tape
110+ ^- tape
114− ?: ?=(%blob -.lot)
111+ ?: ?=($blob -.lot)
115− ['~' '0' ((v-co 1) (jam p.lot))]
112+ ['~' '0' ((v-co 1) (jam p.lot))]
116− ?: ?=(%many -.lot)
113+ ?: ?=($many -.lot)
117− :- '.'
114+ :- '.'
118− |- ^- tape
115+ |- ^- tape
119− ?~ p.lot
116+ ?~ p.lot
120− ['_' '_' rex]
117+ ['_' '_' rep]
121− ['_' (weld (trip (wack rent(lot i.p.lot))) $(p.lot t.p.lot))]
118+ ['_' (weld (trip (wack rent(lot i.p.lot))) $(p.lot t.p.lot))]
122− =+ [yed=(end 3 1 p.p.lot) hay=(cut 3 [1 1] p.p.lot)]
119+ =+ [yed=(end 3 1 p.p.lot) hay=(cut 3 [1 1] p.p.lot)]
123− |- ^- tape
120+ |- ^- tape
124− ?+ yed (z-co q.p.lot)
121+ ?+ yed (z-co q.p.lot)
125− %c ['~' '-' (weld (rip 3 (wood (tuft q.p.lot))) rex)]
122+ $c ['~' '-' (weld (rip 3 (wood (tuft q.p.lot))) rep)]
126− %d
123+ $d
127− ?+ hay (z-co q.p.lot)
124+ ?+ hay (z-co q.p.lot)
128− %a
125+ $a
129− =+ yod=(yore q.p.lot)
126+ =+ yod=(yore q.p.lot)
130− => ^+(. .(rex ?~(f.t.yod rex ['.' (s-co f.t.yod)])))
127+ => ^+(. .(rep ?~(f.t.yod rep ['.' (s-co f.t.yod)])))
131− => ^+ .
128+ => ^+ .
132− %= .
129+ %= .
133− rex
130+ rep
134− ?: &(=(~ f.t.yod) =(0 h.t.yod) =(0 m.t.yod) =(0 s.t.yod))
131+ ?: &(=(~ f.t.yod) =(0 h.t.yod) =(0 m.t.yod) =(0 s.t.yod))
135− rex
132+ rep
136− => .(rex ['.' (y-co s.t.yod)])
133+ => .(rep ['.' (y-co s.t.yod)])
137− => .(rex ['.' (y-co m.t.yod)])
134+ => .(rep ['.' (y-co m.t.yod)])
138− ['.' '.' (y-co h.t.yod)]
135+ ['.' '.' (y-co h.t.yod)]
139− ==
140− => .(rex ['.' (a-co d.t.yod)])
141− => .(rex ['.' (a-co m.yod)])
142− => .(rex ?:(a.yod rex ['-' rex]))
143− ['~' (a-co y.yod)]
144− ::
145− %r
146− =+ yug=(yell q.p.lot)
147− => ^+(. .(rex ?~(f.yug rex ['.' (s-co f.yug)])))
148− :- '~'
149− ?: &(=(0 d.yug) =(0 m.yug) =(0 h.yug) =(0 s.yug))
150− ['.' 's' '0' rex]
151− => ^+(. ?:(=(0 s.yug) . .(rex ['.' 's' (a-co s.yug)])))
152− => ^+(. ?:(=(0 m.yug) . .(rex ['.' 'm' (a-co m.yug)])))
153− => ^+(. ?:(=(0 h.yug) . .(rex ['.' 'h' (a-co h.yug)])))
154− => ^+(. ?:(=(0 d.yug) . .(rex ['.' 'd' (a-co d.yug)])))
155− +.rex
156− ==
157− ::
158− %f
159− ?: =(& q.p.lot)
160− ['.' 'y' rex]
161− ?:(=(| q.p.lot) ['.' 'n' rex] (z-co q.p.lot))
162− ::
163− %n ['~' rex]
164− %i
165− ?+ hay (z-co q.p.lot)
166− %f ((ro-co [3 10 4] |=(a=@ ~(d ne a))) q.p.lot)
167− %s ((ro-co [4 16 8] |=(a=@ ~(x ne a))) q.p.lot)
168− ==
169− ::
170− %p
171− =+ dyx=(met 3 q.p.lot)
172− :- '~'
173− ?: (lte dyx 1)
174− (weld (trip (tod:po q.p.lot)) rex)
175− ?: =(2 dyx)
176− ;: weld
177− (trip (tos:po (end 3 1 q.p.lot)))
178− (trip (tod:po (rsh 3 1 q.p.lot)))
179− rex
180− ==
181− =+ [dyz=(met 5 q.p.lot) fin=|]
182− |- ^- tape
183− ?: =(0 dyz)
184− rex
185− %= $
186− fin &
187− dyz (dec dyz)
188− q.p.lot (rsh 5 1 q.p.lot)
189− rex
190− =+ syb=(wren:un (end 5 1 q.p.lot))
191− =+ cog=~(zig mu [(rsh 4 1 syb) (end 4 1 syb)])
192− ;: weld
193− (trip (tos:po (end 3 1 p.cog)))
194− (trip (tod:po (rsh 3 1 p.cog)))
195− `tape`['-' ~]
196− (trip (tos:po (end 3 1 q.cog)))
197− (trip (tod:po (rsh 3 1 q.cog)))
198− `tape`?:(fin ['-' ?:(=(1 (end 0 1 dyz)) ~ ['-' ~])] ~)
199− rex
200 ==
136 ==
201− ==
137+ => .(rep ['.' (a-co d.t.yod)])
202− ::
138+ => .(rep ['.' (a-co m.yod)])
203− %r
139+ => .(rep ?:(a.yod rep ['-' rep]))
204− ?+ hay (z-co q.p.lot)
140+ ['~' (a-co y.yod)]
205− %d
206− =+ r=(rlyd q.p.lot)
207− ?~ e.r
208− ['.' '~' (r-co r)]
209− ['.' '~' u.e.r]
210− %h ['.' '~' '~' (r-co (rlyh q.p.lot))]
211− %q ['.' '~' '~' '~' (r-co (rlyq q.p.lot))]
212− %s ['.' (r-co (rlys q.p.lot))]
213− ==
214− ::
215− %u
216− =- (weld p.gam ?:(=(0 q.p.lot) `tape`['0' ~] q.gam))
217− ^= gam ^- [p=tape q=tape]
218− ?+ hay [~ ((ox-co [10 3] |=(a=@ ~(d ne a))) q.p.lot)]
219− %b [['0' 'b' ~] ((ox-co [2 4] |=(a=@ ~(d ne a))) q.p.lot)]
220− %i [['0' 'i' ~] ((d-co 1) q.p.lot)]
221− %x [['0' 'x' ~] ((ox-co [16 4] |=(a=@ ~(x ne a))) q.p.lot)]
222− %v [['0' 'v' ~] ((ox-co [32 5] |=(a=@ ~(x ne a))) q.p.lot)]
223− %w [['0' 'w' ~] ((ox-co [64 5] |=(a=@ ~(w ne a))) q.p.lot)]
224− ==
225− ::
226− %s
227− %+ weld
228− ?:((syn:si q.p.lot) "--" "-")
229− $(yed 'u', q.p.lot (abs:si q.p.lot))
230− ::
231− %t
232− ?: =('a' hay)
233− ?: =('s' (cut 3 [2 1] p.p.lot))
234−
235− (weld (rip 3 q.p.lot) rex)
236− ['~' '.' (weld (rip 3 q.p.lot) rex)]
237− ['~' '~' (weld (rip 3 (wood q.p.lot)) rex)]
238− ==
239− --
240− =+ rex=*tape
241− =< |%
242− ++ a-co |=(dat=@ ((d-co 1) dat))
243− ++ d-co |=(min=@ (em-co [10 min] |=([? b=@ c=tape] [~(d ne b) c])))
244− ++ r-co
245− |= [syn=? nub=@ der=@ ign=(unit tape) ne=?]
246− => .(rex ['.' (t-co ((d-co 1) der) ne)])
247− => .(rex ((d-co 1) nub))
248− ?:(syn rex ['-' rex])
249− ++ t-co |= [a=tape n=?] ^- tape
250− ?: n a
251− ?~ a ~|(%empty-frac !!) t.a
252 ::
141 ::
253− ++ s-co
142+ $r
254− |= esc=(list ,@) ^- tape
143+ =+ yug=(yell q.p.lot)
255− ~| [%so-co esc]
144+ => ^+(. .(rep ?~(f.yug rep ['.' (s-co f.yug)])))
256− ?~ esc
257− rex
258− :- '.'
145+ :- '~'
259− =>(.(rex $(esc t.esc)) ((x-co 4) i.esc))
146+ ?: &(=(0 d.yug) =(0 m.yug) =(0 h.yug) =(0 s.yug))
260−
147+ ['s' '0' rep]
148+ => ^+(. ?:(=(0 s.yug) . .(rep ['.' 's' (a-co s.yug)])))
149+ => ^+(. ?:(=(0 m.yug) . .(rep ['.' 'm' (a-co m.yug)])))
150+ => ^+(. ?:(=(0 h.yug) . .(rep ['.' 'h' (a-co h.yug)])))
151+ => ^+(. ?:(=(0 d.yug) . .(rep ['.' 'd' (a-co d.yug)])))
152+ +.rep
153+ ==
261 ::
154 ::
262− ++ v-co |=(min=@ (em-co [32 min] |=([? b=@ c=tape] [~(v ne b) c])))
155+ $f
263− ++ w-co |=(min=@ (em-co [64 min] |=([? b=@ c=tape] [~(w ne b) c])))
156+ ?: =(& q.p.lot)
264− ++ x-co |=(min=@ (em-co [16 min] |=([? b=@ c=tape] [~(x ne b) c])))
157+ ['.' 'y' rep]
265− ++ y-co |=(dat=@ ((d-co 2) dat))
158+ ?:(=(| q.p.lot) ['.' 'n' rep] (z-co q.p.lot))
266− ++ z-co |=(dat=@ `tape`['0' 'x' ((x-co 1) dat)])
159+ ::
267− --
160+ $n ['~' rep]
268− ~% %co +> ~
161+ $i
269− |%
162+ ?+ hay (z-co q.p.lot)
270− ++ em-co
163+ $f ((ro-co [3 10 4] |=(a/@ ~(d ne a))) q.p.lot)
271− ~/ %emco
164+ $s ((ro-co [4 16 8] |=(a/@ ~(x ne a))) q.p.lot)
272− |= [[bas=@ min=@] [par=$+([? @ tape] tape)]]
165+ ==
273− |= hol=@
166+ ::
274− ^- tape
167+ $p
275− ?: &(=(0 hol) =(0 min))
168+ =+ dyx=(met 3 q.p.lot)
276− rex
169+ :- '~'
277− =+ [rad=(mod hol bas) dar=(div hol bas)]
170+ ?: (lte dyx 1)
278− %= $
171+ (weld (trip (tod:po q.p.lot)) rep)
279− min ?:(=(0 min) 0 (dec min))
172+ ?: =(2 dyx)
280− hol dar
173+ ;: weld
281− rex (par =(0 dar) rad rex)
174+ (trip (tos:po (end 3 1 q.p.lot)))
175+ (trip (tod:po (rsh 3 1 q.p.lot)))
176+ rep
177+ ==
178+ =+ [dyz=(met 5 q.p.lot) fin=| dub=&]
179+ |- ^- tape
180+ ?: =(0 dyz)
181+ rep
182+ %= $
183+ fin &
184+ dub !dub
185+ dyz (dec dyz)
186+ q.p.lot (rsh 5 1 q.p.lot)
187+ rep
188+ =+ syb=(wren:un (end 5 1 q.p.lot))
189+ =+ cog=~(zig mu [(rsh 4 1 syb) (end 4 1 syb)])
190+ ;: weld
191+ (trip (tos:po (end 3 1 p.cog)))
192+ (trip (tod:po (rsh 3 1 p.cog)))
193+ `tape`['-' ~]
194+ (trip (tos:po (end 3 1 q.cog)))
195+ (trip (tod:po (rsh 3 1 q.cog)))
196+ `tape`?.(fin ~ ['-' ?.(dub ~ ['-' ~])])
197+ rep
198+ ==
199+ ==
200+ ::
201+ $r
202+ ?+ hay (z-co q.p.lot)
203+ $d ['.' '~' (r-co (rlyd q.p.lot))]
204+ $h ['.' '~' '~' (r-co (rlyh q.p.lot))]
205+ $q ['.' '~' '~' '~' (r-co (rlyq q.p.lot))]
206+ $s ['.' (r-co (rlys q.p.lot))]
207+ ==
208+ ::
209+ $u
210+ ?: ?=($c hay)
211+ %+ welp ['0' 'c' (reap (pad:fa q.p.lot) '1')]
212+ (c-co (enc:fa q.p.lot))
213+ =- (weld p.gam ?:(=(0 q.p.lot) `tape`['0' ~] q.gam))
214+ ^= gam ^- {p/tape q/tape}
215+ ?+ hay [~ ((ox-co [10 3] |=(a/@ ~(d ne a))) q.p.lot)]
216+ $b [['0' 'b' ~] ((ox-co [2 4] |=(a/@ ~(d ne a))) q.p.lot)]
217+ $i [['0' 'i' ~] ((d-co 1) q.p.lot)]
218+ $x [['0' 'x' ~] ((ox-co [16 4] |=(a/@ ~(x ne a))) q.p.lot)]
219+ $v [['0' 'v' ~] ((ox-co [32 5] |=(a/@ ~(x ne a))) q.p.lot)]
220+ $w [['0' 'w' ~] ((ox-co [64 5] |=(a/@ ~(w ne a))) q.p.lot)]
221+ ==
222+ ::
223+ $s
224+ %+ weld
225+ ?:((syn:si q.p.lot) "--" "-")
226+ $(yed 'u', q.p.lot (abs:si q.p.lot))
227+ ::
228+ $t
229+ ?: =('a' hay)
230+ ?: =('s' (cut 3 [2 1] p.p.lot))
231+ (weld (rip 3 q.p.lot) rep)
232+ ['~' '.' (weld (rip 3 q.p.lot) rep)]
233+ ['~' '~' (weld (rip 3 (wood q.p.lot)) rep)]
282 ==
234 ==
283− ::
284− ++ ox-co
285− ~/ %oxco
286− |= [[bas=@ gop=@] dug=$+(@ @)]
287− %+ em-co
288− [|-(?:(=(0 gop) 1 (mul bas $(gop (dec gop))))) 0]
289− |= [top=? seg=@ res=tape]
290− %+ weld
291− ?:(top ~ `tape`['.' ~])
292− %. seg
293− %+ em-co(rex res)
294− [bas ?:(top 0 gop)]
295− |=([? b=@ c=tape] [(dug b) c])
296− ::
297− ++ ro-co
298− ~/ %roco
299− |= [[buz=@ bas=@ dop=@] dug=$+(@ @)]
300− |= hol=@
301− ^- tape
302− ?: =(0 dop)
303− rex
304− => .(rex $(dop (dec dop)))
305− :- '.'
306− %- (em-co [bas 1] |=([? b=@ c=tape] [(dug b) c]))
307− [(cut buz [(dec dop) 1] hol)]
308 --
235 --
309− ::
310
236
311Examples
237Examples
312--------
238--------
313
239
314 ~zod/try=> ~(rend co ~ %ux 200)
240 ~zod/try=> ~(rend co ~ %ux 200)
315 "0xc8"
241 "0xc8"
316− ~zod/try=> ~(rend co %many ~[[%$ ux/200] [%$ p/40]])
242+ ~zod/try=> ~(rend co %many ~[[%$ ux+200] [%$ p+40]])
317 "._0xc8_~~tem__"
243 "._0xc8_~~tem__"
318 ~zod/try=> ~(rend co ~ %p 32.819)
244 ~zod/try=> ~(rend co ~ %p 32.819)
319 "~pillyt"
245 "~pillyt"
docs/system/hoon/library/src/4k/gate/iny.md+3−3
@@ -2,13 +2,13 @@
2
2
3Indentation block
3Indentation block
4
4
5−Apply [`++rule`]() to indented block starting at current column number, omitting
5+Apply `++rule` to indented block starting at current column number, omitting
6the leading whitespace.
6the leading whitespace.
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`sef` is a [`++rule`]()
11+`sef` is a `++rule`
12
12
13Produces
13Produces
14--------
14--------
@@ -18,7 +18,7 @@ A `++rule`.
18Source
18Source
19------
19------
20
20
21− ++ iny |* sef=_rule :: indentation block
21+ ++ inde |* sef/rule :: indentation block
22 |= nail ^+ (sef)
22 |= nail ^+ (sef)
23 =+ [har tap]=[p q]:+<
23 =+ [har tap]=[p q]:+<
24 =+ lev=(fil 3 (dec q.har) ' ')
24 =+ lev=(fil 3 (dec q.har) ' ')
docs/system/hoon/library/src/4k/gate/mes.md+1−1
@@ -8,7 +8,7 @@ Source
8------
8------
9
9
10 ++ mes %+ cook :: hexbyte
10 ++ mes %+ cook :: hexbyte
11− |=([a=@ b=@] (add (mul 16 a) b))
11+ |=({a/@ b/@} (add (mul 16 a) b))
12 ;~(plug hit hit)
12 ;~(plug hit hit)
13
13
14Examples
14Examples
docs/system/hoon/library/src/4k/gate/ven.md+2−2
@@ -7,10 +7,10 @@ Axis syntax parser
7Source
7Source
8------
8------
9
9
10− ++ ven ;~ (comp |=([a=@ b=@] (peg a b))) :: +>- axis syntax
10+ ++ ven ;~ (comp |=({a/@ b/@} (peg a b))) :: +>- axis syntax
11 bet
11 bet
12 =+ hom=`?`|
12 =+ hom=`?`|
13− |= tub=nail
13+ |= tub/nail
14 ^- (like axis)
14 ^- (like axis)
15 =+ vex=?:(hom (bet tub) (gul tub))
15 =+ vex=?:(hom (bet tub) (gul tub))
16 ?~ q.vex
16 ?~ q.vex
docs/system/hoon/library/src/4k/gate/vit.md+3−3
@@ -9,9 +9,9 @@ Source
9
9
10 ++ vit :: base64 digit
10 ++ vit :: base64 digit
11 ;~ pose
11 ;~ pose
12− (cook |=(a=@ (sub a 65)) (shim 'A' 'Z'))
12+ (cook |=(a/@ (sub a 65)) (shim 'A' 'Z'))
13− (cook |=(a=@ (sub a 71)) (shim 'a' 'z'))
13+ (cook |=(a/@ (sub a 71)) (shim 'a' 'z'))
14− (cook |=(a=@ (add a 4)) (shim '0' '9'))
14+ (cook |=(a/@ (add a 4)) (shim '0' '9'))
15 (cold 62 (just '-'))
15 (cold 62 (just '-'))
16 (cold 63 (just '+'))
16 (cold 63 (just '+'))
17 ==
17 ==
docs/system/hoon/library/src/4k/gate/vul.md+1−1
@@ -5,7 +5,7 @@ Comments to null
5Source
5Source
6------
6------
7
7
8− ++ vul %- cold :- ~ :: comments
8+ ++ vul %+ cold ~ :: comments
9 ;~ plug col col
9 ;~ plug col col
10 (star prn)
10 (star prn)
11 (just `@`10)
11 (just `@`10)
docs/system/hoon/library/src/4l/core/so.md+195−76
@@ -2,7 +2,7 @@
2
2
3Coin parser engine
3Coin parser engine
4
4
5−Core containing arms that parse [`++coin`]s.
5+Core containing arms that parse `++coin`.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -29,7 +29,7 @@ Examples
29Parse odor-atom pair
29Parse odor-atom pair
30
30
31Parsing rule. Parses an unsigned integer of any permitted base,
31Parsing rule. Parses an unsigned integer of any permitted base,
32−producing a [`++dime`]().
32+producing a `++dime`.
33
33
34Accepts
34Accepts
35-------
35-------
@@ -69,8 +69,8 @@ Examples
69Parse `@da`, `@dr`, `@p`, `@t`
69Parse `@da`, `@dr`, `@p`, `@t`
70
70
71Parsing rule. Parses any atom of any of the following odors after a
71Parsing rule. Parses any atom of any of the following odors after a
72−leading sig, `~` into a [`++dime`](): [`@da`](), [`@dr`](), [`@p`](),
72+leading sig, `~` into a `++dime`: `@da`, `@dr`, `@p`,
73−and [`@t`](), producing a [`++dime`]().
73+and `@t`, producing a `++dime`.
74
74
75Accepts
75Accepts
76-------
76-------
@@ -82,12 +82,13 @@ Source
82------
82------
83
83
84 ++ crub
84 ++ crub
85+ ~+
85 ;~ pose
86 ;~ pose
86 %+ cook
87 %+ cook
87− |=(det=date `dime`[%da (year det)])
88+ |=(det/date `dime`[%da (year det)])
88 ;~ plug
89 ;~ plug
89 %+ cook
90 %+ cook
90− |=([a=@ b=?] [b a])
91+ |=({a/@ b/?} [b a])
91 ;~(plug dim:ag ;~(pose (cold | hep) (easy &)))
92 ;~(plug dim:ag ;~(pose (cold | hep) (easy &)))
92 ;~(pfix dot dim:ag) :: month
93 ;~(pfix dot dim:ag) :: month
93 ;~(pfix dot dim:ag) :: day
94 ;~(pfix dot dim:ag) :: day
@@ -106,16 +107,16 @@ Source
106 ==
107 ==
107 ::
108 ::
108 %+ cook
109 %+ cook
109− |= [a=(list ,[p=?(%d %h %m %s) q=@]) b=(list ,@)]
110+ |= {a/(list {p/?($d $h $m $s) q/@}) b/(list @)}
110 =+ rop=`tarp`[0 0 0 0 b]
111 =+ rop=`tarp`[0 0 0 0 b]
111 |- ^- dime
112 |- ^- dime
112 ?~ a
113 ?~ a
113 [%dr (yule rop)]
114 [%dr (yule rop)]
114 ?- p.i.a
115 ?- p.i.a
115− %d $(a t.a, d.rop (add q.i.a d.rop))
116+ $d $(a t.a, d.rop (add q.i.a d.rop))
116− %h $(a t.a, h.rop (add q.i.a h.rop))
117+ $h $(a t.a, h.rop (add q.i.a h.rop))
117− %m $(a t.a, m.rop (add q.i.a m.rop))
118+ $m $(a t.a, m.rop (add q.i.a m.rop))
118− %s $(a t.a, s.rop (add q.i.a s.rop))
119+ $s $(a t.a, s.rop (add q.i.a s.rop))
119 ==
120 ==
120 ;~ plug
121 ;~ plug
121 %+ most
122 %+ most
@@ -131,20 +132,122 @@ Source
131 ::
132 ::
132 (stag %p fed:ag)
133 (stag %p fed:ag)
133 ;~(pfix dot (stag %ta urs:ab))
134 ;~(pfix dot (stag %ta urs:ab))
134− ;~(pfix sig (stag %t (cook woad urs:ab)))
135+ ;~(pfix sig (stag %t urx:ab))
135− ;~(pfix hep (stag %c (cook turf (cook woad urs:ab))))
136+ ;~(pfix hep (stag %c (cook turf urx:ab)))
136 ==
137 ==
138+ ++ nuck
139+ ~/ %nuck |= a/nail %. a
140+ %+ knee *coin |. ~+
141+ %- stew
142+ ^. stet ^. limo
143+ :~ :- ['a' 'z'] (cook |=(a/@ta [%$ %tas a]) sym)
144+ :- ['0' '9'] (stag %$ bisk)
145+ :- '-' (stag %$ tash)
146+ :- '.' ;~(pfix dot perd)
147+ :- '~' ;~(pfix sig ;~(pose twid (easy [%$ %n 0])))
148+ ==
149+ ++ nusk
150+ ~+
151+ :(sear |=(a/@ta (rush a nuck)) wick urt:ab)
152+ ++ perd
153+ ~+
154+ ;~ pose
155+ (stag %$ zust)
156+ (stag %many (ifix [cab ;~(plug cab cab)] (more cab nusk)))
157+ ==
158+ ++ royl
159+ ~+
160+ =+ ^= moo
161+ |= a/tape
162+ :- (lent a)
163+ (scan a (bass 10 (plus sid:ab)))
164+ =+ ^= voy
165+ %+ cook royl-cell
166+ ;~ pose
167+ ;~ plug
168+ (easy %d)
169+ ;~ pose (cold | hep) (easy &) ==
170+ ;~ plug dim:ag
171+ ;~ pose
172+ ;~(pfix dot (cook moo (plus (shim '0' '9'))))
173+ (easy [0 0])
174+ ==
175+ ;~ pose
176+ ;~ pfix
177+ (just 'e')
178+ ;~(plug ;~(pose (cold | hep) (easy &)) dim:ag)
179+ ==
180+ (easy [& 0])
181+ ==
182+ ==
183+ ==
184+ ;~ plug
185+ (easy %i)
186+ ;~ sfix
187+ ;~ pose (cold | hep) (easy &) ==
188+ (jest 'inf')
189+ ==
190+ ==
191+ ;~ plug
192+ (easy %n)
193+ (cold ~ (jest 'nan'))
194+ ==
195+ ==
196+ ;~ pose
197+ (stag %rh (cook rylh ;~(pfix ;~(plug sig sig) voy)))
198+ (stag %rq (cook rylq ;~(pfix ;~(plug sig sig sig) voy)))
199+ (stag %rd (cook ryld ;~(pfix sig voy)))
200+ (stag %rs (cook ryls voy))
201+ ==
202+ ::
203+ ++ royl-cell
204+ |= rn
205+ ^- dn
206+ ?. ?=({$d *} +<) +<
207+ =+ ^= h
208+ (dif:si (new:si f.b i.b) (sun:si d.b))
209+ [%d a h (add (mul c.b (pow 10 d.b)) e.b)]
210+ ::
211+ ++ tash
212+ ~+
213+ =+ ^= neg
214+ |= {syn/? mol/dime} ^- dime
215+ ?> =('u' (end 3 1 p.mol))
216+ [(cat 3 's' (rsh 3 1 p.mol)) (new:si syn q.mol)]
217+ ;~ pfix hep
218+ ;~ pose
219+ (cook |=(a/dime (neg | a)) bisk)
220+ ;~(pfix hep (cook |=(a/dime (neg & a)) bisk))
221+ ==
222+ ==
223+ ::
224+ ++ twid
225+ ~+
226+ ;~ pose
227+ (cook |=(a/@ [%blob (cue a)]) ;~(pfix (just '0') vum:ag))
228+ (stag %$ crub)
229+ ==
230+ ::
231+ ++ zust
232+ ~+
233+ ;~ pose
234+ (stag %is bip:ag)
235+ (stag %if lip:ag)
236+ (stag %f ;~(pose (cold & (just 'y')) (cold | (just 'n'))))
237+ royl
238+ ==
239+ --
137
240
138Examples
241Examples
139--------
242--------
140
243
141 ~zod/try=> (scan "1926.5.12" crub:so)
244 ~zod/try=> (scan "1926.5.12" crub:so)
142 [p=~.da q=170.141.184.449.747.016.871.285.095.307.149.312.000]
245 [p=~.da q=170.141.184.449.747.016.871.285.095.307.149.312.000]
143− ~zod/try=> (,[%da @da] (scan "1926.5.12" crub:so))
246+ ~zod/try=> ([%da @da] (scan "1926.5.12" crub:so))
144 [%da ~1926.5.12]
247 [%da ~1926.5.12]
145 ~zod/try=> (scan "s10" crub:so)
248 ~zod/try=> (scan "s10" crub:so)
146 [p=~.dr q=184.467.440.737.095.516.160]
249 [p=~.dr q=184.467.440.737.095.516.160]
147− ~zod/try=> (,[%dr @dr] (scan "s10" crub:so))
250+ ~zod/try=> ([%dr @dr] (scan "s10" crub:so))
148 [%dr ~s10]
251 [%dr ~s10]
149 ~zod/try=> (scan "doznec" crub:so)
252 ~zod/try=> (scan "doznec" crub:so)
150 [%p 256]
253 [%p 256]
@@ -158,7 +261,7 @@ Examples
158Top-level coin parser
261Top-level coin parser
159
262
160Parsing rule. Switches on the first character and applies the
263Parsing rule. Switches on the first character and applies the
161−corresponding [`++coin`]() parser.
264+corresponding `++coin` parser.
162
265
163Accepts
266Accepts
164-------
267-------
@@ -169,16 +272,19 @@ Produces
169Source
272Source
170------
273------
171
274
172− ++ nuck
275+ ++ nuck
276+ ~/ %nuck |= a/nail %. a
173− %+ knee *coin |. ~+
277+ %+ knee *coin |. ~+
174− %- stew
278+ %- stew
175− ^. stet ^. limo
279+ ^. stet ^. limo
176− :~ :- ['a' 'z'] (cook |=(a=@ta [~ %tas a]) sym)
280+ :~ :- ['a' 'z'] (cook |=(a/@ta [%$ %tas a]) sym)
177− :- ['0' '9'] (stag ~ bisk)
281+ :- ['0' '9'] (stag %$ bisk)
178− :- '-' (stag ~ tash)
282+ :- '-' (stag %$ tash)
179− :- '.' ;~(pfix dot perd)
283+ :- '.' ;~(pfix dot perd)
180− :- '~' ;~(pfix sig ;~(pose twid (easy [~ %n 0])))
284+ :- '~' ;~(pfix sig ;~(pose twid (easy [%$ %n 0])))
181− ==
285+ ==
286+
287+
182
288
183Examples
289Examples
184--------
290--------
@@ -224,7 +330,7 @@ Source
224------
330------
225
331
226 ++ nusk
332 ++ nusk
227− (sear |=(a=@ta (rush (wick a) nuck)) urt:ab)
333+ (sear |=(a/@ta (rush (wick a) nuck)) urt:ab)
228
334
229Examples
335Examples
230--------
336--------
@@ -235,7 +341,7 @@ Examples
235 [1 ~.asd_a]
341 [1 ~.asd_a]
236 ~zod/try=> (scan "~~.asd~-a" nusk:so)
342 ~zod/try=> (scan "~~.asd~-a" nusk:so)
237 [% p=[p=~.ta q=418.212.246.369]]
343 [% p=[p=~.ta q=418.212.246.369]]
238− ~zod/try=> (,[~ %ta @ta] (scan "~~.asd~-a" nusk:so))
344+ ~zod/try=> ([~ %ta @ta] (scan "~~.asd~-a" nusk:so))
239 [~ %ta ~.asd_a]
345 [~ %ta ~.asd_a]
240
346
241------------------------------------------------------------------------
347------------------------------------------------------------------------
@@ -280,7 +386,7 @@ Examples
280
386
281Parse dime float
387Parse dime float
282
388
283−Parsing rule. Parses a number into a [`++dime`]() float.
389+Parsing rule. Parses a number into a `++dime` float.
284
390
285Accepts
391Accepts
286-------
392-------
@@ -291,28 +397,51 @@ Produces
291Source
397Source
292------
398------
293
399
294− ++ royl
400+ ++ royl
295− =+ ^= zer
401+ ~+
296− (cook lent (star (just '0')))
402+ =+ ^= moo
403+ |= a/tape
404+ :- (lent a)
405+ (scan a (bass 10 (plus sid:ab)))
297− =+ ^= voy
406+ =+ ^= voy
298− %+ cook royl-cell
407+ %+ cook royl-cell
299− ;~ plug
408+ ;~ pose
409+ ;~ plug
410+ (easy %d)
300− ;~(pose (cold | hep) (easy &))
411+ ;~ pose (cold | hep) (easy &) ==
301− ;~(plug dim:ag ;~(pose ;~(pfix dot ;~(plug zer dim:ag)) (easy [0 0])))
412+ ;~ plug dim:ag
413+ ;~ pose
414+ ;~(pfix dot (cook moo (plus (shim '0' '9'))))
415+ (easy [0 0])
416+ ==
302− ;~ pose
417+ ;~ pose
303− ;~ pfix
418+ ;~ pfix
304− (just 'e')
419+ (just 'e')
305− (cook some ;~(plug ;~(pose (cold | hep) (easy &)) dim:ag))
420+ ;~(plug ;~(pose (cold | hep) (easy &)) dim:ag)
306− ==
307− (easy ~)
308 ==
421 ==
422+ (easy [& 0])
309 ==
423 ==
424+ ==
425+ ==
426+ ;~ plug
427+ (easy %i)
428+ ;~ sfix
310− ;~ pose
429+ ;~ pose (cold | hep) (easy &) ==
311− (stag %rh (cook rylh ;~(pfix ;~(plug sig sig) voy)))
430+ (jest 'inf')
312− (stag %rq (cook rylq ;~(pfix ;~(plug sig sig sig) voy)))
431+ ==
313− (stag %rd (cook ryld ;~(pfix sig voy)))
432+ ==
314− (stag %rs (cook ryls voy)
433+ ;~ plug
434+ (easy %n)
435+ (cold ~ (jest 'nan'))
315 ==
436 ==
437+ ==
438+ ;~ pose
439+ (stag %rh (cook rylh ;~(pfix ;~(plug sig sig) voy)))
440+ (stag %rq (cook rylq ;~(pfix ;~(plug sig sig sig) voy)))
441+ (stag %rd (cook ryld ;~(pfix sig voy)))
442+ (stag %rs (cook ryls voy))
443+ ==
444+ ::
316
445
317Examples
446Examples
318--------
447--------
@@ -330,6 +459,15 @@ XX still not fully functional
330
459
331Intermediate parsed float convereter
460Intermediate parsed float convereter
332
461
462+ ++ royl-cell
463+ |= rn
464+ ^- dn
465+ ?. ?=({$d *} +<) +<
466+ =+ ^= h
467+ (dif:si (new:si f.b i.b) (sun:si d.b))
468+ [%d a h (add (mul c.b (pow 10 d.b)) e.b)]
469+ ::
470+
333------------------------------------------------------------------------
471------------------------------------------------------------------------
334
472
335### `++tash`
473### `++tash`
@@ -339,46 +477,27 @@ Parse signed dime
339Accepts
477Accepts
340-------
478-------
341
479
342−Accepts
343−-------
344−
345Produces
480Produces
346--------
481--------
347
482
348−Produces
349−--------
350−
351−Parsing rule. Parses a signed number into a [`++dime`]().
483+Parsing rule. Parses a signed number into a `++dime`.
352−
353−Source
354−------
355−
356− ++ royl-cell
357− |= [a=? b=[c=@ d=@ e=@] f=(unit ,[h=? i=@])]
358− ^- [? @ @ @ (unit ,@s)]
359− ?~ f
360− [a c.b d.b e.b ~]
361− ?: h.u.f
362− [a c.b d.b e.b [~ (mul i.u.f 2)]]
363− [a c.b d.b e.b [~ (dec (mul i.u.f 2))]]
364−
365−Examples
366−--------
367
484
368Source
485Source
369------
486------
370
487
371 ++ tash
488 ++ tash
489+ ~+
372 =+ ^= neg
490 =+ ^= neg
373− |= [syn=? mol=dime] ^- dime
491+ |= {syn/? mol/dime} ^- dime
374 ?> =('u' (end 3 1 p.mol))
492 ?> =('u' (end 3 1 p.mol))
375 [(cat 3 's' (rsh 3 1 p.mol)) (new:si syn q.mol)]
493 [(cat 3 's' (rsh 3 1 p.mol)) (new:si syn q.mol)]
376 ;~ pfix hep
494 ;~ pfix hep
377 ;~ pose
495 ;~ pose
378− (cook |=(a=dime (neg | a)) bisk)
496+ (cook |=(a/dime (neg | a)) bisk)
379− ;~(pfix hep (cook |=(a=dime (neg & a)) bisk))
497+ ;~(pfix hep (cook |=(a/dime (neg & a)) bisk))
380 ==
498 ==
381 ==
499 ==
500+ ::
382
501
383Examples
502Examples
384--------
503--------
@@ -411,7 +530,7 @@ Source
411
530
412 ++ twid
531 ++ twid
413 ;~ pose
532 ;~ pose
414− (cook |=(a=@ [%blob (cue a)]) ;~(pfix (just '0') vum:ag))
533+ (cook |=(a/@ [%blob (cue a)]) ;~(pfix (just '0') vum:ag))
415 (stag ~ crub)
534 (stag ~ crub)
416 ==
535 ==
417 ::
536 ::
@@ -436,8 +555,8 @@ Examples
436
555
437Parse prefixed dimes from `@if`, `@f`, `@rd`
556Parse prefixed dimes from `@if`, `@f`, `@rd`
438
557
439−Parsing rule. Parses an atom of either [`@if`]() (IP address), [`@f`]()
558+Parsing rule. Parses an atom of either `@if` (IP address), `@f`
440−(loobean), or [`rf`]()(floating point) into a [`++dime`]().
559+(loobean), or `rf`(floating point) into a `++dime`.
441
560
442Accepts
561Accepts
443-------
562-------
docs/system/hoon/library/src/4m/gate/scot.md+2−2
@@ -10,12 +10,12 @@ Accepts
10Produces
10Produces
11--------
11--------
12
12
13−`mol` is a [`++dime`]().
13+`mol` is a `++dime`.
14
14
15Source
15Source
16------
16------
17
17
18− ++ scot |=(mol=dime ~(rent co %$ mol))
18+ ++ scot |=(mol/dime ~(rent co %$ mol))
19
19
20Examples
20Examples
21--------
21--------
docs/system/hoon/library/src/4m/gate/scow.md+2−2
@@ -10,12 +10,12 @@ Accepts
10Produces
10Produces
11--------
11--------
12
12
13−`mol` is a [`++dime`]().
13+`mol` is a `++dime`.
14
14
15Source
15Source
16------
16------
17
17
18− ++ scow |=(mol=dime ~(rend co %$ mol))
18+ ++ scow |=(mol/dime ~(rend co %$ mol))
19
19
20Examples
20Examples
21--------
21--------
docs/system/hoon/library/src/4m/gate/slat.md+8−8
@@ -2,7 +2,7 @@
2
2
3Curried slaw
3Curried slaw
4
4
5−Produces a [`gate`]() that parses a [`term`]() `txt` to an atom of the
5+Produces a `gate` that parses a `term` `txt` to an atom of the
6odor specified by `mod`.
6odor specified by `mod`.
7
7
8Accepts
8Accepts
@@ -11,25 +11,25 @@ Accepts
11Produces
11Produces
12--------
12--------
13
13
14−`mod` is a term, an atom of odor [`@tas`]().
14+`mod` is a term, an atom of odor `@tas`.
15
15
16−`txt` is a span, an atom of odor [`@ta`]().
16+`txt` is a span, an atom of odor `@ta`.
17
17
18Source
18Source
19------
19------
20
20
21− ++ slat |=(mod=@tas |=(txt=@ta (slaw mod txt)))
21+ ++ slat |=(mod/@tas |=(txt/@ta (slaw mod txt)))
22
22
23Examples
23Examples
24--------
24--------
25
25
26− ~zod/try=> `(unit ,@p)`((slat %p) '~pillyt')
26+ ~zod/try=> `(unit @p)`((slat %p) '~pillyt')
27 [~ ~pillyt]
27 [~ ~pillyt]
28− ~zod/try=> `(unit ,@ux)`((slat %ux) '0x12')
28+ ~zod/try=> `(unit @ux)`((slat %ux) '0x12')
29 [~ 0x12]
29 [~ 0x12]
30− ~zod/try=> `(unit ,@if)`((slat %if) '.127.0.0.1')
30+ ~zod/try=> `(unit @if)`((slat %if) '.127.0.0.1')
31 [~ .127.0.0.1]
31 [~ .127.0.0.1]
32− ~zod/try=> `(unit ,@ta)`((slat %ta) '~.asd_a')
32+ ~zod/try=> `(unit @ta)`((slat %ta) '~.asd_a')
33 [~ ~.asd_a
33 [~ ~.asd_a
34
34
35
35
docs/system/hoon/library/src/4m/gate/slav.md+3−3
@@ -11,14 +11,14 @@ Accepts
11Produces
11Produces
12--------
12--------
13
13
14−`mod` is a term, an atom of odor [`@tas`]().
14+`mod` is a term, an atom of odor `@tas`.
15
15
16−`txt` is a span, an atom of odor [`@ta`]().
16+`txt` is a span, an atom of odor `@ta`.
17
17
18Source
18Source
19------
19------
20
20
21− ++ slav |=([mod=@tas txt=@ta] (need (slaw mod txt)))
21+ ++ slav |=([mod/@tas txt/@ta] (need (slaw mod txt)))
22
22
23Examples
23Examples
24--------
24--------
docs/system/hoon/library/src/4m/gate/slaw.md+15−14
@@ -10,38 +10,39 @@ Accepts
10Produces
10Produces
11--------
11--------
12
12
13−`mod` is a term, an atom of odor [`@tas`]().
13+`mod` is a term, an atom of odor `@tas`.
14
14
15−`txt` is a span, an atom of odor [`@ta`]().
15+`txt` is a span, an atom of odor `@ta`.
16
16
17Source
17Source
18------
18------
19
19
20 ++ slaw
20 ++ slaw
21+ ~/ %slaw
21− |= [mod=@tas txt=@ta]
22+ |= {mod/@tas txt/@ta}
22− ^- (unit ,@)
23+ ^- (unit @)
23 =+ con=(slay txt)
24 =+ con=(slay txt)
24− ?.(&(?=([~ %$ @ @] con) =(p.p.u.con mod)) ~ [~ q.p.u.con])
25+ ?.(&(?=({$~ $$ @ @} con) =(p.p.u.con mod)) ~ [~ q.p.u.con])
25− ::
26+
26
27
27Examples
28Examples
28--------
29--------
29
30
30− ~zod/try=> `(unit ,@p)`(slaw %p '~pillyt')
31+ ~zod/try=> `(unit @p)`(slaw %p '~pillyt')
31 [~ ~pillyt]
32 [~ ~pillyt]
32− ~zod/try=> `(unit ,@p)`(slaw %p '~pillam')
33+ ~zod/try=> `(unit @p)`(slaw %p '~pillam')
33 ~
34 ~
34− ~zod/try=> `(unit ,@ux)`(slaw %ux '0x12')
35+ ~zod/try=> `(unit @ux)`(slaw %ux '0x12')
35 [~ 0x12]
36 [~ 0x12]
36− ~zod/try=> `(unit ,@ux)`(slaw %ux '0b10')
37+ ~zod/try=> `(unit @ux)`(slaw %ux '0b10')
37 ~
38 ~
38− ~zod/try=> `(unit ,@if)`(slaw %if '.127.0.0.1')
39+ ~zod/try=> `(unit @if)`(slaw %if '.127.0.0.1')
39 [~ .127.0.0.1]
40 [~ .127.0.0.1]
40− ~zod/try=> `(unit ,@if)`(slaw %if '.fe80.0.0.202')
41+ ~zod/try=> `(unit @if)`(slaw %if '.fe80.0.0.202')
41 ~
42 ~
42− ~zod/try=> `(unit ,@ta)`(slaw %ta '~.asd_a')
43+ ~zod/try=> `(unit @ta)`(slaw %ta '~.asd_a')
43 [~ ~.asd_a]
44 [~ ~.asd_a]
44− ~zod/try=> `(unit ,@ta)`(slaw %ta '~~asd-a')
45+ ~zod/try=> `(unit @ta)`(slaw %ta '~~asd-a')
45 ~
46 ~
46
47
47
48
docs/system/hoon/library/src/4m/gate/slay.md+13−9
@@ -2,7 +2,7 @@
2
2
3Parse span to coin
3Parse span to coin
4
4
5−Parses a span `txt` to the unit of a [`++coin`]().
5+Parses a span `txt` to the unit of a `++coin`.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -10,18 +10,22 @@ Accepts
10Produces
10Produces
11--------
11--------
12
12
13−`txt` is a [`@ta`]().
13+`txt` is a `@ta`.
14
14
15Source
15Source
16------
16------
17
17
18− ++ slay
18+ ++ slay
19− |= txt=@ta ^- (unit coin)
19+ |= txt/@ta ^- (unit coin)
20+ =+ ^= vex
21+ ?: (gth 0x7fff.ffff txt) :: XX petty cache
20− =+ vex=((full nuck:so) [[1 1] (trip txt)])
22+ ~+ ((full nuck:so) [[1 1] (trip txt)])
23+ ((full nuck:so) [[1 1] (trip txt)])
21− ?~ q.vex
24+ ?~ q.vex
22− ~
25+ ~
23− [~ p.u.q.vex]
26+ [~ p.u.q.vex]
24− ::
27+ ::
28+
25
29
26Examples
30Examples
27--------
31--------
docs/system/hoon/library/src/4m/gate/smyt.md+7−7
@@ -2,7 +2,7 @@
2
2
3Render path as tank
3Render path as tank
4
4
5−Renders the path `bon` as a [`tank`](), which is used for
5+Renders the path `bon` as a `tank`, which is used for
6pretty-printing.
6pretty-printing.
7
7
8Accepts
8Accepts
@@ -11,16 +11,16 @@ Accepts
11Produces
11Produces
12--------
12--------
13
13
14−`bon` is a [`++path`]().
14+`bon` is a `++path`.
15
15
16Source
16Source
17------
17------
18
18
19− ++ smyt
19+ ++ smyt :: pretty print path
20− |= bon=path ^- tank
20+ |= bon/path ^- tank
21− :+ %rose [['/' ~] ['/' ~] ['/' ~]]
21+ :+ %rose [['/' ~] ['/' ~] ~]
22− |- ^- (list tank)
23− (turn bon |=(a=@ [%leaf (rip 3 a)]))
22+ (turn bon |=(a/@ [%leaf (trip a)]))
23+ ::
24
24
25Examples
25Examples
26--------
26--------
docs/system/hoon/library/src/4m/gate/spat.md+2−2
@@ -10,12 +10,12 @@ Accepts
10Produces
10Produces
11--------
11--------
12
12
13−`pax` is a [`path`]().
13+`pax` is a `path`.
14
14
15Source
15Source
16------
16------
17
17
18− ++ spat |=(pax=path (crip (spud pax))) :: path to cord
18+ ++ spat |=(pax/path (crip (spud pax))) :: path to cord
19
19
20Examples
20Examples
21--------
21--------
docs/system/hoon/library/src/4m/gate/spud.md+3−3
@@ -2,7 +2,7 @@
2
2
3Render path as tape
3Render path as tape
4
4
5−Renders a path `pax` as [tape]().
5+Renders a path `pax` as tape.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -10,12 +10,12 @@ Accepts
10Produces
10Produces
11--------
11--------
12
12
13−`pax` is a [`path`]().
13+`pax` is a `path`.
14
14
15Source
15Source
16------
16------
17
17
18− ++ spud |=(pax=path ~(ram re (smyt pax))) :: path to tape
18+ ++ spud |=(pax/path ~(ram re (smyt pax))) :: path to tape
19
19
20Examples
20Examples
21--------
21--------
docs/system/hoon/library/src/4m/gate/stab.md+5−4
@@ -2,7 +2,7 @@
2
2
3Parse span to path
3Parse span to path
4
4
5−Parsing rule. Parses a span `zep` to a static [`++path`](/doc/hoon/library/1#++path).
5+Parsing rule. Parses a span `zep` to a static `++path`.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -13,9 +13,10 @@ Produces
13Source
13Source
14------
14------
15
15
16− ++ stab :: parse span to path
16+ ++ stab :: parse cord to path
17− |= zep=@ta ^- path
18− (rash zep ;~(pfix fas ;~(sfix (more fas urs:ab) fas)))
17+ =+ fel=;~(pfix fas (more fas urs:ab))
18+ |=(zep/@t `path`(rash zep fel))
19+
19
20
20Examples
21Examples
21--------
22--------
docs/system/hoon/library/src/4n/gate/mack.md+7−6
@@ -2,14 +2,14 @@
2
2
3Nock subject to unit
3Nock subject to unit
4
4
5−Accepts a nock subject-formula cell and wraps it into a [`++unit`]().
5+Accepts a nock subject-formula cell and wraps it into a `++unit`.
6`fol` is pure nock, meaning that nock `11` operations result in a block,
6`fol` is pure nock, meaning that nock `11` operations result in a block,
7producing a `~`.
7producing a `~`.
8
8
9Accepts
9Accepts
10-------
10-------
11
11
12−`sub` is a subject [noun]().
12+`sub` is a subject noun.
13
13
14`fol` is a formula noun, which is generally a `++nock`.
14`fol` is a formula noun, which is generally a `++nock`.
15
15
@@ -22,12 +22,13 @@ Source
22------
22------
23
23
24 ++ mack
24 ++ mack
25− |= [sub=* fol=*]
25+ |= {sub/* fol/*}
26 ^- (unit)
26 ^- (unit)
27− =+ ton=(mink [sub fol] |=(* ~))
27+ =+ ton=(mink [sub fol] |=({* *} ~))
28− ?.(?=([0 *] ton) ~ [~ p.ton])
28+ ?.(?=({$0 *} ton) ~ [~ p.ton])
29 ::
29 ::
30
30
31+
31Examples
32Examples
32--------
33--------
33
34
@@ -39,7 +40,7 @@ Examples
39 ~
40 ~
40 ~zod/try=> (mack [[[0 2] [1 3]] 4 4 4 4 0 5])
41 ~zod/try=> (mack [[[0 2] [1 3]] 4 4 4 4 0 5])
41 [~ 6]
42 [~ 6]
42− ~zod/try=> ;;((unit ,@tas) (mack [[1 %yes %no] 6 [0 2] [0 6] 0 7]))
43+ ~zod/try=> ;;((unit @tas) (mack [[1 %yes %no] 6 [0 2] [0 6] 0 7]))
43 [~ %no]
44 [~ %no]
44
45
45
46
docs/system/hoon/library/src/4n/gate/mink.md+44−42
@@ -2,19 +2,19 @@
2
2
3Mock interpreter
3Mock interpreter
4
4
5−Bottom-level [mock]() (virtual nock) interpreter. Produces a
5+Bottom-level mock (virtual nock) interpreter. Produces a
6−[`++tone`](), a nock computation result. If nock 11 is invoked, `sky`
6+`++tone`, a nock computation result. If nock 11 is invoked, `sky`
7−computes on the subject and produces a [`++unit`]() result. An empty
7+computes on the subject and produces a `++unit` result. An empty
8result becomes a `%1` `++tone`, indicating a block.
8result becomes a `%1` `++tone`, indicating a block.
9
9
10Accepts
10Accepts
11-------
11-------
12
12
13−`sub` is the subject as a [noun]().
13+`sub` is the subject as a noun.
14
14
15`fol` is the formula as a noun.
15`fol` is the formula as a noun.
16
16
17−`sky` is an [`%iron`]() gate invoked with [nock operator 11]().
17+`sky` is an `%iron` gate invoked with nock operator 11.
18
18
19Produces
19Produces
20--------
20--------
@@ -26,98 +26,100 @@ Source
26
26
27 ++ mink
27 ++ mink
28 ~/ %mink
28 ~/ %mink
29− |= [[sub=* fol=*] sky=$+(* (unit))]
29+ |= {{sub/* fol/*} gul/$-({* *} (unit (unit)))}
30− =+ tax=*(list ,[@ta *])
30+ =+ tax=*(list {@ta *})
31 |- ^- tone
31 |- ^- tone
32 ?@ fol
32 ?@ fol
33 [%2 tax]
33 [%2 tax]
34 ?: ?=(^ -.fol)
34 ?: ?=(^ -.fol)
35 =+ hed=$(fol -.fol)
35 =+ hed=$(fol -.fol)
36− ?: ?=(%2 -.hed)
36+ ?: ?=($2 -.hed)
37 hed
37 hed
38 =+ tal=$(fol +.fol)
38 =+ tal=$(fol +.fol)
39 ?- -.tal
39 ?- -.tal
40− %0 ?-(-.hed %0 [%0 p.hed p.tal], %1 hed)
40+ $0 ?-(-.hed $0 [%0 p.hed p.tal], $1 hed)
41− %1 ?-(-.hed %0 tal, %1 [%1 (weld p.hed p.tal)])
41+ $1 ?-(-.hed $0 tal, $1 [%1 (weld p.hed p.tal)])
42− %2 tal
42+ $2 tal
43 ==
43 ==
44 ?+ fol
44 ?+ fol
45 [%2 tax]
45 [%2 tax]
46 ::
46 ::
47− [0 b=@]
47+ {$0 b/@}
48 ?: =(0 b.fol) [%2 tax]
48 ?: =(0 b.fol) [%2 tax]
49 ?: =(1 b.fol) [%0 sub]
49 ?: =(1 b.fol) [%0 sub]
50 ?: ?=(@ sub) [%2 tax]
50 ?: ?=(@ sub) [%2 tax]
51 =+ [now=(cap b.fol) lat=(mas b.fol)]
51 =+ [now=(cap b.fol) lat=(mas b.fol)]
52 $(b.fol lat, sub ?:(=(2 now) -.sub +.sub))
52 $(b.fol lat, sub ?:(=(2 now) -.sub +.sub))
53 ::
53 ::
54− [1 b=*]
54+ {$1 b/*}
55 [%0 b.fol]
55 [%0 b.fol]
56 ::
56 ::
57− [2 b=[^ *]]
57+ {$2 b/{^ *}}
58 =+ ben=$(fol b.fol)
58 =+ ben=$(fol b.fol)
59− ?. ?=(%0 -.ben) ben
59+ ?. ?=($0 -.ben) ben
60 ?>(?=(^ p.ben) $(sub -.p.ben, fol +.p.ben))
60 ?>(?=(^ p.ben) $(sub -.p.ben, fol +.p.ben))
61 ::?>(?=(^ p.ben) $([sub fol] p.ben)
61 ::?>(?=(^ p.ben) $([sub fol] p.ben)
62 ::
62 ::
63− [3 b=*]
63+ {$3 b/*}
64 =+ ben=$(fol b.fol)
64 =+ ben=$(fol b.fol)
65− ?. ?=(%0 -.ben) ben
65+ ?. ?=($0 -.ben) ben
66 [%0 .?(p.ben)]
66 [%0 .?(p.ben)]
67 ::
67 ::
68− [4 b=*]
68+ {$4 b/*}
69 =+ ben=$(fol b.fol)
69 =+ ben=$(fol b.fol)
70− ?. ?=(%0 -.ben) ben
70+ ?. ?=($0 -.ben) ben
71 ?. ?=(@ p.ben) [%2 tax]
71 ?. ?=(@ p.ben) [%2 tax]
72 [%0 .+(p.ben)]
72 [%0 .+(p.ben)]
73 ::
73 ::
74− [5 b=*]
74+ {$5 b/*}
75 =+ ben=$(fol b.fol)
75 =+ ben=$(fol b.fol)
76− ?. ?=(%0 -.ben) ben
76+ ?. ?=($0 -.ben) ben
77 ?. ?=(^ p.ben) [%2 tax]
77 ?. ?=(^ p.ben) [%2 tax]
78 [%0 =(-.p.ben +.p.ben)]
78 [%0 =(-.p.ben +.p.ben)]
79 ::
79 ::
80− [6 b=* c=* d=*]
80+ {$6 b/* c/* d/*}
81 $(fol =>(fol [2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]))
81 $(fol =>(fol [2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]))
82 ::
82 ::
83− [7 b=* c=*] $(fol =>(fol [2 b 1 c]))
83+ {$7 b/* c/*} $(fol =>(fol [2 b 1 c]))
84− [8 b=* c=*] $(fol =>(fol [7 [[0 1] b] c]))
84+ {$8 b/* c/*} $(fol =>(fol [7 [[0 1] b] c]))
85− [9 b=* c=*] $(fol =>(fol [7 c 0 b]))
85+ {$9 b/* c/*} $(fol =>(fol [7 c 0 b]))
86− [10 @ c=*] $(fol c.fol)
86+ {$10 @ c/*} $(fol c.fol)
87− [10 [b=* c=*] d=*]
87+ {$10 {b/* c/*} d/*}
88 =+ ben=$(fol c.fol)
88 =+ ben=$(fol c.fol)
89− ?. ?=(%0 -.ben) ben
89+ ?. ?=($0 -.ben) ben
90− ?: ?=(?(%hunk %lose %mean %spot) b.fol)
90+ ?: ?=(?($hunk $hand $lose $mean $spot) b.fol)
91 $(fol d.fol, tax [[b.fol p.ben] tax])
91 $(fol d.fol, tax [[b.fol p.ben] tax])
92 $(fol d.fol)
92 $(fol d.fol)
93 ::
93 ::
94− [11 b=*]
94+ {$11 b/* c/*}
95+ =+ ref=$(fol b.fol)
95− =+ ben=$(fol b.fol)
96+ =+ ben=$(fol c.fol)
97+ ?. ?=($0 -.ref) ref
96− ?. ?=(%0 -.ben) ben
98+ ?. ?=($0 -.ben) ben
97− =+ val=(sky p.ben)
99+ =+ val=(gul p.ref p.ben)
98− ?~(val [%1 p.ben ~] [%0 u.val])
100+ ?~(val [%1 p.ben ~] ?~(u.val [%2 [[%hunk (mush p.ben)] tax]] [%0 u.u.val]))
99− ::
100 ==
101 ==
101 ::
102 ::
102
103
104+
103Examples
105Examples
104--------
106--------
105
107
106− ~zod/try=> (mink [20 [4 0 1]] ,~)
108+ ~zod/try=> (mink [20 [4 0 1]] $~)
107 [%0 p=21]
109 [%0 p=21]
108− ~zod/try=> (mink [[90 5 3] [0 3]] ,~)
110+ ~zod/try=> (mink [[90 5 3] [0 3]] $~)
109 [%0 p=[5 3]]
111 [%0 p=[5 3]]
110− ~zod/try=> (mink 20^[4 0 1] ,~)
112+ ~zod/try=> (mink 20^[4 0 1] $~)
111 [%0 p=21]
113 [%0 p=21]
112− ~zod/try=> (mink [90 5 3]^[0 3] ,~)
114+ ~zod/try=> (mink [90 5 3]^[0 3] $~)
113 [%0 p=[5 3]]
115 [%0 p=[5 3]]
114− ~zod/try=> (mink [0]^[11 1 20] ,~)
116+ ~zod/try=> (mink [0]^[11 1 20] $~)
115 [%1 p=~[20]]
117 [%1 p=~[20]]
116 ~zod/try=> (mink [0]^[11 1 20] |=(a=* `[40 a]))
118 ~zod/try=> (mink [0]^[11 1 20] |=(a=* `[40 a]))
117 [%0 p=[40 20]]
119 [%0 p=[40 20]]
118− ~zod/try=> (mink [5]^[0 2] ,~)
120+ ~zod/try=> (mink [5]^[0 2] $~)
119 [%2 p=~]
121 [%2 p=~]
120− ~zod/try=> (mink [5]^[10 yelp/[0 1] 0 0] ,~)
122+ ~zod/try=> (mink [5]^[10 yelp/[0 1] 0 0] $~)
121 [%2 p=~[[~.yelp 5]]]
123 [%2 p=~[[~.yelp 5]]]
122
124
123
125
docs/system/hoon/library/src/4n/gate/mock.md+7−6
@@ -2,19 +2,19 @@
2
2
3Compute formula on subject with hint
3Compute formula on subject with hint
4
4
5−Produces a [`++toon`](), which is either a sucessful, blocked, or
5+Produces a `++toon`, which is either a sucessful, blocked, or
6crashed result. If nock 11 is invoked, `sky` computes on the subject and
6crashed result. If nock 11 is invoked, `sky` computes on the subject and
7−produces a [`++unit`]() result. An empty result becomes a `%1` `++tune`,
7+produces a `++unit` result. An empty result becomes a `%1` `++tune`,
8indicating a block.
8indicating a block.
9
9
10Accepts
10Accepts
11-------
11-------
12
12
13−`sub` is the subject as a [noun]().
13+`sub` is the subject as a noun.
14
14
15`fol` is the formula as a noun.
15`fol` is the formula as a noun.
16
16
17−`sky` is an [%iron]() gate invoked with [nock operator 11]().
17+`sky` is an %iron gate invoked with nock operator 11.
18
18
19Produces
19Produces
20--------
20--------
@@ -25,10 +25,11 @@ Source
25------
25------
26
26
27 ++ mock
27 ++ mock
28− |= [[sub=* fol=*] sky=$+(* (unit))]
28+ |= {{sub/* fol/*} gul/$-({* *} (unit (unit)))}
29− (mook (mink [sub fol] sky))
29+ (mook (mink [sub fol] gul))
30 ::
30 ::
31
31
32+
32Examples
33Examples
33--------
34--------
34
35
docs/system/hoon/library/src/4n/gate/mong.md+13−13
@@ -2,17 +2,17 @@
2
2
3Slam gate with sample
3Slam gate with sample
4
4
5−Produces a [`++toon`]() computation result from slamming `gat` with
5+Produces a `++toon` computation result from slamming `gat` with
6`sam`, using `sky` to compute or block on nock 11 when applicable.
6`sam`, using `sky` to compute or block on nock 11 when applicable.
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`gat` is a [noun]() that is generally a [`gate`]().
11+`gat` is a noun that is generally a `gate`.
12
12
13−`sam` is a [`sample`]() noun.
13+`sam` is a `sample` noun.
14
14
15−`sky` is an [%iron]() gate invoked with [nock operator 11]().
15+`sky` is an %iron gate invoked with nock operator 11.
16
16
17Produces
17Produces
18--------
18--------
@@ -23,11 +23,11 @@ Source
23------
23------
24
24
25 ++ mong
25 ++ mong
26− |= [[gat=* sam=*] sky=$+(* (unit))]
26+ |= {{gat/* sam/*} gul/$-({* *} (unit (unit)))}
27 ^- toon
27 ^- toon
28 ?. &(?=(^ gat) ?=(^ +.gat))
28 ?. &(?=(^ gat) ?=(^ +.gat))
29 [%2 ~]
29 [%2 ~]
30− (mock [[-.gat [sam +>.gat]] -.gat] sky)
30+ (mock [[-.gat [sam +>.gat]] -.gat] gul)
31 ::
31 ::
32
32
33Examples
33Examples
@@ -37,19 +37,19 @@ Examples
37 [%0 p=20]
37 [%0 p=20]
38 ~zod/try=> (mong [|=(@ !!) ~] ,~)
38 ~zod/try=> (mong [|=(@ !!) ~] ,~)
39 [%2 p=~]
39 [%2 p=~]
40− ~zod/try=> (mong [|=(a=@ (add 20 a)) ~] ,~)
40+ ~zod/try=> (mong [|=(a/@ (add 20 a)) ~] ,~)
41 [%0 p=20]
41 [%0 p=20]
42− ~zod/try=> (mong [|=(a=[@ @] (add 20 -.a)) ~] ,~)
42+ ~zod/try=> (mong [|=(a/[@ @] (add 20 -.a)) ~] ,~)
43 [%2 p=~]
43 [%2 p=~]
44− ~zod/try=> (mong [|=(a=[@ @] (add 20 -.a)) [4 6]] ,~)
44+ ~zod/try=> (mong [|=(a/[@ @] (add 20 -.a)) [4 6]] ,~)
45 [%0 p=24]
45 [%0 p=24]
46− ~zod/try=> (mong [|=(a=@ .^(a)) ~] ,~)
46+ ~zod/try=> (mong [|=(a/@ .^(a)) ~] ,~)
47 [%1 p=~[0]]
47 [%1 p=~[0]]
48− ~zod/try=> (mong [|=(a=@ .^(a)) ~] ,[~ %42])
48+ ~zod/try=> (mong [|=(a/@ .^(a)) ~] ,[~ %42])
49 [%0 p=42]
49 [%0 p=42]
50− ~zod/try=> (mong [|=(a=@ .^(a)) ~] |=(a=* [~ a 6]))
50+ ~zod/try=> (mong [|=(a/@ .^(a)) ~] |=(a/* [~ a 6]))
51 [%0 p=[0 6]]
51 [%0 p=[0 6]]
52− ~zod/try=> (mong [|=(a=@ .^(a)) 8] |=(a=* [~ a 6]))
52+ ~zod/try=> (mong [|=(a/@ .^(a)) 8] |=(a/* [~ a 6]))
53 [%0 p=[8 6]]
53 [%0 p=[8 6]]
54
54
55
55
docs/system/hoon/library/src/4n/gate/mook.md+22−33
@@ -2,67 +2,56 @@
2
2
3Intelligently render crash annotation
3Intelligently render crash annotation
4
4
5−Converts a `%2` `++tone` nock stack trace to a list of [`++tank`]().
5+Converts a `%2` `++tone` nock stack trace to a list of `++tank`.
6−Each may be a tank, cord, [`++spot`](), or trapped tank.
6+Each may be a tank, cord, `++spot`, or trapped tank.
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`ton` is a [`++tone`]().
11+`ton` is a `++tone`.
12
12
13Produces
13Produces
14--------
14--------
15
15
16−A [`++toon`]().
16+A `++toon`.
17
17
18Source
18Source
19------
19------
20
20
21 ++ mook
21 ++ mook
22− |= ton=tone
22+ |= ton/tone
23 ^- toon
23 ^- toon
24− ?. ?=([2 *] ton) ton
24+ ?. ?=({$2 *} ton) ton
25 :- %2
25 :- %2
26+ :: =. p.ton (moop p.ton)
26 =+ yel=(lent p.ton)
27 =+ yel=(lent p.ton)
27 =. p.ton
28 =. p.ton
28 ?. (gth yel 256) p.ton
29 ?. (gth yel 256) p.ton
29 %+ weld
30 %+ weld
30 (scag 128 p.ton)
31 (scag 128 p.ton)
31− ^- (list ,[@ta *])
32+ ^- (list {@ta *})
32 :_ (slag (sub yel 128) p.ton)
33 :_ (slag (sub yel 128) p.ton)
33 :- %lose
34 :- %lose
34 %+ rap 3
35 %+ rap 3
35− ;: weld
36− "[skipped "
37− ~(rend co %$ %ud (sub yel 256))
36+ "[skipped {(scow %ud (sub yel 256))} frames]"
38− " frames]"
39− ==
40 |- ^- (list tank)
37 |- ^- (list tank)
41 ?~ p.ton ~
38 ?~ p.ton ~
42− =+ rex=$(p.ton t.p.ton)
39+ =+ rep=$(p.ton t.p.ton)
43− ?+ -.i.p.ton rex
40+ ?+ -.i.p.ton rep
44− %hunk [(tank +.i.p.ton) rex]
41+ $hunk [(tank +.i.p.ton) rep]
45− %lose [[%leaf (rip 3 (,@ +.i.p.ton))] rex]
42+ $lose [[%leaf (rip 3 (@ +.i.p.ton))] rep]
43+ $hand [[%leaf (scow %p (mug +.i.p.ton))] rep]
46− %mean :_ rex
44+ $mean :_ rep
47− ?@ +.i.p.ton [%leaf (rip 3 (,@ +.i.p.ton))]
45+ ?@ +.i.p.ton [%leaf (rip 3 (@ +.i.p.ton))]
48 =+ mac=(mack +.i.p.ton +<.i.p.ton)
46 =+ mac=(mack +.i.p.ton +<.i.p.ton)
49 ?~(mac [%leaf "####"] (tank u.mac))
47 ?~(mac [%leaf "####"] (tank u.mac))
50− %spot :_ rex
48+ $spot :_ rep
51 =+ sot=(spot +.i.p.ton)
49 =+ sot=(spot +.i.p.ton)
52− :- %leaf
50+ :+ %rose [":" ~ ~]
53− ;: weld
54− ~(ram re (smyt p.sot))
51+ :~ (smyt p.sot)
55− ":<["
56− ~(rend co ~ %ud p.p.q.sot)
52+ => [ud=|=(a/@u (scow %ud a)) q.sot]
57− " "
53+ leaf+"<[{(ud p.p)} {(ud q.p)}].[{(ud p.q)} {(ud q.q)}]>"
58− ~(rend co ~ %ud q.p.q.sot)
59− "].["
60− ~(rend co ~ %ud p.q.q.sot)
61− " "
62− ~(rend co ~ %ud q.q.q.sot)
63− "]>"
64− ==
65− ==
54+ == ==
66 ::
55 ::
67
56
68Examples
57Examples
docs/system/hoon/library/src/4n/gate/mule.md+6−5
@@ -2,13 +2,13 @@
2
2
3Typed virtual
3Typed virtual
4
4
5−Kicks a [`++trap`](), producing its results or any errors that occur along
5+Kicks a `++trap`, producing its results or any errors that occur along
6the way. Used to lazily compute stack traces.
6the way. Used to lazily compute stack traces.
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`taq` is a [`++trap`](), generally producing a list of [`++tank`]()s.
11+`taq` is a `++trap`, generally producing a list of `++tank`s.
12
12
13Produces
13Produces
14--------
14--------
@@ -20,14 +20,15 @@ Source
20
20
21 ++ mule :: typed virtual
21 ++ mule :: typed virtual
22 ~/ %mule
22 ~/ %mule
23− |* taq=_|.(_*)
23+ |* taq/_|.(**)
24 =+ mud=(mute taq)
24 =+ mud=(mute taq)
25 ?- -.mud
25 ?- -.mud
26− & [%& p=$:taq]
26+ $& [%& p=$:taq] :: XX transition
27− | [%| p=p.mud]
27+ $| [%| p=p.mud]
28 ==
28 ==
29 ::
29 ::
30
30
31+
31Examples
32Examples
32--------
33--------
33
34
docs/system/hoon/library/src/4n/gate/mute.md+10−21
@@ -3,32 +3,32 @@
3Untyped virtual
3Untyped virtual
4
4
5Kicks a `++trap`, producing its result as a noun or the tanks of any
5Kicks a `++trap`, producing its result as a noun or the tanks of any
6−error that occurs. Similar to [`++mule`](), but preserves no type
6+error that occurs. Similar to `++mule`, but preserves no type
7information.
7information.
8
8
9Accepts
9Accepts
10-------
10-------
11
11
12−`taq` is a [`++trap`](/doc/hoon/library/1#++trap).
12+`taq` is a `++trap`.
13−
14Produces
13Produces
15--------
14--------
16
15
17−Either a noun or a [`++list`]() of [`++tank`]().
16+Either a noun or a `++list` of `++tank`.
18
17
19Source
18Source
20------
19------
21
20
22 ++ mute :: untyped virtual
21 ++ mute :: untyped virtual
23− |= taq=_^?(|.(_*))
22+ |= taq/_^?(|.(**))
24− ^- (each ,* (list tank))
23+ ^- (each * (list tank))
25− =+ ton=(mock [taq 9 2 0 1] |=(* ~))
24+ =+ ton=(mock [taq 9 2 0 1] |=({* *} ~))
26 ?- -.ton
25 ?- -.ton
27− %0 [%& p.ton]
26+ $0 [%& p.ton]
28− %1 [%| (turn p.ton |=(a=* (smyt (path a))))]
27+ $1 [%| (turn p.ton |=(a/* (smyt (path a))))]
29− %2 [%| p.ton]
28+ $2 [%| p.ton]
30 ==
29 ==
31
30
31+
32Examples
32Examples
33--------
33--------
34
34
@@ -36,17 +36,6 @@ Examples
36 [%.y p=[1.717.658.988 104 101 108 108 111 0]]
36 [%.y p=[1.717.658.988 104 101 108 108 111 0]]
37 ~zod/try=> (mute |.(!!))
37 ~zod/try=> (mute |.(!!))
38 [%.n p=~]
38 [%.n p=~]
39− ~zod/try=> (mute |.(.^(a//=pals/1)))
40− [ %.n
41− p
42− ~[
43− [ %rose
44− p=[p="/" q="/" r="/"]
45− q=[i=[%leaf p="a"] t=[i=[%leaf p="~zod"] t=[i=[%leaf p="pals"] t=[i=[%leaf p="1"] t=~]]]]
46− ]
47− ]
48− ]
49−
50
39
51
40
52***
41***
docs/system/hoon/library/src/5f/mold/mane.md+2−2
@@ -3,7 +3,7 @@
3XML name
3XML name
4
4
5An XML name (tag name or attribute name) with an optional namespace. Parsed by
5An XML name (tag name or attribute name) with an optional namespace. Parsed by
6−[`++name`]() within [`++poxa`](), rendered by [`++name`]() within `++poxo`.
6+`++name` within `++poxa`, rendered by `++name` within `++poxo`.
7
7
8Source
8Source
9------
9------
@@ -13,7 +13,7 @@ Source
13Examples
13Examples
14--------
14--------
15
15
16−See also: [`++sail`]()
16+See also: `++sail`
17
17
18 ~zod/try=> *mane
18 ~zod/try=> *mane
19 %$
19 %$
docs/system/hoon/library/src/5f/mold/manx.md+3−3
@@ -2,17 +2,17 @@
2
2
3XML node.
3XML node.
4
4
5−Parsed by [`++apex`]() within [`++poxa`](), rendered by [`++poxo`]().
5+Parsed by `++apex` within `++poxa`, rendered by `++poxo`.
6
6
7Source
7Source
8------
8------
9
9
10− ++ manx ,[g=marx c=marl] :: XML node
10+ ++ manx {g/marx c/marl} :: XML node
11
11
12Examples
12Examples
13--------
13--------
14
14
15−See also: [`++sail`]() doc
15+See also: `++sail` doc
16
16
17
17
18
18
docs/system/hoon/library/src/5f/mold/mars.md+3−2
@@ -2,12 +2,13 @@
2
2
3XML CDATA
3XML CDATA
4
4
5−Implicitly produced by [`++chrd`]() within [`++poxa`]()
5+Implicitly produced by `++chrd` within `++poxa`
6
6
7Source
7Source
8------
8------
9
9
10− ++ mars ,[t=[n=%$ a=[i=[n=%$ v=tape] t=~]] c=~] :: XML cdata
10+ ++ mars {t/{n/$$ a/{i/{n/$$ v/tape} t/$~}} c/$~} :: XML cdata
11+
11
12
12Examples
13Examples
13--------
14--------
docs/system/hoon/library/src/5f/mold/mart.md+4−4
@@ -2,15 +2,15 @@
2
2
3List of XML attributes
3List of XML attributes
4
4
5−Each `++mart` is a list of pairs of [`++mane`]() and
5+Each `++mart` is a list of pairs of `++mane` and
6−[`++tape`]().
6+`++tape`.
7
7
8−Parsed by [`++attr`]() within [`++poxa`](), rendered by `++attr` within [`++poxo`]()
8+Parsed by `++attr` within `++poxa`, rendered by `++attr` within `++poxo`
9
9
10Source
10Source
11------
11------
12
12
13− ++ mart (list ,[n=mane v=tape]) :: XML attributes
13+ ++ mart (list {n/mane v/tape}) :: XML attributes
14
14
15Examples
15Examples
16--------
16--------
docs/system/hoon/library/src/5f/mold/marx.md+2−2
@@ -3,12 +3,12 @@
3XML tag
3XML tag
4
4
5A `++marx` is a pair of a tag name, `++mane` and a list of attributes,
5A `++marx` is a pair of a tag name, `++mane` and a list of attributes,
6−`++mart`. Parsed by [`++head`]() `++poxa`, rendered within `++poxo`.
6+`++mart`. Parsed by `++head` `++poxa`, rendered within `++poxo`.
7
7
8Source
8Source
9------
9------
10
10
11− ++ marx ,[n=mane a=mart] :: XML tag
11+ ++ marx {n/mane a/mart} :: XML tag
12
12
13Examples
13Examples
14--------
14--------
docs/system/hoon/library/src/5f/mold/ring.md+1−1
@@ -7,7 +7,7 @@ Used primarily in crypto.
7Source
7Source
8------
8------
9
9
10− ++ ring ,@ :: private key
10+ ++ ring @ :: private key
11
11
12
12
13
13
docs/system/hoon/library/src/5f/mold/time.md+2−2
@@ -7,12 +7,12 @@ The `@da` odor designates an absolute date atom.
7Source
7Source
8------
8------
9
9
10− ++ time ,@da :: galactic time
10+ ++ time @da :: galactic time
11
11
12Examples
12Examples
13--------
13--------
14
14
15−See also: [`++date`](), [odor reference]()
15+See also: `++date`, odor reference
16
16
17 ~zod/try=> `time`-<-
17 ~zod/try=> `time`-<-
18 ~2014.9.25..20.01.47..eeac
18 ~2014.9.25..20.01.47..eeac