on master help sign in
thru 4f
commit9d440656164c65272b7b8619b87de99ee0874d0e authorHenry Ault <henry@tlon.io> dateMon 21 Mar 2016, 15:34 (11 years ago) parentf167964
42 files changed+222−198
docs/system/hoon/library/src/2p/gate/cue.md+6−6 docs/system/hoon/library/src/2p/gate/jam.md+4−4 docs/system/hoon/library/src/2p/gate/mat.md+4−3 docs/system/hoon/library/src/2p/gate/rub.md+2−2 docs/system/hoon/library/src/4d/gate/last.md+4−5 docs/system/hoon/library/src/4d/gate/lust.md+4−3 docs/system/hoon/library/src/4e/gate/bend.md+14−14 docs/system/hoon/library/src/4e/gate/comp.md+9−8 docs/system/hoon/library/src/4e/gate/fail.md+3−3 docs/system/hoon/library/src/4e/gate/glue.md+3−3 docs/system/hoon/library/src/4e/gate/less.md+4−4 docs/system/hoon/library/src/4e/gate/pfix.md+3−4 docs/system/hoon/library/src/4e/gate/plug.md+3−3 docs/system/hoon/library/src/4e/gate/pose.md+6−4 docs/system/hoon/library/src/4e/gate/sfix.md+3−2 docs/system/hoon/library/src/4e/gate/simu.md+3−3 docs/system/hoon/library/src/4f/gate/bass.md+9−7 docs/system/hoon/library/src/4f/gate/boss.md+9−7 docs/system/hoon/library/src/4f/gate/cold.md+6−7 docs/system/hoon/library/src/4f/gate/cook.md+6−6 docs/system/hoon/library/src/4f/gate/easy.md+2−2 docs/system/hoon/library/src/4f/gate/full.md+2−2 docs/system/hoon/library/src/4f/gate/funk.md+4−5 docs/system/hoon/library/src/4f/gate/here.md+6−6 docs/system/hoon/library/src/4f/gate/ifix.md+7−3 docs/system/hoon/library/src/4f/gate/jest.md+7−7 docs/system/hoon/library/src/4f/gate/just.md+4−4 docs/system/hoon/library/src/4f/gate/knee.md+5−5 docs/system/hoon/library/src/4f/gate/mask.md+5−5 docs/system/hoon/library/src/4f/gate/more.md+3−2 docs/system/hoon/library/src/4f/gate/most.md+3−2 docs/system/hoon/library/src/4f/gate/next.md+3−3 docs/system/hoon/library/src/4f/gate/plus.md+4−3 docs/system/hoon/library/src/4f/gate/sear.md+7−7 docs/system/hoon/library/src/4f/gate/shim.md+4−4 docs/system/hoon/library/src/4f/gate/slug.md+7−5 docs/system/hoon/library/src/4f/gate/stag.md+3−3 docs/system/hoon/library/src/4f/gate/star.md+4−4 docs/system/hoon/library/src/4f/gate/stet.md+1−1 docs/system/hoon/library/src/4f/gate/stew.md+8−6 docs/system/hoon/library/src/4f/gate/stir.md+19−12 docs/system/hoon/library/src/4f/gate/stun.md+9−9
docs/system/hoon/library/src/2p/gate/cue.md+6−6
@@ -7,24 +7,24 @@ Produces a noun unpacked from atom `a`. The inverse of jam.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212Produces
1313--------
1414
15−A [`++noun`]().
15+A `++noun`.
1616
1717Source
1818------
1919
20− ++ cue :: unpack atom to noun
20+ ++ cue :: unpack
2121 ~/ %cue
22− |= a=@
22+ |= a/@
2323 ^- *
2424 =+ b=0
25− =+ m=`(map ,@ ,*)`~
25+ =+ m=`(map @ *)`~
2626 =< q
27− |- ^- [p=@ q=* r=_m]
27+ |- ^- {p/@ q/* r/(map @ *)}
2828 ?: =(0 (cut 0 [b 1] a))
2929 =+ c=(rub +(b) a)
3030 [+(p.c) q.c (~(put by m) b q.c)]
docs/system/hoon/library/src/2p/gate/jam.md+4−4
@@ -7,7 +7,7 @@ Produces an atom unpacked from noun `a`. The inverse of cue.
77Accepts
88-------
99
10−`a` is a [noun]().
10+`a` is a noun.
1111
1212Produces
1313--------
@@ -19,12 +19,12 @@ Source
1919
2020 ++ jam :: pack
2121 ~/ %jam
22− |= a=*
22+ |= a/*
2323 ^- @
2424 =+ b=0
25− =+ m=`(map ,* ,@)`~
25+ =+ m=`(map * @)`~
2626 =< q
27− |- ^- [p=@ q=@ r=_m]
27+ |- ^- {p/@ q/@ r/(map * @)}
2828 =+ c=(~(get by m) a)
2929 ?~ c
3030 => .(m (~(put by m) a b))
docs/system/hoon/library/src/2p/gate/mat.md+4−3
@@ -19,16 +19,17 @@ A cell of two atoms, `p` and `q`.
1919Source
2020------
2121
22− ++ mat :: length-encode
22+ ++ mat :: length-encode
2323 ~/ %mat
24− |= a=@
25− ^- [p=@ q=@]
24+ |= a/@
25+ ^- {p/@ q/@}
2626 ?: =(0 a)
2727 [1 1]
2828 =+ b=(met 0 a)
2929 =+ c=(met 0 b)
3030 :- (add (add c c) b)
3131 (cat 0 (bex c) (mix (end 0 (dec c) b) (lsh 0 (dec c) a)))
32+ ::
3233
3334
3435Examples
docs/system/hoon/library/src/2p/gate/rub.md+2−2
@@ -24,8 +24,8 @@ Source
2424
2525 ++ rub :: length-decode
2626 ~/ %rub
27− |= [a=@ b=@]
28− ^- [p=@ q=@]
27+ |= {a/@ b/@}
28+ ^- {p/@ q/@}
2929 =+ ^= c
3030 =+ [c=0 m=(met 0 b)]
3131 |- ?< (gth c m)
docs/system/hoon/library/src/4d/gate/last.md+4−5
@@ -2,15 +2,15 @@
22
33Farther trace
44
5−Compares two line-column pairs, called [`++hair`]()s, `zyc` and `naz`, producing whichever
5+Compares two line-column pairs, called `++hair`s, `zyc` and `naz`, producing whichever
66is further along.
77
88Accepts
99-------
1010
11−`naz` is a [hair]().
11+`naz` is a hair.
1212
13−`zyc` is a [hair]().
13+`zyc` is a hair.
1414
1515Produces
1616--------
@@ -20,12 +20,11 @@ a `++hair`.
2020Source
2121------
2222
23− ++ last |= [zyc=hair naz=hair] :: farther trace
23+ ++ last |= {zyc/hair naz/hair} :: farther trace
2424 ^- hair
2525 ?: =(p.zyc p.naz)
2626 ?:((gth q.zyc q.naz) zyc naz)
2727 ?:((gth p.zyc p.naz) zyc naz)
28− ::
2928
3029
3130Examples
docs/system/hoon/library/src/4d/gate/lust.md+4−3
@@ -3,7 +3,7 @@
33
44Detect newline
55
6−Advances the [`++hair`]() `naz` by a row if the [`++char`]() `weq` is a newline, or by a
6+Advances the `++hair` `naz` by a row if the `++char` `weq` is a newline, or by a
77column if `weq` is any other character.
88
99Accepts
@@ -21,9 +21,10 @@ A hair.
2121Source
2222------
2323
24− ++ lust |= [weq=char naz=hair] :: detect newline
24+ ++ lust |= {weq/char naz/hair} :: detect newline
2525 ^- hair
26− ?:(=(10 weq) [+(p.naz) 1] [p.naz +(q.naz)])
26+ ?:(=(`@`10 weq) [+(p.naz) 1] [p.naz +(q.naz)])
27+
2728
2829
2930Examples
docs/system/hoon/library/src/4e/gate/bend.md+14−14
@@ -2,8 +2,8 @@
22
33Conditional composer
44
5−Parsing composer: connects the [`++edge`]() `vex` with the subsequent [`++rule`]() `sab`
6−as an optional suffix, using [gate]() `raq` to compose or reject its
5+Parsing composer: connects the `++edge` `vex` with the subsequent `++rule` `sab`
6+as an optional suffix, using gate `raq` to compose or reject its
77result. If there is no suffix, or if the suffix fails to be composed
88with the current result, the current result is produced. Used to map a
99group of rules to a specified output.
@@ -11,25 +11,25 @@ group of rules to a specified output.
1111Accepts
1212-------
1313
14−`raq` is a [gate]().
14+`raq` is a gate.
1515
16−`sab` is a [rule]().
16+`sab` is a rule.
1717
18−`vex` is an [edge]().
18+`vex` is an edge.
1919
2020Produces
2121--------
2222
23−A [`++rule`]().
23+A `++rule`.
2424
2525Source
2626------
2727
2828 ++ bend :: conditional comp
2929 ~/ %bend
30− |* raq=_|*([a=* b=*] [~ u=[a b]])
30+ |* raq/_|*({a/* b/*} [~ u=[a b]])
3131 ~/ %fun
32− |* [vex=edge sab=_rule]
32+ |* {vex/edge sab/rule}
3333 ?~ q.vex
3434 vex
3535 =+ yit=(sab q.u.q.vex)
@@ -45,18 +45,18 @@ Source
4545Examples
4646--------
4747
48− ~zod/try=> (;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qs")
48+ ~zod/try=> (;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qs")
4949 [p=[p=1 q=3] q=[~ u=[p=~~q q=[p=[p=1 q=2] q="s"]]]]
50− ~zod/try=> (;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qqq")
50+ ~zod/try=> (;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qqq")
5151 [p=[p=1 q=3] q=[~ u=[p=~~r q=[p=[p=1 q=3] q="q"]]]]
52− ~zod/try=> (scan "aa" ;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn))
52+ ~zod/try=> (scan "aa" ;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn))
5353 ~~b
54− ~zod/try=> (scan "ba" ;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn))
54+ ~zod/try=> (scan "ba" ;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn))
5555 ! {1 3}
5656 ! exit
57− ~zod/try=> `(unit ,@tas)`(scan "" ;~((bend) (easy ~) sym))
57+ ~zod/try=> `(unit @tas)`(scan "" ;~((bend) (easy ~) sym))
5858 ~
59− ~zod/try=> `(unit ,@tas)`(scan "sep" ;~((bend) (easy ~) sym))
59+ ~zod/try=> `(unit @tas)`(scan "sep" ;~((bend) (easy ~) sym))
6060 [~ %sep]
6161
6262
docs/system/hoon/library/src/4e/gate/comp.md+9−8
@@ -2,14 +2,14 @@
22
33Arbitrary compose
44
5−Parsing composer: connects the [`++edge`]() `vex` with a following [`++rule`]() `sab`,
5+Parsing composer: connects the `++edge` `vex` with a following `++rule` `sab`,
66combining the contents of `vex` with the result of `sab` using a binary
7−[gate]() `raq`. Used to fold over the results of several `++rules`.
7+gate `raq`. Used to fold over the results of several `++rules`.
88
99Accepts
1010-------
1111
12−`raq` is a gate that accepts a cell of two [nouns](), `a` and `b`, and
12+`raq` is a gate that accepts a cell of two nouns, `a` and `b`, and
1313produces a cell of two nouns.
1414
1515`sab` is a rule.
@@ -19,16 +19,17 @@ produces a cell of two nouns.
1919Produces
2020--------
2121
22−A [`++rule`]().
22+A `++rule`.
2323
2424Source
2525------
2626
2727 ++ comp
2828 ~/ %comp
29− |* raq=_|*([a=* b=*] [a b]) :: arbitrary compose
29+ |* raq/_|*({a/* b/*} [a b]) :: arbitrary compose
3030 ~/ %fun
31− |* [vex=edge sab=_rule]
31+ |* {vex/edge sab/rule}
32+ ~! +<
3233 ?~ q.vex
3334 vex
3435 =+ yit=(sab q.u.q.vex)
@@ -41,9 +42,9 @@ Source
4142Examples
4243--------
4344
44− ~zod/try=> (scan "123" ;~((comp |=([a=@u b=@u] (add a b))) dit dit dit))
45+ ~zod/try=> (scan "123" ;~((comp |=([a/@u b/@u] (add a b))) dit dit dit))
4546 6
46− ~zod/try=> (scan "12" ;~((comp |=([a=@u b=@u] (add a b))) dit dit dit))
47+ ~zod/try=> (scan "12" ;~((comp |=([a/@u b/@u] (add a b))) dit dit dit))
4748 ! {1 3}
4849 ! exit
4950
docs/system/hoon/library/src/4e/gate/fail.md+3−3
@@ -2,13 +2,13 @@
22
33Never parse
44
5−Produces an [`++edge`]() at the same text position ([`++hair`]()) with a failing
5+Produces an `++edge` at the same text position (`++hair`) with a failing
66result (`q=~`).
77
88Accepts
99-------
1010
11−`tub` is a [`++nail`]().
11+`tub` is a `++nail`.
1212
1313Produces
1414--------
@@ -18,7 +18,7 @@ An `++edge`.
1818Source
1919------
2020
21− ++ fail |=(tub=nail [p=p.tub q=~]) :: never parse
21+ ++ fail |=(tub/nail [p=p.tub q=~]) :: never parse
2222
2323Examples
2424--------
docs/system/hoon/library/src/4e/gate/glue.md+3−3
@@ -2,7 +2,7 @@
22
33Skip delimiter
44
5−Parsing composer: connects an [`++edge`]() `vex` with a following [`++rule`]() `sab` by
5+Parsing composer: connects an `++edge` `vex` with a following `++rule` `sab` by
66parsing the `++rule` `bus` (the delimiting symbol) and throwing out the
77result.
88
@@ -25,9 +25,9 @@ Source
2525
2626 ++ glue :: add rule
2727 ~/ %glue
28− |* bus=_rule
28+ |* bus/rule
2929 ~/ %fun
30− |* [vex=edge sab=_rule]
30+ |* {vex/edge sab/rule}
3131 (plug vex ;~(pfix bus sab))
3232 ::
3333
docs/system/hoon/library/src/4e/gate/less.md+4−4
@@ -2,8 +2,8 @@
22
33Parse unless
44
5−Parsing composer: if an [`++edge`]() `vex` reflects a success, fail. Otherwise,
6−connect `vex` with the following [`++rule`]().
5+Parsing composer: if an `++edge` `vex` reflects a success, fail. Otherwise,
6+connect `vex` with the following `++rule`.
77
88Accepts
99-------
@@ -21,11 +21,11 @@ Source
2121------
2222
2323 ++ less :: no first and second
24− |* [vex=edge sab=_rule]
24+ |* {vex/edge sab/rule}
2525 ?~ q.vex
2626 =+ roq=(sab)
2727 [p=(last p.vex p.roq) q=q.roq]
28− vex(q ~)
28+ (fail +<.sab)
2929 ::
3030
3131Examples
docs/system/hoon/library/src/4e/gate/pfix.md+3−4
@@ -2,13 +2,13 @@
22
33Discard first rule
44
5−Parsing composer: connects an [`++edge`]() `vex` with two subsequent [`++rule`]()s,
5+Parsing composer: connects an `++edge` `vex` with two subsequent `++rule`s,
66ignoring the result of the first and producing the result of the second.
77
88Accepts
99-------
1010
11−`vex` is an [edge]().
11+`vex` is an edge.
1212
1313Produces
1414--------
@@ -20,8 +20,7 @@ Source
2020
2121 ++ pfix :: discard first rule
2222 ~/ %pfix
23− (comp |*([a=* b=*] b))
24− ::
23+ (comp |*({a/* b/*} b))
2524
2625Examples
2726--------
docs/system/hoon/library/src/4e/gate/plug.md+3−3
@@ -2,8 +2,8 @@
22
33Parse to tuple
44
5−Parsing composer: connects an [`++edge`]() `vex` with a following [`++rule`]() `sab`, producing
6−a cell of both the results. See also: the monad applicator [;\~]() for a
5+Parsing composer: connects an `++edge` `vex` with a following `++rule` `sab`, producing
6+a cell of both the results. See also: the monad applicator ;\~ for a
77more detailed explanation.
88
99Accepts
@@ -23,7 +23,7 @@ Source
2323
2424 ++ plug :: first then second
2525 ~/ %plug
26− |* [vex=edge sab=_rule]
26+ |* {vex/edge sab/rule}
2727 ?~ q.vex
2828 vex
2929 =+ yit=(sab q.u.q.vex)
docs/system/hoon/library/src/4e/gate/pose.md+6−4
@@ -3,14 +3,14 @@
33Parse options
44
55Parsing composer: if `vex` reflects a failure, connect it with the
6−following rule `sab`. See also: the monad applicator [;\~]()
6+following rule `sab`. See also: the monad applicator ;\~
77
88Accepts
99-------
1010
11−`sab` is a [`++rule`]().
11+`sab` is a `++rule`.
1212
13−`vex` is an [`++edge`]().
13+`vex` is an `++edge`.
1414
1515Produces
1616--------
@@ -22,11 +22,13 @@ Source
2222
2323 ++ pose :: first or second
2424 ~/ %pose
25− |* [vex=edge sab=_rule]
25+ |* {vex/edge sab/rule}
2626 ?~ q.vex
2727 =+ roq=(sab)
2828 [p=(last p.vex p.roq) q=q.roq]
2929 vex
30+ ::
31+
3032
3133Examples
3234--------
docs/system/hoon/library/src/4e/gate/sfix.md+3−2
@@ -2,7 +2,7 @@
22
33Discard second rule
44
5−Parsing composer: connects [`++edge`]()s `vex` with two subsequent [`++rule`]()s returning the
5+Parsing composer: connects `++edge`s `vex` with two subsequent `++rule`s returning the
66result of the first and discarding the result of the second.
77
88Accepts
@@ -22,7 +22,8 @@ Source
2222
2323 ++ sfix :: discard second rule
2424 ~/ %sfix
25− (comp |*([a=* b=*] a))
25+ (comp |*({a/* b/*} a))
26+
2627
2728Examples
2829--------
docs/system/hoon/library/src/4e/gate/simu.md+3−3
@@ -2,8 +2,8 @@
22
33First and second
44
5−Parsing composer: if an [`++edge`]() `vex` reflects a failure, fail. Otherwise,
6−connect `vex` with the following [`++rule`]().
5+Parsing composer: if an `++edge` `vex` reflects a failure, fail. Otherwise,
6+connect `vex` with the following `++rule`.
77
88Accepts
99-------
@@ -21,7 +21,7 @@ Source
2121------
2222
2323 ++ simu :: first and second
24− |* [vex=edge sab=_rule]
24+ |* {vex/edge sab/rule}
2525 ?~ q.vex
2626 vex
2727 =+ roq=(sab)
docs/system/hoon/library/src/4f/gate/bass.md+9−7
@@ -1,31 +1,33 @@
11### `++bass`
22
3−Parser modifier: [LSB](http://en.wikipedia.org/wiki/Least_significant_bit)
4−ordered [`++list`]() as atom of a [`++base`]().
3+Parser modifier: LSB
4+ordered `++list` as atom of a `++base`.
55
66Accepts
77-------
88
99`wuc` is an atom.
1010
11−`tyd` is a [`++rule`]().
11+`tyd` is a `++rule`.
1212
1313Produces
1414--------
1515
16−A [`++rule`]().
16+A `++rule`.
1717
1818Source
1919------
2020
2121 ++ bass
22− |* [wuc=@ tyd=_rule]
22+ |* {wuc/@ tyd/rule}
2323 %+ cook
24− |= waq=(list ,@)
24+ |= waq/(list @)
2525 %+ roll
2626 waq
27− =|([p=@ q=@] |.((add p (mul wuc q))))
27+ =|({p/@ q/@} |.((add p (mul wuc q))))
2828 tyd
29+ ::
30+
2931
3032Examples
3133--------
docs/system/hoon/library/src/4f/gate/boss.md+9−7
@@ -1,32 +1,34 @@
11
22### `++boss`
33
4−Parser modifier: [LSB](http://en.wikipedia.org/wiki/Least_significant_bit)
5−ordered [`++list`]() as atom of a [`++base`]().
4+Parser modifier: LSB
5+
6+Ordered `++list` as atom of a `++base`.
67
78Accepts
89-------
910
1011`wuc` is an atom.
1112
12−`tyd` is a [`++rule`]().
13+`tyd` is a `++rule`.
1314
1415Produces
1516--------
1617
17−A [`++rule`]().
18+A `++rule`.
1819
1920Source
2021------
2122
2223 ++ boss
23− |* [wuc=@ tyd=_rule]
24+ |* {wuc/@ tyd/rule}
2425 %+ cook
25− |= waq=(list ,@)
26+ |= waq/(list @)
2627 %+ reel
2728 waq
28− =|([p=@ q=@] |.((add p (mul wuc q))))
29+ =|({p/@ q/@} |.((add p (mul wuc q))))
2930 tyd
31+ ::
3032
3133Examples
3234--------
docs/system/hoon/library/src/4f/gate/cold.md+6−7
@@ -2,34 +2,33 @@
22
33Replace with constant
44
5−Parser modifier. Accepts a [`++rule`]() `sef` and produces a parser that
5+Parser modifier. Accepts a `++rule` `sef` and produces a parser that
66produces a constant `cus`, assuming `sef` is successful.
77
88Accepts
99-------
1010
11−`cus` is a constant [noun]().
11+`cus` is a constant noun.
1212
1313`sef` is a `++rule`.
1414
1515Produces
1616--------
1717
18−An [`++edge`]().
18+An `++edge`.
1919
2020Source
2121------
2222
23− ++ cold :: replace w/ constant
23+ ++ cold :: replace w+ constant
2424 ~/ %cold
25− |* [cus=* sef=_rule]
25+ |* {cus/* sef/rule}
2626 ~/ %fun
27− |= tub=nail
27+ |= tub/nail
2828 =+ vex=(sef tub)
2929 ?~ q.vex
3030 vex
3131 [p=p.vex q=[~ u=[p=cus q=q.u.q.vex]]]
32− ::
3332
3433Examples
3534--------
docs/system/hoon/library/src/4f/gate/cook.md+6−6
@@ -3,28 +3,28 @@
33Apply gate
44
55Parser modifier. Produces a parser that takes a (successful) result of a
6−[`++rule`]() `sef` and slams it through `poq`.
6+`++rule` `sef` and slams it through `poq`.
77
88Accepts
99-------
1010
11−`poq` is a [gate]().
11+`poq` is a gate.
1212
13−`sef` is a [`++rule`]().
13+`sef` is a `++rule`.
1414
1515Produces
1616--------
1717
18−An [`++rule`]().
18+An `++rule`.
1919
2020Source
2121------
2222
2323 ++ cook :: apply gate
2424 ~/ %cook
25− |* [poq=_,* sef=_rule]
25+ |* {poq/$-(* *) sef/rule}
2626 ~/ %fun
27− |= tub=nail
27+ |= tub/nail
2828 =+ vex=(sef tub)
2929 ?~ q.vex
3030 vex
docs/system/hoon/library/src/4f/gate/easy.md+2−2
@@ -2,7 +2,7 @@
22
33Always parse
44
5−Parser generator. Produces a parser that succeeds with given [noun]() `huf`
5+Parser generator. Produces a parser that succeeds with given noun `huf`
66without consuming any text.
77
88Accepts
@@ -13,7 +13,7 @@ Accepts
1313Produces
1414--------
1515
16−A [`++rule`]().
16+A `++rule`.
1717
1818Source
1919------
docs/system/hoon/library/src/4f/gate/full.md+2−2
@@ -2,13 +2,13 @@
22
33Parse to end
44
5−Parser modifier. Accepts a [`++rule`]() `sef`, and produces a parser that succeeds only
5+Parser modifier. Accepts a `++rule` `sef`, and produces a parser that succeeds only
66when the of `tub` is fully consumed using `sef`.
77
88Accepts
99-------
1010
11−`sef` is a [`++rule`]().
11+`sef` is a `++rule`.
1212
1313Produces
1414--------
docs/system/hoon/library/src/4f/gate/funk.md+4−5
@@ -2,14 +2,14 @@
22
33Add to tape
44
5−Parser modifier: prepend text to [`++tape`]() before applying parser.
5+Parser modifier: prepend text to `++tape` before applying parser.
66
77Accepts
88-------
99
1010`pre` is a `++tape`
1111
12−`sef` is a [`++rule`]()
12+`sef` is a `++rule`
1313
1414Produces
1515--------
@@ -20,10 +20,9 @@ Source
2020------
2121
2222 ++ funk :: add to tape first
23− |* [pre=tape sef=_rule]
24− |= tub=nail
23+ |* {pre/tape sef/rule}
24+ |= tub/nail
2525 (sef p.tub (weld pre q.tub))
26− ::
2726
2827Examples
2928--------
docs/system/hoon/library/src/4f/gate/here.md+6−6
@@ -2,16 +2,16 @@
22
33Place-based apply
44
5−Parser modifier. Similar to [`++cook`]() in that it produces a parser that takes a
5+Parser modifier. Similar to `++cook` in that it produces a parser that takes a
66(successful) result of `sef` and slams it through `hez`. `hez` accepts a
7−[`++pint`]() `a` and a [noun]() `b`, which is what the parser parsed.
7+`++pint` `a` and a noun `b`, which is what the parser parsed.
88
99Accepts
1010-------
1111
12−`hez` is a [gate]().
12+`hez` is a gate.
1313
14−`sef` is a [`++rule`]()
14+`sef` is a `++rule`
1515
1616Produces
1717--------
@@ -23,9 +23,9 @@ Source
2323
2424 ++ here :: place-based apply
2525 ~/ %here
26− |* [hez=_|=([a=pint b=*] [a b]) sef=_rule]
26+ |* {hez/_|=({a/pint b/*} [a b]) sef/rule}
2727 ~/ %fun
28− |= tub=nail
28+ |= tub/nail
2929 =+ vex=(sef tub)
3030 ?~ q.vex
3131 vex
docs/system/hoon/library/src/4f/gate/ifix.md+7−3
@@ -2,7 +2,7 @@
22
33Infix
44
5−Parser modifier: surround with pair of [`++rule`]()s, the output of which is
5+Parser modifier: surround with pair of `++rule`s, the output of which is
66discarded.
77
88Accepts
@@ -21,8 +21,12 @@ Source
2121------
2222
2323 ++ ifix
24− |* [fel=[p=_rule q=_rule] hof=_rule]
25− ;~(pfix p.fel ;~(sfix hof q.fel))
24+ |* {fel/{rule rule} hof/rule}
25+ ~! +<
26+ ~! +<:-.fel
27+ ~! +<:+.fel
28+ ;~(pfix -.fel ;~(sfix hof +.fel))
29+ ::
2630
2731Examples
2832--------
docs/system/hoon/library/src/4f/gate/jest.md+7−7
@@ -7,24 +7,24 @@ Match and consume a cord.
77Accepts
88-------
99
10−`daf` is a [`@t`]().
10+`daf` is a `@t`.
1111
1212Produces
1313--------
1414
15−An [`++edge`]().
15+An `++edge`.
1616
1717Source
1818------
1919
2020 ++ jest :: match a cord
21− |= daf=@t
22− |= tub=nail
21+ |= daf/@t
22+ |= tub/nail
2323 =+ fad=daf
24− |- ^- (like ,@t)
25− ?: =(0 daf)
24+ |- ^- (like @t)
25+ ?: =(`@`0 daf)
2626 [p=p.tub q=[~ u=[p=fad q=tub]]]
27− ?: |(?=(~ q.tub) !=((end 3 1 daf) i.q.tub))
27+ ?: |(?=($~ q.tub) !=((end 3 1 daf) i.q.tub))
2828 (fail tub)
2929 $(p.tub (lust i.q.tub p.tub), q.tub t.q.tub, daf (rsh 3 1 daf))
3030 ::
docs/system/hoon/library/src/4f/gate/just.md+4−4
@@ -7,21 +7,21 @@ Match and consume a single character.
77Accepts
88-------
99
10−`daf` is a [`++char`]()
10+`daf` is a `++char`
1111
1212Produces
1313--------
1414
15−A [`++rule`]().
15+A `++rule`.
1616
1717Source
1818------
1919
2020 ++ just :: XX redundant, jest
2121 ~/ %just :: match a char
22− |= daf=char
22+ |= daf/char
2323 ~/ %fun
24− |= tub=nail
24+ |= tub/nail
2525 ^- (like char)
2626 ?~ q.tub
2727 (fail tub)
docs/system/hoon/library/src/4f/gate/knee.md+5−5
@@ -10,20 +10,20 @@ Accepts
1010
1111`gar` is a noun.
1212
13−`sef` is a [gate]() that accepts a [`++rule`]()
13+`sef` is a gate that accepts a `++rule`
1414
1515Produces
1616--------
1717
18−A [`++rule`]().
18+A `++rule`.
1919
2020Source
2121------
2222
2323 ++ knee :: callbacks
24− |* [gar=* sef=_|.(rule)]
25− |= tub=nail
26− ^- (like ,_gar)
24+ |* {gar/* sef/_|.(*rule)}
25+ |= tub/nail
26+ ^- (like _gar)
2727 ((sef) tub)
2828 ::
2929
docs/system/hoon/library/src/4f/gate/mask.md+5−5
@@ -8,25 +8,25 @@ characters.
88Accepts
99-------
1010
11−`bud` is a list of [`++char`]()
11+`bud` is a list of `++char`
1212
1313Produces
1414--------
1515
16−A [`++rule`]().
16+A `++rule`.
1717
1818Source
1919------
2020
2121 ++ mask :: match char in set
2222 ~/ %mask
23− |= bud=(list char)
23+ |= bud/(list char)
2424 ~/ %fun
25− |= tub=nail
25+ |= tub/nail
2626 ^- (like char)
2727 ?~ q.tub
2828 (fail tub)
29− ?. (lien bud |=(a=char =(i.q.tub a)))
29+ ?. (lien bud |=(a/char =(i.q.tub a)))
3030 (fail tub)
3131 (next tub)
3232 ::
docs/system/hoon/library/src/4f/gate/more.md+3−2
@@ -2,7 +2,7 @@
22
33Parse list with delimiter
44
5−Parser modifier: Parse a list of matches using a delimiter [`++rule`]().
5+Parser modifier: Parse a list of matches using a delimiter `++rule`.
66
77Accepts
88-------
@@ -20,8 +20,9 @@ Source
2020------
2121
2222 ++ more
23− |* [bus=_rule fel=_rule]
23+ |* {bus/rule fel/rule}
2424 ;~(pose (most bus fel) (easy ~))
25+ ::
2526
2627Examples
2728--------
docs/system/hoon/library/src/4f/gate/most.md+3−2
@@ -2,7 +2,7 @@
22
33Parse list of at least one match
44
5−Parser modifier: parse a [`++list`]() of at least one match using a delimiter [`++rule`]().
5+Parser modifier: parse a `++list` of at least one match using a delimiter `++rule`.
66
77Accepts
88-------
@@ -20,8 +20,9 @@ Source
2020------
2121
2222 ++ most
23− |* [bus=_rule fel=_rule]
23+ |* {bus/rule fel/rule}
2424 ;~(plug fel (star ;~(pfix bus fel)))
25+ ::
2526
2627Examples
2728--------
docs/system/hoon/library/src/4f/gate/next.md+3−3
@@ -7,18 +7,18 @@ Consume any character, producing it as a result.
77Accepts
88-------
99
10−`tub` is a [`++nail`]()
10+`tub` is a `++nail`
1111
1212Produces
1313--------
1414
15−An [`++edge`]().
15+An `++edge`.
1616
1717Source
1818------
1919
2020 ++ next :: consume a char
21− |= tub=nail
21+ |= tub/nail
2222 ^- (like char)
2323 ?~ q.tub
2424 (fail tub)
docs/system/hoon/library/src/4f/gate/plus.md+4−3
@@ -3,12 +3,12 @@
33
44List of at least one match.
55
6−Parser modifier: parse [`++list`]() of at least one match.
6+Parser modifier: parse `++list` of at least one match.
77
88Accepts
99-------
1010
11−`fel` is a [`++rule`]().
11+`fel` is a `++rule`.
1212
1313Produces
1414--------
@@ -18,7 +18,8 @@ A `++rule`.
1818Source
1919------
2020
21− ++ plus |*(fel=_rule ;~(plug fel (star fel)))
21+ ++ plus |*(fel/rule ;~(plug fel (star fel)))
22+
2223
2324Examples
2425--------
docs/system/hoon/library/src/4f/gate/sear.md+7−7
@@ -2,25 +2,24 @@
22
33Conditional `++cook`
44
5−Conditional [`++cook`](). Slams the result through a gate that produces
5+Conditional `++cook`. Slams the result through a gate that produces
66a unit; if that unit is empty, fail.
77
88Accepts
99-------
1010
11−`tub` is a [`++nail`](/doc/hoon/library/1#++nail)
12−
11+`tub` is a `++nail`.
1312Produces
1413--------
1514
16−A [`++rule`]().
15+A `++rule`.
1716
1817Source
1918------
2019
2120 ++ sear :: conditional cook
22− |* [pyq=_|=(* *(unit)) sef=_rule]
23− |= tub=nail
21+ |* {pyq/$-(* (unit)) sef/rule}
22+ |= tub/nail
2423 =+ vex=(sef tub)
2524 ?~ q.vex
2625 vex
@@ -30,10 +29,11 @@ Source
3029 [p=p.vex q=[~ u=[p=u.gey q=q.u.q.vex]]]
3130 ::
3231
32+
3333Examples
3434--------
3535
36− ~zod/try=> ((sear |=(a=* ?@(a (some a) ~)) (just `a`)) [[1 1] "abc"])
36+ ~zod/try=> ((sear |=(a/* ?@(a (some a) ~)) (just `a`)) [[1 1] "abc"])
3737 [p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]]
3838 ~zod/try=> ((sear |=(* ~) (just 'a')) [[1 1] "abc"])
3939 [p=[p=1 q=2] q=~]
docs/system/hoon/library/src/4f/gate/shim.md+4−4
@@ -2,7 +2,7 @@
22
33Char in range
44
5−Match characters ([`++char`]()) within a range.
5+Match characters (`++char`) within a range.
66
77Accepts
88-------
@@ -14,16 +14,16 @@ Accepts
1414Produces
1515--------
1616
17−A [`++rule`]().
17+A `++rule`.
1818
1919Source
2020------
2121
2222 ++ shim :: match char in range
2323 ~/ %shim
24− |= [les=@ mos=@]
24+ |= {les/@ mos/@}
2525 ~/ %fun
26− |= tub=nail
26+ |= tub/nail
2727 ^- (like char)
2828 ?~ q.tub
2929 (fail tub)
docs/system/hoon/library/src/4f/gate/slug.md+7−5
@@ -2,13 +2,13 @@
22
33Use gate to parse delimited list
44
5−Parser modifier: By composing with a [gate](), parse a delimited [`++list`]() of
5+Parser modifier: By composing with a gate, parse a delimited `++list` of
66matches.
77
88Accepts
99-------
1010
11−`bus` is a [`++rule`]().
11+`bus` is a `++rule`.
1212
1313`fel` is a `++rule`.
1414
@@ -21,16 +21,18 @@ Source
2121------
2222
2323 ++ slug
24− |* raq=_|*([a=* b=*] [a b])
25− |* [bus=_rule fel=_rule]
24+ |* raq/_|*({a/* b/*} [a b])
25+ |* {bus/rule fel/rule}
2626 ;~((comp raq) fel (stir +<+.raq raq ;~(pfix bus fel)))
27+ ::
28+
2729
2830Examples
2931--------
3032
3133 ~zod/try=> (scan "20+5+110" ((slug add) lus dem))
3234 135
33− ~zod/try=> `@t`(scan "a b c" ((slug |=(a=[@ @t] (cat 3 a))) ace alp))
35+ ~zod/try=> `@t`(scan "a b c" ((slug |=(a/[@ @t] (cat 3 a))) ace alp))
3436 'abc'
3537
3638
docs/system/hoon/library/src/4f/gate/stag.md+3−3
@@ -14,16 +14,16 @@ Accepts
1414Produces
1515--------
1616
17−A [`++rule`]().
17+A `++rule`.
1818
1919Source
2020------
2121
2222 ++ stag :: add a label
2323 ~/ %stag
24− |* [gob=* sef=_rule]
24+ |* {gob/* sef/rule}
2525 ~/ %fun
26− |= tub=nail
26+ |= tub/nail
2727 =+ vex=(sef tub)
2828 ?~ q.vex
2929 vex
docs/system/hoon/library/src/4f/gate/star.md+4−4
@@ -2,19 +2,19 @@
22
33List of matches
44
5−Parser modifier: parse [`++list`]() of matches.
5+Parser modifier: parse `++list` of matches.
66
77Accepts
88-------
99
10−`fel` is a [`++rule`]().
10+`fel` is a `++rule`.
1111
1212Produces
1313--------
1414
1515 ++ star :: 0 or more times
16− |* fel=_rule
17− (stir `(list ,_(wonk *fel))`~ |*([a=* b=*] [a b]) fel)
16+ |* fel/rule
17+ (stir `(list _(wonk *fel))`~ |*({a/* b/*} [a b]) fel)
1818
1919Examples
2020--------
docs/system/hoon/library/src/4f/gate/stet.md+1−1
@@ -18,7 +18,7 @@ Source
1818------
1919
2020 ++ stet
21− |* leh=(list ,[?(@ [@ @]) _rule])
21+ |* leh/(list {?(@ {@ @}) rule})
2222 |-
2323 ?~ leh
2424 ~
docs/system/hoon/library/src/4f/gate/stew.md+8−6
@@ -4,14 +4,14 @@ Switch by first
44
55 ++ stew :: switch by first char
66 ~/ %stew
7− |* leh=(list ,[p=?(@ [@ @]) q=_rule]) :: char/range keys
7+ |* leh/(list {p/?(@ {@ @}) q/rule}) :: char+range keys
88 =+ ^= wor :: range complete lth
9− |= [ort=?(@ [@ @]) wan=?(@ [@ @])]
9+ |= {ort/?(@ {@ @}) wan/?(@ {@ @})}
1010 ?@ ort
1111 ?@(wan (lth ort wan) (lth ort -.wan))
1212 ?@(wan (lth +.ort wan) (lth +.ort -.wan))
1313 =+ ^= hel :: build parser map
14− =+ hel=`(tree $_(?>(?=(^ leh) i.leh)))`~
14+ =+ hel=`(tree _?>(?=(^ leh) i.leh))`~
1515 |- ^+ hel
1616 ?~ leh
1717 ~
@@ -31,7 +31,7 @@ Switch by first
3131 [n.yal l.yal nuc]
3232 [n.nuc [n.yal l.yal l.nuc] r.nuc]
3333 ~% %fun ..^$ ~
34− |= tub=nail
34+ |= tub/nail
3535 ?~ q.tub
3636 (fail tub)
3737 |-
@@ -47,8 +47,10 @@ Switch by first
4747 $(hel r.hel)
4848 ::
4949
50−Parser generator. From an associative [`++list`]() of characters or character
51−ranges to [`++rule`]()s, construct a [`++map`](), and parse [`++tape`]()s only
50+
51+
52+Parser generator. From an associative `++list` of characters or character
53+ranges to `++rule`s, construct a `++map`, and parse `++tape`s only
5254with `++rules` associated with a range that the `++tape`'s first character falls in.
5355
5456
docs/system/hoon/library/src/4f/gate/stir.md+19−12
@@ -2,7 +2,7 @@
22
33Parse repeatedly
44
5−Parse with [`++rule`]() as many times as possible, and fold over results with a
5+Parse with `++rule` as many times as possible, and fold over results with a
66binary gate.
77
88Accepts
@@ -22,19 +22,26 @@ A rule.
2222Source
2323------
2424
25−++ stir :: parse repeatedly
26− ~/ %stir
27− |* [rud=* raq=_|*([a=* b=*] [a b]) fel=_rule]
28− ~/ %fun
29− |= tub=nail
30− ^- (like ,_rud)
25+ ++ stun :: parse several times
26+ |* {lig/{@ @} fel/rule}
27+ |= tub/nail
28+ ^- (like (list _(wonk (fel))))
29+ ?: =(0 +.lig)
30+ [p.tub [~ ~ tub]]
3131 =+ vex=(fel tub)
3232 ?~ q.vex
33− [p.vex [~ rud tub]]
34− =+ wag=$(tub q.u.q.vex)
35− ?> ?=(^ q.wag)
36− [(last p.vex p.wag) [~ (raq p.u.q.vex p.u.q.wag) q.u.q.wag]]
37− ::
33+ ?: =(0 -.lig)
34+ [p.vex [~ ~ tub]]
35+ vex
36+ =+ ^= wag %= $
37+ -.lig ?:(=(0 -.lig) 0 (dec -.lig))
38+ +.lig ?:(=(0 +.lig) 0 (dec +.lig))
39+ tub q.u.q.vex
40+ ==
41+ ?~ q.wag
42+ wag
43+ [p.wag [~ [p.u.q.vex p.u.q.wag] q.u.q.wag]]
44+
3845
3946Examples
4047--------
docs/system/hoon/library/src/4f/gate/stun.md+9−9
@@ -9,30 +9,30 @@ Accepts
99
1010`[les=@ mos=@]` is a cell of atoms indicating the bounds.
1111
12−`fel` is a [`++rule`]().
12+`fel` is a `++rule`.
1313
1414Produces
1515--------
1616
17−A [`++rule`]().
17+A `++rule`.
1818
1919Source
2020------
2121
2222 ++ stun :: parse several times
23− |* [[les=@ mos=@] fel=_rule]
24− |= tub=nail
25− ^- (like (list ,_(wonk (fel))))
26− ?: =(0 mos)
23+ |* {lig/{@ @} fel/rule}
24+ |= tub/nail
25+ ^- (like (list _(wonk (fel))))
26+ ?: =(0 +.lig)
2727 [p.tub [~ ~ tub]]
2828 =+ vex=(fel tub)
2929 ?~ q.vex
30− ?: =(0 les)
30+ ?: =(0 -.lig)
3131 [p.vex [~ ~ tub]]
3232 vex
3333 =+ ^= wag %= $
34− les ?:(=(0 les) 0 (dec les))
35− mos ?:(=(0 mos) 0 (dec mos))
34+ -.lig ?:(=(0 -.lig) 0 (dec -.lig))
35+ +.lig ?:(=(0 +.lig) 0 (dec +.lig))
3636 tub q.u.q.vex
3737 ==
3838 ?~ q.wag