on master help sign in
thru 4c
commitf1679649d9a2a33486e5dfd3aa01e7862216c09d authorHenry Ault <henry@tlon.io> dateMon 21 Mar 2016, 13:06 (11 years ago) parent732920a
2 files changed+58−70
docs/system/hoon/library/src/4c/core/re.md+30−42 docs/system/hoon/library/src/4c/gate/show.md+28−28
docs/system/hoon/library/src/4c/core/re.md+30−42
@@ -2,7 +2,7 @@
22
33Pretty-printing engine
44
5−Pretty-printing engine that accepts a [`++tank`](/doc/hoon/library/1#++tank) [sample]() and contains arms that perform computation on it.
5+Pretty-printing engine that accepts a `++tank` sample and contains arms that perform computation on it.
66
77Accepts
88-------
@@ -13,24 +13,24 @@ Produces
1313--------
1414
1515 ++ re
16− |_ tac=tank
16+ |_ tac/tank
1717
1818Examples
1919--------
2020
21− /~zod/try=> ~(. re leaf/"ham")
22− <2.ghl [[%leaf ""] <414.gly 100.xkc 1.ypj %164>]>
21+ /~zod/try=> ~(. re leaf+"ham")
22+ <2.gdc {tac/{$leaf ""} <402.arm 110.jyx 1.ztu $151>}>
2323
2424### `++ram`
2525
2626Flatten to tape
2727
28−Flatten [`++tank`]() out into a [`++tape`]().
28+Flatten `++tank` out into a `++tape`.
2929
3030Accepts
3131-------
3232
33−`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
33+`tac` is a `++tank`, taken from sample of `++re` core.
3434
3535Produces
3636--------
@@ -43,9 +43,9 @@ Source
4343 ++ ram
4444 ^- tape
4545 ?- -.tac
46− %leaf p.tac
47− %palm ram(tac [%rose [p.p.tac (weld q.p.tac r.p.tac) s.p.tac] q.tac])
48− %rose
46+ $leaf p.tac
47+ $palm ram(tac [%rose [p.p.tac (weld q.p.tac r.p.tac) s.p.tac] q.tac])
48+ $rose
4949 %+ weld
5050 q.p.tac
5151 |- ^- tape
@@ -59,9 +59,9 @@ Source
5959Examples
6060--------
6161
62− /~zod/try=> ~(ram re leaf/"foo")
62+ /~zod/try=> ~(ram re leaf+"foo")
6363 "foo"
64− /~zod/try=> ~(ram re rose/["." "(" ")"]^~[leaf/"bar" leaf/"baz" leaf/"bam"])
64+ /~zod/try=> ~(ram re rose+["." "(" ")"]^~[leaf+"bar" leaf+"baz" leaf+"bam"])
6565 "(bar.baz.bam)"
6666
6767### `++win`
@@ -73,25 +73,25 @@ Render at indent level `tab` and width `edg`.
7373Accepts
7474-------
7575
76−`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
76+`tac` is a `++tank`, taken from sample of `++re` core.
7777
7878`tab` and `edg` are atoms.
7979
8080Produces
8181--------
8282
83−A [`++wall`]() ([`++list`]() of [`++tapes`]()).
83+A `++wall` (`++list` of `++tapes`).
8484
8585Source
8686------
8787
8888 ++ win
89− |= [tab=@ edg=@]
89+ |= {tab/@ edg/@}
9090 =+ lug=`wall`~
9191 |^ |- ^- wall
9292 ?- -.tac
93− %leaf (rig p.tac)
94− %palm
93+ $leaf (rig p.tac)
94+ $palm
9595 ?: fit
9696 (rig ram)
9797 ?~ q.tac
@@ -111,30 +111,17 @@ Source
111111 ==
112112 (wig(lug qyr) q.p.tac)
113113 ::
114− %rose
115− ?: fit
116− (rig ram)
117− =+ ^= gyl
118− |- ^- wall
119− ?~ q.tac
120− ?:(=(%$ r.p.tac) lug (rig r.p.tac))
121− ^$(tac i.q.tac, lug $(q.tac t.q.tac), tab din)
122− ?: =(%$ q.p.tac)
123− gyl
124− (wig(lug gyl) q.p.tac)
125− ==
126− ::
127114
128115Examples
129116--------
130117
131− /~zod/try=> (~(win re leaf/"samoltekon-lapdok") 0 20)
118+ /~zod/try=> (~(win re leaf+"samoltekon-lapdok") 0 20)
132119 <<"samoltekon-lapdok">>
133− /~zod/try=> (~(win re leaf/"samoltekon-lapdok") 0 10)
120+ /~zod/try=> (~(win re leaf+"samoltekon-lapdok") 0 10)
134121 <<"\/samolt\/" " ekon-l" " apdok" "\/ \/">>
135− /~zod/try=> (~(win re rose/["--" "[" "]"]^~[leaf/"1423" leaf/"2316"]) 0 20)
122+ /~zod/try=> (~(win re rose+["--" "[" "]"]^~[leaf+"1423" leaf+"2316"]) 0 20)
136123 <<"[1423--2316]">>
137− /~zod/try=> (~(win re rose/["--" "[" "]"]^~[leaf/"1423" leaf/"2316"]) 0 10)
124+ /~zod/try=> (~(win re rose+["--" "[" "]"]^~[leaf+"1423" leaf+"2316"]) 0 10)
138125 <<"[ 1423" " 2316" "]">>
139126
140127### `++din`
@@ -185,28 +172,28 @@ Examples
185172
186173Wrap in `\/`
187174
188−Wrap [`++tape`]() in `\/` if it doesn't fit at current indentation. Internal to
189−[`++win`]()
175+Wrap `++tape` in `\/` if it doesn't fit at current indentation. Internal to
176+`++win`
190177
191178Accepts
192179-------
193180
194−`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
181+`tac` is a `++tank`, taken from sample of `++re` core.
195182
196183`hom` is a `++tape`.
197184
198185Produces
199186--------
200187
201−A [`++wall`]() (list of `++tape`s).
188+A `++wall` (list of `++tape`s).
202189
203190Source
204191------
205192
206193 ++ rig
207− |= hom=tape
194+ |= hom/tape
208195 ^- wall
209− ?: (lte (lent hom) (sub edg tab))
196+ ?: & ::(lte (lent hom) (sub edg tab))
210197 [(runt [tab ' '] hom) lug]
211198 => .(tab (add tab 2), edg (sub edg 2))
212199 =+ mut=(trim (sub edg tab) hom)
@@ -229,12 +216,12 @@ Examples
229216
230217`++win` render tape
231218
232−Render [`++tape`](). Internal to [`++win`]().
219+Render `++tape`. Internal to `++win`.
233220
234221Accepts
235222-------
236223
237−`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
224+`tac` is a `++tank`, taken from sample of `++re` core.
238225
239226`hom` is a `++tape`.
240227
@@ -242,7 +229,7 @@ Produces
242229--------
243230
244231 ++ wig
245− |= hom=tape
232+ |= hom/tape
246233 ^- wall
247234 ?~ lug
248235 (rig hom)
@@ -259,4 +246,5 @@ Produces
259246
260247
261248
249+
262250***
docs/system/hoon/library/src/4c/gate/show.md+28−28
@@ -1,49 +1,48 @@
11### `++show`
22
3− ++ show :: XX deprecated, use type
4− |= vem=*
3+ ++ show :: XX deprecated, use span
4+ |= vem/*
55 |^ ^- tank
66 ?: ?=(@ vem)
77 [%leaf (mesc (trip vem))]
88 ?- vem
9− [s=~ c=*]
9+ {s/$~ c/*}
1010 [%leaf '\'' (weld (mesc (tape +.vem)) `tape`['\'' ~])]
1111 ::
12− [s=%a c=@] [%leaf (mesc (trip c.vem))]
13− [s=%b c=*] (shop c.vem |=(a=@ ~(rub at a)))
14− [s=[%c p=@] c=*]
12+ {s/$a c/@} [%leaf (mesc (trip c.vem))]
13+ {s/$b c/*} (shop c.vem |=(a/@ ~(rub at a)))
14+ {s/{$c p/@} c/*}
1515 :+ %palm
1616 [['.' ~] ['-' ~] ~ ~]
1717 [[%leaf (mesc (trip p.s.vem))] $(vem c.vem) ~]
1818 ::
19− [s=%d c=*] (shop c.vem |=(a=@ ~(rud at a)))
20− [s=%k c=*] (tank c.vem)
21− [s=%h c=*]
22− ?: =(0 c.vem) :: XX remove after 220
23− [%leaf '#' ~]
19+ {s/$d c/*} (shop c.vem |=(a/@ ~(rud at a)))
20+ {s/$k c/*} (tank c.vem)
21+ {s/$h c/*}
2422 :+ %rose
2523 [['/' ~] ['/' ~] ~]
26− =+ yol=((list ,@ta) c.vem)
27− (turn yol |=(a=@ta [%leaf (trip a)]))
24+ =+ yol=((list @ta) c.vem)
25+ (turn yol |=(a/@ta [%leaf (trip a)]))
2826 ::
29− [s=%o c=*]
27+ {s/$l c/*} (shol c.vem)
28+ {s/$o c/*}
3029 %= $
3130 vem
3231 :- [%m '%h:<[%d %d].[%d %d]>']
3332 [-.c.vem +<-.c.vem +<+.c.vem +>-.c.vem +>+.c.vem ~]
3433 ==
3534 ::
36− [s=%p c=*] (shop c.vem |=(a=@ ~(rup at a)))
37− [s=%q c=*] (shop c.vem |=(a=@ ~(r at a)))
38− [s=%r c=*] $(vem [[%r ' ' '{' '}'] c.vem])
39− [s=%t c=*] (shop c.vem |=(a=@ ~(rt at a)))
40− [s=%v c=*] (shop c.vem |=(a=@ ~(ruv at a)))
41− [s=%x c=*] (shop c.vem |=(a=@ ~(rux at a)))
42− [s=[%m p=@] c=*] (shep p.s.vem c.vem)
43− [s=[%r p=@] c=*]
35+ {s/$p c/*} (shop c.vem |=(a/@ ~(rup at a)))
36+ {s/$q c/*} (shop c.vem |=(a/@ ~(r at a)))
37+ {s/$r c/*} $(vem [[%r ' ' '{' '}'] c.vem])
38+ {s/$t c/*} (shop c.vem |=(a/@ ~(rt at a)))
39+ {s/$v c/*} (shop c.vem |=(a/@ ~(ruv at a)))
40+ {s/$x c/*} (shop c.vem |=(a/@ ~(rux at a)))
41+ {s/{$m p/@} c/*} (shep p.s.vem c.vem)
42+ {s/{$r p/@} c/*}
4443 $(vem [[%r ' ' (cut 3 [0 1] p.s.vem) (cut 3 [1 1] p.s.vem)] c.vem])
4544 ::
46− [s=[%r p=@ q=@ r=@] c=*]
45+ {s/{$r p/@ q/@ r/@} c/*}
4746 :+ %rose
4847 :* p=(mesc (trip p.s.vem))
4948 q=(mesc (trip q.s.vem))
@@ -54,7 +53,7 @@
5453 ~
5554 [^$(vem -.c.vem) $(c.vem +.c.vem)]
5655 ::
57− [s=%z c=*] $(vem [[%r %$ %$ %$] c.vem])
56+ {s/$z c/*} $(vem [[%r %$ %$ %$] c.vem])
5857 * !!
5958 ==
6059
@@ -63,7 +62,7 @@ XX document
6362### `++shep`
6463
6564 ++ shep
66− |= [fom=@ gar=*]
65+ |= {fom/@ gar/*}
6766 ^- tank
6867 =+ l=(met 3 fom)
6968 =+ i=0
@@ -84,8 +83,8 @@ XX document
8483
8584### `++shop`
8685
87− ++ shop
88− |= [aug=* vel=$+(a=@ tape)]
86+ ++ shop
87+ |= {aug/* vel/$-(a/@ tape)}
8988 ^- tank
9089 ?: ?=(@ aug)
9190 [%leaf (vel aug)]
@@ -96,7 +95,8 @@ XX document
9695 ?: ?=(@ aug)
9796 [^$ ~]
9897 [^$(aug -.aug) $(aug +.aug)]
99− --
98+ ::
99+
100100
101101XX document
102102