on master help sign in
Merge branch 'cleanorg' of http://github.com/urbit/docs into cleanorg
5f26fccC. Guy Yarvin
docs.md+2−1
@@ -1,5 +1,6 @@
1---
1---
2anchor: none
2anchor: none
3+footer: true
3---
4---
4
5
5<div class="lead">
6<div class="lead">
@@ -8,5 +9,5 @@ anchor: none
8</div>
9</div>
9
10
10<div class="sections lead-offset">
11<div class="sections lead-offset">
11− <kids></kids>
12+ <kids grid="true"></kids>
12</div>
13</div>
docs/system/hoon/library/$.mdnew file+173
@@ -0,0 +1,173 @@
1+# 5f: molds and mold builders
2+### `++mane`
3+
4+XML name
5+
6+An XML name (tag name or attribute name) with an optional namespace. Parsed by
7+`++name` within `++poxa`, rendered by `++name` within `++poxo`.
8+
9+Source
10+------
11+
12+ ++ mane $@(@tas [@tas @tas]) :: XML name/space
13+
14+Examples
15+--------
16+
17+See also: `++sail`
18+
19+ > *mane
20+ %$
21+
22+ > `mane`n.g:`manx`;div:namespace;
23+ %div
24+ > `mane`n.g:`manx`;div_namespace;
25+ [%div %namespace]
26+
27+
28+
29+***
30+### `++manx`
31+
32+XML node.
33+
34+Parsed by `++apex` within `++poxa`, rendered by `++poxo`.
35+
36+Source
37+------
38+
39+ ++ manx {g/marx c/marl} :: XML node
40+
41+Examples
42+--------
43+
44+See also: `++sail` doc
45+
46+
47+
48+***
49+### `++marl`
50+
51+List of XML nodes
52+
53+A list of [`++manx`]().
54+
55+Source
56+------
57+
58+ ++ marl (list manx) :: XML node list
59+
60+Examples
61+--------
62+
63+
64+
65+
66+***
67+### `++mars`
68+
69+XML CDATA
70+
71+Implicitly produced by `++chrd` within `++poxa`
72+
73+Source
74+------
75+
76+ ++ mars {t/{n/$$ a/{i/{n/$$ v/tape} t/$~}} c/$~} :: XML cdata
77+
78+
79+Examples
80+--------
81+
82+
83+
84+***
85+### `++mart`
86+
87+List of XML attributes
88+
89+Each `++mart` is a list of pairs of `++mane` and
90+`++tape`.
91+
92+Parsed by `++attr` within `++poxa`, rendered by `++attr` within `++poxo`
93+
94+Source
95+------
96+
97+ ++ mart (list {n/mane v/tape}) :: XML attributes
98+
99+Examples
100+--------
101+
102+
103+
104+***
105+### `++marx`
106+
107+XML tag
108+
109+A `++marx` is a pair of a tag name, `++mane` and a list of attributes,
110+`++mart`. Parsed by `++head` `++poxa`, rendered within `++poxo`.
111+
112+Source
113+------
114+
115+ ++ marx {n/mane a/mart} :: XML tag
116+
117+Examples
118+--------
119+
120+
121+
122+***
123+### `++pass`
124+
125+Atom alias
126+
127+Used primarily in crypto.
128+
129+Source
130+------
131+
132+ ++ pass @ :: public key
133+
134+
135+
136+***
137+### `++ring`
138+
139+Atom alias
140+
141+Used primarily in crypto.
142+
143+Source
144+------
145+
146+ ++ ring @ :: private key
147+
148+
149+
150+***
151+### `++time`
152+
153+Absolute date
154+
155+The `@da` odor designates an absolute date atom.
156+
157+Source
158+------
159+
160+ ++ time @da :: galactic time
161+
162+Examples
163+--------
164+
165+See also: `++date`, odor reference
166+
167+
168+ > `time`~2014.1.1
169+ ~2014.1.1
170+
171+
172+
173+***
docs/system/hoon/library/1a.md+78−81
@@ -8,7 +8,7 @@ Produces the sum of `a` and `b`.
8Accepts
8Accepts
9-------
9-------
10
10
11−`a` is an [atom]().
11+`a` is an atom.
12
12
13`b` is an atom.
13`b` is an atom.
14
14
@@ -22,7 +22,7 @@ Source
22
22
23 ++ add :: add
23 ++ add :: add
24 ~/ %add
24 ~/ %add
25− |= [a=@ b=@]
25+ |= [a/@ b/@]
26 ^- @
26 ^- @
27 ?: =(0 a) b
27 ?: =(0 a) b
28 $(a (dec a), b +(b))
28 $(a (dec a), b +(b))
@@ -30,11 +30,11 @@ Source
30Examples
30Examples
31--------
31--------
32
32
33− ~zod/try=> (add 2 2)
33+ > (add 2 2)
34 4
34 4
35− ~zod/try=> (add 1 1.000.000)
35+ > (add 1 1.000.000)
36 1.000.001
36 1.000.001
37− ~zod/try=> (add 1.333 (mul 2 2))
37+ > (add 1.333 (mul 2 2))
38 1.337
38 1.337
39
39
40***
40***
@@ -47,7 +47,7 @@ Decrements `a` by `1`.
47Accepts
47Accepts
48-------
48-------
49
49
50−`a` is an [atom]().
50+`a` is an atom.
51
51
52Produces
52Produces
53--------
53--------
@@ -59,21 +59,20 @@ Source
59
59
60 ++ dec :: decrement
60 ++ dec :: decrement
61 ~/ %dec
61 ~/ %dec
62− |= a=@
62+ |= a/@
63 ~| %decrement-underflow
63 ~| %decrement-underflow
64 ?< =(0 a)
64 ?< =(0 a)
65 =+ b=0
65 =+ b=0
66 |- ^- @
66 |- ^- @
67 ?: =(a +(b)) b
67 ?: =(a +(b)) b
68 $(b +(b))
68 $(b +(b))
69− ::
70
69
71Examples
70Examples
72--------
71--------
73
72
74− ~zod/try=> (dec 7)
73+ > (dec 7)
75 6
74 6
76− ~zod/try=> (dec 0)
75+ > (dec 0)
77 ! decrement-underflow
76 ! decrement-underflow
78 ! exit
77 ! exit
79
78
@@ -89,9 +88,9 @@ Computes `a` divided by `b`.
89Accepts
88Accepts
90-------
89-------
91
90
92−`a` is an [atom]().
91+`a` is an atom.
93
92
94−`b` is an [atom]().
93+`b` is an atom.
95
94
96Produces
95Produces
97--------
96--------
@@ -103,7 +102,7 @@ Source
103
102
104 ++ div :: divide
103 ++ div :: divide
105 ~/ %div
104 ~/ %div
106− |= [a=@ b=@]
105+ |= [a/@ b/@]
107 ^- @
106 ^- @
108 ~| 'div'
107 ~| 'div'
109 ?< =(0 b)
108 ?< =(0 b)
@@ -116,11 +115,11 @@ Source
116Examples
115Examples
117--------
116--------
118
117
119− ~zod/try=> (div 4 2)
118+ > (div 4 2)
120 2
119 2
121− ~zod/try=> (div 17 8)
120+ > (div 17 8)
122 2
121 2
123− ~zod/try=> (div 20 30)
122+ > (div 20 30)
124 0
123 0
125
124
126
125
@@ -134,7 +133,7 @@ Tests whether `a` is greater than a number `b`.
134Accepts
133Accepts
135-------
134-------
136
135
137−`a` is an [atom]().
136+`a` is an atom.
138
137
139`b` is an atom.
138`b` is an atom.
140
139
@@ -148,19 +147,19 @@ Source
148
147
149 ++ gte :: greater-equal
148 ++ gte :: greater-equal
150 ~/ %gte
149 ~/ %gte
151− |= [a=@ b=@]
150+ |= {a/@ b/@}
152 ^- ?
151 ^- ?
153 !(lth a b)
152 !(lth a b)
154− ::
153+
155
154
156Examples
155Examples
157--------
156--------
158
157
159− ~zod/try=> (gte 100 10)
158+ > (gte 100 10)
160 %.y
159 %.y
161− ~zod/try=> (gte 4 4)
160+ > (gte 4 4)
162 %.y
161 %.y
163− ~zod/try=> (gte 3 4)
162+ > (gte 3 4)
164 %.n
163 %.n
165
164
166
165
@@ -175,7 +174,7 @@ Tests whether `a` is greater than `b`.
175Accepts
174Accepts
176-------
175-------
177
176
178−`a` is an [atom]().
177+`a` is an atom.
179
178
180`b` is an atom.
179`b` is an atom.
181
180
@@ -189,17 +188,18 @@ Source
189
188
190 ++ gth :: greater-than
189 ++ gth :: greater-than
191 ~/ %gth
190 ~/ %gth
192− |= [a=@ b=@]
191+ |= {a/@ b/@}
193 ^- ?
192 ^- ?
194 !(lte a b)
193 !(lte a b)
195− ::
194+
195+
196
196
197Examples
197Examples
198--------
198--------
199
199
200− ~zod/try=> (gth 'd' 'c')
200+ > (gth 'd' 'c')
201 %.y
201 %.y
202− ~zod/try=> (gth ~h1 ~m61)
202+ > (gth ~h1 ~m61)
203 %.n
203 %.n
204
204
205
205
@@ -214,7 +214,7 @@ Tests whether `a` is less than or equal to `b`.
214Accepts
214Accepts
215-------
215-------
216
216
217−`a` is an [atom]().
217+`a` is an atom.
218
218
219`b` is an atom.
219`b` is an atom.
220
220
@@ -228,20 +228,21 @@ Source
228
228
229 ++ lte :: less-equal
229 ++ lte :: less-equal
230 ~/ %lte
230 ~/ %lte
231− |= [a=@ b=@]
231+ |= {a/@ b/@}
232 |(=(a b) (lth a b))
232 |(=(a b) (lth a b))
233+
233 ::
234 ::
234
235
235Examples
236Examples
236--------
237--------
237
238
238− ~zod/try=> (lte 4 5)
239+ > (lte 4 5)
239 %.y
240 %.y
240− ~zod/try=> (lte 5 4)
241+ > (lte 5 4)
241 %.n
242 %.n
242− ~zod/try=> (lte 5 5)
243+ > (lte 5 5)
243 %.y
244 %.y
244− ~zod/try=> (lte 0 0)
245+ > (lte 0 0)
245 %.y
246 %.y
246
247
247
248
@@ -256,7 +257,7 @@ Tests whether `a` is less than `b`.
256Accepts
257Accepts
257-------
258-------
258
259
259−`a` is an [atom]().
260+`a` is an atom.
260
261
261`b` is an atom.
262`b` is an atom.
262
263
@@ -270,26 +271,25 @@ Source
270
271
271 ++ lth :: less-than
272 ++ lth :: less-than
272 ~/ %lth
273 ~/ %lth
273− |= [a=@ b=@]
274+ |= {a/@ b/@}
274 ^- ?
275 ^- ?
275− ?& !=(a b)
276+ ?& !=(a b)
276− |-
277+ |-
277− ?| =(0 a)
278+ ?| =(0 a)
278− ?& !=(0 b)
279+ ?& !=(0 b)
279 $(a (dec a), b (dec b))
280 $(a (dec a), b (dec b))
280 == == ==
281 == == ==
281− ::
282
282
283Examples
283Examples
284--------
284--------
285
285
286− ~zod/try=> (lth 4 5)
286+ > (lth 4 5)
287 %.y
287 %.y
288− ~zod/try=> (lth 5 4)
288+ > (lth 5 4)
289 %.n
289 %.n
290− ~zod/try=> (lth 5 5)
290+ > (lth 5 5)
291 %.n
291 %.n
292− ~zod/try=> (lth 5 0)
292+ > (lth 5 0)
293 %.n
293 %.n
294
294
295
295
@@ -303,7 +303,7 @@ Computes the greater of `a` and `b`.
303Accepts
303Accepts
304-------
304-------
305
305
306−`a` is an [atom]().
306+`a` is an atom.
307
307
308`b` is an atom.
308`b` is an atom.
309
309
@@ -317,20 +317,19 @@ Source
317
317
318 ++ max :: maximum
318 ++ max :: maximum
319 ~/ %max
319 ~/ %max
320− |= [a=@ b=@]
320+ |= {a/@ b/@}
321 ^- @
321 ^- @
322 ?: (gth a b) a
322 ?: (gth a b) a
323 b
323 b
324− ::
325
324
326Examples
325Examples
327--------
326--------
328
327
329− ~zod/try=> (max 10 100)
328+ > (max 10 100)
330 100
329 100
331− ~zod/try=> (max 10.443 9)
330+ > (max 10.443 9)
332 10.443
331 10.443
333− ~zod/try=> (max 0 1)
332+ > (max 0 1)
334 1
333 1
335
334
336
335
@@ -345,7 +344,7 @@ Computes the lesser of `a` and `b`.
345Accepts
344Accepts
346-------
345-------
347
346
348−`a` is an [atom]().
347+`a` is an atom.
349
348
350`b` is an atom.
349`b` is an atom.
351
350
@@ -359,20 +358,19 @@ Source
359
358
360 ++ min :: minimum
359 ++ min :: minimum
361 ~/ %min
360 ~/ %min
362− |= [a=@ b=@]
361+ |= {a/@ b/@}
363 ^- @
362 ^- @
364 ?: (lth a b) a
363 ?: (lth a b) a
365 b
364 b
366− ::
365+
367−
368Examples
366Examples
369--------
367--------
370
368
371− ~zod/try=> (min 10 100)
369+ > (min 10 100)
372 10
370 10
373− ~zod/try=> (min 10.443 9)
371+ > (min 10.443 9)
374 9
372 9
375− ~zod/try=> (min 0 1)
373+ > (min 0 1)
376 0
374 0
377
375
378
376
@@ -387,7 +385,7 @@ Computes the remainder of dividing `a` by `b`.
387Accepts
385Accepts
388-------
386-------
389
387
390−`a` is an [atom]().
388+`a` is an atom.
391
389
392`b` is an atom.
390`b` is an atom.
393
391
@@ -401,18 +399,18 @@ Source
401
399
402 ++ mod :: remainder
400 ++ mod :: remainder
403 ~/ %mod
401 ~/ %mod
404− |= [a=@ b=@]
402+ |: [a=`@`1 b=`@`1]
405 ^- @
403 ^- @
406 ?< =(0 b)
404 ?< =(0 b)
407 (sub a (mul b (div a b)))
405 (sub a (mul b (div a b)))
408− ::
406+
409
407
410Examples
408Examples
411--------
409--------
412
410
413− ~zod/try=> (mod 5 2)
411+ > (mod 5 2)
414 1
412 1
415− ~zod/try=> (mod 5 5)
413+ > (mod 5 5)
416 0
414 0
417
415
418
416
@@ -427,7 +425,7 @@ Multiplies `a` by `b`.
427Accepts
425Accepts
428-------
426-------
429
427
430−`a` is an [atom]().
428+`a` is an atom.
431
429
432`b` is an atom.
430`b` is an atom.
433
431
@@ -441,20 +439,19 @@ Source
441
439
442 ++ mul :: multiply
440 ++ mul :: multiply
443 ~/ %mul
441 ~/ %mul
444− |= [a=@ b=@]
442+ |: [a=`@`1 b=`@`1]
445 ^- @
443 ^- @
446 =+ c=0
444 =+ c=0
447 |-
445 |-
448 ?: =(0 a) c
446 ?: =(0 a) c
449 $(a (dec a), c (add b c))
447 $(a (dec a), c (add b c))
450− ::
448+
451−
452Examples
449Examples
453--------
450--------
454
451
455− ~zod/try=> (mul 3 4)
452+ > (mul 3 4)
456 12
453 12
457− ~zod/try=> (mul 0 1)
454+ > (mul 0 1)
458 0
455 0
459
456
460
457
@@ -469,9 +466,9 @@ Subtracts `b` from `a`.
469Accepts
466Accepts
470-------
467-------
471
468
472−`a` is an [atom]().
469+`a` is an atom.
473
470
474−`b` is an [atom]().
471+`b` is an atom.
475
472
476Produces
473Produces
477--------
474--------
@@ -481,24 +478,24 @@ An atom.
481Source
478Source
482------
479------
483
480
484− ++ sub :: subtract
481+ ++ sub :: subtract
485− ~/ %sub
482+ ~/ %sub
486− |= [a=@ b=@]
483+ |= [a/@ b/@]
487− ~| %subtract-underflow
484+ ~| %subtract-underflow
488− ^- @
485+ ^- @
489− ?: =(0 b) a
486+ ?: =(0 b) a
490− $(a (dec a), b (dec b))
487+ $(a (dec a), b (dec b))
491
488
492Examples
489Examples
493--------
490--------
494
491
495− ~zod/try=> (sub 10 5)
492+ > (sub 10 5)
496 5
493 5
497− ~zod/try=> (sub 243 44)
494+ > (sub 243 44)
498 199
495 199
499− ~zod/try=> (sub 5 0)
496+ > (sub 5 0)
500 5
497 5
501− ~zod/try=> (sub 0 5)
498+ > (sub 0 5)
502 ! subtract-underflow
499 ! subtract-underflow
503 ! exit
500 ! exit
504
501
docs/system/hoon/library/1b.md+42−43
@@ -3,8 +3,8 @@
3
3
4Tree head
4Tree head
5
5
6−Tests whether an `a` is in the head or tail of a [noun](). Produces the
6+Tests whether an `a` is in the head or tail of a noun. Produces the
7−[cube]() `%2` if it is within the head, or the cube `%3` if it is
7+cube `%2` if it is within the head, or the cube `%3` if it is
8within the tail.
8within the tail.
9
9
10Accepts
10Accepts
@@ -15,31 +15,31 @@ Accepts
15Produces
15Produces
16--------
16--------
17
17
18−A [cube]().
18+A cube.
19
19
20Source
20Source
21------
21------
22
22
23− ++ cap :: tree head
23+ ++ cap :: tree head
24− ~/ %cap
24+ ~/ %cap
25− |= a=@
25+ |= a=@
26− ^- ?(%2 %3)
26+ ^- ?(%2 %3)
27− ?- a
27+ ?- a
28− %2 %2
28+ %2 %2
29− %3 %3
29+ %3 %3
30− ?(%0 %1) !!
30+ ?(%0 %1) !!
31− * $(a (div a 2))
31+ * $(a (div a 2))
32− ==
32+ ==
33− ::
33+ ::
34
34
35Examples
35Examples
36--------
36--------
37
37
38− ~zod/try=> (cap 4)
38+ > (cap 4)
39 %2
39 %2
40− ~zod/try=> (cap 6)
40+ > (cap 6)
41 %3
41 %3
42− ~zod/try=> (cap (add 10 9))
42+ > (cap (add 10 9))
43 %2
43 %2
44
44
45
45
@@ -64,32 +64,32 @@ An atom.
64Source
64Source
65------
65------
66
66
67− ++ mas :: tree body
67+ ++ mas :: tree body
68− ~/ %mas
68+ ~/ %mas
69− |= a=@
69+ |= a=@
70− ^- @
70+ ^- @
71− ?- a
71+ ?- a
72− 1 !!
72+ 1 !!
73− 2 1
73+ 2 1
74− 3 1
74+ 3 1
75− * (add (mod a 2) (mul $(a (div a 2)) 2))
75+ * (add (mod a 2) (mul $(a (div a 2)) 2))
76− ==
76+ ==
77− ::
77+ ::
78
78
79Examples
79Examples
80--------
80--------
81
81
82− ~zod/try=> (mas 3)
82+ > (mas 3)
83 1
83 1
84− ~zod/try=> (mas 4)
84+ > (mas 4)
85 2
85 2
86− ~zod/try=> (mas 5)
86+ > (mas 5)
87 3
87 3
88− ~zod/try=> (mas 6)
88+ > (mas 6)
89 2
89 2
90− ~zod/try=> (mas 0)
90+ > (mas 0)
91 ! exit
91 ! exit
92− ~zod/try=> (mas 1)
92+ > (mas 1)
93 ! exit
93 ! exit
94
94
95
95
@@ -104,7 +104,7 @@ Computes the axis of `b` within axis `a`.
104Accepts
104Accepts
105-------
105-------
106
106
107−`a` is an [atom]().
107+`a` is an atom.
108
108
109`b` is an atom.
109`b` is an atom.
110
110
@@ -118,24 +118,23 @@ Source
118
118
119 ++ peg :: tree connect
119 ++ peg :: tree connect
120 ~/ %peg
120 ~/ %peg
121− |= [a=@ b=@]
121+ |= {a/@ b/@}
122 ^- @
122 ^- @
123 ?- b
123 ?- b
124− 1 a
124+ $1 a
125− 2 (mul a 2)
125+ $2 (mul a 2)
126− 3 +((mul a 2))
126+ $3 +((mul a 2))
127 * (add (mod b 2) (mul $(b (div b 2)) 2))
127 * (add (mod b 2) (mul $(b (div b 2)) 2))
128 ==
128 ==
129− ::
130
129
131Examples
130Examples
132--------
131--------
133
132
134− ~zod/try=> (peg 4 1)
133+ > (peg 4 1)
135 4
134 4
136− ~zod/try=> (peg 4 2)
135+ > (peg 4 2)
137 8
136 8
138− ~zod/try=> (peg 8 45)
137+ > (peg 8 45)
139 269
138 269
140
139
141
140
docs/system/hoon/library/1c.md+73−61
@@ -5,19 +5,18 @@ Blocksize
5
5
6Atom representing a blocksize, by convention expressed as a power of 2.
6Atom representing a blocksize, by convention expressed as a power of 2.
7
7
8−
9Source
8Source
10------
9------
11
10
12− ++ bloq ,@ :: blockclass
11+ ++ bloq @ :: blockclass
13
12
14Examples
13Examples
15--------
14--------
16
15
17− ~zod/try=> :: ++met measures how many bloqs long an atom is
16+ > :: ++met measures how many bloqs long an atom is
18− ~zod/try=> (met 3 256)
17+ > (met 3 256)
19 2
18 2
20− ~zod/try=> :: 256 is 2 bloqs of 2^3
19+ > :: 256 is 2 bloqs of 2^3
21
20
22
21
23***
22***
@@ -25,21 +24,22 @@ Examples
25
24
26Mold of fork between two
25Mold of fork between two
27
26
28−[mold]() generator: produces a dicriminated [fork]() between two types.
27+mold generator: produces a dicriminated fork between two types.
29
28
30Source
29Source
31------
30------
32
31
33− ++ each |*([a=$+(* *) b=$+(* *)] $%([& p=a] [| p=b])) :: either a or b
32+ ++ each
33+ |* {a/$-(* *) b/$-(* *)} :: either a or b
34+ $%({$& p/a} {$| p/b}) :: a default
35+
34
36
35Examples
37Examples
36--------
38--------
37
39
38− ~zod/try=> :type; *(each cord time)
40+ > ? *(each cord time)
41+ ?({$.y p/@t} {$.n p/@da})
39 [%.y p='']
42 [%.y p='']
40− {[%.y p=@t] [%.n p=@da]}
41−
42−
43
43
44***
44***
45### `++gate`
45### `++gate`
@@ -47,28 +47,26 @@ Examples
47Function
47Function
48
48
49A core with one arm, `$`--the empty name--which transforms a sample noun into a product
49A core with one arm, `$`--the empty name--which transforms a sample noun into a product
50−noun. If used [dryly]() as a type, the [subject]() must have a sample type of [`*`]().
50+noun. If used dryly as a type, the subject must have a sample type of `*`.
51
51
52
52
53Source
53Source
54------
54------
55
55
56− ++ gate $+(* *) :: general gate
56+ ++ gate $-(* *) :: general gate
57+
57
58
58Examples
59Examples
59--------
60--------
60
61
61−See also: [`++lift`](), [`++cork`]()
62+See also: `++lift`, `++cork`
62
63
63− ~zod/try=> *gate
64+ > ? gate
64− <1|mws [* <101.jzo 1.ypj %164>]>
65+ <1.ybc {* <110.jyx 1.ztu $151>}>
65− ~zod/try=> `gate`|=(* 0)
66+ <1.ybc {* <110.jyx 1.ztu $151>}>
66− <1|mws [* <101.jzo 1.ypj %164>]>
67
67
68− ~zod/try=> (|=(a=* [a 'b']) 'c')
69− [99 'b']
70− ~zod/try=> (`gate`|=(a=* [a 'b']) 'c')
68+ > (`gate`|=(a/* [a 'b']) 1)
71− [99 98]
69+ [1 'b']
72
70
73
71
74
72
@@ -77,61 +75,62 @@ See also: [`++lift`](), [`++cork`]()
77
75
78List
76List
79
77
80−[mold]() generator. `++list` generates a mold of a null-termanated list of a
78+mold generator. `++list` generates a mold of a null-termanated list of a
81homogenous type.
79homogenous type.
82
80
83
81
84Source
82Source
85------
83------
86
84
87− ++ list |* a=_,* :: null-term list
85+ ++ list |* a/$-(* *) :: null-term list
86+ $@($~ {i/a t/(list a)}) ::
87+
88
88
89Examples
89Examples
90--------
90--------
91
91
92−See also: [`++turn`](), [`++snag`]()
92+See also: `++turn`, `++snag`
93
93
94− ~zod/try=> *(list)
94+ > *(list)
95 ~
95 ~
96− ~zod/try=> `(list ,@)`"abc"
96+ > `(list @)`"abc"
97 ~[97 98 99]
97 ~[97 98 99]
98− ~zod/try=> (snag 0 "abc")
98+ > (snag 0 "abc")
99− ~~a
99+ 'a'
100
100
101
101
102
102
103***
103***
104### `++lone`
104### `++lone`
105
105
106−Tile generator. `++lone` puts face of `p` on something.
106+`++lone` puts face of `p` on something.
107
107
108XX unused
108XX unused
109
109
110Source
110Source
111------
111------
112
112
113− ++ lone |*(a=$+(* *) ,p=a) :: just one thing
113+ ++ lone |*(a/$-(* *) p/a) :: just one thing
114−
115−
116
114
117***
115***
118### `++pair`
116### `++pair`
119
117
120Mold of pair of types
118Mold of pair of types
121
119
122−[mold]() generator. Produces a tuple of two of the types passed in.
120+mold generator. Produces a tuple of two of the types passed in.
123
121
124
122
125Source
123Source
126------
124------
127
125
128− ++ pair |*([a=$+(* *) b=$+(* *)] ,[p=a q=b]) :: just a pair
126+ ++ pair |*({a/$-(* *) b/$-(* *)} {p/a q/b}) :: just a pair
127+
129
128
130
129
131Examples
130Examples
132--------
131--------
133
132
134− ~zod/try=> *(pair bean cord)
133+ > *(pair bean cord)
135 [p=%.y q='']
134 [p=%.y q='']
136
135
137
136
@@ -141,17 +140,20 @@ Examples
141
140
142Faceless list
141Faceless list
143
142
144−A [`++list`]() without the [face]()s `i` and `t`.
143+A `++list` without the faces `i` and `t`.
145
144
146Source
145Source
147------
146------
148
147
149− ++ pole |* a=_,* :: nameless list
148+ ++ pole |* a/$-(* *) :: nameless list
149+ $@($~ {a (pole a)}) ::
150+
151+
150
152
151Examples
153Examples
152--------
154--------
153
155
154− ~zod/try=> `(pole char)`"asdf"
156+ > `(pole char)`"asdf"
155 [~~a [~~s [~~d [~~f ~]]]]
157 [~~a [~~s [~~d [~~f ~]]]]
156
158
157
159
@@ -166,38 +168,38 @@ A `++qual` is a tuple of four of the types passed in.
166Source
168Source
167------
169------
168
170
169− ++ qual |* [a=$+(* *) b=$+(* *) c=$+(* *) d=$+(* *)] :: just a quadruple
171+ ++ qual |* {a/$-(* *) b/$-(* *) c/$-(* *) d/$-(* *)} :: just a quadruple
172+ {p/a q/b r/c s/d} ::
170
173
171Examples
174Examples
172--------
175--------
173
176
174− ~zod/try=> *(qual date time tape cord)
177+ > *(qual date time tape cord)
175 [p=[[a=%.y y=0] m=0 t=[d=0 h=0 m=0 s=0 f=~]] q=~292277024401-.1.1 r="" s='']
178 [p=[[a=%.y y=0] m=0 t=[d=0 h=0 m=0 s=0 f=~]] q=~292277024401-.1.1 r="" s='']
176
179
177
180
178
181
179−***
182+ ***
180### `++trap`
183### `++trap`
181
184
182Core with one arm `$`
185Core with one arm `$`
183
186
184−A trap is a core with one arm `++$`. Used when XX
187+A trap is a core with one arm `++$`.
185
188
186Source
189Source
187------
190------
188
191
189− ++ trap ,_|.(_*) :: makes perfect sense
192+ ++ trap |*(a/_* _|?(*a)) :: makes perfect sense
193+
190
194
191Examples
195Examples
192--------
196--------
193
197
194−See also: `|.`
195−
196− ~zod/try=> *trap
198+ > *trap
197 <1.mws 101.jzo 1.ypj %164>
199 <1.mws 101.jzo 1.ypj %164>
198− ~zod/try=> (*trap)
200+ > (*trap)
199 0
201 0
200− ~zod/try=> (|.(42))
202+ > (|.(42))
201 42
203 42
202
204
203
205
@@ -213,12 +215,14 @@ left/right sub `++tree` of the same type. Pretty-printed with `{}`.
213Source
215Source
214------
216------
215
217
216− ++ tree |* a=_,* :: binary tree
218+ ++ tree |* a/$-(* *) :: binary tree
219+ $@($~ {n/a l/(tree a) r/(tree a)}) ::
220+
217
221
218Examples
222Examples
219--------
223--------
220
224
221− ~zod/try=> `(tree ,[@ tape])`[[1 "hi"] [[2 "bye"] ~ ~] ~]
225+ > `(tree {@ tape})`[[1 "hi"] [[2 "bye"] ~ ~] ~]
222 {[2 "bye"] [1 "hi"]}
226 {[2 "bye"] [1 "hi"]}
223
227
224
228
@@ -228,17 +232,19 @@ Examples
228
232
229Mold of three types
233Mold of three types
230
234
231−[`++mold`]() of the tuple of the three types passed in.
235+`++mold` of the tuple of the three types passed in.
232
236
233Source
237Source
234------
238------
235
239
236− ++ trel |* [a=$+(* *) b=$+(* *) c=$+(* *)] :: just a triple
240+ ++ trel |* {a/$-(* *) b/$-(* *) c/$-(* *)} :: just a triple
241+ {p/a q/b r/c} ::
242+
237
243
238Examples
244Examples
239--------
245--------
240
246
241− ~zod/try=> *(trel ,@ud ,@t ,@s)
247+ > *(trel @ud @t @s)
242 [p=0 q='' r=--0]
248 [p=0 q='' r=--0]
243
249
244
250
@@ -248,26 +254,32 @@ Examples
248
254
249Maybe
255Maybe
250
256
251−[mold]() generator. A `++unit` is either `~` or `[~ u=a]` where `a` is the
257+mold generator. A `++unit` is either `~` or `[~ u=a]` where `a` is the
252type that was passed in.
258type that was passed in.
253
259
254
260
255Source
261Source
256------
262------
257
263
258− ++ unit |* a=_,* :: maybe
264+ ++ unit |* a/$-(* *) :: maybe
265+ $@($~ {$~ u/a}) ::
266+
259
267
260Examples
268Examples
261--------
269--------
262
270
263−See also: [`++bind`]()
271+See also: `++bind`
264
272
265− ~zod/try=> :type; *(unit time)
273+ > ? *(unit time)
274+ ?({$~ u/@da} $~)
266 ~
275 ~
267− u(@da)
268− ~zod/try=> `(unit time)`[~ -<-]
269− [~ ~2014.9.24..19.25.10..7dd5]
270
276
277+ > > =a |= a/@
278+ ^- (unit @)
279+ ?~ a ~
280+ [~ a]
281+ > (a 2)
282+ [~ u=2]
271
283
272
284
273***
285***
docs/system/hoon/library/2a.md+79−69
@@ -3,7 +3,7 @@
3
3
4Unit as argument
4Unit as argument
5
5
6−Applies a function `b` that produces a unit to the unwrapped value of [++unit]()
6+Applies a function `b` that produces a unit to the unwrapped value of ++unit
7`a` (`u.a`). If `a` is empty, `~` is produced.
7`a` (`u.a`). If `a` is empty, `~` is produced.
8
8
9Accepts
9Accepts
@@ -22,16 +22,17 @@ Source
22------
22------
23
23
24 ++ biff :: apply
24 ++ biff :: apply
25− |* [a=(unit) b=$+(* (unit))]
25+ |* {a/(unit) b/$-(* (unit))}
26 ?~ a ~
26 ?~ a ~
27 (b u.a)
27 (b u.a)
28
28
29+
29Examples
30Examples
30--------
31--------
31
32
32− ~zod/try=> (biff (some 5) |=(a=@ (some (add a 2))))
33+ > (biff (some 5) |=(a/@ (some (add a 2))))
33 [~ u=7]
34 [~ u=7]
34− ~zod/try=> (biff ~ |=(a=@ (some (add a 2))))
35+ > (biff ~ |=(a/@ (some (add a 2))))
35 ~
36 ~
36
37
37
38
@@ -41,7 +42,7 @@ Examples
41
42
42Non-unit function to unit, producing unit
43Non-unit function to unit, producing unit
43
44
44−Applies a function `b` to the value (`u.a`) of a [++unit]() `a`, producing
45+Applies a function `b` to the value (`u.a`) of a ++unit `a`, producing
45a unit. Used when you want a function that does not accept or produce a
46a unit. Used when you want a function that does not accept or produce a
46unit to both accept and produce a unit.
47unit to both accept and produce a unit.
47
48
@@ -61,17 +62,18 @@ Source
61------
62------
62
63
63 ++ bind :: argue
64 ++ bind :: argue
64− |* [a=(unit) b=gate]
65+ |* {a/(unit) b/gate}
65 ?~ a ~
66 ?~ a ~
66 [~ u=(b u.a)]
67 [~ u=(b u.a)]
67
68
69+
68Examples
70Examples
69--------
71--------
70
72
71− ~zod/try=> (bind ((unit ,@) [~ 97]) ,@t)
73+ > (bind ((unit @) [~ 97]) ,@t)
72 [~ `a`]
74 [~ `a`]
73− ~zod/try=> =a |=(a=@ (add a 1))
75+ > =a |=(a/@ (add a 1))
74− ~zod/try=> (bind ((unit ,@) [~ 2]) a)
76+ > (bind ((unit @) [~ 2]) a)
75 [~ 3]
77 [~ 3]
76
78
77
79
@@ -81,7 +83,7 @@ Examples
81
83
82Replace null
84Replace null
83
85
84−Replaces an empty [++unit]() `b` with the product of a called [trap]()
86+Replaces an empty ++unit `b` with the product of a called trap
85`a`. If the unit is not empty, then the original unit is produced.
87`a`. If the unit is not empty, then the original unit is produced.
86
88
87Accepts
89Accepts
@@ -100,19 +102,20 @@ Source
100------
102------
101
103
102 ++ bond :: replace
104 ++ bond :: replace
103− |* a=trap
105+ |* a/(trap)
104− |* b=(unit)
106+ |* b/(unit)
105 ?~ b $:a
107 ?~ b $:a
106 u.b
108 u.b
107
109
110+
108Examples
111Examples
109--------
112--------
110
113
111− ~zod/try=> (bex 10)
114+ > (bex 10)
112 1.024
115 1.024
113− ~zod/try=> ((bond |.((bex 10))) ~)
116+ > ((bond |.((bex 10))) ~)
114 1.024
117 1.024
115− ~zod/try=> ((bond |.((bex 10))) (slaw %ud '123'))
118+ > ((bond |.((bex 10))) (slaw %ud '123'))
116 123
119 123
117
120
118
121
@@ -123,7 +126,7 @@ Examples
123Group unit values into pair
126Group unit values into pair
124
127
125Produces `~` if either `a` or `b` are empty. Otherwise, produces a
128Produces `~` if either `a` or `b` are empty. Otherwise, produces a
126−[++unit]() whose value is a cell of the values of two input units `a` and
129+++unit whose value is a cell of the values of two input units `a` and
127`b`.
130`b`.
128
131
129Accepts
132Accepts
@@ -142,17 +145,18 @@ Source
142------
145------
143
146
144 ++ both :: all the above
147 ++ both :: all the above
145− |* [a=(unit) b=(unit)]
148+ |* {a/(unit) b/(unit)}
146 ?~ a ~
149 ?~ a ~
147 ?~ b ~
150 ?~ b ~
148 [~ u=[u.a u.b]]
151 [~ u=[u.a u.b]]
149
152
153+
150Examples
154Examples
151--------
155--------
152
156
153− ~zod/try=> (both (some 1) (some %b))
157+ > (both (some 1) (some %b))
154 [~ u=[1 %b]]
158 [~ u=[1 %b]]
155− ~zod/try=> (both ~ (some %b))
159+ > (both ~ (some %b))
156 ~
160 ~
157
161
158
162
@@ -161,7 +165,7 @@ Examples
161
165
162Apply function to two units
166Apply function to two units
163
167
164−Applies a binary function `c`--which does not usually accept or produce a [`++unit`]()--
168+Applies a binary function `c`--which does not usually accept or produce a `++unit`--
165to the values of two units, `a` and `b`, producing a unit.
169to the values of two units, `a` and `b`, producing a unit.
166
170
167Accepts
171Accepts
@@ -182,22 +186,23 @@ Source
182------
186------
183
187
184 ++ clap :: combine
188 ++ clap :: combine
185− |* [a=(unit) b=(unit) c=_|=(^ +<-)]
189+ |* {a/(unit) b/(unit) c/_|=(^ +<-)}
186 ?~ a b
190 ?~ a b
187 ?~ b a
191 ?~ b a
188 [~ u=(c u.a u.b)]
192 [~ u=(c u.a u.b)]
189
193
194+
190Examples
195Examples
191--------
196--------
192
197
193− ~zod/try=> =u ((unit ,@t) [~ 'a'])
198+ > =u ((unit @t) [~ 'a'])
194− ~zod/try=> =v ((unit ,@t) [~ 'b'])
199+ > =v ((unit @t) [~ 'b'])
195− ~zod/try=> (clap u v |=([a=@t b=@t] (welp (trip a) (trip b))))
200+ > (clap u v |=([a=@t b=@t] (welp (trip a) (trip b))))
196 [~ u="ab"]
201 [~ u="ab"]
197− ~zod/try=> =a ((unit ,@u) [~ 1])
202+ > =a ((unit @u) [~ 1])
198− ~zod/try=> =b ((unit ,@u) [~ 2])
203+ > =b ((unit @u) [~ 2])
199− ~zod/try=> =c |=([a=@ b=@] (add a b))
204+ > =c |=([a=@ b=@] (add a b))
200− ~zod/try=> (clap a b c)
205+ > (clap a b c)
201 [~ 3]
206 [~ 3]
202
207
203
208
@@ -207,7 +212,7 @@ Examples
207
212
208Unit to list
213Unit to list
209
214
210−Makes a [++list]() of the unwrapped value (`u.a`) of a [`++unit`]() `a`.
215+Makes a ++list of the unwrapped value (`u.a`) of a `++unit` `a`.
211
216
212Accepts
217Accepts
213-------
218-------
@@ -223,18 +228,19 @@ Source
223------
228------
224
229
225 ++ drop :: enlist
230 ++ drop :: enlist
226− |* a=(unit)
231+ |* a/(unit)
227 ?~ a ~
232 ?~ a ~
228 [i=u.a t=~]
233 [i=u.a t=~]
229
234
235+
230Examples
236Examples
231--------
237--------
232
238
233− ~zod/try=> =a ((unit ,@) [~ 97])
239+ > =a ((unit @) [~ 97])
234− ~zod/try=> (drop a)
240+ > (drop a)
235 [i=97 t=~]
241 [i=97 t=~]
236− ~zod/try=> =a ((unit ,@) [~])
242+ > =a ((unit @) [~])
237− ~zod/try=> (drop a)
243+ > (drop a)
238 ~
244 ~
239
245
240
246
@@ -244,14 +250,14 @@ Examples
244
250
245Give unit a default value
251Give unit a default value
246
252
247−Produces a default value `b` for a [`++unit`]() `a` in cases where `a` is null.
253+Produces a default value `b` for a `++unit` `a` in cases where `a` is null.
248
254
249Accepts
255Accepts
250-------
256-------
251
257
252`a` is a unit.
258`a` is a unit.
253
259
254−`b` is a [noun]() that's used as the default value.
260+`b` is a noun that's used as the default value.
255
261
256Produces
262Produces
257--------
263--------
@@ -262,15 +268,16 @@ Source
262------
268------
263
269
264 ++ fall :: default
270 ++ fall :: default
265− |* [a=(unit) b=*]
271+ |* {a/(unit) b/*}
266 ?~(a b u.a)
272 ?~(a b u.a)
267
273
274+
268Examples
275Examples
269--------
276--------
270
277
271− ~zod/try=> (fall ~ `a`)
278+ > (fall ~ `a`)
272 `a`
279 `a`
273− ~zod/try=> (fall [~ u=0] `a`)
280+ > (fall [~ u=0] `a`)
274 0
281 0
275
282
276
283
@@ -280,7 +287,7 @@ Examples
280
287
281Curried bind
288Curried bind
282
289
283−Accepts a [`++gate`]() `a` and produces a function that accepts [`++unit`]()
290+Accepts a `++gate` `a` and produces a function that accepts `++unit`
284`b` to which it applies `a`. Used when you want a function that does not accept
291`b` to which it applies `a`. Used when you want a function that does not accept
285or produce a unit to both accept and produce a unit.
292or produce a unit to both accept and produce a unit.
286
293
@@ -300,16 +307,17 @@ Source
300------
307------
301
308
302 ++ lift :: lift gate (fmap)
309 ++ lift :: lift gate (fmap)
303− |* a=gate :: flipped
310+ |* a/gate :: flipped
304− |* b=(unit) :: curried
311+ |* b/(unit) :: curried
305 (bind b a) :: bind
312 (bind b a) :: bind
306
313
314+
307Examples
315Examples
308--------
316--------
309
317
310− ~zod/try=> ((lift dec) `(unit ,@)`~)
318+ > ((lift dec) `(unit @)`~)
311 ~
319 ~
312− ~zod/try=> ((lift dec) `(unit ,@)`[~ 20])
320+ > ((lift dec) `(unit @)`[~ 20])
313 [~ 19]
321 [~ 19]
314
322
315
323
@@ -340,26 +348,27 @@ A unit or crash.
340Source
348Source
341------
349------
342
350
343−++ mate :: choose
351+ ++ mate :: choose
344− |* [a=(unit) b=(unit)]
352+ |* {a/(unit) b/(unit)}
345− ?~ b a
353+ ?~ b a
346− ?~ a b
354+ ?~ a b
347− ?.(=(u.a u.b) ~|('mate' !!) a)
355+ ?.(=(u.a u.b) ~|('mate' !!) a)
356+
348
357
349Examples
358Examples
350--------
359--------
351
360
352− ~zod/try=> =a ((unit ,@) [~ 97])
361+ > =a ((unit @) [~ 97])
353− ~zod/try=> =b ((unit ,@) [~ 97])
362+ > =b ((unit @) [~ 97])
354− ~zod/try=> (mate a b)
363+ > (mate a b)
355 [~ 97]
364 [~ 97]
356− ~zod/try=> =a ((unit ,@) [~ 97])
365+ > =a ((unit @) [~ 97])
357− ~zod/try=> =b ((unit ,@) [~])
366+ > =b ((unit @) [~])
358− ~zod/try=> (mate a b)
367+ > (mate a b)
359 [~ 97]
368 [~ 97]
360− ~zod/try=> =a ((unit ,@) [~ 97])
369+ > =a ((unit @) [~ 97])
361− ~zod/try=> =b ((unit ,@) [~ 98])
370+ > =b ((unit @) [~ 98])
362− ~zod/try=> (mate a b)
371+ > (mate a b)
363 ! 'mate'
372 ! 'mate'
364 ! exit
373 ! exit
365
374
@@ -370,7 +379,7 @@ Examples
370
379
371Unwrap unit
380Unwrap unit
372
381
373−Retrieve the value from a [`++unit`]() and crash if the unit is null.
382+Retrieve the value from a `++unit` and crash if the unit is null.
374
383
375Accepts
384Accepts
376-------
385-------
@@ -386,21 +395,22 @@ Source
386------
395------
387
396
388 ++ need :: demand
397 ++ need :: demand
389− |* a=(unit)
398+ |* a/(unit)
390− ?~ a !!
399+ ?~ a ~|(%need !!)
391 u.a
400 u.a
392
401
402+
393Examples
403Examples
394--------
404--------
395
405
396− ~zod/try=> =a ((unit ,[@t @t]) [~ ['a' 'b']])
406+ > =a ((unit [@t @t]) [~ ['a' 'b']])
397− ~zod/try=> (need a)
407+ > (need a)
398 ['a' 'b']
408 ['a' 'b']
399− ~zod/try=> =a ((unit ,@ud) [~ 17])
409+ > =a ((unit @ud) [~ 17])
400− ~zod/try=> (need a)
410+ > (need a)
401 17
411 17
402− ~zod/try=> =a ((unit ,@) [~])
412+ > =a ((unit @) [~])
403− ~zod/try=> (need a)
413+ > (need a)
404 ! exit
414 ! exit
405
415
406
416
@@ -432,9 +442,9 @@ Source
432Examples
442Examples
433--------
443--------
434
444
435− ~zod/try=> (some [`a` `b`])
445+ > (some [`a` `b`])
436 [~ u=[`a` `b`]]
446 [~ u=[`a` `b`]]
437− ~zod/try=> (some &)
447+ > (some &)
438 [~ u=%.y]
448 [~ u=%.y]
439
449
440
450
docs/system/hoon/library/2b.md+158−125
@@ -20,7 +20,7 @@ Source
20
20
21 ++ flop :: reverse
21 ++ flop :: reverse
22 ~/ %flop
22 ~/ %flop
23− |* a=(list)
23+ |* a/(list)
24 => .(a (homo a))
24 => .(a (homo a))
25 ^+ a
25 ^+ a
26 =+ b=`_a`~
26 =+ b=`_a`~
@@ -29,11 +29,12 @@ Source
29 $(a t.a, b [i.a b])
29 $(a t.a, b [i.a b])
30
30
31
31
32+
32Examples
33Examples
33--------
34--------
34
35
35− ~zod/try=> =a (limo [1 2 3 ~])
36+ > =a (limo [1 2 3 ~])
36− ~zod/try=> (flop a)
37+ > (flop a)
37 ~[3 2 1]
38 ~[3 2 1]
38
39
39
40
@@ -43,7 +44,7 @@ Examples
43
44
44Homogenize
45Homogenize
45
46
46−Produces a [`++list`]() whose type is a fork of all the contained types in the
47+Produces a `++list` whose type is a fork of all the contained types in the
47list `a`. Used when you want to make all the types of the elements of a list the same.
48list `a`. Used when you want to make all the types of the elements of a list the same.
48
49
49Accepts
50Accepts
@@ -60,23 +61,24 @@ Source
60------
61------
61
62
62 ++ homo :: homogenize
63 ++ homo :: homogenize
63− |* a=(list)
64+ |* a/(list)
64 ^+ =< $
65 ^+ =< $
65− |% +- $ ?:(_? ~ [i=(snag 0 a) t=$])
66+ |% +- $ ?:(*? ~ [i=(snag 0 a) t=$])
66 --
67 --
67 a
68 a
68
69
70+
69Examples
71Examples
70--------
72--------
71
73
72− ~zod/try=> lyst
74+ > lyst
73 [i=1 t=[i=97 t=[i=2 t=[i=98 t=[i=[~ u=10] t=~]]]]]
75 [i=1 t=[i=97 t=[i=2 t=[i=98 t=[i=[~ u=10] t=~]]]]]
74− ~zod/try=> (homo lyst)
76+ > (homo lyst)
75 ~[1 97 2 98 [~ u=10]]
77 ~[1 97 2 98 [~ u=10]]
76− ~zod/try=> =a (limo [1 2 3 ~])
78+ > =a (limo [1 2 3 ~])
77− ~zod/try=> a
79+ > a
78 [i=1 t=[i=2 t=[i=3 t=~]]]
80 [i=1 t=[i=2 t=[i=3 t=~]]]
79− ~zod/try=> (homo a)
81+ > (homo a)
80 ~[1 2 3]
82 ~[1 2 3]
81
83
82
84
@@ -86,7 +88,7 @@ Examples
86
88
87List length
89List length
88
90
89−Produces the length of any [`++list`]() `a` as an atom.
91+Produces the length of any `++list` `a` as an atom.
90
92
91Accepts
93Accepts
92-------
94-------
@@ -103,19 +105,20 @@ Source
103
105
104 ++ lent :: length
106 ++ lent :: length
105 ~/ %lent
107 ~/ %lent
106− |= a=(list)
108+ |= a/(list)
107 ^- @
109 ^- @
108 =+ b=0
110 =+ b=0
109 |-
111 |-
110− ?~ a b
112+ ?~ a b
111 $(a t.a, b +(b))
113 $(a t.a, b +(b))
112
114
115+
113Examples
116Examples
114--------
117--------
115
118
116− ~zod/try=> (lent (limo [1 2 3 4 ~]))
119+ > (lent (limo [1 2 3 4 ~]))
117 4
120 4
118− ~zod/try=> (lent (limo [1 'a' 2 'b' (some 10) ~]))
121+ > (lent (limo [1 'a' 2 'b' (some 10) ~]))
119 5
122 5
120
123
121
124
@@ -125,7 +128,7 @@ Examples
125
128
126Logical "and" on list
129Logical "and" on list
127
130
128−Computes the Boolean logical "and" on the results of [gate]() `b` applied to each individual element in [`++list`]() `a`.
131+Computes the Boolean logical "and" on the results of gate `b` applied to each individual element in `++list` `a`.
129
132
130Accepts
133Accepts
131-------
134-------
@@ -137,25 +140,28 @@ Accepts
137Produces
140Produces
138--------
141--------
139
142
143+A boolean.
144+
140Source
145Source
141------
146------
142
147
143 ++ levy
148 ++ levy
144 ~/ %levy :: all of
149 ~/ %levy :: all of
145− |* [a=(list) b=_|=(p=* .?(p))]
150+ |* {a/(list) b/$-(* ?)}
146 |- ^- ?
151 |- ^- ?
147 ?~ a &
152 ?~ a &
148 ?. (b i.a) |
153 ?. (b i.a) |
149 $(a t.a)
154 $(a t.a)
150
155
156+
151Examples
157Examples
152--------
158--------
153
159
154− ~zod/try=> =a |=(a=@ (lte a 1))
160+ > =a |=(a/@ (lte a 1))
155− ~zod/try=> (levy (limo [0 1 2 1 ~]) a)
161+ > (levy (limo [0 1 2 1 ~]) a)
156 %.n
162 %.n
157− ~zod/try=> =a |=(a=@ (lte a 3))
163+ > =a |=(a/@ (lte a 3))
158− ~zod/try=> (levy (limo [0 1 2 1 ~]) a)
164+ > (levy (limo [0 1 2 1 ~]) a)
159 %.y
165 %.y
160
166
161
167
@@ -165,25 +171,34 @@ Examples
165
171
166Logical "or" on list
172Logical "or" on list
167
173
174+Computes the Boolean logical "or" on the results of applying [gate]() `b` to every element of [`++list`]() `a`.
175+
176+Accepts
177+-------
178+
179+`a` is a list.
180+
181+`b` is a gate.
182+
183+Source
184+------
185+
168 ++ lien :: some of
186 ++ lien :: some of
169 ~/ %lien
187 ~/ %lien
170− |* [a=(list) b=$+(* ?)]
188+ |* {a/(list) b/$-(* ?)}
171 |- ^- ?
189 |- ^- ?
172 ?~ a |
190 ?~ a |
173 ?: (b i.a) &
191 ?: (b i.a) &
174 $(a t.a)
192 $(a t.a)
193+
194+Examples
195+--------
175
196
176−Computes the Boolean logical "or" on the results of applying [gate]() `b` to every element of [`++list`]() `a`.
177−
178−`a` is a list.
179−
180−`b` is a gate.
181−
182− ~zod/try=> =a |=(a=@ (gte a 1))
197+ > =a |=(a=@ (gte a 1))
183− ~zod/try=> (lien (limo [0 1 2 1 ~]) a)
198+ > (lien (limo [0 1 2 1 ~]) a)
184 %.y
199 %.y
185− ~zod/try=> =a |=(a=@ (gte a 3))
200+ > =a |=(a=@ (gte a 3))
186− ~zod/try=> (lien (limo [0 1 2 1 ~]) a)
201+ > (lien (limo [0 1 2 1 ~]) a)
187 %.n
202 %.n
188
203
189
204
@@ -203,7 +218,7 @@ Accepts
203Produces
218Produces
204--------
219--------
205
220
206−A list
221+A `++list`.
207
222
208Source
223Source
209------
224------
@@ -218,7 +233,7 @@ Source
218Examples
233Examples
219--------
234--------
220
235
221− ~zod/try=> (limo [1 2 3 ~])
236+ > (limo [1 2 3 ~])
222 [i=1 t=[i=2 t=[i=3 t=~]]]
237 [i=1 t=[i=2 t=[i=3 t=~]]]
223
238
224
239
@@ -228,16 +243,16 @@ Examples
228
243
229Maybe transform
244Maybe transform
230
245
231−Passes each member of [`++list`]() `a` to [gate]() `b`, which must produce a
246+Passes each member of `++list` `a` to gate `b`, which must produce a
232−[`++unit`](). Produces a new list with all the results that do not produce
247+`++unit`. Produces a new list with all the results that do not produce
233`~`.
248`~`.
234
249
235Accepts
250Accepts
236-------
251-------
237
252
238−`a` is a [list]().
253+`a` is a list.
239
254
240−`b` is a [gate]() that produces a [unit]().
255+`b` is a gate that produces a unit.
241
256
242Produces
257Produces
243--------
258--------
@@ -248,7 +263,8 @@ Source
248------
263------
249
264
250 ++ murn :: maybe transform
265 ++ murn :: maybe transform
266+ ~/ %murn
251− |* [a=(list) b=$+(* (unit))]
267+ |* {a/(list) b/$-(* (unit))}
252 |-
268 |-
253 ?~ a ~
269 ?~ a ~
254 =+ c=(b i.a)
270 =+ c=(b i.a)
@@ -259,8 +275,8 @@ Source
259Examples
275Examples
260--------
276--------
261
277
262− ~zod/try=> =a |=(a=@ ?.((gte a 2) ~ (some (add a 10))))
278+ > =a |=(a=@ ?.((gte a 2) ~ (some (add a 10))))
263− ~zod/try=> (murn (limo [0 1 2 3 ~]) a)
279+ > (murn (limo [0 1 2 3 ~]) a)
264 [i=12 t=[i=13 t=~]]
280 [i=12 t=[i=13 t=~]]
265
281
266
282
@@ -270,12 +286,12 @@ Examples
270
286
271Replicate
287Replicate
272
288
273−Replicate: produces a [`++list`]() containing `a` copies of `b`.
289+Replicate: produces a `++list` containing `a` copies of `b`.
274
290
275Accepts
291Accepts
276-------
292-------
277
293
278−`b` is a [noun]()
294+`b` is a noun.
279
295
280Produces
296Produces
281--------
297--------
@@ -286,19 +302,20 @@ Source
286------
302------
287
303
288 ++ reap :: replicate
304 ++ reap :: replicate
305+ ~/ %reap
289− |* [a=@ b=*]
306+ |* {a/@ b/*}
290− |- ^- (list ,_b)
307+ |- ^- (list _b)
291 ?~ a ~
308 ?~ a ~
292 [b $(a (dec a))]
309 [b $(a (dec a))]
293
310
294Examples
311Examples
295--------
312--------
296
313
297− ~zod/try=> (reap 20 %a)
314+ > (reap 20 %a)
298 ~[%a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a]
315 ~[%a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a]
299− ~zod/try=> (reap 5 ~s1)
316+ > (reap 5 ~s1)
300 ~[~s1 ~s1 ~s1 ~s1 ~s1]
317 ~[~s1 ~s1 ~s1 ~s1 ~s1]
301− ~zod/try=> `@dr`(roll (reap 5 ~s1) add)
318+ > `@dr`(roll (reap 5 ~s1) add)
302 ~s5
319 ~s5
303
320
304
321
@@ -308,8 +325,8 @@ Examples
308
325
309Right fold
326Right fold
310
327
311−Right fold: moves right to left across a [`++list`]() `a`, recursively slamming
328+Right fold: moves right to left across a `++list` `a`, recursively slamming
312−a binary [gate]() `b` with an element from `a` and an accumulator, producing
329+a binary gate `b` with an element from `a` and an accumulator, producing
313the final value of the accumulator.
330the final value of the accumulator.
314
331
315Accepts
332Accepts
@@ -320,29 +337,30 @@ Accepts
320Produces
337Produces
321--------
338--------
322
339
323−The accumulator, which is a [noun]().
340+The accumulator, which is a noun.
324
341
325Source
342Source
326------
343------
327
344
328− ++ reel :: right fold
345+ ++ reel :: right fold
329 ~/ %reel
346 ~/ %reel
330− |* [a=(list) b=_|=([* *] +<+)]
347+ |* {a/(list) b/_|=({* *} +<+)}
331 |- ^+ +<+.b
348 |- ^+ +<+.b
332 ?~ a
349 ?~ a
333 +<+.b
350 +<+.b
334 (b i.a $(a t.a))
351 (b i.a $(a t.a))
335
352
353+
336Examples
354Examples
337--------
355--------
338
356
339− ~zod/try=> =sum =|([p=@ q=@] |.((add p q)))
357+ > =sum =|([p=@ q=@] |.((add p q)))
340− ~zod/try=> (reel (limo [1 2 3 4 5 ~]) sum)
358+ > (reel (limo [1 2 3 4 5 ~]) sum)
341 15
359 15
342− ~zod/try=> =a =|([p=@ q=@] |.((sub p q)))
360+ > =a =|([p=@ q=@] |.((sub p q)))
343− ~zod/try=> (reel (limo [6 3 1 ~]) a)
361+ > (reel (limo [6 3 1 ~]) a)
344 4
362 4
345− ~zod/try=> (reel (limo [3 6 1 ~]) a)
363+ > (reel (limo [3 6 1 ~]) a)
346 ! subtract-underflow
364 ! subtract-underflow
347 ! exit
365 ! exit
348
366
@@ -381,14 +399,14 @@ Source
381Examples
399Examples
382--------
400--------
383
401
384− ~zod/try=> =sum =|([p=@ q=@] |.((add p q)))
402+ > =sum =|([p=@ q=@] |.((add p q)))
385− ~zod/try=> (roll (limo [1 2 3 4 5 ~]) sum)
403+ > (roll (limo [1 2 3 4 5 ~]) sum)
386 q=15
404 q=15
387− ~zod/try=> =a =|([p=@ q=@] |.((sub p q)))
405+ > =a =|([p=@ q=@] |.((sub p q)))
388− ~zod/try=> (roll (limo [6 3 1 ~]) a)
406+ > (roll (limo [6 3 1 ~]) a)
389 ! subtract-underflow
407 ! subtract-underflow
390 ! exit
408 ! exit
391− ~zod/try=> (roll (limo [1 3 6 ~]) a)
409+ > (roll (limo [1 3 6 ~]) a)
392 q=4
410 q=4
393
411
394
412
@@ -424,9 +442,9 @@ Source
424Examples
442Examples
425--------
443--------
426
444
427− ~zod/try=> (scag 2 (limo [0 1 2 3 ~]))
445+ > (scag 2 (limo [0 1 2 3 ~]))
428 [i=0 t=[i=1 t=~]]
446 [i=0 t=[i=1 t=~]]
429− ~zod/try=> (scag 10 (limo [1 2 3 4 ~]))
447+ > (scag 10 (limo [1 2 3 4 ~]))
430 [i=1 t=[i=2 t=[i=3 t=[i=4 t=~]]]]
448 [i=1 t=[i=2 t=[i=3 t=[i=4 t=~]]]]
431
449
432
450
@@ -436,8 +454,8 @@ Examples
436
454
437Separate
455Separate
438
456
439−Separates a [`++list`]() `a` into two lists - Those elements of `a` who produce
457+Separates a `++list` `a` into two lists - Those elements of `a` who produce
440−true when slammed to [gate]() `b` and those who produce `%.n`.
458+true when slammed to gate `b` and those who produce `%.n`.
441
459
442Accepts
460Accepts
443-------
461-------
@@ -453,18 +471,20 @@ Source
453------
471------
454
472
455 ++ skid :: separate
473 ++ skid :: separate
474+ ~/ %skid
456− |* [a=(list) b=$+(* ?)]
475+ |* {a/(list) b/$-(* ?)}
457 |- ^+ [p=a q=a]
476 |- ^+ [p=a q=a]
458 ?~ a [~ ~]
477 ?~ a [~ ~]
459 =+ c=$(a t.a)
478 =+ c=$(a t.a)
460 ?:((b i.a) [[i.a p.c] q.c] [p.c [i.a q.c]])
479 ?:((b i.a) [[i.a p.c] q.c] [p.c [i.a q.c]])
461
480
462
481
482+
463Examples
483Examples
464--------
484--------
465
485
466− ~zod/try=> =a |=(a=@ (gth a 1))
486+ > =a |=(a/@ (gth a 1))
467− ~zod/try=> (skid (limo [0 1 2 3 ~]) a)
487+ > (skid (limo [0 1 2 3 ~]) a)
468 [p=[i=2 t=[i=3 t=~]] q=[i=0 t=[i=1 t=~]]]
488 [p=[i=2 t=[i=3 t=~]] q=[i=0 t=[i=1 t=~]]]
469
489
470
490
@@ -481,27 +501,30 @@ producing a list of all of the members that produce `%.y`. Inverse of
481Accepts
501Accepts
482-------
502-------
483
503
484−`b` is a [gate]() that accepts one argument and produces a loobean.
504+`b` is a gate that accepts one argument and produces a boolean.
485
505
486Produces
506Produces
487--------
507--------
488
508
509+A boolean
510+
489Source
511Source
490------
512------
491
513
492−++ skim :: only
514+ ++ skim :: only
493− ~/ %skim
515+ ~/ %skim
494− |* [a=(list) b=_|=(p=* .?(p))]
516+ |* {a/(list) b/$-(* ?)}
495− |-
517+ |-
496− ^+ a`
518+ ^+ a
497− ?~ a ~
519+ ?~ a ~
498− ?:((b i.a) [i.a $(a t.a)] $(a t.a))
520+ ?:((b i.a) [i.a $(a t.a)] $(a t.a))
521+
499
522
500Examples
523Examples
501--------
524--------
502
525
503− ~zod/try=> =a |=(a=@ (gth a 1))
526+ > =a |=(a/@ (gth a 1))
504− ~zod/try=> (skim (limo [0 1 2 3 ~]) a)
527+ > (skim (limo [0 1 2 3 ~]) a)
505 [i=2 t=[i=3 t=~]]
528 [i=2 t=[i=3 t=~]]
506
529
507
530
@@ -511,14 +534,14 @@ Examples
511
534
512Except
535Except
513
536
514−Cycles through the members of [`++list`]() `a`, passing them to a [gate]() `b`.
537+Cycles through the members of `++list` `a`, passing them to a gate `b`.
515Produces a list of all of the members that produce `%.n`. Inverse of
538Produces a list of all of the members that produce `%.n`. Inverse of
516`++skim`.
539`++skim`.
517
540
518Accepts
541Accepts
519-------
542-------
520
543
521−`b` is a [gate]() that accepts one argument and produces a loobean.
544+`b` is a gate that accepts one argument and produces a loobean.
522
545
523Produces
546Produces
524--------
547--------
@@ -530,17 +553,18 @@ Source
530
553
531 ++ skip :: except
554 ++ skip :: except
532 ~/ %skip
555 ~/ %skip
533− |* [a=(list) b=_|=(p=* .?(p))]
556+ |* {a/(list) b/$-(* ?)}
534 |-
557 |-
535 ^+ a
558 ^+ a
536 ?~ a ~
559 ?~ a ~
537 ?:((b i.a) $(a t.a) [i.a $(a t.a)])
560 ?:((b i.a) $(a t.a) [i.a $(a t.a)])
538
561
562+
539Examples
563Examples
540--------
564--------
541
565
542− ~zod/try=> =a |=(a=@ (gth a 1))
566+ > =a |=(a/@ (gth a 1))
543− ~zod/try=> (skip (limo [0 1 2 3 ~]) a)
567+ > (skip (limo [0 1 2 3 ~]) a)
544 [i=0 t=[i=1 t=~]]
568 [i=0 t=[i=1 t=~]]
545
569
546
570
@@ -556,7 +580,7 @@ Accepts an atom `a` and list `b`, producing the remaining elements from
556Accepts
580Accepts
557-------
581-------
558
582
559−`b` is a [list]().
583+`b` is a list.
560
584
561Produces
585Produces
562--------
586--------
@@ -568,18 +592,19 @@ Source
568
592
569 ++ slag :: suffix
593 ++ slag :: suffix
570 ~/ %slag
594 ~/ %slag
571− |* [a=@ b=(list)]
595+ |* {a/@ b/(list)}
572 |- ^+ b
596 |- ^+ b
573 ?: =(0 a) b
597 ?: =(0 a) b
574 ?~ b ~
598 ?~ b ~
575 $(b t.b, a (dec a))
599 $(b t.b, a (dec a))
576
600
601+
577Examples
602Examples
578--------
603--------
579
604
580− ~zod/try=> (slag 2 (limo [1 2 3 4 ~]))
605+ > (slag 2 (limo [1 2 3 4 ~]))
581 [i=3 t=[i=4 t=~]]
606 [i=3 t=[i=4 t=~]]
582− ~zod/try=> (slag 1 (limo [1 2 3 4 ~]))
607+ > (slag 1 (limo [1 2 3 4 ~]))
583 [i=2 t=[i=3 t=[i=4 t=~]]]
608 [i=2 t=[i=3 t=[i=4 t=~]]]
584
609
585
610
@@ -589,13 +614,13 @@ Examples
589
614
590Index
615Index
591
616
592−Accepts an atom `a` and a [`++list`]() `b`, producing the element at the index
617+Accepts an atom `a` and a `++list` `b`, producing the element at the index
593of `a`and failing if the list is null. Lists are 0-indexed.
618of `a`and failing if the list is null. Lists are 0-indexed.
594
619
595Accepts
620Accepts
596-------
621-------
597
622
598−`b` is a [list]().
623+`b` is a list.
599
624
600Produces
625Produces
601--------
626--------
@@ -607,19 +632,20 @@ Source
607
632
608 ++ snag :: index
633 ++ snag :: index
609 ~/ %snag
634 ~/ %snag
610− |* [a=@ b=(list)]
635+ |* {a/@ b/(list)}
611 |-
636 |-
612 ?~ b
637 ?~ b
613 ~|('snag-fail' !!)
638 ~|('snag-fail' !!)
614 ?: =(0 a) i.b
639 ?: =(0 a) i.b
615 $(b t.b, a (dec a))
640 $(b t.b, a (dec a))
616
641
642+
617Examples
643Examples
618--------
644--------
619
645
620− ~zod/try=> (snag 2 "asdf")
646+ > (snag 2 "asdf")
621 ~~d
647 ~~d
622− ~zod/try=> (snag 0 `(list ,@ud)`~[1 2 3 4])
648+ > (snag 0 `(list ,@ud)`~[1 2 3 4])
623 1
649 1
624
650
625
651
@@ -629,7 +655,7 @@ Examples
629
655
630Quicksort
656Quicksort
631
657
632−Quicksort: accepts a [`++list`]() `a` and a [gate]() `b` which accepts two nouns and
658+Quicksort: accepts a `++list` `a` and a gate `b` which accepts two nouns and
633produces a loobean. `++sort` then produces a list of the elements of `a`,
659produces a loobean. `++sort` then produces a list of the elements of `a`,
634sorted according to `b`.
660sorted according to `b`.
635
661
@@ -646,22 +672,23 @@ A list
646Source
672Source
647------
673------
648
674
649− ++ sort :: quicksort
675+ ++ sort !. :: quicksort
650 ~/ %sort
676 ~/ %sort
651− |* [a=(list) b=$+([* *] ?)]
677+ |* {a/(list) b/$-([* *] ?)}
652 => .(a ^.(homo a))
678 => .(a ^.(homo a))
653 |- ^+ a
679 |- ^+ a
654 ?~ a ~
680 ?~ a ~
655 %+ weld
681 %+ weld
656− $(a (skim t.a |=(c=_i.a (b c i.a))))
682+ $(a (skim t.a |=(c/_i.a (b c i.a))))
657 ^+ t.a
683 ^+ t.a
658− [i.a $(a (skim t.a |=(c=_i.a !(b c i.a))))]
684+ [i.a $(a (skim t.a |=(c/_i.a !(b c i.a))))]
685+
659
686
660Examples
687Examples
661--------
688--------
662
689
663− ~zod/try=> =a =|([p=@ q=@] |.((gth p q)))
690+ > =a =|({p=@ q=@} |.((gth p q)))
664− ~zod/try=> (sort (limo [0 1 2 3 ~]) a)
691+ > (sort (limo [0 1 2 3 ~]) a)
665 ~[3 2 1 0]
692 ~[3 2 1 0]
666
693
667
694
@@ -677,7 +704,7 @@ inclusive index `a`, producing `b` number of characters.
677Accepts
704Accepts
678-------
705-------
679
706
680−`c` is a [list]().
707+`c` is a list.
681
708
682Produces
709Produces
683--------
710--------
@@ -688,15 +715,16 @@ Source
688------
715------
689
716
690 ++ swag :: infix
717 ++ swag :: infix
691− |* [[a=@ b=@] c=(list)]
718+ |* {{a/@ b/@} c/(list)}
692− (scag b (slag a c))
719+ (scag +<-> (slag +<-< c))
720+
693
721
694Examples
722Examples
695--------
723--------
696
724
697− ~zod/try=> (swag [2 5] "roly poly")
725+ > (swag [2 5] "roly poly")
698 "ly po"
726 "ly po"
699− ~zod/try=> (swag [2 2] (limo [1 2 3 4 ~]))
727+ > (swag [2 2] (limo [1 2 3 4 ~]))
700 [i=3 t=[i=4 t=~]]
728 [i=3 t=[i=4 t=~]]
701
729
702
730
@@ -706,7 +734,7 @@ Examples
706
734
707Gate to list
735Gate to list
708
736
709−Accepts a [`++list`]() `a` and a [gate]() `b`. Produces a list with the gate applied
737+Accepts a `++list` `a` and a gate `b`. Produces a list with the gate applied
710to each element of the original list.
738to each element of the original list.
711
739
712Accepts
740Accepts
@@ -724,18 +752,19 @@ Source
724
752
725 ++ turn :: transform
753 ++ turn :: transform
726 ~/ %turn
754 ~/ %turn
727− |* [a=(list) b=_,*]
755+ |* {a/(list) b/$-(* *)}
728 |-
756 |-
729 ?~ a ~
757 ?~ a ~
730 [i=(b i.a) t=$(a t.a)]
758 [i=(b i.a) t=$(a t.a)]
731
759
760+
732Examples
761Examples
733--------
762--------
734
763
735− ~zod/try=> (turn (limo [104 111 111 110 ~]) ,@t)
764+ > (turn (limo [104 111 111 110 ~]) ,@t)
736 <|h o o n|>
765 <|h o o n|>
737− ~zod/try=> =a |=(a=@ (add a 4))
766+ > =a |=(a/@ (add a 4))
738− ~zod/try=> (turn (limo [1 2 3 4 ~]) a)
767+ > (turn (limo [1 2 3 4 ~]) a)
739 ~[5 6 7 8]
768 ~[5 6 7 8]
740
769
741
770
@@ -745,30 +774,31 @@ Examples
745
774
746Concatenate
775Concatenate
747
776
748−Concatenate two [`++list`]()s `a` and `b`.
777+Concatenate two `++list`s `a` and `b`.
749
778
750Accepts
779Accepts
751-------
780-------
752
781
753−`a` and `b` are [list]()s.
782+`a` and `b` are lists.
754
783
755Source
784Source
756------
785------
757
786
758 ++ weld :: concatenate
787 ++ weld :: concatenate
759 ~/ %weld
788 ~/ %weld
760− |* [a=(list) b=(list)]
789+ |* {a/(list) b/(list)}
761 => .(a ^.(homo a), b ^.(homo b))
790 => .(a ^.(homo a), b ^.(homo b))
762 |- ^+ b
791 |- ^+ b
763 ?~ a b
792 ?~ a b
764 [i.a $(a t.a)]
793 [i.a $(a t.a)]
765
794
795+
766Examples
796Examples
767--------
797--------
768
798
769− ~zod/try=> (weld "urb" "it")
799+ > (weld "urb" "it")
770 ~[~~u ~~r ~~b ~~i ~~t]
800 ~[~~u ~~r ~~b ~~i ~~t]
771− ~zod/try=> (weld (limo [1 2 ~]) (limo [3 4 ~]))
801+ > (weld (limo [1 2 ~]) (limo [3 4 ~]))
772 ~[1 2 3 4]
802 ~[1 2 3 4]
773
803
774
804
@@ -778,7 +808,7 @@ Examples
778
808
779Perfect weld
809Perfect weld
780
810
781−Concatenate two [`++list`]()s `a` and `b` without losing their type information
811+Concatenate two `++list`s `a` and `b` without losing their type information
782to homogenization.
812to homogenization.
783
813
784Accepts
814Accepts
@@ -797,7 +827,7 @@ Source
797------
827------
798
828
799 ++ welp :: perfect weld
829 ++ welp :: perfect weld
800− =| [* *]
830+ =| {* *}
801 |%
831 |%
802 +- $
832 +- $
803 ?~ +<-
833 ?~ +<-
@@ -805,17 +835,18 @@ Source
805 +<-(+ $(+<- +<->))
835 +<-(+ $(+<- +<->))
806 --
836 --
807
837
838+
808Examples
839Examples
809--------
840--------
810
841
811− ~zod/try=> (welp "foo" "bar")
842+ > (welp "foo" "bar")
812 "foobar"
843 "foobar"
813 ~zod/arvo=/hoon/hoon> (welp ~[60 61 62] ~[%a %b %c])
844 ~zod/arvo=/hoon/hoon> (welp ~[60 61 62] ~[%a %b %c])
814 [60 61 62 %a %b %c ~]
845 [60 61 62 %a %b %c ~]
815− ~zod/arvo=/hoon/hoon> :type; (welp ~[60 61 62] ~[%a %b %c])
846+ ~zod/arvo=/hoon/hoon>? (welp ~[60 61 62] ~[%a %b %c])
816 [60 61 62 %a %b %c ~]
847 [60 61 62 %a %b %c ~]
817 [@ud @ud @ud %a %b %c %~]
848 [@ud @ud @ud %a %b %c %~]
818− ~zod/arvo=/hoon/hoon> (welp [sa/1 so/2 ~] si/3)
849+ ~zod/arvo=/hoon/hoon> (welp [sa+1 so+2 ~] si/3)
819 [[%sa 1] [%so 2] %si 3]
850 [[%sa 1] [%so 2] %si 3]
820
851
821
852
@@ -825,7 +856,7 @@ Examples
825
856
826Cons
857Cons
827
858
828−Turns a [`++list`]() of lists into a single list by promoting the elements of
859+Turns a `++list` of lists into a single list by promoting the elements of
829each sublist into the higher.
860each sublist into the higher.
830
861
831Accepts
862Accepts
@@ -850,12 +881,14 @@ Source
850 (welp +<- $(+< +<+))
881 (welp +<- $(+< +<+))
851 --
882 --
852
883
884+
885+
853Examples
886Examples
854--------
887--------
855
888
856− ~zod/try=> (zing (limo [(limo ['a' 'b' 'c' ~]) (limo ['e' 'f' 'g' ~]) (limo ['h' 'i' 'j' ~]) ~]))
889+ > (zing (limo [(limo ['a' 'b' 'c' ~]) (limo ['e' 'f' 'g' ~]) (limo ['h' 'i' 'j' ~]) ~]))
857 ~['a' 'b' 'c' 'e' 'f' 'g' 'h' 'i' 'j']
890 ~['a' 'b' 'c' 'e' 'f' 'g' 'h' 'i' 'j']
858− ~zod/try=> (zing (limo [(limo [1 'a' 2 'b' ~]) (limo [3 'c' 4 'd' ~]) ~]))
891+ > (zing (limo [(limo [1 'a' 2 'b' ~]) (limo [3 'c' 4 'd' ~]) ~]))
859 ~[1 97 2 98 3 99 4 100]
892 ~[1 97 2 98 3 99 4 100]
860
893
861
894
docs/system/hoon/library/2c.md+140−136
@@ -3,7 +3,7 @@
3
3
4Binary exponent
4Binary exponent
5
5
6−Computes the result of `2^a`, producing an [atom]().
6+Computes the result of `2^a`, producing an atom.
7
7
8Accepts
8Accepts
9-------
9-------
@@ -20,7 +20,7 @@ Source
20
20
21 ++ bex :: binary exponent
21 ++ bex :: binary exponent
22 ~/ %bex
22 ~/ %bex
23− |= a=@
23+ |= a/@
24 ^- @
24 ^- @
25 ?: =(0 a) 1
25 ?: =(0 a) 1
26 (mul 2 $(a (dec a)))
26 (mul 2 $(a (dec a)))
@@ -28,11 +28,11 @@ Source
28Examples
28Examples
29--------
29--------
30
30
31− ~zod/try=> (bex 4)
31+ > (bex 4)
32 16
32 16
33− ~zod/try=> (bex (add 19 1))
33+ > (bex (add 19 1))
34 1.048.576
34 1.048.576
35− ~zod/try=> (bex 0)
35+ > (bex 0)
36 1
36 1
37
37
38
38
@@ -43,16 +43,16 @@ Examples
43
43
44Assemble
44Assemble
45
45
46−Produces an [atom]() from a list `b` of length-value pairs `p` and `q`,
46+Produces an atom from a list `b` of length-value pairs `p` and `q`,
47where `p` is the length in bloqs of size `a`, and `q` is an atomic
47where `p` is the length in bloqs of size `a`, and `q` is an atomic
48value.
48value.
49
49
50Accepts
50Accepts
51-------
51-------
52
52
53−`a` is a block size (see [`++bloq`]()).
53+`a` is a block size (see `++bloq`).
54
54
55−`b` is a [`++list`]() of length value pairs, `p` and `q`.
55+`b` is a `++list` of length value pairs, `p` and `q`.
56
56
57Produces
57Produces
58--------
58--------
@@ -64,7 +64,7 @@ Source
64
64
65 ++ can :: assemble
65 ++ can :: assemble
66 ~/ %can
66 ~/ %can
67− |= [a=bloq b=(list ,[p=@ q=@])]
67+ |= [a/bloq b/(list [p=@ q=@])]
68 ^- @
68 ^- @
69 ?~ b 0
69 ?~ b 0
70 (mix (end a p.i.b q.i.b) (lsh a p.i.b $(b t.b)))
70 (mix (end a p.i.b q.i.b) (lsh a p.i.b $(b t.b)))
@@ -72,17 +72,17 @@ Source
72Examples
72Examples
73--------
73--------
74
74
75− ~zod/try=> `@ub`(can 3 ~[[1 1]])
75+ > `@ub`(can 3 ~[[1 1]])
76 0b1
76 0b1
77− ~zod/try=> `@ub`(can 0 ~[[1 255]])
77+ > `@ub`(can 0 ~[[1 255]])
78 0b1
78 0b1
79− ~zod/try=> `@ux`(can 3 [3 0xc1] [1 0xa] ~)
79+ > `@ux`(can 3 [3 0xc1] [1 0xa] ~)
80 0xa00.00c1
80 0xa00.00c1
81− ~zod/try=> `@ux`(can 3 [3 0xc1] [1 0xa] [1 0x23] ~)
81+ > `@ux`(can 3 [3 0xc1] [1 0xa] [1 0x23] ~)
82 0x23.0a00.00c1
82 0x23.0a00.00c1
83− ~zod/try=> `@ux`(can 4 [3 0xc1] [1 0xa] [1 0x23] ~)
83+ > `@ux`(can 4 [3 0xc1] [1 0xa] [1 0x23] ~)
84 0x23.000a.0000.0000.00c1
84 0x23.000a.0000.0000.00c1
85− ~zod/try=> `@ux`(can 3 ~[[1 'a'] [2 'bc']])
85+ > `@ux`(can 3 ~[[1 'a'] [2 'bc']])
86 0x63.6261
86 0x63.6261
87
87
88
88
@@ -91,13 +91,13 @@ Examples
91
91
92Concatenate
92Concatenate
93
93
94−Concatenates two [atom]()s, `b` and `c`, according to bloq size `a`, producing an
94+Concatenates two atoms, `b` and `c`, according to bloq size `a`, producing an
95atom.
95atom.
96
96
97Accepts
97Accepts
98-------
98-------
99
99
100−`a` is a block size (see [`++bloq`]()).
100+`a` is a block size (see `++bloq`).
101
101
102`b` is an atom.
102`b` is an atom.
103
103
@@ -113,29 +113,30 @@ Source
113
113
114 ++ cat :: concatenate
114 ++ cat :: concatenate
115 ~/ %cat
115 ~/ %cat
116− |= [a=bloq b=@ c=@]
116+ |= {a/bloq b/@ c/@}
117 (add (lsh a (met a b) c) b)
117 (add (lsh a (met a b) c) b)
118
118
119+
119Examples
120Examples
120--------
121--------
121
122
122− ~zod/try=> `@ub`(cat 3 1 0)
123+ > `@ub`(cat 3 1 0)
123 0b1
124 0b1
124− ~zod/try=> `@ub`(cat 0 1 1)
125+ > `@ub`(cat 0 1 1)
125 0b11
126 0b11
126− ~zod/try=> `@ub`(cat 0 2 1)
127+ > `@ub`(cat 0 2 1)
127 0b110
128 0b110
128− ~zod/try=> `@ub`(cat 2 1 1)
129+ > `@ub`(cat 2 1 1)
129 0b1.0001
130 0b1.0001
130− ~zod/try=> `@ub`256
131+ > `@ub`256
131 0b1.0000.0000
132 0b1.0000.0000
132− ~zod/try=> `@ub`255
133+ > `@ub`255
133 0b1111.1111
134 0b1111.1111
134− ~zod/try=> `@ub`(cat 3 256 255)
135+ > `@ub`(cat 3 256 255)
135 0b1111.1111.0000.0001.0000.0000
136 0b1111.1111.0000.0001.0000.0000
136− ~zod/try=> `@ub`(cat 2 256 255)
137+ > `@ub`(cat 2 256 255)
137 0b1111.1111.0001.0000.0000
138 0b1111.1111.0001.0000.0000
138− ~zod/try=> (cat 3 256 255)
139+ > (cat 3 256 255)
139 16.711.936
140 16.711.936
140
141
141
142
@@ -150,9 +151,9 @@ Slices `c` blocks of size `a` that are `b` blocks from the end of `d`.
150Accepts
151Accepts
151-------
152-------
152
153
153−`a` is a block size (see [++bloq]()).
154+`a` is a block size (see ++bloq).
154
155
155−`b` is an [atom]().
156+`b` is an atom.
156
157
157`c` is an atom.
158`c` is an atom.
158
159
@@ -166,27 +167,27 @@ Source
166
167
167 ++ cut :: slice
168 ++ cut :: slice
168 ~/ %cut
169 ~/ %cut
169− |= [a=bloq [b=@ c=@] d=@]
170+ |= {a/bloq {b/@u c/@u} d/@}
170 (end a c (rsh a b d))
171 (end a c (rsh a b d))
171
172
172Examples
173Examples
173--------
174--------
174
175
175− ~zod/try=> (cut 0 [1 1] 2)
176+ > (cut 0 [1 1] 2)
176 1
177 1
177− ~zod/try=> (cut 0 [2 1] 4)
178+ > (cut 0 [2 1] 4)
178 1
179 1
179− ~zod/try=> `@t`(cut 3 [0 3] 'abcdefgh')
180+ > `@t`(cut 3 [0 3] 'abcdefgh')
180 'abc'
181 'abc'
181− ~zod/try=> `@t`(cut 3 [1 3] 'abcdefgh')
182+ > `@t`(cut 3 [1 3] 'abcdefgh')
182 'bcd'
183 'bcd'
183− ~zod/try=> `@ub`(cut 0 [0 3] 0b1111.0000.1101)
184+ > `@ub`(cut 0 [0 3] 0b1111.0000.1101)
184 0b101
185 0b101
185− ~zod/try=> `@ub`(cut 0 [0 6] 0b1111.0000.1101)
186+ > `@ub`(cut 0 [0 6] 0b1111.0000.1101)
186 0b1101
187 0b1101
187− ~zod/try=> `@ub`(cut 0 [4 6] 0b1111.0000.1101)
188+ > `@ub`(cut 0 [4 6] 0b1111.0000.1101)
188 0b11.0000
189 0b11.0000
189− ~zod/try=> `@ub`(cut 0 [3 6] 0b1111.0000.1101)
190+ > `@ub`(cut 0 [3 6] 0b1111.0000.1101)
190 0b10.0001
191 0b10.0001
191
192
192
193
@@ -196,16 +197,16 @@ Examples
196
197
197Tail
198Tail
198
199
199−Produces an [atom]() by taking the last `b` blocks of size `a` from `c`.
200+Produces an atom by taking the last `b` blocks of size `a` from `c`.
200
201
201Accepts
202Accepts
202-------
203-------
203
204
204−`a` is a block size (see [`++bloq`]()).
205+`a` is a block size (see `++bloq`).
205
206
206`b` is an atom.
207`b` is an atom.
207
208
208−`c` is an [atom]().
209+`c` is an atom.
209
210
210Produces
211Produces
211--------
212--------
@@ -218,27 +219,28 @@ Source
218
219
219 ++ end :: tail
220 ++ end :: tail
220 ~/ %end
221 ~/ %end
221− |= [a=bloq b=@ c=@]
222+ |= {a/bloq b/@u c/@}
222 (mod c (bex (mul (bex a) b)))
223 (mod c (bex (mul (bex a) b)))
223
224
225+
224Examples
226Examples
225--------
227--------
226
228
227− ~zod/try=> `@ub`12
229+ > `@ub`12
228 0b1100
230 0b1100
229− ~zod/try=> `@ub`(end 0 3 12)
231+ > `@ub`(end 0 3 12)
230 0b100
232 0b100
231− ~zod/try=> (end 0 3 12)
233+ > (end 0 3 12)
232 4
234 4
233− ~zod/try=> `@ub`(end 1 3 12)
235+ > `@ub`(end 1 3 12)
234 0b1100
236 0b1100
235− ~zod/try=> (end 1 3 12)
237+ > (end 1 3 12)
236 12
238 12
237− ~zod/try=> `@ux`'abc'
239+ > `@ux`'abc'
238 0x63.6261
240 0x63.6261
239− ~zod/try=> `@ux`(end 3 2 'abc')
241+ > `@ux`(end 3 2 'abc')
240 0x6261
242 0x6261
241− ~zod/try=> `@t`(end 3 2 'abc')
243+ > `@t`(end 3 2 'abc')
242 'ab'
244 'ab'
243
245
244
246
@@ -248,16 +250,16 @@ Examples
248
250
249Fill bloqstream
251Fill bloqstream
250
252
251−Produces an [atom]() by repeating `c` for `b` blocks of size `a`.
253+Produces an atom by repeating `c` for `b` blocks of size `a`.
252
254
253Accepts
255Accepts
254-------
256-------
255
257
256−`a` is a block size (see [`++bloq`]()).
258+`a` is a block size (see `++bloq`).
257
259
258`b` is an atom.
260`b` is an atom.
259
261
260−`c` is an [atom]().
262+`c` is an atom.
261
263
262Produces
264Produces
263--------
265--------
@@ -268,7 +270,7 @@ Source
268------
270------
269
271
270 ++ fil :: fill bloqstream
272 ++ fil :: fill bloqstream
271− |= [a=bloq b=@ c=@]
273+ |= {a/bloq b/@u c/@}
272 =+ n=0
274 =+ n=0
273 =+ d=c
275 =+ d=c
274 |- ^- @
276 |- ^- @
@@ -276,16 +278,17 @@ Source
276 (rsh a 1 d)
278 (rsh a 1 d)
277 $(d (add c (lsh a 1 d)), n +(n))
279 $(d (add c (lsh a 1 d)), n +(n))
278
280
281+
279Examples
282Examples
280--------
283--------
281
284
282− ~zod/try=> `@t`(fil 3 5 %a)
285+ > `@t`(fil 3 5 %a)
283 'aaaaa'
286 'aaaaa'
284− ~zod/try=> `@t`(fil 5 10 %ceeb)
287+ > `@t`(fil 5 10 %ceeb)
285 'ceebceebceebceebceebceebceebceebceebceeb'
288 'ceebceebceebceebceebceebceebceebceebceeb'
286− ~zod/try=> `@t`(fil 4 10 %eced)
289+ > `@t`(fil 4 10 %eced)
287 'ʇʇʇʇʇʇʇʇʇʇed'
290 'ʇʇʇʇʇʇʇʇʇʇed'
288− ~zod/try=> `@tas`(fil 4 10 %bf)
291+ > `@tas`(fil 4 10 %bf)
289 %bfbfbfbfbfbfbfbfbfbf
292 %bfbfbfbfbfbfbfbfbfbf
290
293
291
294
@@ -295,12 +298,12 @@ Examples
295
298
296Left-shift
299Left-shift
297
300
298−Produces an [atom]() by left-shifting `c` by `b` blocks of size `a`.
301+Produces an atom by left-shifting `c` by `b` blocks of size `a`.
299
302
300Accepts
303Accepts
301-------
304-------
302
305
303−`a` is a block size (see [`++bloq`]()).
306+`a` is a block size (see `++bloq`).
304
307
305`b` is an atom.
308`b` is an atom.
306
309
@@ -316,23 +319,24 @@ Source
316
319
317 ++ lsh :: left-shift
320 ++ lsh :: left-shift
318 ~/ %lsh
321 ~/ %lsh
319− |= [a=bloq b=@ c=@]
322+ |= {a/bloq b/@u c/@}
320 (mul (bex (mul (bex a) b)) c)
323 (mul (bex (mul (bex a) b)) c)
321
324
325+
322Examples
326Examples
323--------
327--------
324
328
325− ~zod/try=> `@ub`1
329+ > `@ub`1
326 0b1
330 0b1
327− ~zod/try=> `@ub`(lsh 0 1 1)
331+ > `@ub`(lsh 0 1 1)
328 0b10
332 0b10
329− ~zod/try=> (lsh 0 1 1)
333+ > (lsh 0 1 1)
330 2
334 2
331− ~zod/try=> `@ub`255
335+ > `@ub`255
332 0b1111.1111
336 0b1111.1111
333− ~zod/try=> `@ub`(lsh 3 1 255)
337+ > `@ub`(lsh 3 1 255)
334 0b1111.1111.0000.0000
338 0b1111.1111.0000.0000
335− ~zod/try=> (lsh 3 1 255)
339+ > (lsh 3 1 255)
336 65.280
340 65.280
337
341
338
342
@@ -342,9 +346,9 @@ Examples
342
346
343Measure
347Measure
344
348
345−Computes the number of blocks of size `a` in `b`, producing an [atom]().
349+Computes the number of blocks of size `a` in `b`, producing an atom.
346
350
347−`a` is a block size (see [`++bloq`]()).
351+`a` is a block size (see `++bloq`).
348
352
349`b` is an atom.
353`b` is an atom.
350
354
@@ -353,7 +357,7 @@ Source
353
357
354 ++ met :: measure
358 ++ met :: measure
355 ~/ %met
359 ~/ %met
356− |= [a=bloq b=@]
360+ |= {a/bloq b/@}
357 ^- @
361 ^- @
358 =+ c=0
362 =+ c=0
359 |-
363 |-
@@ -363,15 +367,15 @@ Source
363Examples
367Examples
364--------
368--------
365
369
366− ~zod/try=> (met 0 1)
370+ > (met 0 1)
367 1
371 1
368− ~zod/try=> (met 0 2)
372+ > (met 0 2)
369 2
373 2
370− ~zod/try=> (met 3 255)
374+ > (met 3 255)
371 1
375 1
372− ~zod/try=> (met 3 256)
376+ > (met 3 256)
373 2
377 2
374− ~zod/try=> (met 3 'abcde')
378+ > (met 3 'abcde')
375 5
379 5
376
380
377
381
@@ -381,14 +385,14 @@ Examples
381
385
382Assemble non-zero
386Assemble non-zero
383
387
384−Concatenates a list of [atom]()s `b` using blocksize `a`, producing an atom.
388+Concatenates a list of atoms `b` using blocksize `a`, producing an atom.
385
389
386Accepts
390Accepts
387-------
391-------
388
392
389−`a` is a block size (see [`++bloq`]()).
393+`a` is a block size (see `++bloq`).
390
394
391−`b` is a [`++list`]() of [atom]()s.
395+`b` is a `++list` of atoms.
392
396
393Produces
397Produces
394--------
398--------
@@ -400,7 +404,7 @@ Source
400
404
401 ++ rap :: assemble nonzero
405 ++ rap :: assemble nonzero
402 ~/ %rap
406 ~/ %rap
403− |= [a=bloq b=(list ,@)]
407+ |= {a/bloq b/(list @)}
404 ^- @
408 ^- @
405 ?~ b 0
409 ?~ b 0
406 (cat a i.b $(b t.b))
410 (cat a i.b $(b t.b))
@@ -408,13 +412,13 @@ Source
408Examples
412Examples
409--------
413--------
410
414
411− ~zod/try=> `@ub`(rap 2 (limo [1 2 3 4 ~]))
415+ > `@ub`(rap 2 (limo [1 2 3 4 ~]))
412 0b100.0011.0010.0001
416 0b100.0011.0010.0001
413− ~zod/try=> `@ub`(rap 1 (limo [1 2 3 4 ~]))
417+ > `@ub`(rap 1 (limo [1 2 3 4 ~]))
414 0b1.0011.1001
418 0b1.0011.1001
415− ~zod/try=> (rap 0 (limo [0 0 0 ~]))
419+ > (rap 0 (limo [0 0 0 ~]))
416 0
420 0
417− ~zod/try=> (rap 0 (limo [1 0 1 ~]))
421+ > (rap 0 (limo [1 0 1 ~]))
418 3
422 3
419
423
420
424
@@ -424,12 +428,12 @@ Examples
424
428
425Assemble single
429Assemble single
426
430
427−Produces an [atom]() by assembling a list of atoms `b` using block size `a`.
431+Produces an atom by assembling a list of atoms `b` using block size `a`.
428
432
429Accepts
433Accepts
430-------
434-------
431
435
432−`a` is a block size (see [`++bloq`]()).
436+`a` is a block size (see `++bloq`).
433
437
434`b` is a list of atoms.
438`b` is a list of atoms.
435
439
@@ -443,7 +447,7 @@ Source
443
447
444 ++ rep :: assemble single
448 ++ rep :: assemble single
445 ~/ %rep
449 ~/ %rep
446− |= [a=bloq b=(list ,@)]
450+ |= {a/bloq b/(list @)}
447 ^- @
451 ^- @
448 =+ c=0
452 =+ c=0
449 |-
453 |-
@@ -453,19 +457,19 @@ Source
453Examples
457Examples
454--------
458--------
455
459
456− ~zod/try=> `@ub`(rep 2 (limo [1 2 3 4 ~]))
460+ > `@ub`(rep 2 (limo [1 2 3 4 ~]))
457 0b100.0011.0010.0001
461 0b100.0011.0010.0001
458− ~zod/try=> (rep 0 (limo [0 0 1 ~]))
462+ > (rep 0 (limo [0 0 1 ~]))
459 4
463 4
460− ~zod/try=> (rep 0 (limo [0 0 0 1 ~]))
464+ > (rep 0 (limo [0 0 0 1 ~]))
461 8
465 8
462− ~zod/try=> (rep 0 (limo [0 1 0 0 ~]))
466+ > (rep 0 (limo [0 1 0 0 ~]))
463 2
467 2
464− ~zod/try=> (rep 0 (limo [0 1 0 1 ~]))
468+ > (rep 0 (limo [0 1 0 1 ~]))
465 10
469 10
466− ~zod/try=> (rep 0 (limo [0 1 0 1 0 1 ~]))
470+ > (rep 0 (limo [0 1 0 1 0 1 ~]))
467 42
471 42
468− ~zod/try=> `@ub`42
472+ > `@ub`42
469 0b10.1010
473 0b10.1010
470
474
471
475
@@ -475,12 +479,12 @@ Examples
475
479
476Disassemble
480Disassemble
477
481
478−Produces a list of [atom]()s from the bits of `b` using block size `a`.
482+Produces a list of atoms from the bits of `b` using block size `a`.
479
483
480Accepts
484Accepts
481-------
485-------
482
486
483−`a` is a block size (see [`++bloq`]()).
487+`a` is a block size (see `++bloq`).
484
488
485`b` is an atom.
489`b` is an atom.
486
490
@@ -494,29 +498,29 @@ Source
494
498
495 ++ rip :: disassemble
499 ++ rip :: disassemble
496 ~/ %rip
500 ~/ %rip
497− |= [a=bloq b=@]
501+ |= {a/bloq b/@}
498− ^- (list ,@)
502+ ^- (list @)
499 ?: =(0 b) ~
503 ?: =(0 b) ~
500 [(end a 1 b) $(b (rsh a 1 b))]
504 [(end a 1 b) $(b (rsh a 1 b))]
501
505
502Examples
506Examples
503--------
507--------
504
508
505− ~zod/try=> `@ub`155
509+ > `@ub`155
506 0b1001.1011
510 0b1001.1011
507− ~zod/try=> (rip 0 155)
511+ > (rip 0 155)
508 ~[1 1 0 1 1 0 0 1]
512 ~[1 1 0 1 1 0 0 1]
509− ~zod/try=> (rip 2 155)
513+ > (rip 2 155)
510 ~[11 9]
514 ~[11 9]
511− ~zod/try=> (rip 1 155)
515+ > (rip 1 155)
512 ~[3 2 1 2]
516 ~[3 2 1 2]
513− ~zod/try=> `@ub`256
517+ > `@ub`256
514 0b1.0000.0000
518 0b1.0000.0000
515− ~zod/try=> (rip 0 256)
519+ > (rip 0 256)
516 ~[0 0 0 0 0 0 0 0 1]
520 ~[0 0 0 0 0 0 0 0 1]
517− ~zod/try=> (rip 2 256)
521+ > (rip 2 256)
518 ~[0 0 1]
522 ~[0 0 1]
519− ~zod/try=> (rip 3 256)
523+ > (rip 3 256)
520 ~[0 1]
524 ~[0 1]
521
525
522
526
@@ -526,12 +530,12 @@ Examples
526
530
527Right-shift
531Right-shift
528
532
529−Right-shifts `c` by `b` blocks of size `a`, producing an [atom]().
533+Right-shifts `c` by `b` blocks of size `a`, producing an atom.
530
534
531Accepts
535Accepts
532-------
536-------
533
537
534−`a` is a block size (see [`++bloq`]()).
538+`a` is a block size (see `++bloq`).
535
539
536`b` is an atom.
540`b` is an atom.
537
541
@@ -547,33 +551,33 @@ Source
547
551
548 ++ rsh :: right-shift
552 ++ rsh :: right-shift
549 ~/ %rsh
553 ~/ %rsh
550− |= [a=bloq b=@ c=@]
554+ |= {a/bloq b/@u c/@}
551 (div c (bex (mul (bex a) b)))
555 (div c (bex (mul (bex a) b)))
552
556
553Examples
557Examples
554--------
558--------
555
559
556− ~zod/try=> `@ub`145
560+ > `@ub`145
557 0b1001.0001
561 0b1001.0001
558− ~zod/try=> `@ub`(rsh 1 1 145)
562+ > `@ub`(rsh 1 1 145)
559 0b10.0100
563 0b10.0100
560− ~zod/try=> (rsh 1 1 145)
564+ > (rsh 1 1 145)
561 36
565 36
562− ~zod/try=> `@ub`(rsh 2 1 145)
566+ > `@ub`(rsh 2 1 145)
563 0b1001
567 0b1001
564− ~zod/try=> (rsh 2 1 145)
568+ > (rsh 2 1 145)
565 9
569 9
566− ~zod/try=> `@ub`10
570+ > `@ub`10
567 0b1010
571 0b1010
568− ~zod/try=> `@ub`(rsh 0 1 10)
572+ > `@ub`(rsh 0 1 10)
569 0b101
573 0b101
570− ~zod/try=> (rsh 0 1 10)
574+ > (rsh 0 1 10)
571 5
575 5
572− ~zod/try=> `@ux`'abc'
576+ > `@ux`'abc'
573 0x63.6261
577 0x63.6261
574− ~zod/try=> `@t`(rsh 3 1 'abc')
578+ > `@t`(rsh 3 1 'abc')
575 'bc'
579 'bc'
576− ~zod/try=> `@ux`(rsh 3 1 'abc')
580+ > `@ux`(rsh 3 1 'abc')
577 0x6362
581 0x6362
578
582
579
583
@@ -583,14 +587,14 @@ Examples
583
587
584Reverse block order
588Reverse block order
585
589
586−Switches little endian to big and vice versa: produces an [atom]() by
590+Switches little endian to big and vice versa: produces an atom by
587reversing the block order of `b` using block size `a`.
591reversing the block order of `b` using block size `a`.
588
592
589
593
590Accepts
594Accepts
591-------
595-------
592
596
593−`a` is a block size (see [`++bloq`]()).
597+`a` is a block size (see `++bloq`).
594
598
595`b` is an atom.
599`b` is an atom.
596
600
@@ -602,20 +606,20 @@ An atom
602Source
606Source
603------
607------
604
608
605− ++ swap |=([a=bloq b=@] (rep a (flop (rip a b)))) :: reverse bloq order
609+ ++ swap |=({a/bloq b/@} (rep a (flop (rip a b)))) :: reverse bloq order
606
610
607Examples
611Examples
608--------
612--------
609
613
610− ~zod/try=> `@ub`24
614+ > `@ub`24
611 0b1.1000
615 0b1.1000
612− ~zod/try=> (swap 0 24)
616+ > (swap 0 24)
613 3
617 3
614− ~zod/try=> `@ub`3
618+ > `@ub`3
615 0b11
619 0b11
616− ~zod/try=> (swap 0 0)
620+ > (swap 0 0)
617 0
621 0
618− ~zod/try=> (swap 0 128)
622+ > (swap 0 128)
619 1
623 1
620
624
621
625
@@ -625,7 +629,7 @@ Examples
625
629
626Binary logarithm
630Binary logarithm
627
631
628−Computes the base-2 logarithm of `a`, producing an [atom]().
632+Computes the base-2 logarithm of `a`, producing an atom.
629
633
630Accepts
634Accepts
631-------
635-------
@@ -641,25 +645,25 @@ Source
641------
645------
642
646
643 ++ xeb :: binary logarithm
647 ++ xeb :: binary logarithm
644− :: ~/ %xeb
648+ ~/ %xeb
645− |= a=@
649+ |= a/@
646 ^- @
650 ^- @
647 (met 0 a)
651 (met 0 a)
648
652
649Examples
653Examples
650--------
654--------
651
655
652− ~zod/try=> (xeb 31)
656+ > (xeb 31)
653 5
657 5
654− ~zod/try=> (xeb 32)
658+ > (xeb 32)
655 6
659 6
656− ~zod/try=> (xeb 49)
660+ > (xeb 49)
657 6
661 6
658− ~zod/try=> (xeb 0)
662+ > (xeb 0)
659 0
663 0
660− ~zod/try=> (xeb 1)
664+ > (xeb 1)
661 1
665 1
662− ~zod/try=> (xeb 2)
666+ > (xeb 2)
663 2
667 2
664
668
665
669
docs/system/hoon/library/2d.md+42−41
@@ -23,7 +23,7 @@ Source
23
23
24 ++ con :: binary or
24 ++ con :: binary or
25 ~/ %con
25 ~/ %con
26− |= [a=@ b=@]
26+ |= {a/@ b/@}
27 =+ [c=0 d=0]
27 =+ [c=0 d=0]
28 |- ^- @
28 |- ^- @
29 ?: ?&(=(0 a) =(0 b)) d
29 ?: ?&(=(0 a) =(0 b)) d
@@ -31,9 +31,9 @@ Source
31 a (rsh 0 1 a)
31 a (rsh 0 1 a)
32 b (rsh 0 1 b)
32 b (rsh 0 1 b)
33 c +(c)
33 c +(c)
34− d %+ add d
34+ d %+ add d
35− %^ lsh 0 c
35+ %^ lsh 0 c
36− ?& =(0 (end 0 1 a))
36+ ?& =(0 (end 0 1 a))
37 =(0 (end 0 1 b))
37 =(0 (end 0 1 b))
38 ==
38 ==
39 ==
39 ==
@@ -41,17 +41,17 @@ Source
41Examples
41Examples
42--------
42--------
43
43
44− ~zod/try=> (con 0b0 0b1)
44+ > (con 0b0 0b1)
45 1
45 1
46− ~zod/try=> (con 0 1)
46+ > (con 0 1)
47 1
47 1
48− ~zod/try=> (con 0 0)
48+ > (con 0 0)
49 0
49 0
50− ~zod/try=> `@ub`(con 0b1111.0000 0b1.0011)
50+ > `@ub`(con 0b1111.0000 0b1.0011)
51 0b1111.0011
51 0b1111.0011
52− ~zod/try=> (con 4 4)
52+ > (con 4 4)
53 4
53 4
54− ~zod/try=> (con 10.000 234)
54+ > (con 10.000 234)
55 10.234
55 10.234
56
56
57
57
@@ -61,7 +61,7 @@ Examples
61
61
62Binary AND
62Binary AND
63
63
64−Computes the bit-wise logical AND of two [atom]()s `a` and `b`, producing an
64+Computes the bit-wise logical AND of two atoms `a` and `b`, producing an
65atom.
65atom.
66
66
67Accepts
67Accepts
@@ -81,17 +81,17 @@ Source
81
81
82 ++ dis :: binary and
82 ++ dis :: binary and
83 ~/ %dis
83 ~/ %dis
84− |= [a=@ b=@]
84+ |= {a/@ b/@}
85− =| [c=@ d=@]
85+ =| {c/@ d/@}
86 |- ^- @
86 |- ^- @
87 ?: ?|(=(0 a) =(0 b)) d
87 ?: ?|(=(0 a) =(0 b)) d
88 %= $
88 %= $
89 a (rsh 0 1 a)
89 a (rsh 0 1 a)
90 b (rsh 0 1 b)
90 b (rsh 0 1 b)
91 c +(c)
91 c +(c)
92− d %+ add d
92+ d %+ add d
93− %^ lsh 0 c
93+ %^ lsh 0 c
94− ?| =(0 (end 0 1 a))
94+ ?| =(0 (end 0 1 a))
95 =(0 (end 0 1 b))
95 =(0 (end 0 1 b))
96 ==
96 ==
97 ==
97 ==
@@ -99,21 +99,21 @@ Source
99Examples
99Examples
100--------
100--------
101
101
102− ~zod/try=> `@ub`9
102+ > `@ub`9
103 0b1001
103 0b1001
104− ~zod/try=> `@ub`5
104+ > `@ub`5
105 0b101
105 0b101
106− ~zod/try=> `@ub`(dis 9 5)
106+ > `@ub`(dis 9 5)
107 0b1
107 0b1
108− ~zod/try=> (dis 9 5)
108+ > (dis 9 5)
109 1
109 1
110− ~zod/try=> `@ub`534
110+ > `@ub`534
111 0b10.0001.0110
111 0b10.0001.0110
112− ~zod/try=> `@ub`987
112+ > `@ub`987
113 0b11.1101.1011
113 0b11.1101.1011
114− ~zod/try=> `@ub`(dis 534 987)
114+ > `@ub`(dis 534 987)
115 0b10.0001.0010
115 0b10.0001.0010
116− ~zod/try=> (dis 534 987)
116+ > (dis 534 987)
117 530
117 530
118
118
119
119
@@ -123,7 +123,7 @@ Examples
123
123
124Binary XOR
124Binary XOR
125
125
126−Produces the bit-wise logical XOR of `a` and `b`, producing an [atom]().
126+Produces the bit-wise logical XOR of `a` and `b`, producing an atom.
127
127
128Accepts
128Accepts
129-------
129-------
@@ -142,7 +142,7 @@ Source
142
142
143 ++ mix :: binary xor
143 ++ mix :: binary xor
144 ~/ %mix
144 ~/ %mix
145− |= [a=@ b=@]
145+ |= {a/@ b/@}
146 ^- @
146 ^- @
147 =+ [c=0 d=0]
147 =+ [c=0 d=0]
148 |-
148 |-
@@ -157,17 +157,17 @@ Source
157Examples
157Examples
158--------
158--------
159
159
160− ~zod/try=> `@ub`2
160+ > `@ub`2
161 0b10
161 0b10
162− ~zod/try=> `@ub`3
162+ > `@ub`3
163 0b11
163 0b11
164− ~zod/try=> `@ub`(mix 2 3)
164+ > `@ub`(mix 2 3)
165 0b1
165 0b1
166− ~zod/try=> (mix 2 3)
166+ > (mix 2 3)
167 1
167 1
168− ~zod/try=> `@ub`(mix 2 2)
168+ > `@ub`(mix 2 2)
169 0b0
169 0b0
170− ~zod/try=> (mix 2 2)
170+ > (mix 2 2)
171 0
171 0
172
172
173
173
@@ -183,9 +183,9 @@ of `c`.
183Accepts
183Accepts
184-------
184-------
185
185
186−`a` is a block size (see [`++bloq`]()).
186+`a` is a block size (see `++bloq`).
187
187
188−`b` is an [atom]().
188+`b` is an atom.
189
189
190`c` is an atom.
190`c` is an atom.
191
191
@@ -197,23 +197,24 @@ An atom.
197Source
197Source
198------
198------
199
199
200− ++ not |= [a=bloq b=@ c=@] :: binary not (sized)
200+ ++ not |= {a/bloq b/@ c/@} :: binary not (sized)
201 (mix c (dec (bex (mul b (bex a)))))
201 (mix c (dec (bex (mul b (bex a)))))
202
202
203+
203Examples
204Examples
204--------
205--------
205
206
206− ~zod/try=> `@ub`24
207+ > `@ub`24
207 0b1.1000
208 0b1.1000
208− ~zod/try=> (not 0 5 24)
209+ > (not 0 5 24)
209 7
210 7
210− ~zod/try=> `@ub`7
211+ > `@ub`7
211 0b111
212 0b111
212− ~zod/try=> (not 2 5 24)
213+ > (not 2 5 24)
213 1.048.551
214 1.048.551
214− ~zod/try=> (not 2 5 1.048.551)
215+ > (not 2 5 1.048.551)
215 24
216 24
216− ~zod/try=> (not 1 1 (not 1 1 10))
217+ > (not 1 1 (not 1 1 10))
217 10
218 10
218
219
219
220
docs/system/hoon/library/2e.md+25−33
@@ -3,7 +3,7 @@
3
3
4Hashes an atom with the 32-bit FNV non-cryptographic hash algorithm.
4Hashes an atom with the 32-bit FNV non-cryptographic hash algorithm.
5Multiplies `a` by the prime number 16,777,619 and then takes the block
5Multiplies `a` by the prime number 16,777,619 and then takes the block
6−of size 5 off the product's end, producing an [atom]().
6+of size 5 off the product's end, producing an atom.
7
7
8Accepts
8Accepts
9-------
9-------
@@ -19,16 +19,16 @@ An atom.
19Source
19Source
20------
20------
21
21
22− ++ fnv |=(a=@ (end 5 1 (mul 16.777.619 a))) :: FNV scrambler
22+ ++ fnv |=(a/@ (end 5 1 (mul 16.777.619 a))) :: FNV scrambler
23
23
24Examples
24Examples
25--------
25--------
26
26
27− ~zod/try=> (fnv 10.000)
27+ > (fnv 10.000)
28 272.465.456
28 272.465.456
29− ~zod/try=> (fnv 10.001)
29+ > (fnv 10.001)
30 289.243.075
30 289.243.075
31− ~zod/try=> (fnv 1)
31+ > (fnv 1)
32 16.777.619
32 16.777.619
33
33
34
34
@@ -37,12 +37,12 @@ Examples
37### `++mug`
37### `++mug`
38
38
39Hashes `a` with the 31-bit nonzero FNV-1a non-cryptographic hash
39Hashes `a` with the 31-bit nonzero FNV-1a non-cryptographic hash
40−algorithm, producing an [atom]().
40+algorithm, producing an atom.
41
41
42Accepts
42Accepts
43-------
43-------
44
44
45−A is a [noun]().
45+A is a noun.
46
46
47Produces
47Produces
48--------
48--------
@@ -54,7 +54,7 @@ Source
54
54
55 ++ mug :: 31bit nonzero FNV1a
55 ++ mug :: 31bit nonzero FNV1a
56 ~/ %mug
56 ~/ %mug
57− |= a=*
57+ |= a/*
58 ?^ a
58 ?^ a
59 =+ b=[p=$(a -.a) q=$(a +.a)]
59 =+ b=[p=$(a -.a) q=$(a +.a)]
60 |- ^- @
60 |- ^- @
@@ -73,18 +73,19 @@ Source
73 ^$(b +(b))
73 ^$(b +(b))
74 $(c (fnv (mix c (cut 3 [d 1] a))), d +(d))
74 $(c (fnv (mix c (cut 3 [d 1] a))), d +(d))
75
75
76+
76Examples
77Examples
77--------
78--------
78
79
79− ~zod/try=> (mug 10.000)
80+ > (mug 10.000)
80 178.152.889
81 178.152.889
81− ~zod/try=> (mug 10.001)
82+ > (mug 10.001)
82 714.838.017
83 714.838.017
83− ~zod/try=> (mug 1)
84+ > (mug 1)
84 67.918.732
85 67.918.732
85− ~zod/try=> (mug (some 10))
86+ > (mug (some 10))
86 1.872.403.737
87 1.872.403.737
87− ~zod/try=> (mug (limo [1 2 3 4 5 ~]))
88+ > (mug (limo [1 2 3 4 5 ~]))
88 1.067.931.605
89 1.067.931.605
89
90
90
91
@@ -105,15 +106,15 @@ Source
105
106
106 ++ mum :: mug with murmur3
107 ++ mum :: mug with murmur3
107 ~/ %mum
108 ~/ %mum
108− |= a=*
109+ |= a/*
109 |^ (trim ?@(a a (mix $(a -.a) (mix 0x7fff.ffff $(a +.a)))))
110 |^ (trim ?@(a a (mix $(a -.a) (mix 0x7fff.ffff $(a +.a)))))
110 ++ spec :: standard murmur3
111 ++ spec :: standard murmur3
111− |= [syd=@ key=@]
112+ |= {syd/@ key/@}
112 ?> (lte (met 5 syd) 1)
113 ?> (lte (met 5 syd) 1)
113 =+ ^= row
114 =+ ^= row
114− |= [a=@ b=@]
115+ |= {a/@ b/@}
115 (con (end 5 1 (lsh 0 a b)) (rsh 0 (sub 32 a) b))
116 (con (end 5 1 (lsh 0 a b)) (rsh 0 (sub 32 a) b))
116− =+ mow=|=([a=@ b=@] (end 5 1 (mul a b)))
117+ =+ mow=|=({a/@ b/@} (end 5 1 (mul a b)))
117 =+ len=(met 5 key)
118 =+ len=(met 5 key)
118 =- =. goc (mix goc len)
119 =- =. goc (mix goc len)
119 =. goc (mix goc (rsh 4 1 goc))
120 =. goc (mix goc (rsh 4 1 goc))
@@ -127,35 +128,26 @@ Source
127 ?: =(inx len) goc
128 ?: =(inx len) goc
128 =+ kop=(cut 5 [inx 1] key)
129 =+ kop=(cut 5 [inx 1] key)
129 =. kop (mow kop 0xcc9e.2d51)
130 =. kop (mow kop 0xcc9e.2d51)
130− =. kop (row 15 kop)
131+ =. kop (row 15 kop)
131 =. kop (mow kop 0x1b87.3593)
132 =. kop (mow kop 0x1b87.3593)
132 =. goc (mix kop goc)
133 =. goc (mix kop goc)
133 =. goc (row 13 goc)
134 =. goc (row 13 goc)
134 =. goc (end 5 1 (add 0xe654.6b64 (mul 5 goc)))
135 =. goc (end 5 1 (add 0xe654.6b64 (mul 5 goc)))
135 $(inx +(inx))
136 $(inx +(inx))
136− ::
137+
137− ++ trim :: 31-bit nonzero
138− |= key=@
139− =+ syd=0xcafe.babe
140− |- ^- @
141− =+ haz=(spec syd key)
142− =+ ham=(mix (rsh 0 31 haz) (end 0 31 haz))
143− ?.(=(0 ham) ham $(syd +(syd)))
144− --
145− ::
146
138
147Examples
139Examples
148--------
140--------
149
141
150− ~zod/try=> (mum 10.000)
142+ > (mum 10.000)
151 1.232.632.901
143 1.232.632.901
152− ~zod/try=> (mum 10.001)
144+ > (mum 10.001)
153 658.093.079
145 658.093.079
154− ~zod/try=> (mum 1)
146+ > (mum 1)
155 818.387.364
147 818.387.364
156− ~zod/try=> (mum (some 10))
148+ > (mum (some 10))
157 1.177.215.703
149 1.177.215.703
158− ~zod/try=> (mum ~[1 2 3 4 5])
150+ > (mum ~[1 2 3 4 5])
159 1.517.902.092
151 1.517.902.092
160
152
161
153
docs/system/hoon/library/2f.md+51−45
@@ -9,7 +9,7 @@ boolean.
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
@@ -22,9 +22,9 @@ A boolean atom.
22Source
22Source
23------
23------
24
24
25− ++ aor :: alphabetic-order
25+ ++ aor :: a-order
26 ~/ %aor
26 ~/ %aor
27− |= [a=* b=*]
27+ |= {a/* b/*}
28 ^- ?
28 ^- ?
29 ?: =(a b) &
29 ?: =(a b) &
30 ?. ?=(@ a)
30 ?. ?=(@ a)
@@ -39,24 +39,25 @@ Source
39 $(a (rsh 3 1 a), b (rsh 3 1 b))
39 $(a (rsh 3 1 a), b (rsh 3 1 b))
40 (lth c d)
40 (lth c d)
41
41
42+
42Examples
43Examples
43--------
44--------
44
45
45− ~zod/try=> (aor 'a' 'b')
46+ > (aor 'a' 'b')
46 %.y
47 %.y
47− ~zod/try=> (aor 'b' 'a')
48+ > (aor 'b' 'a')
48 %.n
49 %.n
49− ~zod/try=> (aor "foo" "bar")
50+ > (aor "foo" "bar")
50 %.n
51 %.n
51− ~zod/try=> (aor "bar" "foo")
52+ > (aor "bar" "foo")
52 %.y
53 %.y
53− ~zod/try=> (aor "abcdefz" "abcdefa")
54+ > (aor "abcdefz" "abcdefa")
54 %.n
55 %.n
55− ~zod/try=> (aor "abcdefa" "abcdefz")
56+ > (aor "abcdefa" "abcdefz")
56 %.y
57 %.y
57− ~zod/try=> (aor 10.000 17.000)
58+ > (aor 10.000 17.000)
58 %.y
59 %.y
59− ~zod/try=> (aor 10 9)
60+ > (aor 10 9)
60 %.n
61 %.n
61
62
62
63
@@ -72,7 +73,7 @@ boolean.
72Accepts
73Accepts
73-------
74-------
74
75
75−`a` is a [noun]().
76+`a` is a noun.
76
77
77`b` is a noun.
78`b` is a noun.
78
79
@@ -86,7 +87,7 @@ Source
86
87
87 ++ dor :: d-order
88 ++ dor :: d-order
88 ~/ %dor
89 ~/ %dor
89− |= [a=* b=*]
90+ |= {a/* b/*}
90 ^- ?
91 ^- ?
91 ?: =(a b) &
92 ?: =(a b) &
92 ?. ?=(@ a)
93 ?. ?=(@ a)
@@ -97,20 +98,21 @@ Source
97 ?. ?=(@ b) &
98 ?. ?=(@ b) &
98 (lth a b)
99 (lth a b)
99
100
101+
100Examples
102Examples
101--------
103--------
102
104
103− ~zod/try=> (dor 1 2)
105+ > (dor 1 2)
104 %.y
106 %.y
105− ~zod/try=> (dor 2 1)
107+ > (dor 2 1)
106 %.n
108 %.n
107− ~zod/try=> (dor ~[1 2 3] ~[1 2 4])
109+ > (dor ~[1 2 3] ~[1 2 4])
108 %.y
110 %.y
109− ~zod/try=> (dor ~[1 2 4] ~[1 2 3])
111+ > (dor ~[1 2 4] ~[1 2 3])
110 %.n
112 %.n
111− ~zod/try=> (dor (limo ~[99 100 10.000]) ~[99 101 10.000])
113+ > (dor (limo ~[99 100 10.000]) ~[99 101 10.000])
112 %.y
114 %.y
113− ~zod/try=> (dor ~[99 101 10.999] (limo ~[99 100 10.000]))
115+ > (dor ~[99 101 10.999] (limo ~[99 100 10.000]))
114 %.n
116 %.n
115
117
116
118
@@ -125,50 +127,51 @@ XX revisit
125Accepts
127Accepts
126-------
128-------
127
129
128−`a` is a [noun]().
130+`a` is a noun.
129
131
130`b` is a noun.
132`b` is a noun.
131
133
132Produces
134Produces
133--------
135--------
134
136
135−A boolean [atom]().
137+A boolean atom.
136
138
137Source
139Source
138------
140------
139
141
140 ++ gor :: g-order
142 ++ gor :: g-order
141 ~/ %gor
143 ~/ %gor
142− |= [a=* b=*]
144+ |= {a/* b/*}
143 ^- ?
145 ^- ?
144 =+ [c=(mug a) d=(mug b)]
146 =+ [c=(mug a) d=(mug b)]
145 ?: =(c d)
147 ?: =(c d)
146 (dor a b)
148 (dor a b)
147 (lth c d)
149 (lth c d)
148
150
151+
149Examples
152Examples
150--------
153--------
151
154
152− ~zod/try=> (gor 'd' 'c')
155+ > (gor 'd' 'c')
153 %.y
156 %.y
154− ~zod/try=> 'd'
157+ > 'd'
155 'd'
158 'd'
156− ~zod/try=> 'c'
159+ > 'c'
157− ~zod/try=> `@ud`'d'
160+ > `@ud`'d'
158 100
161 100
159− ~zod/try=> `@ud`'c'
162+ > `@ud`'c'
160 99
163 99
161− ~zod/try=> (mug 'd')
164+ > (mug 'd')
162 1.628.185.714
165 1.628.185.714
163− ~zod/try=> (mug 'c')
166+ > (mug 'c')
164 1.712.073.811
167 1.712.073.811
165− ~zod/try=> (gor 'd' 'c')
168+ > (gor 'd' 'c')
166 %.y
169 %.y
167− ~zod/try=> (gor 'c' 'd')
170+ > (gor 'c' 'd')
168 %.n
171 %.n
169− ~zod/try=> (gor "foo" "bar")
172+ > (gor "foo" "bar")
170 %.n
173 %.n
171− ~zod/try=> (gor (some 10) (limo [1 2 3 ~]))
174+ > (gor (some 10) (limo [1 2 3 ~]))
172 %.n
175 %.n
173
176
174
177
@@ -185,14 +188,14 @@ Recursive hash comparator gate.
185Accepts
188Accepts
186-------
189-------
187
190
188−`a` is a [noun]().
191+`a` is a noun.
189
192
190`b` is a noun.
193`b` is a noun.
191
194
192Produces
195Produces
193--------
196--------
194
197
195−A boolean [atom]().
198+A boolean atom.
196
199
197
200
198Source
201Source
@@ -200,7 +203,7 @@ Source
200
203
201 ++ hor :: h-order
204 ++ hor :: h-order
202 ~/ %hor
205 ~/ %hor
203− |= [a=* b=*]
206+ |= {a/* b/*}
204 ^- ?
207 ^- ?
205 ?: ?=(@ a)
208 ?: ?=(@ a)
206 ?. ?=(@ b) &
209 ?. ?=(@ b) &
@@ -209,17 +212,19 @@ Source
209 ?: =(-.a -.b)
212 ?: =(-.a -.b)
210 (gor +.a +.b)
213 (gor +.a +.b)
211 (gor -.a -.b)
214 (gor -.a -.b)
215+ ::
216+
212
217
213Examples
218Examples
214--------
219--------
215
220
216− ~zod/try=> (hor . 1)
221+ > (hor . 1)
217 %.n
222 %.n
218− ~zod/try=> (hor 1 2)
223+ > (hor 1 2)
219 %.y
224 %.y
220− ~zod/try=> (hor "abc" "cba")
225+ > (hor "abc" "cba")
221 %.y
226 %.y
222− ~zod/try=> (hor 'c' 'd')
227+ > (hor 'c' 'd')
223 %.n
228 %.n
224
229
225
230
@@ -234,7 +239,7 @@ XX revisit
234Accepts
239Accepts
235-------
240-------
236
241
237−`a` is a [noun]()
242+`a` is a noun
238
243
239`b` is a noun
244`b` is a noun
240
245
@@ -246,21 +251,22 @@ Source
246
251
247 ++ vor :: v-order
252 ++ vor :: v-order
248 ~/ %vor
253 ~/ %vor
249− |= [a=* b=*]
254+ |= {a/* b/*}
250 ^- ?
255 ^- ?
251 =+ [c=(mug (mug a)) d=(mug (mug b))]
256 =+ [c=(mug (mug a)) d=(mug (mug b))]
252 ?: =(c d)
257 ?: =(c d)
253 (dor a b)
258 (dor a b)
254 (lth c d)
259 (lth c d)
255
260
261+
256Examples
262Examples
257--------
263--------
258
264
259− ~zod/try=> (vor 'f' 'g')
265+ > (vor 'f' 'g')
260 %.y
266 %.y
261− ~zod/try=> (vor 'a' 'z')
267+ > (vor 'a' 'z')
262 %.n
268 %.n
263− ~zod/try=> (vor 43.326 41.106)
269+ > (vor 43.326 41.106)
264 %.n
270 %.n
265
271
266
272
docs/system/hoon/library/2g.md+1−1
@@ -1 +1 @@
1−# 2g: unsigned powers
1+# 2g: unsigned powers (currently undocumented)
docs/system/hoon/library/2h.md+106−97
@@ -4,7 +4,7 @@
4
4
5Set operations
5Set operations
6
6
7−Core whose [arm]()s contain a variety of functions that operate on [`++set`]()s. Its [sample]() accepts the input [`++set`]() to be manipulated.
7+Core whose arms contain a variety of functions that operate on `++set`s. Its sample accepts the input `++set` to be manipulated.
8
8
9Accepts
9Accepts
10-------
10-------
@@ -16,12 +16,12 @@ Source
16
16
17 ++ in :: set engine
17 ++ in :: set engine
18 ~/ %in
18 ~/ %in
19− |/ a=(set)
19+ |_ a/(set)
20
20
21Examples
21Examples
22--------
22--------
23
23
24− ~zod/try=> ~(. in (sa "asd"))
24+ > ~(. in (sa "asd"))
25 <13.evb [nlr(^$1{@tD $1}) <414.fvk 101.jzo 1.ypj %164>]>
25 <13.evb [nlr(^$1{@tD $1}) <414.fvk 101.jzo 1.ypj %164>]>
26
26
27### `+-all:in`
27### `+-all:in`
@@ -34,9 +34,9 @@ producing a boolean.
34Accepts
34Accepts
35-------
35-------
36
36
37−`a` is a [`++set`]().
37+`a` is a `++set`.
38
38
39−`b` is a [wet]() [gate]() that accepts a [noun]() and produces a boolean.
39+`b` is a wet gate that accepts a noun and produces a boolean.
40
40
41Produces
41Produces
42--------
42--------
@@ -48,21 +48,21 @@ Source
48
48
49 +- all :: logical AND
49 +- all :: logical AND
50 ~/ %all
50 ~/ %all
51− |* b=$+(* ?)
51+ |* b/$-(* ?)
52 |- ^- ?
52 |- ^- ?
53 ?~ a
53 ?~ a
54 &
54 &
55 ?&((b n.a) $(a l.a) $(a r.a))
55 ?&((b n.a) $(a l.a) $(a r.a))
56− ::
56+
57
57
58Examples
58Examples
59--------
59--------
60
60
61− ~zod/try=> =b (sa `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
61+ > =b (sa `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
62− ~zod/try=> (~(all in b) |=(a=* ?@(+.a & |)))
62+ > (~(all in b) |=(a/* ?@(+.a & |)))
63 %.n
63 %.n
64− ~zod/try=> =b (sa `(list ,@t)`['john' 'bonita' 'daniel' 'madeleine' ~])
64+ > =b (sa `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
65− ~zod/try=> (~(all in b) |=(a=@t (gte a 100)))
65+ > (~(all in b) |=(a/@t (gte a 100)))
66 %.y
66 %.y
67
67
68------------------------------------------------------------------------
68------------------------------------------------------------------------
@@ -76,9 +76,9 @@ Computes the logical OR on every element of `a` slammed with `b`.
76Accepts
76Accepts
77-------
77-------
78
78
79−`a` is a [`++set`]().
79+`a` is a `++set`.
80
80
81−`b` is a [gate]() that accepts a noun and produces a boolean.
81+`b` is a gate that accepts a noun and produces a boolean.
82
82
83Produces
83Produces
84--------
84--------
@@ -90,21 +90,22 @@ Source
90
90
91 +- any :: logical OR
91 +- any :: logical OR
92 ~/ %any
92 ~/ %any
93− |* b=$+(* ?)
93+ |* b/$-(* ?)
94 |- ^- ?
94 |- ^- ?
95 ?~ a
95 ?~ a
96 |
96 |
97 ?|((b n.a) $(a l.a) $(a r.a))
97 ?|((b n.a) $(a l.a) $(a r.a))
98 ::
98 ::
99
99
100+
100Examples
101Examples
101--------
102--------
102
103
103− ~zod/try=> =b (sa `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
104+ > =b (sa `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
104− ~zod/try=> (~(any in b) |=(a=* ?@(+.a & |)))
105+ > (~(any in b) |=(a/* ?@(+.a & |)))
105 %.y
106 %.y
106− ~zod/try=> =b (sa `(list ,@t)`['john' 'bonita' 'daniel' 'madeleine' ~])
107+ > =b (sa `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
107− ~zod/try=> (~(any in b) |=(a=@t (lte a 100)))
108+ > (~(any in b) |=(a/@t (lte a 100)))
108 %.n
109 %.n
109
110
110------------------------------------------------------------------------
111------------------------------------------------------------------------
@@ -113,14 +114,14 @@ Examples
113
114
114Remove noun
115Remove noun
115
116
116−Removes `b` from the [`++set`]() `a`.
117+Removes `b` from the `++set` `a`.
117
118
118Accepts
119Accepts
119-------
120-------
120
121
121`a` is a set.
122`a` is a set.
122
123
123−`b` is a [noun]().
124+`b` is a noun.
124
125
125Produces
126Produces
126--------
127--------
@@ -132,7 +133,7 @@ Source
132
133
133 +- del :: b without any a
134 +- del :: b without any a
134 ~/ %del
135 ~/ %del
135− |* b=*
136+ |* b/*
136 |- ^+ a
137 |- ^+ a
137 ?~ a
138 ?~ a
138 ~
139 ~
@@ -140,7 +141,7 @@ Source
140 ?: (hor b n.a)
141 ?: (hor b n.a)
141 [n.a $(a l.a) r.a]
142 [n.a $(a l.a) r.a]
142 [n.a l.a $(a r.a)]
143 [n.a l.a $(a r.a)]
143− |- ^- ?(~ _a)
144+ |- ^- {$?($~ _a)}
144 ?~ l.a r.a
145 ?~ l.a r.a
145 ?~ r.a l.a
146 ?~ r.a l.a
146 ?: (vor n.l.a n.r.a)
147 ?: (vor n.l.a n.r.a)
@@ -152,13 +153,13 @@ Source
152Examples
153Examples
153--------
154--------
154
155
155− ~zod/try=> =b (sa `(list ,@t)`['a' 'b' 'c' ~])
156+ > =b (sa `(list @t)`['a' 'b' 'c' ~])
156− ~zod/try=> (~(del in b) 'a')
157+ > (~(del in b) 'a')
157 {'c' 'b'}
158 {'c' 'b'}
158− ~zod/try=> =b (sa `(list ,@t)`['john' 'bonita' 'daniel' 'madeleine' ~])
159+ > =b (sa `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
159− ~zod/try=> (~(del in b) 'john')
160+ > (~(del in b) 'john')
160 {'bonita' 'madeleine' 'daniel'}
161 {'bonita' 'madeleine' 'daniel'}
161− ~zod/try=> (~(del in b) 'susan')
162+ > (~(del in b) 'susan')
162 {'bonita' 'madeleine' 'daniel' 'john'}
163 {'bonita' 'madeleine' 'daniel' 'john'}
163
164
164------------------------------------------------------------------------
165------------------------------------------------------------------------
@@ -172,43 +173,44 @@ Produce the axis of `b` within `a`.
172Accepts
173Accepts
173-------
174-------
174
175
175−`a` is a [`++set`]().
176+`a` is a `++set`.
176
177
177−`b` is a [noun]().
178+`b` is a noun.
178
179
179Produces
180Produces
180--------
181--------
181
182
182−The [`++unit`]() of an atom.
183+The `++unit` of an atom.
183
184
184Source
185Source
185------
186------
186
187
187 +- dig :: axis of a in b
188 +- dig :: axis of a in b
188− |= b=*
189+ |= b/*
189 =+ c=1
190 =+ c=1
190− |- ^- (unit ,@)
191+ |- ^- (unit @)
191 ?~ a ~
192 ?~ a ~
192 ?: =(b n.a) [~ u=(peg c 2)]
193 ?: =(b n.a) [~ u=(peg c 2)]
193− ?: (gor b n.a)
194+ ?: (hor b n.a)
194 $(a l.a, c (peg c 6))
195 $(a l.a, c (peg c 6))
195 $(a r.a, c (peg c 7))
196 $(a r.a, c (peg c 7))
196 ::
197 ::
197
198
198
199
200+
199Examples
201Examples
200--------
202--------
201
203
202− ~zod/try=> =a (sa `(list ,@)`[1 2 3 4 5 6 7 ~])
204+ > =a (sa `(list @)`[1 2 3 4 5 6 7 ~])
203− ~zod/try=> a
205+ > a
204 {5 4 7 6 1 3 2}
206 {5 4 7 6 1 3 2}
205− ~zod/try=> -.a
207+ > -.a
206 n=6
208 n=6
207− ~zod/try=> (~(dig in a) 7)
209+ > (~(dig in a) 7)
208 [~ 12]
210 [~ 12]
209− ~zod/try=> (~(dig in a) 2)
211+ > (~(dig in a) 2)
210 [~ 14]
212 [~ 14]
211− ~zod/try=> (~(dig in a) 6)
213+ > (~(dig in a) 6)
212 [~ 2]
214 [~ 2]
213
215
214------------------------------------------------------------------------
216------------------------------------------------------------------------
@@ -217,7 +219,7 @@ Examples
217
219
218Concatenate
220Concatenate
219
221
220−Insert the elements of a [`++list`]() `b` into a [`++set`]() `a`.
222+Insert the elements of a `++list` `b` into a `++set` `a`.
221
223
222Accepts
224Accepts
223-------
225-------
@@ -236,22 +238,22 @@ Source
236
238
237 +- gas :: concatenate
239 +- gas :: concatenate
238 ~/ %gas
240 ~/ %gas
239− |= b=(list ,_?>(?=(^ a) n.a))
241+ |= b/(list _?>(?=(^ a) n.a))
240 |- ^+ a
242 |- ^+ a
241 ?~ b
243 ?~ b
242 a
244 a
243− $(b t.b, a (put(+< a) i.b))
245+ $(b t.b, a (put i.b))
244 ::
246 ::
245
247
246
248
247Examples
249Examples
248--------
250--------
249
251
250− ~zod/try=> b
252+ > b
251 {'bonita' 'madeleine' 'rudolf' 'john'}
253 {'bonita' 'madeleine' 'rudolf' 'john'}
252− ~zod/try=> (~(gas in b) `(list ,@t)`['14' 'things' 'number' '1.337' ~])
254+ > (~(gas in b) `(list @t)`['14' 'things' 'number' '1.337' ~])
253 {'1.337' '14' 'number' 'things' 'bonita' 'madeleine' 'rudolf' 'john'}
255 {'1.337' '14' 'number' 'things' 'bonita' 'madeleine' 'rudolf' 'john'}
254− ~zod/try=> (~(gas in s) `(list ,@t)`['1' '2' '3' ~])
256+ > (~(gas in s) `(list ,@t)`['1' '2' '3' ~])
255 {'1' '3' '2' 'e' 'd' 'a' 'c' 'b'}
257 {'1' '3' '2' 'e' 'd' 'a' 'c' 'b'}
256
258
257------------------------------------------------------------------------
259------------------------------------------------------------------------
@@ -279,7 +281,7 @@ Source
279
281
280 +- has :: b exists in a check
282 +- has :: b exists in a check
281 ~/ %has
283 ~/ %has
282− |* b=*
284+ |* b/*
283 |- ^- ?
285 |- ^- ?
284 ?~ a
286 ?~ a
285 |
287 |
@@ -294,10 +296,10 @@ Source
294Examples
296Examples
295--------
297--------
296
298
297− ~zod/try=> =a (~(gas in `(set ,@t)`~) `(list ,@t)`[`a` `b` `c` ~])
299+ > =a (~(gas in `(set @t)`~) `(list @t)`[`a` `b` `c` ~])
298− ~zod/try=> (~(has in a) `a`)
300+ > (~(has in a) `a`)
299 %.y
301 %.y
300− ~zod/try=> (~(has in a) 'z')
302+ > (~(has in a) 'z')
301 %.n
303 %.n
302
304
303------------------------------------------------------------------------
305------------------------------------------------------------------------
@@ -306,7 +308,7 @@ Examples
306
308
307Intersection
309Intersection
308
310
309−Produces a set of the intersection between two [`++set`]()s of the same type,
311+Produces a set of the intersection between two `++set`s of the same type,
310`a` and `b`.
312`a` and `b`.
311
313
312Accepts
314Accepts
@@ -319,14 +321,14 @@ Accepts
319Produces
321Produces
320--------
322--------
321
323
322−A [`++set`]().
324+A `++set`.
323
325
324Source
326Source
325------
327------
326
328
327− +- int :: intersection
329+ +- int :: intersection
328 ~/ %int
330 ~/ %int
329− |* b=_a
331+ |* b/_a
330 |- ^+ a
332 |- ^+ a
331 ?~ b
333 ?~ b
332 ~
334 ~
@@ -337,20 +339,22 @@ Source
337 ?: =(n.b n.a)
339 ?: =(n.b n.a)
338 [n.a $(a l.a, b l.b) $(a r.a, b r.b)]
340 [n.a $(a l.a, b l.b) $(a r.a, b r.b)]
339 ?: (hor n.b n.a)
341 ?: (hor n.b n.a)
340− %- uni(+< $(a l.a, b [n.b l.b ~])) $(b r.b)
342+ %- uni(a $(a l.a, b [n.b l.b ~])) $(b r.b)
341− %- uni(+< $(a r.a, b [n.b ~ r.b])) $(b l.b)
343+ %- uni(a $(a r.a, b [n.b ~ r.b])) $(b l.b)
344+ ::
345+
342
346
343
347
344Examples
348Examples
345--------
349--------
346
350
347− ~zod/try=> (~(int in (sa "ac")) (sa "ha"))
351+ > (~(int in (sa "ac")) (sa "ha"))
348 {~~a}
352 {~~a}
349− ~zod/try=> (~(int in (sa "acmo")) ~)
353+ > (~(int in (sa "acmo")) ~)
350 {}
354 {}
351− ~zod/try=> (~(int in (sa "acmo")) (sa "ham"))
355+ > (~(int in (sa "acmo")) (sa "ham"))
352 {~~a ~~m}
356 {~~a ~~m}
353− ~zod/try=> (~(int in (sa "acmo")) (sa "lep"))
357+ > (~(int in (sa "acmo")) (sa "lep"))
354 {}
358 {}
355
359
356------------------------------------------------------------------------
360------------------------------------------------------------------------
@@ -359,26 +363,26 @@ Examples
359
363
360Put b in a
364Put b in a
361
365
362−Add an element `b` to the [`++set`]() `a`.
366+Add an element `b` to the `++set` `a`.
363
367
364Accepts
368Accepts
365-------
369-------
366
370
367`a` is a set.
371`a` is a set.
368
372
369−`b` is a [noun]().
373+`b` is a noun.
370
374
371Produces
375Produces
372--------
376--------
373
377
374−A [`++set`]().
378+A `++set`.
375
379
376Source
380Source
377------
381------
378
382
379− +- put :: puts b in a
383+ +- put :: puts b in a, sorted
380 ~/ %put
384 ~/ %put
381− |* b=*
385+ |* b/*
382 |- ^+ a
386 |- ^+ a
383 ?~ a
387 ?~ a
384 [b ~ ~]
388 [b ~ ~]
@@ -401,11 +405,11 @@ Source
401Examples
405Examples
402--------
406--------
403
407
404− ~zod/try=> =a (~(gas in `(set ,@t)`~) `(list ,@t)`[`a` `b` `c` ~])
408+ > =a (~(gas in `(set @t)`~) `(list @t)`[`a` `b` `c` ~])
405− ~zod/try=> =b (~(put in a) `d`)
409+ > =b (~(put in a) `d`)
406− ~zod/try=> b
410+ > b
407 {`d` `a` `c` `b`}
411 {`d` `a` `c` `b`}
408− ~zod/try=> -.l.+.b
412+ > -.l.+.b
409 n=`d`
413 n=`d`
410
414
411------------------------------------------------------------------------
415------------------------------------------------------------------------
@@ -414,14 +418,14 @@ Examples
414
418
415Accumulate
419Accumulate
416
420
417−Accumulate the elements of `a` using a [gate]() `c` and an accumulator `b`.
421+Accumulate the elements of `a` using a gate `c` and an accumulator `b`.
418
422
419Accepts
423Accepts
420--------
424--------
421
425
422−`a` is a [`++set`]().
426+`a` is a `++set`.
423
427
424−`b` is a [noun]().
428+`b` is a noun.
425
429
426`c` is a gate.
430`c` is a gate.
427
431
@@ -433,21 +437,21 @@ A noun.
433Source
437Source
434------
438------
435
439
436− +- rep :: replace by tile
440+ +- rep :: replace by product
437− |* [b=* c=_,*]
441+ |* b/_|=({* *} +<+)
438− |-
442+ |-
439− ?~ a b
443+ ?~ a +<+.b
440− $(a r.a, b $(a l.a, b (c n.a b)))
444+ $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
441− ::
445+
442
446
443
447
444Examples
448Examples
445--------
449--------
446
450
447− ~zod/try=> =a (~(gas in *(set ,@)) [1 2 3 ~])
451+ > =a (~(gas in *(set @)) [1 2 3 ~])
448− ~zod/try=> a
452+ > a
449 {1 3 2}
453 {1 3 2}
450− ~zod/try=> (~(rep in a) 0 |=([a=@ b=@] (add a b)))
454+ > (~(rep in a) 0 |=([a/@ b/@] (add a b)))
451 6
455 6
452
456
453------------------------------------------------------------------------
457------------------------------------------------------------------------
@@ -456,7 +460,7 @@ Examples
456
460
457Set to list
461Set to list
458
462
459−Flattens the [`++set`]() `a` into a [`++list`]().
463+Flattens the `++set` `a` into a `++list`.
460
464
461Accepts
465Accepts
462-------
466-------
@@ -471,25 +475,26 @@ A list.
471Source
475Source
472------
476------
473
477
474− +- tap :: list tiles a set
478+ +- tap :: convert to list
475 ~/ %tap
479 ~/ %tap
476− |= b=(list ,_?>(?=(^ a) n.a))
480+ |= b/(list _?>(?=(^ a) n.a))
477 ^+ b
481 ^+ b
478 ?~ a
482 ?~ a
479 b
483 b
480− $(a r.a, b [n.a $(a l.a)])
484+ $(a r.a b [n.a $(a l.a)])
481 ::
485 ::
482
486
483
487
488+
484Examples
489Examples
485--------
490--------
486
491
487− ~zod/try=> =s (sa `(list ,@t)`['a' 'b' 'c' 'd' 'e' ~])
492+ > =s (sa `(list @t)`['a' 'b' 'c' 'd' 'e' ~])
488− ~zod/try=> s
493+ > s
489 {'e' 'd' 'a' 'c' 'b'}
494 {'e' 'd' 'a' 'c' 'b'}
490− ~zod/try=> (~(tap in s) `(list ,@t)`['1' '2' '3' ~])
495+ > (~(tap in s) `(list @t)`['1' '2' '3' ~])
491 ~['b' 'c' 'a' 'd' 'e' '1' '2' '3']
496 ~['b' 'c' 'a' 'd' 'e' '1' '2' '3']
492− ~zod/try=> b
497+ > b
493 {'bonita' 'madeleine' 'daniel' 'john'}
498 {'bonita' 'madeleine' 'daniel' 'john'}
494 ~zod/try=> (~(tap in b) `(list ,@t)`['david' 'people' ~])
499 ~zod/try=> (~(tap in b) `(list ,@t)`['david' 'people' ~])
495 ~['john' 'daniel' 'madeleine' 'bonita' 'david' 'people']
500 ~['john' 'daniel' 'madeleine' 'bonita' 'david' 'people']
@@ -520,7 +525,8 @@ Source
520
525
521 +- uni :: union
526 +- uni :: union
522 ~/ %uni
527 ~/ %uni
523− |* b=_a
528+ |* b/_a
529+ ?: =(a b) a
524 |- ^+ a
530 |- ^+ a
525 ?~ b
531 ?~ b
526 a
532 a
@@ -537,18 +543,19 @@ Source
537 ?: (hor n.a n.b)
543 ?: (hor n.a n.b)
538 $(b [n.b $(b l.b, a [n.a l.a ~]) r.b], a r.a)
544 $(b [n.b $(b l.b, a [n.a l.a ~]) r.b], a r.a)
539 $(b [n.b l.b $(b r.b, a [n.a ~ r.a])], a l.a)
545 $(b [n.b l.b $(b r.b, a [n.a ~ r.a])], a l.a)
546+ ::
540
547
541
548
542Examples
549Examples
543--------
550--------
544
551
545− ~zod/try=> (~(uni in (sa "ac")) (sa "ha"))
552+ > (~(uni in (sa "ac")) (sa "ha"))
546 {~~a ~~c ~~h}
553 {~~a ~~c ~~h}
547− ~zod/try=> (~(uni in (sa "acmo")) ~)
554+ > (~(uni in (sa "acmo")) ~)
548 {~~a ~~c ~~m ~~o}
555 {~~a ~~c ~~m ~~o}
549− ~zod/try=> (~(uni in (sa "acmo")) (sa "ham"))
556+ > (~(uni in (sa "acmo")) (sa "ham"))
550 {~~a ~~c ~~m ~~o ~~h}
557 {~~a ~~c ~~m ~~o ~~h}
551− ~zod/try=> (~(uni in (sa "acmo")) (sa "lep"))
558+ > (~(uni in (sa "acmo")) (sa "lep"))
552 {~~e ~~a ~~c ~~m ~~l ~~o ~~p}
559 {~~e ~~a ~~c ~~m ~~l ~~o ~~p}
553
560
554------------------------------------------------------------------------
561------------------------------------------------------------------------
@@ -575,17 +582,19 @@ Source
575 +- wyt :: size of set
582 +- wyt :: size of set
576 |- ^- @
583 |- ^- @
577 ?~(a 0 +((add $(a l.a) $(a r.a))))
584 ?~(a 0 +((add $(a l.a) $(a r.a))))
585+ --
586+
578
587
579
588
580Examples
589Examples
581--------
590--------
582
591
583− ~zod/try=> =a (~(put in (~(put in (sa)) 'a')) 'b')
592+ > =a (~(put in (~(put in (sa)) 'a')) 'b')
584− ~zod/try=> ~(wyt in a)
593+ > ~(wyt in a)
585 2
594 2
586− ~zod/try=> b
595+ > b
587 {'bonita' 'madeleine' 'daniel' 'john'}
596 {'bonita' 'madeleine' 'daniel' 'john'}
588− ~zod/try=> ~(wyt in b)
597+ > ~(wyt in b)
589 4
598 4
590
599
591
600
docs/system/hoon/library/2i.md+150−138
@@ -5,14 +5,15 @@ Map operations
5
5
6 ++ by :: map engine
6 ++ by :: map engine
7 ~/ %by
7 ~/ %by
8− |/ a=(map)
8+ |_ a/(map)
9+
9
10
10Container arm for map operation arms. A map is a set of key, value
11Container arm for map operation arms. A map is a set of key, value
11−pairs. The contained arms inherit it's [sample]() [map](), `a`.
12+pairs. The contained arms inherit it's sample map, `a`.
12
13
13−`a` is a [map]().
14+`a` is a map.
14
15
15− ~zod/try=> ~(. by (mo (limo [%a 1] [%b 2] ~)))
16+ > ~(. by (mo (limo [%a 1] [%b 2] ~)))
16 <19.irb [nlr([p={%a %b} q=@ud]) <414.rvm 101.jzo 1.ypj %164>]>
17 <19.irb [nlr([p={%a %b} q=@ud]) <414.rvm 101.jzo 1.ypj %164>]>
17
18
18------------------------------------------------------------------------
19------------------------------------------------------------------------
@@ -23,26 +24,28 @@ Logical AND
23
24
24 +- all :: logical AND
25 +- all :: logical AND
25 ~/ %all
26 ~/ %all
26− |* b=$+(* ?)
27+ |* b/$-(* ?)
27 |- ^- ?
28 |- ^- ?
28 ?~ a
29 ?~ a
29 &
30 &
30 ?&((b q.n.a) $(a l.a) $(a r.a))
31 ?&((b q.n.a) $(a l.a) $(a r.a))
32+ ::
33+
31
34
32Computes the logical AND on the results of slamming every element in map
35Computes the logical AND on the results of slamming every element in map
33`a` with gate `b`. Produces a loobean.
36`a` with gate `b`. Produces a loobean.
34
37
35−`a` is a [map]().
38+`a` is a map.
36
39
37−`b` is a [wet gate]().
40+`b` is a wet gate.
38
41
39− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
42+ > =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
40− ~zod/try=> (~(all by b) |=(a=* ?@(a & |)))
43+ > (~(all by b) |=(a/* ?@(a & |)))
41 %.n
44 %.n
42− ~zod/try=> =a (mo `(list ,[@t @u])`[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
45+ > =a (mo `(list {@t @u})`[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
43− ~zod/try=> (~(all by a) |=(a=@ (lte a 6)))
46+ > (~(all by a) |=(a/@ (lte a 6)))
44 %.y
47 %.y
45− ~zod/try=> (~(all by a) |=(a=@ (lte a 4)))
48+ > (~(all by a) |=(a/@ (lte a 4)))
46 %.n
49 %.n
47
50
48------------------------------------------------------------------------
51------------------------------------------------------------------------
@@ -62,15 +65,15 @@ Logical OR
62Computes the logical OR on the results of slamming every element with
65Computes the logical OR on the results of slamming every element with
63gate `b`. Produces a loobean.
66gate `b`. Produces a loobean.
64
67
65−`a` is a [map]().
68+`a` is a map.
66
69
67−`b` is a [wet gate]().
70+`b` is a wet gate.
68
71
69− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
72+ > =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
70− ~zod/try=> (~(all by b) |=(a=* ?@(a & |)))
73+ > (~(all by b) |=(a/* ?@(a & |)))
71 %.y
74 %.y
72− ~zod/try=> =a (mo `(list ,[@t @u])`[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
75+ > =a (mo `(list {@t @u})`[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
73− ~zod/try=> (~(any by a) |=(a=@ (lte a 4)))
76+ > (~(any by a) |=(a=@ (lte a 4)))
74 %.y
77 %.y
75
78
76------------------------------------------------------------------------
79------------------------------------------------------------------------
@@ -81,7 +84,7 @@ Delete
81
84
82 +- del :: delete at key b
85 +- del :: delete at key b
83 ~/ %del
86 ~/ %del
84− |* b=*
87+ |* b/*
85 |- ^+ a
88 |- ^+ a
86 ?~ a
89 ?~ a
87 ~
90 ~
@@ -89,21 +92,22 @@ Delete
89 ?: (gor b p.n.a)
92 ?: (gor b p.n.a)
90 [n.a $(a l.a) r.a]
93 [n.a $(a l.a) r.a]
91 [n.a l.a $(a r.a)]
94 [n.a l.a $(a r.a)]
92− |- ^- ?(~ _a)
95+ |- ^- {$?($~ _a)}
93 ?~ l.a r.a
96 ?~ l.a r.a
94 ?~ r.a l.a
97 ?~ r.a l.a
95 ?: (vor p.n.l.a p.n.r.a)
98 ?: (vor p.n.l.a p.n.r.a)
96 [n.l.a l.l.a $(l.a r.l.a)]
99 [n.l.a l.l.a $(l.a r.l.a)]
97 [n.r.a $(r.a l.r.a) r.r.a]
100 [n.r.a $(r.a l.r.a) r.r.a]
101+ ::
98
102
99Produces map `a` with the element located at key `b` removed.
103Produces map `a` with the element located at key `b` removed.
100
104
101−`a` is a [map]().
105+`a` is a map.
102
106
103−`b` is a key as a [noun]().
107+`b` is a key as a noun.
104
108
105− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
109+ > =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
106− ~zod/try=> (~(del by b) `a`)
110+ > (~(del by b) `a`)
107 {[p=`b` q=[2 3]]}
111 {[p=`b` q=[2 3]]}
108
112
109------------------------------------------------------------------------
113------------------------------------------------------------------------
@@ -112,24 +116,26 @@ Produces map `a` with the element located at key `b` removed.
112
116
113Axis of key
117Axis of key
114
118
115− +- dig :: axis of key
119+ +- dig :: axis of b key
116− |= b=*
120+ |= b/*
117 =+ c=1
121 =+ c=1
118− |- ^- (unit ,@)
122+ |- ^- (unit @)
119 ?~ a ~
123 ?~ a ~
120 ?: =(b p.n.a) [~ u=(peg c 2)]
124 ?: =(b p.n.a) [~ u=(peg c 2)]
121 ?: (gor b p.n.a)
125 ?: (gor b p.n.a)
122 $(a l.a, c (peg c 6))
126 $(a l.a, c (peg c 6))
123 $(a r.a, c (peg c 7))
127 $(a r.a, c (peg c 7))
128+ ::
129+
124
130
125Produce the axis of key `b` within map `a`.
131Produce the axis of key `b` within map `a`.
126
132
127−`a` is a [map]().
133+`a` is a map.
128
134
129−`b` is a key as a [noun]().
135+`b` is a key as a noun.
130
136
131− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
137+ > =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
132− ~zod/try=> (~(dig by b) `b`)
138+ > (~(dig by b) `b`)
133 [~ 2]
139 [~ 2]
134
140
135------------------------------------------------------------------------
141------------------------------------------------------------------------
@@ -140,22 +146,23 @@ Concatenate
140
146
141 +- gas :: concatenate
147 +- gas :: concatenate
142 ~/ %gas
148 ~/ %gas
143− |* b=(list ,[p=* q=*])
144− => .(b `(list ,_?>(?=(^ a) n.a))`b)
149+ |= b/(list _?>(?=(^ a) n.a))
145 |- ^+ a
150 |- ^+ a
146 ?~ b
151 ?~ b
147 a
152 a
148− $(b t.b, a (put(+< a) p.i.b q.i.b))
153+ $(b t.b, a (put i.b))
154+ ::
155+
149
156
150Insert a list of key-value pairs `b` into map `a`.
157Insert a list of key-value pairs `b` into map `a`.
151
158
152−`a` is a [map]().
159+`a` is a map.
153
160
154−`b` is a [list]() of [cells]() of key-value nouns `p` and `q`.
161+`b` is a list of cells of key-value nouns `p` and `q`.
155
162
156− ~zod/try=> =a (mo `(list ,[@t *])`[[`a` 1] [`b` 2] ~])
163+ > =a (mo `(list {@t *})`[[`a` 1] [`b` 2] ~])
157− ~zod/try=> =b `(list ,[@t *])`[[`c` 3] [`d` 4] ~]
164+ > =b `(list {@t *})`[[`c` 3] [`d` 4] ~]
158− ~zod/try=> (~(gas by a) b)
165+ > (~(gas by a) b)
159 {[p=`d` q=4] [p=`a` q=1] [p=`c` q=3] [p=`b` q=2]}
166 {[p=`d` q=4] [p=`a` q=1] [p=`c` q=3] [p=`b` q=2]}
160
167
161------------------------------------------------------------------------
168------------------------------------------------------------------------
@@ -178,12 +185,12 @@ Grab unit value
178
185
179Produce the unit value of the value located at key `b` within map `a`.
186Produce the unit value of the value located at key `b` within map `a`.
180
187
181−`a` is a [map]()
188+`a` is a map
182
189
183−`b` is a [key]() as a [noun]()
190+`b` is a key as a noun
184
191
185− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
192+ > =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
186− ~zod/try=> (~(get by b) `b`)
193+ > (~(get by b) `b`)
187 [~ [2 3]]
194 [~ [2 3]]
188
195
189------------------------------------------------------------------------
196------------------------------------------------------------------------
@@ -193,25 +200,24 @@ Produce the unit value of the value located at key `b` within map `a`.
193Assert
200Assert
194
201
195 +- got
202 +- got
196− |* b=*
203+ |* b/*
197− %- need
204+ (need (get b))
198− %- get(+< a) b
199
205
200Produce the value located at key `b` within map `a`. Crash if key `b`
206Produce the value located at key `b` within map `a`. Crash if key `b`
201does not exist.
207does not exist.
202
208
203−`a` is a [map]().
209+`a` is a map.
204
210
205−`b` is a [key]().
211+`b` is a key.
206
212
207− ~zod/try=> =m (mo `(list ,[@t *])`[['a' 1] ['b' 2] ~])
213+ > =m (mo `(list {@t *})`[['a' 1] ['b' 2] ~])
208− ~zod/try=> m
214+ > m
209 {[p='a' q=1] [p='b' q=2]}
215 {[p='a' q=1] [p='b' q=2]}
210− ~zod/try=> (~(get by m) 'a')
216+ > (~(get by m) 'a')
211 [~ 1]
217 [~ 1]
212− ~zod/try=> (~(got by m) 'a')
218+ > (~(got by m) 'a')
213 1
219 1
214− ~zod/try=> (~(got by m) 'c')
220+ > (~(got by m) 'c')
215 ! exit
221 ! exit
216
222
217------------------------------------------------------------------------
223------------------------------------------------------------------------
@@ -222,20 +228,21 @@ Key existence check
222
228
223 +- has :: key existence check
229 +- has :: key existence check
224 ~/ %has
230 ~/ %has
225− |* b=*
231+ |* b/*
226− !=(~ (get(+< a) b))
232+ !=(~ (get b))
233+
227
234
228Checks whether map `a` contains an element with key `b`, producing a
235Checks whether map `a` contains an element with key `b`, producing a
229loobean.
236loobean.
230
237
231−`a` is a [map]().
238+`a` is a map.
232
239
233−`b` is a key as a [noun]().
240+`b` is a key as a noun.
234
241
235− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
242+ > =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
236− ~zod/try=> (~(has by b) `b`)
243+ > (~(has by b) `b`)
237 %.y
244 %.y
238− ~zod/try=> (~(has by b) `c`)
245+ > (~(has by b) `c`)
239 %.n
246 %.n
240
247
241------------------------------------------------------------------------
248------------------------------------------------------------------------
@@ -246,7 +253,7 @@ Intersection
246
253
247 +- int :: intersection
254 +- int :: intersection
248 ~/ %int
255 ~/ %int
249− |* b=_a
256+ |* b/_a
250 |- ^+ a
257 |- ^+ a
251 ?~ b
258 ?~ b
252 ~
259 ~
@@ -255,42 +262,43 @@ Intersection
255 ?: (vor p.n.a p.n.b)
262 ?: (vor p.n.a p.n.b)
256 ?: =(p.n.b p.n.a)
263 ?: =(p.n.b p.n.a)
257 [n.b $(a l.a, b l.b) $(a r.a, b r.b)]
264 [n.b $(a l.a, b l.b) $(a r.a, b r.b)]
258− ?: (hor p.n.b p.n.a)
265+ ?: (gor p.n.b p.n.a)
259− %- uni(+< $(a l.a, b [n.b l.b ~])) $(b r.b)
266+ %- uni(a $(a l.a, b [n.b l.b ~])) $(b r.b)
260− %- uni(+< $(a r.a, b [n.b ~ r.b])) $(b l.b)
267+ %- uni(a $(a r.a, b [n.b ~ r.b])) $(b l.b)
261 ?: =(p.n.a p.n.b)
268 ?: =(p.n.a p.n.b)
262 [n.b $(b l.b, a l.a) $(b r.b, a r.a)]
269 [n.b $(b l.b, a l.a) $(b r.b, a r.a)]
263− ?: (hor p.n.a p.n.b)
270+ ?: (gor p.n.a p.n.b)
264− %- uni(+< $(b l.b, a [n.a l.a ~])) $(a r.a)
271+ %- uni(a $(b l.b, a [n.a l.a ~])) $(a r.a)
265− %- uni(+< $(b r.b, a [n.a ~ r.a])) $(a l.a)
272+ %- uni(a $(b r.b, a [n.a ~ r.a])) $(a l.a)
273+ ::
266
274
267Produces a map of the (key) intersection between two maps of the same
275Produces a map of the (key) intersection between two maps of the same
268type, `a` and `b`. If both maps have an identical key that point to
276type, `a` and `b`. If both maps have an identical key that point to
269different values, the element from map `b` is used.
277different values, the element from map `b` is used.
270
278
271−`a` is a [map]().
279+`a` is a map.
272
280
273−`b` is a [map]().
281+`b` is a map.
274
282
275− ~zod/try=> =n (mo `(list ,[@t *])`[['a' 1] ['c' 3] ~])
283+ > =n (mo `(list {@t *})`[['a' 1] ['c' 3] ~])
276− ~zod/try=> n
284+ > n
277 {[p='a' q=1] [p='c' q=3]}
285 {[p='a' q=1] [p='c' q=3]}
278− ~zod/try=> m
286+ > m
279 {[p='a' q=1] [p='b' q=2]}
287 {[p='a' q=1] [p='b' q=2]}
280− ~zod/try=> (~(int by m) n)
288+ > (~(int by m) n)
281 {[p='a' q=1]}
289 {[p='a' q=1]}
282− ~ravpel-holber/try=> =p (mo `(list ,[@t *])`[['a' 2] ['b' 2] ~])
290+ ~ravpel-holber/try=> =p (mo `(list {@t *})`[['a' 2] ['b' 2] ~])
283− ~zod/try=> p
291+ > p
284 {[p='a' q=2] [p='b' q=2]}
292 {[p='a' q=2] [p='b' q=2]}
285− ~zod/try=> (~(int by p) n)
293+ > (~(int by p) n)
286 {[p='a' q=2]}
294 {[p='a' q=2]}
287− ~zod/try=> =q (mo `(list ,[@t *])`[['a' 2] ['c' 2] ~])
295+ > =q (mo `(list {@t *})`[['a' 2] ['c' 2] ~])
288− ~zod/try=> q
296+ > q
289 {[p='a' q=2] [p='b' q=2]}
297 {[p='a' q=2] [p='b' q=2]}
290− ~zod/try=> (~(int by p) q)
298+ > (~(int by p) q)
291 {[p='a' q=2] [p='b' q=2]}
299 {[p='a' q=2] [p='b' q=2]}
292− ~zod/try=> =o (mo `(list ,[@t *])`[['c' 3] ['d' 4] ~])
300+ > =o (mo `(list {@t *})`[['c' 3] ['d' 4] ~])
293− ~zod/try=> (~(int by m) o)
301+ > (~(int by m) o)
294 {}
302 {}
295
303
296
304
@@ -315,17 +323,17 @@ pair in the map. If the value is null, delete the key.
315
323
316XX This arm is broken, asana task 15186618346453
324XX This arm is broken, asana task 15186618346453
317
325
318− ~zod/try=> m
326+ > m
319 {[p='a' q=1] [p='b' q=2]}
327 {[p='a' q=1] [p='b' q=2]}
320− ~zod/try=> (~(mar by m) 'c' (some 3))
328+ > (~(mar by m) 'c' (some 3))
321 ! -find-limb.n
329 ! -find-limb.n
322 ! find-none
330 ! find-none
323 ! exit
331 ! exit
324− ~zod/try=> (~(mar by m) 'c' ~)
332+ > (~(mar by m) 'c' ~)
325 ! -find-limb.n
333 ! -find-limb.n
326 ! find-none
334 ! find-none
327 ! exit
335 ! exit
328− ~zod/try=> (~(mar by m) 'b' ~)
336+ > (~(mar by m) 'b' ~)
329 ! -find-limb.n
337 ! -find-limb.n
330 ! find-none
338 ! find-none
331 ! exit
339 ! exit
@@ -338,7 +346,7 @@ Add key-value pair
338
346
339 +- put :: adds key-value pair
347 +- put :: adds key-value pair
340 ~/ %put
348 ~/ %put
341− |* [b=* c=*]
349+ |* {b/* c/*}
342 |- ^+ a
350 |- ^+ a
343 ?~ a
351 ?~ a
344 [[b c] ~ ~]
352 [[b c] ~ ~]
@@ -357,23 +365,24 @@ Add key-value pair
357 ?: (vor p.n.a p.n.d)
365 ?: (vor p.n.a p.n.d)
358 [n.a l.a d]
366 [n.a l.a d]
359 [n.d [n.a l.a l.d] r.d]
367 [n.d [n.a l.a l.d] r.d]
368+ ::
360
369
361Produces `a` with the addition of the key-value pair of `b` and `c`.
370Produces `a` with the addition of the key-value pair of `b` and `c`.
362
371
363−`a` is a [map]().
372+`a` is a map.
364
373
365`b` is a key of the same type as the keys in `a`.
374`b` is a key of the same type as the keys in `a`.
366
375
367`c` is a value of the same type of the values in `a`.
376`c` is a value of the same type of the values in `a`.
368
377
369− ~zod/try=> m
378+ > m
370 {[p='a' q=1] [p='b' q=2]}
379 {[p='a' q=1] [p='b' q=2]}
371− ~zod/try=> (~(put by m) 'c' 3)
380+ > (~(put by m) 'c' 3)
372 {[p='a' q=1] [p='c' q=3] [p='b' q=2]}
381 {[p='a' q=1] [p='c' q=3] [p='b' q=2]}
373− ~zod/try=> (~(put by m) "zod" 26)
382+ > (~(put by m) "zod" 26)
374 ! type-fail
383 ! type-fail
375 ! exit
384 ! exit
376− ~zod/try=> (~(put by m) 'a' 2)
385+ > (~(put by m) 'a' 2)
377 {[p='a' q=2] [p='b' q=2]}
386 {[p='a' q=2] [p='b' q=2]}
378
387
379------------------------------------------------------------------------
388------------------------------------------------------------------------
@@ -381,10 +390,11 @@ Produces `a` with the addition of the key-value pair of `b` and `c`.
381### `+-rep:by`
390### `+-rep:by`
382
391
383 +- rep :: replace by product
392 +- rep :: replace by product
384− |* [b=* c=_,*]
393+ |* b/_|=({* *} +<+)
385 |-
394 |-
386− ?~ a b
395+ ?~ a +<+.b
387− $(a r.a, b $(a l.a, b (c q.n.a b)))
396+ $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
397+ ::
388
398
389Accumulate using gate from values in map
399Accumulate using gate from values in map
390
400
@@ -395,7 +405,7 @@ XX interface changing.
395### `+-rib:by`
405### `+-rib:by`
396
406
397 +- rib :: transform + product
407 +- rib :: transform + product
398− |* [b=* c=_,*]
408+ |* {b/* c/$-(* *)}
399 |- ^+ [b a]
409 |- ^+ [b a]
400 ?~ a [b ~]
410 ?~ a [b ~]
401 =+ d=(c n.a b)
411 =+ d=(c n.a b)
@@ -403,6 +413,7 @@ XX interface changing.
403 =+ e=$(a l.a, b -.d)
413 =+ e=$(a l.a, b -.d)
404 =+ f=$(a r.a, b -.e)
414 =+ f=$(a r.a, b -.e)
405 [-.f [n.a +.e +.f]]
415 [-.f [n.a +.e +.f]]
416+ ::
406
417
407Replace values with accumulator
418Replace values with accumulator
408
419
@@ -414,23 +425,23 @@ XX interface changing, possibly disappearing
414
425
415Transform values
426Transform values
416
427
417− +- run :: turns to tuples
428+ +- run :: apply gate to values
418− |* b=_,*
429+ |* b/$-(* *)
419− |-
430+ |-
420 ?~ a a
431 ?~ a a
421− a(n (b q.n.a), l $(a l.a), r $(a r.a))
432+ [n=[p=p.n.a q=(b q.n.a)] l=$(a l.a) r=$(a r.a)]
422
433
423Iterates over every value in set `a` using gate `b`. Produces a map.
434Iterates over every value in set `a` using gate `b`. Produces a map.
424
435
425−`a` is a [map]().
436+`a` is a map.
426
437
427−`b` is a [wet gate]().
438+`b` is a wet gate.
428
439
429− ~zod/try=> m
440+ > m
430 {[p='a' q=1] [p='b' q=2]}
441 {[p='a' q=1] [p='b' q=2]}
431− ~zod/try=> ^+(m (~(run by m) dec))
442+ > ^+(m (~(run by m) dec))
432 {[p='a' q=0] [p='b' q=1]}
443 {[p='a' q=0] [p='b' q=1]}
433− ~zod/try=> `(map ,@tas ,@t)`(~(run by m) (cury scot %ux))
444+ > `(map @tas @t)`(~(run by m) (cury scot %ux))
434 {[p=%a q='0x1'] [p=%b q='0x2']}
445 {[p=%a q='0x1'] [p=%b q='0x2']}
435
446
436------------------------------------------------------------------------
447------------------------------------------------------------------------
@@ -441,25 +452,26 @@ Listify pairs
441
452
442 +- tap :: listify pairs
453 +- tap :: listify pairs
443 ~/ %tap
454 ~/ %tap
444− |= b=(list ,_?>(?=(^ a) n.a))
455+ |= b/(list _?>(?=(^ a) n.a))
445 ^+ b
456 ^+ b
446 ?~ a
457 ?~ a
447 b
458 b
448 $(a r.a, b [n.a $(a l.a)])
459 $(a r.a, b [n.a $(a l.a)])
460+ ::
449
461
450Produces the list of all elements in map `a` that is prepended to list
462Produces the list of all elements in map `a` that is prepended to list
451`b`, which is empty by default.
463`b`, which is empty by default.
452
464
453−`a` is a [map]().
465+`a` is a map.
454
466
455−`b` is a [list]().
467+`b` is a list.
456
468
457 {[p='a' q=1] [p='b' q=2]}
469 {[p='a' q=1] [p='b' q=2]}
458− ~zod/try=> `*`m
470+ > `*`m
459 [[98 2] [[97 1] 0 0] 0]
471 [[98 2] [[97 1] 0 0] 0]
460− ~zod/try=> (~(tap by m))
472+ > (~(tap by m))
461 ~[[p='b' q=2] [p='a' q=1]]
473 ~[[p='b' q=2] [p='a' q=1]]
462− ~zod/try=> `*`(~(tap by m))
474+ > `*`(~(tap by m))
463 [[98 2] [97 1] 0]
475 [[98 2] [97 1] 0]
464
476
465------------------------------------------------------------------------
477------------------------------------------------------------------------
@@ -470,7 +482,7 @@ Union
470
482
471 +- uni :: union, merge
483 +- uni :: union, merge
472 ~/ %uni
484 ~/ %uni
473− |* b=_a
485+ |* b/_a
474 |- ^+ a
486 |- ^+ a
475 ?~ b
487 ?~ b
476 a
488 a
@@ -479,38 +491,38 @@ Union
479 ?: (vor p.n.a p.n.b)
491 ?: (vor p.n.a p.n.b)
480 ?: =(p.n.b p.n.a)
492 ?: =(p.n.b p.n.a)
481 [n.b $(a l.a, b l.b) $(a r.a, b r.b)]
493 [n.b $(a l.a, b l.b) $(a r.a, b r.b)]
482− ?: (hor p.n.b p.n.a)
494+ ?: (gor p.n.b p.n.a)
483 $(a [n.a $(a l.a, b [n.b l.b ~]) r.a], b r.b)
495 $(a [n.a $(a l.a, b [n.b l.b ~]) r.a], b r.b)
484 $(a [n.a l.a $(a r.a, b [n.b ~ r.b])], b l.b)
496 $(a [n.a l.a $(a r.a, b [n.b ~ r.b])], b l.b)
485 ?: =(p.n.a p.n.b)
497 ?: =(p.n.a p.n.b)
486 [n.b $(b l.b, a l.a) $(b r.b, a r.a)]
498 [n.b $(b l.b, a l.a) $(b r.b, a r.a)]
487− ?: (hor p.n.a p.n.b)
499+ ?: (gor p.n.a p.n.b)
488 $(b [n.b $(b l.b, a [n.a l.a ~]) r.b], a r.a)
500 $(b [n.b $(b l.b, a [n.a l.a ~]) r.b], a r.a)
489 $(b [n.b l.b $(b r.b, a [n.a ~ r.a])], a l.a)
501 $(b [n.b l.b $(b r.b, a [n.a ~ r.a])], a l.a)
490
502
491Produces a map of the union between the keys of `a` and `b`. If `b`
503Produces a map of the union between the keys of `a` and `b`. If `b`
492shares a key with `a`, the tuple from `a` is preserved.
504shares a key with `a`, the tuple from `a` is preserved.
493
505
494−`a` is a [map]().
506+`a` is a map.
495
507
496−`b` is a [map]().
508+`b` is a map.
497
509
498− ~zod/try=> m
510+ > m
499 {[p='a' q=1] [p='b' q=2]}
511 {[p='a' q=1] [p='b' q=2]}
500− ~zod/try=> o
512+ > o
501 {[p='d' q=4] [p='c' q=3]}
513 {[p='d' q=4] [p='c' q=3]}
502− ~zod/try=> (~(uni by m) o)
514+ > (~(uni by m) o)
503 {[p='d' q=4] [p='a' q=1] [p='c' q=3] [p='b' q=2]}
515 {[p='d' q=4] [p='a' q=1] [p='c' q=3] [p='b' q=2]}
504− ~zod/try=> (~(uni by m) ~)
516+ > (~(uni by m) ~)
505 {[p='a' q=1] [p='b' q=2]}
517 {[p='a' q=1] [p='b' q=2]}
506− ~zod/try=> n
518+ > n
507 {[p='a' q=1] [p='c' q=9]}
519 {[p='a' q=1] [p='c' q=9]}
508− ~zod/try=> (~(uni by o) n)
520+ > (~(uni by o) n)
509 {[p='d' q=4] [p='a' q=1] [p='c' q=3]}
521 {[p='d' q=4] [p='a' q=1] [p='c' q=3]}
510− ~zod/try=> =n (mo `(list ,[@t *])`[['a' 1] ['c' 9] ~])
522+ > =n (mo `(list ,[@t *])`[['a' 1] ['c' 9] ~])
511− ~zod/try=> n
523+ > n
512 {[p='a' q=1] [p='c' q=9]}
524 {[p='a' q=1] [p='c' q=9]}
513− ~zod/try=> (~(uni by o) n)
525+ > (~(uni by o) n)
514 {[p='d' q=4] [p='a' q=1] [p='c' q=9]}
526 {[p='d' q=4] [p='a' q=1] [p='c' q=9]}
515
527
516------------------------------------------------------------------------
528------------------------------------------------------------------------
@@ -519,8 +531,8 @@ shares a key with `a`, the tuple from `a` is preserved.
519
531
520Turn (with key)
532Turn (with key)
521
533
522− +- urn :: turn
534+ +- urn :: apply gate to nodes
523− |* b=$+([* *] *)
535+ |* b/$-({* *} *)
524 |-
536 |-
525 ?~ a ~
537 ?~ a ~
526 [n=[p=p.n.a q=(b p.n.a q.n.a)] l=$(a l.a) r=$(a r.a)]
538 [n=[p=p.n.a q=(b p.n.a q.n.a)] l=$(a l.a) r=$(a r.a)]
@@ -528,18 +540,18 @@ Turn (with key)
528Iterates over every value in map `a` using gate `b`, which accepts both
540Iterates over every value in map `a` using gate `b`, which accepts both
529the key and the value of each element as its sample.
541the key and the value of each element as its sample.
530
542
531−`a` is a [map]().
543+`a` is a map.
532
544
533−`b` is a [wet gate]() that accepts two nouns (a key and a value) and
545+`b` is a wet gate that accepts two nouns (a key and a value) and
534produces a noun (the new value).
546produces a noun (the new value).
535
547
536− ~zod/try=> m
548+ > m
537 {[p='a' q=1] [p='b' q=2]}
549 {[p='a' q=1] [p='b' q=2]}
538− ~zod/try=> (~(urn by m) |=(a=[p=* q=*] q.a))
550+ > (~(urn by m) |=(a=[p=* q=*] q.a))
539 {[p='a' q=1] [p='b' q=2]}
551 {[p='a' q=1] [p='b' q=2]}
540− ~zod/try=> (~(urn by m) |=(a=[p=* q=*] 7))
552+ > (~(urn by m) |=(a=[p=* q=*] 7))
541 {[p='a' q=7] [p='b' q=7]}
553 {[p='a' q=7] [p='b' q=7]}
542− ~zod/try=> (~(urn by m) |=(a=[p=* q=*] p.a))
554+ > (~(urn by m) |=(a=[p=* q=*] p.a))
543 {[p='a' q=97] [p='b' q=98]}
555 {[p='a' q=97] [p='b' q=98]}
544
556
545------------------------------------------------------------------------
557------------------------------------------------------------------------
@@ -554,17 +566,17 @@ Depth
554
566
555Produce the depth of the tree map `a`.
567Produce the depth of the tree map `a`.
556
568
557−`a` is a [map]().
569+`a` is a map.
558
570
559− ~zod/try=> m
571+ > m
560 {[p='a' q=1] [p='b' q=2]}
572 {[p='a' q=1] [p='b' q=2]}
561− ~zod/try=> o
573+ > o
562 {[p='d' q=4] [p='c' q=3]}
574 {[p='d' q=4] [p='c' q=3]}
563− ~zod/try=> ~(wyt by m)
575+ > ~(wyt by m)
564 2
576 2
565− ~zod/try=> ~(wyt by o)
577+ > ~(wyt by o)
566 2
578 2
567− ~zod/try=> ~(wyt by (~(uni by m) o))
579+ > ~(wyt by (~(uni by m) o))
568 4
580 4
569
581
570
582
docs/system/hoon/library/2j.md+65−215
@@ -3,15 +3,14 @@
3
3
4Jar engine
4Jar engine
5
5
6− ++ ja :: jar engine
7− |/ a=(jar)
6+ |_ a/(jar)
8
7
9A container arm for `++jar` operation arms. A `++jar` is a `++map` of
8A container arm for `++jar` operation arms. A `++jar` is a `++map` of
10−`++list`s. The contained arms inherit the [sample]() jar.
9+`++list`s. The contained arms inherit the sample jar.
11
10
12−`a` is a [jar]().
11+`a` is a jar.
13
12
14− ~zod/try=> ~(. ja (mo (limo a/"ho" b/"he" ~)))
13+ > ~(. ja (mo (limo a/"ho" b/"he" ~)))
15 <2.dgz [nlr([p={%a %b} q=""]) <414.fvk 101.jzo 1.ypj %164>]>
14 <2.dgz [nlr([p={%a %b} q=""]) <414.fvk 101.jzo 1.ypj %164>]>
16
15
17------------------------------------------------------------------------
16------------------------------------------------------------------------
@@ -20,25 +19,26 @@ A container arm for `++jar` operation arms. A `++jar` is a `++map` of
20
19
21Grab value by key
20Grab value by key
22
21
23− +- get :: grab value by key
22+ +- get :: gets list by key
24− |* b=*
23+ |* b/*
25 =+ c=(~(get by a) b)
24 =+ c=(~(get by a) b)
26 ?~(c ~ u.c)
25 ?~(c ~ u.c)
26+ ::
27
27
28Produces a list retrieved from jar `a` using the key `b`.
28Produces a list retrieved from jar `a` using the key `b`.
29
29
30−`a` is a [`++jar`](/doc/hoon/library/1#++jar).
30+`a` is a `++jar`.
31
31
32`b` is a key of the same type as the keys in `a`.
32`b` is a key of the same type as the keys in `a`.
33
33
34− ~zod/try=> =l (mo `(list ,[@t (list ,@)])`[['a' `(list ,@)`[1 2 3 ~]] ['b' `(list ,@)`[4 5 6 ~]] ~])
34+ > =l (mo `(list ,[@t (list ,@)])`[['a' `(list ,@)`[1 2 3 ~]] ['b' `(list ,@)`[4 5 6 ~]] ~])
35− ~zod/try=> l
35+ > l
36 {[p='a' q=~[1 2 3]] [p='b' q=~[4 5 6]]}
36 {[p='a' q=~[1 2 3]] [p='b' q=~[4 5 6]]}
37− ~zod/try=> (~(get ja l) 'a')
37+ > (~(get ja l) 'a')
38 ~[1 2 3]
38 ~[1 2 3]
39− ~zod/try=> (~(get ja l) 'b')
39+ > (~(get ja l) 'b')
40 ~[4 5 6]
40 ~[4 5 6]
41− ~zod/try=> (~(get ja l) 'c')
41+ > (~(get ja l) 'c')
42 ~
42 ~
43
43
44------------------------------------------------------------------------
44------------------------------------------------------------------------
@@ -48,230 +48,77 @@ Produces a list retrieved from jar `a` using the key `b`.
48Prepend to list
48Prepend to list
49
49
50 +- add :: adds key-list pair
50 +- add :: adds key-list pair
51− |* [b=* c=*]
51+ |* {b/* c/*}
52− =+ d=(get(+< a) b)
52+ =+ d=(get b)
53 (~(put by a) b [c d])
53 (~(put by a) b [c d])
54
54
55Produces jar `a` with value `c` prepended to the list located at key
55Produces jar `a` with value `c` prepended to the list located at key
56`b`.
56`b`.
57
57
58−`a` is a [jar]().
58+`a` is a jar.
59
59
60`b` is a key of the same type as the keys in `a`.
60`b` is a key of the same type as the keys in `a`.
61
61
62`c` is a value of the same type as the values in `a`.
62`c` is a value of the same type as the values in `a`.
63
63
64− ~zod/try=> =l (mo `(list ,[@t (list ,@)])`[['a' `(list ,@)`[1 2 3 ~]] ['b' `(list ,@)`[4 5 6 ~]] ~])
64+ > =l (mo `(list ,[@t (list ,@)])`[['a' `(list ,@)`[1 2 3 ~]] ['b' `(list ,@)`[4 5 6 ~]] ~])
65− ~zod/try=> l
65+ > l
66 {[p='a' q=~[1 2 3]] [p='b' q=~[4 5 6]]}
66 {[p='a' q=~[1 2 3]] [p='b' q=~[4 5 6]]}
67− ~zod/try=> (~(add ja l) 'b' 7)
67+ > (~(add ja l) 'b' 7)
68 {[p='a' q=~[1 2 3]] [p='b' q=~[7 4 5 6]]}
68 {[p='a' q=~[1 2 3]] [p='b' q=~[7 4 5 6]]}
69− ~zod/try=> (~(add ja l) 'a' 100)
69+ > (~(add ja l) 'a' 100)
70 {[p='a' q=~[100 1 2 3]] [p='b' q=~[4 5 6]]}
70 {[p='a' q=~[100 1 2 3]] [p='b' q=~[4 5 6]]}
71− ~zod/try=> (~(add ja l) 'c' 7)
71+ > (~(add ja l) 'c' 7)
72 {[p='a' q=~[1 2 3]] [p='c' q=~[7]] [p='b' q=~[4 5 6]]}
72 {[p='a' q=~[1 2 3]] [p='c' q=~[7]] [p='b' q=~[4 5 6]]}
73− ~zod/try=> (~(add ja l) 'c' `(list ,@)`[7 8 9 ~])
73+ > (~(add ja l) 'c' `(list ,@)`[7 8 9 ~])
74 ! type-fail
74 ! type-fail
75 ! exit
75 ! exit
76
76
77−------------------------------------------------------------------------
77+**
78−
79### `++ju`
78### `++ju`
80
79
81Jug operations
80Jug operations
82
81
83 ++ ju :: jug engine
82 ++ ju :: jug engine
84− |/ a=(jug)
83+ |/ a/(jug)
85
84
86Container arm for jug operation arms. A `++jug` is a `++map` of
85Container arm for jug operation arms. A `++jug` is a `++map` of
87−`++sets`. The contained arms inherit its [sample]() jug, `a`.
86+`++sets`. The contained arms inherit its sample jug, `a`.
88
87
89−`a` is a [jug]().
88+`a` is a jug.
90
89
91− ~zod/try=> ~(. ju (mo (limo a/(sa "ho") b/(sa "he") ~)))
90+ > ~(. ju (mo (limo a/(sa "ho") b/(sa "he") ~)))
92 <2.dgz [nlr([p={%a %b} q={nlr(^$1{@tD $1}) nlr(^$3{@tD $3})}]) <414.fvk 101.jzo 1.ypj %164>]>
91 <2.dgz [nlr([p={%a %b} q={nlr(^$1{@tD $1}) nlr(^$3{@tD $3})}]) <414.fvk 101.jzo 1.ypj %164>]>
93
92
94### `+-del:ju`
93### `+-del:ju`
95
94
96Remove
95Remove
97
96
98− +- del :: delete at key b
97+ +- del :: del key-set pair
99− |* [b=* c=*]
98+ |* {b/* c/*}
100 ^+ a
99 ^+ a
101− =+ d=(get(+< a) b)
100+ =+ d=(get b)
102 =+ e=(~(del in d) c)
101 =+ e=(~(del in d) c)
103 ?~ e
102 ?~ e
104 (~(del by a) b)
103 (~(del by a) b)
105 (~(put by a) b e)
104 (~(put by a) b e)
105+ ::
106
106
107−Produces jug `a` with value `c` removed from set located at key `b`.
108−
109−`a` is a [jug]().
110−
111−`b` is a key of the same type as the keys in `a`.
112−
113−`c` is the value of the same type of the keys in `a` that is to be
114−removed.
115−
116− ~zod/try=> s
117− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
118− ~zod/try=> (~(del ju s) 'a' 1)
119− {[p='a' q={3 2}] [p='b' q={5 4 6}]}
120− ~zod/try=> (~(del ju s) 'c' 7)
121− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
122−
123−------------------------------------------------------------------------
124−
125−### `+-get:ju`
126−
127−Retrieve set
128−
129− +- get :: gets set by key
130− |* b=*
131− =+ c=(~(get by a) b)
132− ?~(c ~ u.c)
133−
134−Produces a set retrieved from jar `a` using key `b`.
135−
136−`a` is a [jar]().
137−
138−`b` is a key of the same type as the keys in `a`.
139−
140− ~zod/try=> s
141− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
142− ~zod/try=> (~(get ju s) 'a')
143− {1 3 2}
144− ~zod/try=> (~(get ju s) 'b')
145− {5 4 6}
146− ~zod/try=> (~(get ju s) 'c')
147− ~
148−
149−------------------------------------------------------------------------
150−
151−### `+-has:ju`
152−
153−Check contents
154−
155− +- has :: existence check
156− |* [b=* c=*]
157− ^- ?
158− (~(has in (get(+< a) b)) c)
159−
160−Computes whether a value `c` exists within the set located at key `b`
161−with jar `a`. Produces a loobean.
162−
163−`a` is a [set]().
164−
165−`b` is a key as a [noun]().
166−
167−`c` is a value as a [noun]().
168−
169− ~zod/try=> s
170− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
171− ~zod/try=> (~(has ju s) 'a' 3)
172− %.y
173− ~zod/try=> (~(has ju s) 'b' 6)
174− %.y
175− ~zod/try=> (~(has ju s) 'a' 7)
176− %.n
177− ~zod/try=> (~(has jus s) 'c' 7)
178− ! -find-limb.jus
179− ! find-none
180− ! exit
181− ~zod/try=> (~(has ju s) 'c' 7)
182− %.n
183−
184−------------------------------------------------------------------------
185−
186−### `+-put:ju`
187−
188−Add key-set pair
189−
190− +- put :: adds key-element pair
191− |* [b=* c=*]
192− ^+ a
193− =+ d=(get(+< a) b)
194− (~(put by a) b (~(put in d) c))
195−
196−Produces jar `a` with `c` added to the set value located at key `b`.
197−
198−`a` is a [set]().
199−
200−`b` is a key as a [noun]().
201−
202−`c` is a [value]().
203−
204− ~zod/try=> s
205− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
206− ~zod/try=> (~(put ju s) 'a' 7)
207− {[p='a' q={7 1 3 2}] [p='b' q={5 4 6}]}
208− ~zod/try=> (~(put ju s) 'a' 1)
209− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
210− ~zod/try=> (~(put ju s) 'c' 7)
211− {[p='a' q={1 3 2}] [p='c' q={7}] [p='b' q={5 4 6}]}
212−
213−------------------------------------------------------------------------
214−
215−### `++by`
216−
217−Map operations
218−
219− ++ by :: map engine
220− ~/ %by
221− |/ a=(map)
222−
223−Container arm for map operation arms. A map is a set of key, value
224−pairs. The contained arms inherit it's [sample]() [map](), `a`.
225−
226−`a` is a [map]().
227−
228− ~zod/try=> ~(. by (mo (limo [%a 1] [%b 2] ~)))
229− <19.irb [nlr([p={%a %b} q=@ud]) <414.rvm 101.jzo 1.ypj %164>]>
230−
231−
232−***
233−### `++ju`
234−
235−Jug operations
236−
237− ++ ju :: jug engine
238− |/ a=(jug)
239−
240−Container arm for jug operation arms. A `++jug` is a `++map` of
241−`++sets`. The contained arms inherit its [sample]() jug, `a`.
242−
243−`a` is a [jug]().
244−
245− ~zod/try=> ~(. ju (mo (limo a/(sa "ho") b/(sa "he") ~)))
246− <2.dgz [nlr([p={%a %b} q={nlr(^$1{@tD $1}) nlr(^$3{@tD $3})}]) <414.fvk 101.jzo 1.ypj %164>]>
247−
248−### `+-del:ju`
249−
250−Remove
251−
252− +- del :: delete at key b
253− |* [b=* c=*]
254− ^+ a
255− =+ d=(get(+< a) b)
256− =+ e=(~(del in d) c)
257− ?~ e
258− (~(del by a) b)
259− (~(put by a) b e)
260
107
261Produces jug `a` with value `c` removed from set located at key `b`.
108Produces jug `a` with value `c` removed from set located at key `b`.
262
109
263−`a` is a [jug]().
110+`a` is a jug.
264
111
265`b` is a key of the same type as the keys in `a`.
112`b` is a key of the same type as the keys in `a`.
266
113
267`c` is the value of the same type of the keys in `a` that is to be
114`c` is the value of the same type of the keys in `a` that is to be
268removed.
115removed.
269
116
270− ~zod/try=> s
117+ > s
271 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
118 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
272− ~zod/try=> (~(del ju s) 'a' 1)
119+ > (~(del ju s) 'a' 1)
273 {[p='a' q={3 2}] [p='b' q={5 4 6}]}
120 {[p='a' q={3 2}] [p='b' q={5 4 6}]}
274− ~zod/try=> (~(del ju s) 'c' 7)
121+ > (~(del ju s) 'c' 7)
275 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
122 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
276
123
277------------------------------------------------------------------------
124------------------------------------------------------------------------
@@ -281,23 +128,24 @@ removed.
281Retrieve set
128Retrieve set
282
129
283 +- get :: gets set by key
130 +- get :: gets set by key
284− |* b=*
131+ |* b/*
285 =+ c=(~(get by a) b)
132 =+ c=(~(get by a) b)
286 ?~(c ~ u.c)
133 ?~(c ~ u.c)
134+ ::
287
135
288Produces a set retrieved from jar `a` using key `b`.
136Produces a set retrieved from jar `a` using key `b`.
289
137
290−`a` is a [jar]().
138+`a` is a jar.
291
139
292`b` is a key of the same type as the keys in `a`.
140`b` is a key of the same type as the keys in `a`.
293
141
294− ~zod/try=> s
142+ > s
295 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
143 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
296− ~zod/try=> (~(get ju s) 'a')
144+ > (~(get ju s) 'a')
297 {1 3 2}
145 {1 3 2}
298− ~zod/try=> (~(get ju s) 'b')
146+ > (~(get ju s) 'b')
299 {5 4 6}
147 {5 4 6}
300− ~zod/try=> (~(get ju s) 'c')
148+ > (~(get ju s) 'c')
301 ~
149 ~
302
150
303------------------------------------------------------------------------
151------------------------------------------------------------------------
@@ -307,32 +155,34 @@ Produces a set retrieved from jar `a` using key `b`.
307Check contents
155Check contents
308
156
309 +- has :: existence check
157 +- has :: existence check
310− |* [b=* c=*]
158+ |* {b/* c/*}
311 ^- ?
159 ^- ?
312− (~(has in (get(+< a) b)) c)
160+ (~(has in (get b)) c)
161+ ::
162+
313
163
314Computes whether a value `c` exists within the set located at key `b`
164Computes whether a value `c` exists within the set located at key `b`
315with jar `a`. Produces a loobean.
165with jar `a`. Produces a loobean.
316
166
317−`a` is a [set]().
167+`a` is a set.
318
168
319−`b` is a key as a [noun]().
169+`b` is a key as a noun.
320
170
321−`c` is a value as a [noun]().
171+`c` is a value as a noun.
322
172
323− ~zod/try=> s
173+ > s
324 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
174 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
325− ~zod/try=> (~(has ju s) 'a' 3)
175+ > (~(has ju s) 'a' 3)
326 %.y
176 %.y
327− ~zod/try=> (~(has ju s) 'b' 6)
177+ > (~(has ju s) 'b' 6)
328 %.y
178 %.y
329− ~zod/try=> (~(has ju s) 'a' 7)
179+ > (~(has ju s) 'a' 7)
330 %.n
180 %.n
331− ~zod/try=> (~(has jus s) 'c' 7)
181+ > (~(has jus s) 'c' 7)
332 ! -find-limb.jus
182 ! -find-limb.jus
333 ! find-none
183 ! find-none
334 ! exit
184 ! exit
335− ~zod/try=> (~(has ju s) 'c' 7)
185+ > (~(has ju s) 'c' 7)
336 %.n
186 %.n
337
187
338------------------------------------------------------------------------
188------------------------------------------------------------------------
@@ -341,27 +191,27 @@ with jar `a`. Produces a loobean.
341
191
342Add key-set pair
192Add key-set pair
343
193
344− +- put :: adds key-element pair
194+ +- put :: add key-set pair
345− |* [b=* c=*]
195+ |* {b/* c/*}
346 ^+ a
196 ^+ a
347− =+ d=(get(+< a) b)
197+ =+ d=(get b)
348 (~(put by a) b (~(put in d) c))
198 (~(put by a) b (~(put in d) c))
349
199
350Produces jar `a` with `c` added to the set value located at key `b`.
200Produces jar `a` with `c` added to the set value located at key `b`.
351
201
352−`a` is a [set]().
202+`a` is a set.
353
203
354−`b` is a key as a [noun]().
204+`b` is a key as a noun.
355
205
356−`c` is a [value]().
206+`c` is a value.
357
207
358− ~zod/try=> s
208+ > s
359 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
209 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
360− ~zod/try=> (~(put ju s) 'a' 7)
210+ > (~(put ju s) 'a' 7)
361 {[p='a' q={7 1 3 2}] [p='b' q={5 4 6}]}
211 {[p='a' q={7 1 3 2}] [p='b' q={5 4 6}]}
362− ~zod/try=> (~(put ju s) 'a' 1)
212+ > (~(put ju s) 'a' 1)
363 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
213 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
364− ~zod/try=> (~(put ju s) 'c' 7)
214+ > (~(put ju s) 'c' 7)
365 {[p='a' q={1 3 2}] [p='c' q={7}] [p='b' q={5 4 6}]}
215 {[p='a' q={1 3 2}] [p='c' q={7}] [p='b' q={5 4 6}]}
366
216
367
217
docs/system/hoon/library/2k.md+63−59
@@ -4,18 +4,18 @@
4Queue operations
4Queue operations
5
5
6Container arm for queue operation arms. The contained arms inherit its
6Container arm for queue operation arms. The contained arms inherit its
7−[sample]() `++qeu` `a`.
7+sample `++qeu` `a`.
8
8
9Accepts
9Accepts
10-------
10-------
11
11
12−`a` is a queue, [++qeu]().
12+`a` is a queue, ++qeu.
13
13
14Source
14Source
15------
15------
16
16
17 ++ to :: queue engine
17 ++ to :: queue engine
18− |/ a=(qeu)
18+ |/ a/(qeu)
19
19
20### `+-bal:to`
20### `+-bal:to`
21
21
@@ -26,12 +26,12 @@ Vertically rebalances queue `a`.
26Accepts
26Accepts
27-------
27-------
28
28
29−`a` is a [queue]().
29+`a` is a queue.
30
30
31Produces
31Produces
32--------
32--------
33
33
34−A [queue]().
34+A queue.
35
35
36Source
36Source
37------
37------
@@ -39,23 +39,24 @@ Source
39 +- bal
39 +- bal
40 |- ^+ a
40 |- ^+ a
41 ?~ a ~
41 ?~ a ~
42− ?. |(?=(~ l.a) (vor n.a n.l.a))
42+ ?. |(?=($~ l.a) (vor n.a n.l.a))
43 $(a [n.l.a l.l.a $(a [n.a r.l.a r.a])])
43 $(a [n.l.a l.l.a $(a [n.a r.l.a r.a])])
44− ?. |(?=(~ r.a) (vor n.a n.r.a))
44+ ?. |(?=($~ r.a) (vor n.a n.r.a))
45 $(a [n.r.a $(a [n.a l.a l.r.a]) r.r.a])
45 $(a [n.r.a $(a [n.a l.a l.r.a]) r.r.a])
46 a
46 a
47 ::
47 ::
48
48
49+
49Examples
50Examples
50--------
51--------
51
52
52− ~zod/try=> `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~]
53+ > `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~]
53 {"a" "b" "c" "d" "e" "f" "g"}
54 {"a" "b" "c" "d" "e" "f" "g"}
54− ~zod/try=> `*`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~]
55+ > `*`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~]
55 [[97 0] 0 [98 0] 0 [99 0] 0 [100 0] 0 [101 0] 0 [102 0] 0 [103 0] 0 0]
56 [[97 0] 0 [98 0] 0 [99 0] 0 [100 0] 0 [101 0] 0 [102 0] 0 [103 0] 0 0]
56− ~zod/try=> ~(bal to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~])
57+ > ~(bal to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~])
57 {"a" "b" "c" "d" "e" "f" "g"}
58 {"a" "b" "c" "d" "e" "f" "g"}
58− ~zod/try=> `*`~(bal to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~])
59+ > `*`~(bal to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~])
59 [[100 0] [[99 0] [[98 0] [[97 0] 0 0] 0] 0] [101 0] 0 [102 0] 0 [103 0] 0 0]
60 [[100 0] [[99 0] [[98 0] [[97 0] 0 0] 0] 0] [101 0] 0 [102 0] 0 [103 0] 0 0]
60
61
61------------------------------------------------------------------------
62------------------------------------------------------------------------
@@ -69,7 +70,7 @@ Produces the maximum depth of leaves (r.a and l.a) in queue `a`.
69Accepts
70Accepts
70-------
71-------
71
72
72−`a` is a [queue]().
73+`a` is a queue.
73
74
74Produces
75Produces
75--------
76--------
@@ -85,21 +86,22 @@ Source
85 +((max $(a l.a) $(a r.a)))
86 +((max $(a l.a) $(a r.a)))
86 ::
87 ::
87
88
89+
88Examples
90Examples
89--------
91--------
90
92
91− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 5 6 7 ~])
93+ > =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 7 ~])
92− ~zod/try=> ~(dep to a)
94+ > ~(dep to a)
93 4
95 4
94− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 ~])
96+ > =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 ~])
95− ~zod/try=> ~(dep to a)
97+ > ~(dep to a)
96 3
98 3
97− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 ~])
99+ > =a (~(gas to `(qeu @)`~) `(list @)`[1 2 ~])
98− ~zod/try=> ~(dep to a)
100+ > ~(dep to a)
99 2
101 2
100− ~zod/try=> ~(dep to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~])
102+ > ~(dep to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~])
101 7
103 7
102− ~zod/try=> ~(dep to ~(bal to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~]))
104+ > ~(dep to ~(bal to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~]))
103 4
105 4
104
106
105------------------------------------------------------------------------
107------------------------------------------------------------------------
@@ -108,7 +110,7 @@ Examples
108
110
109Push list
111Push list
110
112
111−Push all elements of [`++list`]() `b` into the [`++queue`]().
113+Push all elements of `++list` `b` into the `++queue`.
112
114
113Accepts
115Accepts
114-------
116-------
@@ -134,11 +136,11 @@ Source
134Examples
136Examples
135--------
137--------
136
138
137− ~zod/try=> (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 ~])
139+ > (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 ~])
138 {3 2 1}
140 {3 2 1}
139− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 ~])
141+ > =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 ~])
140− ~zod/try=> =b `(list ,@)`[4 5 6 ~]
142+ > =b `(list ,@)`[4 5 6 ~]
141− ~zod/try=> (~(gas to a) b)
143+ > (~(gas to a) b)
142 {6 5 4 3 2 1}
144 {6 5 4 3 2 1}
143
145
144------------------------------------------------------------------------
146------------------------------------------------------------------------
@@ -147,7 +149,7 @@ Examples
147
149
148Pop
150Pop
149
151
150−Produces the head and tail [`++queue`]() of `a`.
152+Produces the head and tail `++queue` of `a`.
151
153
152Accepts
154Accepts
153-------
155-------
@@ -163,14 +165,14 @@ Source
163------
165------
164
166
165 +- get :: head-tail pair
167 +- get :: head-tail pair
166− |- ^+ [p=?>(?=(^ a) n.a) q=a]
168+ |- ^+ ?>(?=(^ a) [p=n.a q=*(qeu _n.a)])
167 ?~ a
169 ?~ a
168 !!
170 !!
169 ?~ r.a
171 ?~ r.a
170 [n.a l.a]
172 [n.a l.a]
171 =+ b=$(a r.a)
173 =+ b=$(a r.a)
172 :- p.b
174 :- p.b
173− ?: |(?=(~ q.b) (vor n.a n.q.b))
175+ ?: |(?=($~ q.b) (vor n.a n.q.b))
174 [n.a l.a q.b]
176 [n.a l.a q.b]
175 [n.q.b [n.a l.a l.q.b] r.q.b]
177 [n.q.b [n.a l.a l.q.b] r.q.b]
176 ::
178 ::
@@ -178,10 +180,10 @@ Source
178Examples
180Examples
179--------
181--------
180
182
181− ~zod/try=> =s (~(gas to *(qeu ,@)) `(list ,@)`~[1 2 3])
183+ > =s (~(gas to *(qeu @)) `(list @)`~[1 2 3])
182− ~zod/try=> ~(get to s)
184+ > ~(get to s)
183 [p=1 q={3 2}]
185 [p=1 q={3 2}]
184− ~zod/try=> ~(get to ~)
186+ > ~(get to ~)
185 ! exit
187 ! exit
186
188
187------------------------------------------------------------------------
189------------------------------------------------------------------------
@@ -190,12 +192,12 @@ Examples
190
192
191Remove last element
193Remove last element
192
194
193−Removes the head of [`++queue`]() `a`, producing the resulting queue.
195+Removes the head of `++queue` `a`, producing the resulting queue.
194
196
195Accepts
197Accepts
196-------
198-------
197
199
198−`a` is a [queue]().
200+`a` is a queue.
199
201
200Produces
202Produces
201--------
203--------
@@ -208,22 +210,22 @@ Source
208 +- nap :: removes head
210 +- nap :: removes head
209 ?> ?=(^ a)
211 ?> ?=(^ a)
210 ?: =(~ l.a) r.a
212 ?: =(~ l.a) r.a
211− =+ b=get(+< l.a)
213+ =+ b=get(a l.a)
212− bal(+< ^+(a [p.b q.b r.a]))
214+ bal(a ^+(a [p.b q.b r.a]))
213 ::
215 ::
214
216
215Examples
217Examples
216--------
218--------
217
219
218− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 5 6 ~])
220+ > =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 ~])
219− ~zod/try=> -.a
221+ > -.a
220 n=6
222 n=6
221− ~zod/try=> =b ~(nap to a)
223+ > =b ~(nap to a)
222− ~zod/try=> -.b
224+ > -.b
223 n=2
225 n=2
224− ~zod/try=> b
226+ > b
225 {5 4 3 2 1}
227 {5 4 3 2 1}
226− ~zod/try=> a
228+ > a
227 {6 5 4 3 2 1}
229 {6 5 4 3 2 1}
228
230
229------------------------------------------------------------------------
231------------------------------------------------------------------------
@@ -232,13 +234,13 @@ Examples
232
234
233Insert
235Insert
234
236
235−Accept any [noun]() `b` and adds to [`++queue`]() `a` as the head, producing the
237+Accept any noun `b` and adds to `++queue` `a` as the head, producing the
236resulting queue.
238resulting queue.
237
239
238Accepts
240Accepts
239-------
241-------
240
242
241−`a` is a [queue]().
243+`a` is a queue.
242
244
243`b` is any noun.
245`b` is any noun.
244
246
@@ -251,18 +253,19 @@ Source
251------
253------
252
254
253 +- put :: insert new tail
255 +- put :: insert new tail
254− |* b=*
256+ |* b/*
255 |- ^+ a
257 |- ^+ a
256 ?~ a
258 ?~ a
257 [b ~ ~]
259 [b ~ ~]
258− bal(+< a(l $(a l.a)))
260+ bal(a a(l $(a l.a)))
259 ::
261 ::
260
262
263+
261Examples
264Examples
262--------
265--------
263
266
264− ~zod/try=> (~(gas to `(qeu ,@)`~) `(list ,@)`[3 1 2 4 5 6 ~])
267+ > (~(gas to `(qeu @)`~) `(list @)`[3 1 2 4 5 6 ~])
265− ~zod/try=> (~(put to a) 7)
268+ > (~(put to a) 7)
266 {7 6 5 4 2 1 3}
269 {7 6 5 4 2 1 3}
267
270
268------------------------------------------------------------------------
271------------------------------------------------------------------------
@@ -271,18 +274,19 @@ Examples
271
274
272Queue to list
275Queue to list
273
276
274−Produces [`++queue`]() `a` as a [`++list`]() from front to back.
277+Produces `++queue` `a` as a `++list` from front to back.
275
278
276Accepts
279Accepts
277-------
280-------
278
281
279−`a` is a [queue]().
282+`a` is a queue.
280
283
281Source
284Source
282------
285------
283
286
284− +- tap :: queue to list
287+ +- tap :: adds list to end
285− |= b=(list ,_?>(?=(^ a) n.a))
288+ |= b/(list _?>(?=(^ a) n.a))
289+ =+ z=0 :: XX breaks jet match
286 ^+ b
290 ^+ b
287 ?~ a
291 ?~ a
288 b
292 b
@@ -292,22 +296,22 @@ Source
292Examples
296Examples
293--------
297--------
294
298
295− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[3 1 2 4 5 6 ~])
299+ > =a (~(gas to `(qeu @)`~) `(list @)`[3 1 2 4 5 6 ~])
296− ~zod/try=> `*`a
300+ > `*`a
297 [6 0 2 [4 [5 0 0] 0] 1 0 3 0 0]
301 [6 0 2 [4 [5 0 0] 0] 1 0 3 0 0]
298− ~zod/try=> (~(tap to a) `(list ,@)`[99 100 101 ~])
302+ > (~(tap to a) `(list @)`[99 100 101 ~])
299 ~[3 1 2 4 5 6 99 100 101]
303 ~[3 1 2 4 5 6 99 100 101]
300
304
301------------------------------------------------------------------------
305------------------------------------------------------------------------
302
306
303### `+-top:to`
307### `+-top:to`
304
308
305−Produces the head of [`++queue`]() `a` as a [`++unit`]() (an empty queue has no head).
309+Produces the head of `++queue` `a` as a `++unit` (an empty queue has no head).
306
310
307Accepts
311Accepts
308-------
312-------
309
313
310−`a` is a [queue]().
314+`a` is a queue.
311
315
312Produces
316Produces
313--------
317--------
@@ -318,15 +322,15 @@ Source
318------
322------
319
323
320 +- top :: produces head
324 +- top :: produces head
321− |- ^- (unit ,_?>(?=(^ a) n.a))
325+ |- ^- (unit _?>(?=(^ a) n.a))
322 ?~ a ~
326 ?~ a ~
323 ?~(r.a [~ n.a] $(a r.a))
327 ?~(r.a [~ n.a] $(a r.a))
324
328
325Examples
329Examples
326--------
330--------
327
331
328− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 5 6 ~])
332+ > =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 ~])
329− ~zod/try=> ~(top to a)
333+ > ~(top to a)
330 [~ 1]
334 [~ 1]
331
335
332
336
docs/system/hoon/library/2n.md+49−43
@@ -10,17 +10,18 @@ Build `f` such that `(f x) .= (b (a x))`.
10Source
10Source
11------
11------
12
12
13− ++ cork |*([a=_,* b=gate] (corl b a)) :: compose forward
13+ ++ cork |*({a/_|=(* **) b/gate} (corl b a)) :: compose forward
14+
14
15
15Examples
16Examples
16--------
17--------
17
18
18− ~zod/try=> (:(cork dec dec dec) 20)
19+ > (:(cork dec dec dec) 20)
19 17
20 17
20− ~zod/try=> =mal (mo (limo a/15 b/23 ~))
21+ > =mal (mo (limo a+15 b+23 ~))
21− ~zod/try=> ((cork ~(got by mal) dec) %a)
22+ > ((cork ~(got by mal) dec) %a)
22 14
23 14
23− ~zod/try=> ((cork ~(got by mal) dec) %b)
24+ > ((cork ~(got by mal) dec) %b)
24 22
25 22
25
26
26
27
@@ -40,14 +41,16 @@ Source
40------
41------
41
42
42 ++ corl :: compose backwards
43 ++ corl :: compose backwards
43− |* [a=gate b=_,*]
44+ |* {a/gate b/_|=(* **)}
45+ =< +:|.((a (b))) :: span check
44− |= c=_+<.b
46+ |* c/_+<.b
45 (a (b c))
47 (a (b c))
48+ ::
46
49
47Examples
50Examples
48--------
51--------
49
52
50− ~zod/try=> ((corl (lift bex) (slat %ud)) '2')
53+ > ((corl (lift bex) (slat %ud)) '2')
51 [~ 4]
54 [~ 4]
52
55
53
56
@@ -62,9 +65,9 @@ Right curry a gate, binding the tail of its sample
62Accepts
65Accepts
63-------
66-------
64
67
65−`a` is a [gate]().
68+`a` is a gate.
66
69
67−`c` is a [noun]().
70+`c` is a noun.
68
71
69Produces
72Produces
70--------
73--------
@@ -73,18 +76,19 @@ Produces
73Source
76Source
74------
77------
75
78
76− ++ curr
79+ ++ curr :: curry right
77− |* [a=_|=(^ _*) c=*]
80+ |* {a/_|=(^ **) c/*}
78− |* b=_+<+.a
81+ |* b/_+<+.a
79 (a b c)
82 (a b c)
83+ ::
80
84
81Examples
85Examples
82--------
86--------
83
87
84− ~zod/try=> =tep (curr scan sym)
88+ > =tep (curr scan sym)
85− ~zod/try=> `@t`(tep "asd")
89+ > `@t`(tep "asd")
86 'asd'
90 'asd'
87− ~zod/try=> `@t`(tep "lek-om")
91+ > `@t`(tep "lek-om")
88 'lek-om'
92 'lek-om'
89
93
90
94
@@ -97,30 +101,32 @@ Curry a gate, binding the head of its sample
97Accepts
101Accepts
98-------
102-------
99
103
100−`a` is a [gate]().
104+`a` is a gate.
101
105
102−`b` is a [noun]().
106+`b` is a noun.
103
107
104Produces
108Produces
105--------
109--------
106
110
107−A [gate]().
111+A gate.
108
112
109Source
113Source
110------
114------
111
115
112− ++ cury
116+ ++ cury :: curry left
113− |* [a=_|=(^ _*) b=*]
117+ |* {a/_|=(^ **) b/*}
114− |* c=_+<+.a
118+ |* c/_+<+.a
115 (a b c)
119 (a b c)
120+ ::
121+
116
122
117Examples
123Examples
118--------
124--------
119
125
120− ~zod/try=> =mol (cury add 2)
126+ > =mol (cury add 2)
121− ~zod/try=> (mol 4)
127+ > (mol 4)
122 6
128 6
123− ~zod/try=> (mol 7)
129+ > (mol 7)
124 9
130 9
125
131
126
132
@@ -134,23 +140,22 @@ not.
134Source
140Source
135------
141------
136
142
137− ++ hard
143+ ++ cury :: curry left
138− |* han=$+(* *)
144+ |* {a/_|=(^ **) b/*}
139− |= fud=* ^- han
145+ |* c/_+<+.a
140− ~| %hard
146+ (a b c)
141− =+ gol=(han fud)
147+ ::
142− ?>(=(gol fud) gol)
143
148
144Examples
149Examples
145--------
150--------
146
151
147− ~zod/try=> ((hard (list)) (limo [1 2 3 ~]))
152+ > ((hard (list)) (limo [1 2 3 ~]))
148 ~[1 2 3]
153 ~[1 2 3]
149− ~zod/try=> ((hard ,@) (add 2 2))
154+ > ((hard @) (add 2 2))
150 4
155 4
151− ~zod/try=> ((hard ,@t) (crip "Tape to cord, bro!"))
156+ > ((hard @t) (crip "Tape to cord, bro!"))
152 'Tape to cord, bro'
157 'Tape to cord, bro'
153− ~zod/try=> ((hard tape) (crip "...Tape to cord, bro?..."))
158+ > ((hard tape) (crip "...Tape to cord, bro?..."))
154 ! hard
159 ! hard
155 ! exit
160 ! exit
156
161
@@ -165,24 +170,25 @@ is not.
165Source
170Source
166------
171------
167
172
168− ++ soft
173+ ++ soft :: maybe coerce to span
169− |* han=$+(* *)
174+ |* han/$-(* *)
170− |= fud=* ^- (unit han)
175+ |= fud/* ^- (unit han)
171 =+ gol=(han fud)
176 =+ gol=(han fud)
172 ?.(=(gol fud) ~ [~ gol])
177 ?.(=(gol fud) ~ [~ gol])
178+ ::
173
179
174Examples
180Examples
175--------
181--------
176
182
177− ~zod/try=> ((soft ,%4) (add 2 2))
183+ > ((soft %4) (add 2 2))
178 [~ %4]
184 [~ %4]
179− ~zod/try=> ((soft ,@) (add 2 2))
185+ > ((soft @) (add 2 2))
180 [~ 4]
186 [~ 4]
181− ~zod/try=> ((soft ,%5) (add 2 2))
187+ > ((soft %5) (add 2 2))
182 ~
188 ~
183− ~zod/try=> ((soft ,@t) (crip "Tape to cord, Woohoo!"))
189+ > ((soft @t) (crip "Tape to cord, Woohoo!"))
184 [~ 'Tape to cord, Woohoo!']
190 [~ 'Tape to cord, Woohoo!']
185− ~zod/try=> ((soft ,@t) (trip 'Cmon man... Tape to cord? Please?!'))
191+ > ((soft @t) (trip 'Cmon man... Tape to cord? Please?!'))
186 ~
192 ~
187
193
188
194
docs/system/hoon/library/2o.md+48−46
@@ -2,30 +2,31 @@
2### `++jar`
2### `++jar`
3
3
4
4
5−Tile generator. A [`++jar`]() is a [`++map`]() of [`++list`]().
5+Tile generator. A `++jar` is a `++map` of `++list`.
6
6
7Source
7Source
8------
8------
9
9
10− ++ jar |*([a=_,* b=_,*] (map a (list b))) :: map of lists
10+ ++ jar |*({a/$-(* *) b/$-(* *)} (map a (list b))) :: map of lists
11+
11
12
12Examples
13Examples
13--------
14--------
14
15
15−See also: [`++ja`](), [`++by`](), [`++map`](), [`++list`]()
16+See also: `++ja`, `++by`, `++map`, `++list`
16
17
17− ~zod/try=> =a (limo [1 2 ~])
18+ > =a (limo [1 2 ~])
18− ~zod/try=> a
19+ > a
19 [i=1 t=[i=2 t=~]]
20 [i=1 t=[i=2 t=~]]
20− ~zod/try=> =b (limo [3 4 ~])
21+ > =b (limo [3 4 ~])
21− ~zod/try=> b
22+ > b
22 [i=3 t=[i=4 t=~]]
23 [i=3 t=[i=4 t=~]]
23− ~zod/try=> =c (mo (limo [[%a a] [%b b] ~]))
24+ > =c (mo (limo [[%a a] [%b b] ~]))
24− ~zod/try=> c
25+ > c
25 {[p=%a q=[i=1 t=[i=2 t=~]]] [p=%b q=[i=3 t=[i=4 t=~]]]}
26 {[p=%a q=[i=1 t=[i=2 t=~]]] [p=%b q=[i=3 t=[i=4 t=~]]]}
26− ~zod/try=> (~(get ja c) %a)
27+ > (~(get ja c) %a)
27 [i=1 t=[i=2 t=~]]
28 [i=1 t=[i=2 t=~]]
28− ~zod/try=> (~(get ja c) %c)
29+ > (~(get ja c) %c)
29 ~
30 ~
30
31
31
32
@@ -33,30 +34,31 @@ See also: [`++ja`](), [`++by`](), [`++map`](), [`++list`]()
33***
34***
34### `++jug`
35### `++jug`
35
36
36−[mold]() generator. A `++jug` is a [`++map`]() of [`++set`]()s.
37+mold generator. A `++jug` is a `++map` of `++set`s.
37
38
38Source
39Source
39------
40------
40
41
41− ++ jug |*([a=_,* b=_,*] (map a (set b))) :: map of sets
42+ ++ jug |*({a/$-(* *) b/$-(* *)} (map a (set b))) :: map of sets
43+
42
44
43Examples
45Examples
44--------
46--------
45
47
46See also: `++ju`, `++by`, `++map`, `++set`
48See also: `++ju`, `++by`, `++map`, `++set`
47
49
48− ~zod/try=> =a (sa (limo [1 2 ~]))
50+ > =a (sa (limo [1 2 ~]))
49− ~zod/try=> a
51+ > a
50 {1 2}
52 {1 2}
51− ~zod/try=> =b (sa (limo [3 4 ~]))
53+ > =b (sa (limo [3 4 ~]))
52− ~zod/try=> b
54+ > b
53 {4 3}
55 {4 3}
54− ~zod/try=> =c (mo (limo [[%a a] [%b b] ~]))
56+ > =c (mo (limo [[%a a] [%b b] ~]))
55− ~zod/try=> c
57+ > c
56 {[p=%a q={1 2}] [p=%b q={4 3}]}
58 {[p=%a q={1 2}] [p=%b q={4 3}]}
57− ~zod/try=> (~(get ju c) %b)
59+ > (~(get ju c) %b)
58 {4 3}
60 {4 3}
59− ~zod/try=> (~(put ju c) [%b 5])
61+ > (~(put ju c) [%b 5])
60 {[p=%a q={1 2}] [p=%b q={5 4 3}]}
62 {[p=%a q={1 2}] [p=%b q={5 4 3}]}
61
63
62
64
@@ -65,50 +67,50 @@ See also: `++ju`, `++by`, `++map`, `++set`
65
67
66Map
68Map
67
69
68−[mold]() generator. A `++map` is a [treap](http://en.wikipedia.org/wiki/Treap) of
70+mold generator. A `++map` is a treap of
69−key, value pairs.
71+key-value pairs.
70
72
71
73
72Source
74Source
73------
75------
74
76
75− ++ map |* [a=_,* b=_,*] :: associative tree
77+ ++ map |* {a/$-(* *) b/$-(* *)} :: associative tree
78+ $@($~ {n/{p/a q/b} l/(map a b) r/(map a b)}) ::
79+
76
80
77Examples
81Examples
78--------
82--------
79
83
80−See also: [`++by`]()
84+See also: `++by`
81−
82− ~zod/try=> :type; *(map ,@t ,@u)
83− {}
84− nlr([p=@t q=@u])
85− ~zod/try=> `(map ,@ta ,@ud)`(mo (limo a/1 b/2 ~))
86− {[p=~.a q=1] [p=~.b q=2]}
87−
88
85
86+ >? *(map @t @u)
87+ nlr({p/@t q/@u})
88+ {}
89+ > (molt `(list (pair * *))`[[a+1 b+2] ~])
90+ {[p=[97 1] q=[98 2]]}
91+
89
92
90***
93***
91### `++qeu`
94### `++qeu`
92
95
93Queue
96Queue
94
97
95−[mold]() generator. An ordered [treap](http://en.wikipedia.org/wiki/Treap) of
98+mold generator. An ordered [treap](http://en.wikipedia.org/wiki/Treap) of
96items.
99items.
97
100
98Source
101Source
99------
102------
100
103
101− ++ qeu |* a=_,* :: queue
104+ ++ qeu |* a/$-(* *) :: queue
102− $|(~ [n=a l=(qeu a) r=(qeu a)]) ::
105+ $@($~ {n/a l/(qeu a) r/(qeu a)}) ::
103
106
104−See also: [`++to`]()
105
107
106Examples
108Examples
107--------
109--------
108
110
109− ~zod/try=> (qeu time)
111+ > (qeu time)
110 <1.qyo [* <1.sxx [a=<1.ebd [* <101.jzo 1.ypj %164>]> <101.jzo 1.ypj %164>]>]>
112 <1.qyo [* <1.sxx [a=<1.ebd [* <101.jzo 1.ypj %164>]> <101.jzo 1.ypj %164>]>]>
111− ~zod/try=> (~(gas to *(qeu time)) [~2014.1.1 ~2014.1.2 ~])
113+ > (~(gas to *(qeu time)) [~2014.1.1 ~2014.1.2 ~])
112 {~2014.1.2 ~2014.1.1}
114 {~2014.1.2 ~2014.1.1}
113
115
114
116
@@ -118,25 +120,25 @@ Examples
118
120
119Set
121Set
120
122
121−[mold]() generator. A `++set` is a
123+mold generator. A `++set` is a treap with unique values.
122−[treap](http://en.wikipedia.org/wiki/Treap) with unique values.
123
124
124Source
125Source
125------
126------
126
127
127− ++ set |* a=_,* :: set
128+ ++ set |* a/$-(* *) :: set
128− $|(~ [n=a l=(set a) r=(set a)]) ::
129+ $@($~ {n/a l/(set a) r/(set a)}) ::
130+
129
131
130Examples
132Examples
131--------
133--------
132
134
133−See also: [`++in`]()
135+See also: `++in`
134
136
135− ~zod/try=> (sa "abc")
137+ > (sa "abc")
136 {~~a ~~c ~~b}
138 {~~a ~~c ~~b}
137− ~zod/try=> (~(put in (sa "abc")) %d)
139+ > (~(put in (sa "abc")) %d)
138 {~~d ~~a ~~c ~~b}
140 {~~d ~~a ~~c ~~b}
139− ~zod/try=> (~(put in (sa "abc")) %a)
141+ > (~(put in (sa "abc")) %a)
140 {~~a ~~c ~~b}
142 {~~a ~~c ~~b}
141
143
142
144
docs/system/hoon/library/2p.md+35−34
@@ -8,24 +8,24 @@ Produces a noun unpacked from atom `a`. The inverse of jam.
8Accepts
8Accepts
9-------
9-------
10
10
11−`a` is an [atom]().
11+`a` is an atom.
12
12
13Produces
13Produces
14--------
14--------
15
15
16−A [`++noun`]().
16+A `++noun`.
17
17
18Source
18Source
19------
19------
20
20
21− ++ cue :: unpack atom to noun
21+ ++ cue :: unpack
22 ~/ %cue
22 ~/ %cue
23− |= a=@
23+ |= a/@
24 ^- *
24 ^- *
25 =+ b=0
25 =+ b=0
26− =+ m=`(map ,@ ,*)`~
26+ =+ m=`(map @ *)`~
27 =< q
27 =< q
28− |- ^- [p=@ q=* r=_m]
28+ |- ^- {p/@ q/* r/(map @ *)}
29 ?: =(0 (cut 0 [b 1] a))
29 ?: =(0 (cut 0 [b 1] a))
30 =+ c=(rub +(b) a)
30 =+ c=(rub +(b) a)
31 [+(p.c) q.c (~(put by m) b q.c)]
31 [+(p.c) q.c (~(put by m) b q.c)]
@@ -43,13 +43,13 @@ Source
43Examples
43Examples
44--------
44--------
45
45
46− ~zod/try=> (cue 12)
46+ > (cue 12)
47 1
47 1
48− ~zod/try=> (cue 817)
48+ > (cue 817)
49 [1 1]
49 [1 1]
50− ~zod/try=> (cue 4.657)
50+ > (cue 4.657)
51 [1 2]
51 [1 2]
52− ~zod/try=> (cue 39.689)
52+ > (cue 39.689)
53 [0 19]
53 [0 19]
54
54
55
55
@@ -63,7 +63,7 @@ Produces an atom unpacked from noun `a`. The inverse of cue.
63Accepts
63Accepts
64-------
64-------
65
65
66−`a` is a [noun]().
66+`a` is a noun.
67
67
68Produces
68Produces
69--------
69--------
@@ -75,12 +75,12 @@ Source
75
75
76 ++ jam :: pack
76 ++ jam :: pack
77 ~/ %jam
77 ~/ %jam
78− |= a=*
78+ |= a/*
79 ^- @
79 ^- @
80 =+ b=0
80 =+ b=0
81− =+ m=`(map ,* ,@)`~
81+ =+ m=`(map * @)`~
82 =< q
82 =< q
83− |- ^- [p=@ q=@ r=_m]
83+ |- ^- {p/@ q/@ r/(map * @)}
84 =+ c=(~(get by m) a)
84 =+ c=(~(get by m) a)
85 ?~ c
85 ?~ c
86 => .(m (~(put by m) a b))
86 => .(m (~(put by m) a b))
@@ -102,13 +102,13 @@ Source
102Examples
102Examples
103--------
103--------
104
104
105− ~zod/try=> (jam 1)
105+ > (jam 1)
106 12
106 12
107− ~zod/try=> (jam [1 1])
107+ > (jam [1 1])
108 817
108 817
109− ~zod/try=> (jam [1 2])
109+ > (jam [1 2])
110 4.657
110 4.657
111− ~zod/try=> (jam [~ u=19])
111+ > (jam [~ u=19])
112 39.689
112 39.689
113
113
114
114
@@ -135,36 +135,37 @@ A cell of two atoms, `p` and `q`.
135Source
135Source
136------
136------
137
137
138− ++ mat :: length-encode
138+ ++ mat :: length-encode
139 ~/ %mat
139 ~/ %mat
140− |= a=@
140+ |= a/@
141− ^- [p=@ q=@]
141+ ^- {p/@ q/@}
142 ?: =(0 a)
142 ?: =(0 a)
143 [1 1]
143 [1 1]
144 =+ b=(met 0 a)
144 =+ b=(met 0 a)
145 =+ c=(met 0 b)
145 =+ c=(met 0 b)
146 :- (add (add c c) b)
146 :- (add (add c c) b)
147 (cat 0 (bex c) (mix (end 0 (dec c) b) (lsh 0 (dec c) a)))
147 (cat 0 (bex c) (mix (end 0 (dec c) b) (lsh 0 (dec c) a)))
148+ ::
148
149
149
150
150Examples
151Examples
151--------
152--------
152
153
153− ~zod/try=> (mat 0xaaa)
154+ > (mat 0xaaa)
154 [p=20 q=699.024]
155 [p=20 q=699.024]
155− ~zod/try=> (met 0 q:(mat 0xaaa))
156+ > (met 0 q:(mat 0xaaa))
156 20
157 20
157− ~zod/try=> `@ub`q:(mat 0xaaa)
158+ > `@ub`q:(mat 0xaaa)
158 0b1010.1010.1010.1001.0000
159 0b1010.1010.1010.1001.0000
159− ~zod/try=> =a =-(~&(- -) `@ub`0xaaa)
160+ > =a =-(~&(- -) `@ub`0xaaa)
160 0b1010.1010.1010
161 0b1010.1010.1010
161− ~zod/try=> =b =-(~&(- -) `@ub`(xeb a))
162+ > =b =-(~&(- -) `@ub`(xeb a))
162 0b1100
163 0b1100
163− ~zod/try=> =b =-(~&(- -) `@ub`(met 0 a))
164+ > =b =-(~&(- -) `@ub`(met 0 a))
164 0b1100
165 0b1100
165− ~zod/try=> =c =-(~&(- -) (xeb b))
166+ > =c =-(~&(- -) (xeb b))
166 4
167 4
167− ~zod/try=> [`@ub`a `@ub`(end 0 (dec c) b) `@ub`(bex c)]
168+ > [`@ub`a `@ub`(end 0 (dec c) b) `@ub`(bex c)]
168 [0b1010.1010.1010 0b100 0b1.0000]
169 [0b1010.1010.1010 0b100 0b1.0000]
169
170
170
171
@@ -196,8 +197,8 @@ Source
196
197
197 ++ rub :: length-decode
198 ++ rub :: length-decode
198 ~/ %rub
199 ~/ %rub
199− |= [a=@ b=@]
200+ |= {a/@ b/@}
200− ^- [p=@ q=@]
201+ ^- {p/@ q/@}
201 =+ ^= c
202 =+ ^= c
202 =+ [c=0 m=(met 0 b)]
203 =+ [c=0 m=(met 0 b)]
203 |- ?< (gth c m)
204 |- ?< (gth c m)
@@ -214,11 +215,11 @@ Source
214Examples
215Examples
215--------
216--------
216
217
217− ~zod/try=> `@ub`(jam 0xaaa)
218+ > `@ub`(jam 0xaaa)
218 0b1.0101.0101.0101.0010.0000
219 0b1.0101.0101.0101.0010.0000
219− ~zod/try=> (rub 1 0b1.0101.0101.0101.0010.0000)
220+ > (rub 1 0b1.0101.0101.0101.0010.0000)
220 [p=20 q=2.730]
221 [p=20 q=2.730]
221− ~zod/try=> `@ux`q:(rub 1 0b1.0101.0101.0101.0010.0000)
222+ > `@ux`q:(rub 1 0b1.0101.0101.0101.0010.0000)
222 0xaaa
223 0xaaa
223
224
224***
225***
docs/system/hoon/library/2q.md+53−78
@@ -3,19 +3,19 @@
3
3
4Char
4Char
5
5
6−A single character. [odor]() [`@tD`]() designates a single unicode byte. All
6+A single character. odor `@tD` designates a single unicode byte. All
7−parsers consume [`++tape`]()s, which are lists of `++char`.
7+parsers consume `++tape`s, which are lists of `++char`.
8
8
9
9
10Source
10Source
11------
11------
12
12
13− ++ char ,@tD :: UTF-8 byte
13+ ++ char @tD :: UTF-8 byte
14
14
15Examples
15Examples
16--------
16--------
17
17
18− ~zod/try=> *char
18+ > *char
19 ''
19 ''
20 ~zod/try> (char 97)
20 ~zod/try> (char 97)
21 'a'
21 'a'
@@ -27,27 +27,27 @@ Examples
27
27
28UTF-8 text
28UTF-8 text
29
29
30−One of Hoon's two string types (the other being [`++tape`]()). A cord is an
30+One of Hoon's two string types (the other being `++tape`). A cord is an
31−atom of UTF-8 text. [`++trip`]() and [`++crip`]() convert between cord and
31+atom of UTF-8 text. `++trip` and `++crip` convert between cord and
32`++tape`.
32`++tape`.
33
33
34Source
34Source
35------
35------
36
36
37− ++ cord ,@t :: text atom (UTF-8)
37+ ++ cord @t :: text atom (UTF-8)
38
38
39Examples
39Examples
40--------
40--------
41
41
42−Odor [`@t`]() designates a Unicode atom, little-endian: the first character
42+Odor `@t` designates a Unicode atom, little-endian: the first character
43in the text is the low byte.
43in the text is the low byte.
44
44
45− ~zod/try=> `@ux`'foobar'
45+ > `@ux`'foobar'
46 0x7261.626f.6f66
46 0x7261.626f.6f66
47
47
48− ~zod/try=> `@`'urbit'
48+ > `@`'urbit'
49 499.984.265.845
49 499.984.265.845
50− ~zod/try=> (cord 499.984.265.845)
50+ > (cord 499.984.265.845)
51 'urbit'
51 'urbit'
52
52
53
53
@@ -58,19 +58,20 @@ in the text is the low byte.
58Point in time
58Point in time
59
59
60A boolean designating AD or BC, a year atom, a month
60A boolean designating AD or BC, a year atom, a month
61−atom, and a [`++tarp`](), which is a day atom and a time.
61+atom, and a `++tarp`, which is a day atom and a time.
62
62
63Source
63Source
64------
64------
65
65
66− ++ date ,[[a=? y=@ud] m=@ud t=tarp] :: parsed date
66+ ++ date {{a/? y/@ud} m/@ud t/tarp} :: parsed date
67+
67
68
68Examples
69Examples
69--------
70--------
70
71
71−See also: [`++year`](), [`++yore`]() [`++stud`](), [`++dust`]()
72+See also: `++year`, `++yore` `++stud`, `++dust`
72
73
73− ~zod/try=> `date`(yore ~2014.6.6..21.09.15..0a16)
74+ > `date`(yore ~2014.6.6..21.09.15..0a16)
74 [[a=%.y y=2.014] m=6 t=[d=6 h=21 m=9 s=15 f=~[0xa16]]]
75 [[a=%.y y=2.014] m=6 t=[d=6 h=21 m=9 s=15 f=~[0xa16]]]
75
76
76
77
@@ -96,28 +97,28 @@ list of `++tank` delimted by the strings in `p`.
96Source
97Source
97------
98------
98
99
99− ++ tank $% [%leaf p=tape] :: printing formats
100+ ++ tank $% {$leaf p/tape} :: printing formats
100− $: %palm :: backstep list
101+ $: $palm :: backstep list
101− p=[p=tape q=tape r=tape s=tape] ::
102+ p/{p/tape q/tape r/tape s/tape} ::
102− q=(list tank) ::
103+ q/(list tank) ::
103 == ::
104 == ::
104− $: %rose :: flat list
105+ $: $rose :: flat list
105− p=[p=tape q=tape r=tape] :: mid open close
106+ p/{p/tape q/tape r/tape} :: mid open close
106− q=(list tank) ::
107+ q/(list tank) ::
107 == ::
108 == ::
108− ==
109+ == ::
109
110
110Examples
111Examples
111--------
112--------
112
113
113− ~zod/try=> >(bex 20) (bex 19)<
114+ > >(bex 20) (bex 19)<
114 [%rose p=[p=" " q="[" r="]"] q=~[[%leaf p="1.048.576"] [%leaf p="524.288"]]]
115 [%rose p=[p=" " q="[" r="]"] q=~[[%leaf p="1.048.576"] [%leaf p="524.288"]]]
115− ~zod/try=> (wash [0 80] >(bex 20) (bex 19)<) :: at 80 cols
116+ > (wash [0 80] >(bex 20) (bex 19)<) :: at 80 cols
116 <<"[1.048.576 524.288]">>
117 <<"[1.048.576 524.288]">>
117− ~zod/try=> (wash [0 15] >(bex 20) (bex 19)<) :: at 15 cols (two lines)
118+ > (wash [0 15] >(bex 20) (bex 19)<) :: at 15 cols (two lines)
118 <<"[ 1.048.576" " 524.288" "]">>
119 <<"[ 1.048.576" " 524.288" "]">>
119
120
120− ~zod/try=> [(bex 150) (bex 151)] :: at 80 cols
121+ > [(bex 150) (bex 151)] :: at 80 cols
121 [ 1.427.247.692.705.959.881.058.285.969.449.495.136.382.746.624
122 [ 1.427.247.692.705.959.881.058.285.969.449.495.136.382.746.624
122 2.854.495.385.411.919.762.116.571.938.898.990.272.765.493.248
123 2.854.495.385.411.919.762.116.571.938.898.990.272.765.493.248
123 ]
124 ]
@@ -130,7 +131,7 @@ Examples
130
131
131List of chars
132List of chars
132
133
133−One of Hoon's two string types, the other being [`++cord`](). A tape is a
134+One of Hoon's two string types, the other being `++cord`. A tape is a
134list of chars.
135list of chars.
135
136
136Source
137Source
@@ -141,9 +142,9 @@ Source
141Examples
142Examples
142--------
143--------
143
144
144− ~zod/try=> `(list ,char)`"foobar"
145+ > `(list ,char)`"foobar"
145 "foobar"
146 "foobar"
146− ~zod/try=> `(list ,@)`"foobar"
147+ > `(list ,@)`"foobar"
147 ~[102 111 111 98 97 114]
148 ~[102 111 111 98 97 114]
148
149
149
150
@@ -152,26 +153,26 @@ Examples
152
153
153Day through second
154Day through second
154
155
155−The remaining part of a [`++date`](): day, hour, minute, second and a list
156+The remaining part of a `++date`: day, hour, minute, second and a list
156−of [`@ux`]() for precision.
157+of `@ux` for precision.
157
158
158Source
159Source
159------
160------
160
161
161− @ud h=@ud m=@ud s=@ud f=(list ,@ux)] :: parsed time
162+ ++ tarp {d/@ud h/@ud m/@ud s/@ud f/(list @ux)} :: parsed time
163+
162
164
163Examples
165Examples
164--------
166--------
165
167
166−See also: [`++date`](), [`++yell`[]()/`++yule`]()
167
168
168− ~zod/try=> -<-
169+ > -<-
169 ~2014.9.20..00.43.33..b52a
170 ~2014.9.20..00.43.33..b52a
170− ~zod/try=> :: the time is always in your context at -<-
171+ > :: the time is always in your context at -<-
171− ~zod/try=> (yell -<-)
172+ > (yell -<-)
172 [d=106.751.991.820.278 h=0 m=43 s=39 f=~[0x54d1]]
173 [d=106.751.991.820.278 h=0 m=43 s=39 f=~[0x54d1]]
173
174
174− ~zod/try=> (yell ~d20)
175+ > (yell ~d20)
175 [d=20 h=0 m=0 s=0 f=~]
176 [d=20 h=0 m=0 s=0 f=~]
176
177
177
178
@@ -183,25 +184,25 @@ Hoon constants
183
184
184A restricted text atom for Hoon constants. The only characters permitted are
185A restricted text atom for Hoon constants. The only characters permitted are
185lowercase ASCII, `-`, and `0-9`, the latter two of which can neither be the first or last
186lowercase ASCII, `-`, and `0-9`, the latter two of which can neither be the first or last
186−character. The syntax for [`@tas`]() is the text itself, always preceded by `%`.
187+character. The syntax for `@tas` is the text itself, always preceded by `%`.
187−This means a term is always [cubical](). The empty `@tas` has a special syntax,
188+This means a term is always cubical. The empty `@tas` has a special syntax,
188`$`.
189`$`.
189
190
190
191
191Source
192Source
192------
193------
193
194
194− ++ term ,@tas :: Hoon ASCII subset
195+ ++ term @tas :: Hoon ASCII subset
195
196
196Examples
197Examples
197--------
198--------
198
199
199− ~zod/try=> *term
200+ > *term
200 %$
201 %$
201
202
202− ~zod/try=> %dead-fish9
203+ > %dead-fish9
203 %dead-fish9
204 %dead-fish9
204− ~zod/try=> -:!>(%dead-fish9)
205+ > -:!>(%dead-fish9)
205 [%cube p=271.101.667.197.767.630.546.276 q=[%atom p=%tas]]
206 [%cube p=271.101.667.197.767.630.546.276 q=[%atom p=%tas]]
206
207
207
208
@@ -211,33 +212,13 @@ Examples
211
212
212 ++ wain (list cord) :: text lines (no \n)
213 ++ wain (list cord) :: text lines (no \n)
213
214
214−A list of lines. A `++wain` is used instead of a single [`++cord`]() with
215+A list of lines. A `++wain` is used instead of a single `++cord` with
215`\n`.
216`\n`.
216
217
217−See also: [`++lore`](), [`++role`]()
218+See also: `++lore`, `++role`
218
219
219− ~zod/try=> `wain`/som/del/rok
220+ > `wain`/som/del/rok
220 <|som del rok|>
221 <|som del rok|>
221− ~zod/try=> `wain`(lore ^:@t/=main=/bin/tree/hoon)
222− <|
223− !:
224− :: /===/bin/tree/hoon
225− |= ^
226− |= [pax=path fla=$|(~ [%full ~])]
227− =- ~[te/-]~
228− =+ len=(lent pax)
229− =+ rend=?~(fla |=(a=path +:(spud (slag len a))) spud)
230− |- ^- wain
231− =+ ark=;;(arch .^(cy/pax))
232− =- ?~ q.ark -
233− [(crip (rend pax)) -]
234− %- zing
235− %- turn :_ |=(a=@t ^$(pax (weld pax `path`/[a])))
236− %- sort :_ aor
237− %- turn :_ |=([a=@t ~] a)
238− (~(tap by r.ark))
239− |>
240−
241
222
242
223
243***
224***
@@ -246,7 +227,7 @@ See also: [`++lore`](), [`++role`]()
246List of lines
227List of lines
247
228
248
229
249−A `++wall` is used instead of a single [`++tape`]() with
230+A `++wall` is used instead of a single `++tape` with
250`\n`.
231`\n`.
251
232
252Source
233Source
@@ -257,20 +238,14 @@ Source
257Examples
238Examples
258--------
239--------
259
240
260−See also: [`++wash`]()
241+See also: `++wash`
261
242
262− ~zod/try=> `wall`(wash [0 20] leaf/<(bex 256)>)
243+ > `wall`(wash [0 20] leaf+<(bex 256)>)
263 <<
244 <<
264− "\/115.792.089.237.\/"
245+ "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"
265− " 316.195.423.570."
266− " 985.008.687.907."
267− " 853.269.984.665."
268− " 640.564.039.457."
269− " 584.007.913.129."
270− " 639.936"
271− "\/ \/"
272 >>
246 >>
273
247
274
248
275
249
250+
276***
251***
docs/system/hoon/library/3a.md+218−216
@@ -1,45 +1,4 @@
1# 3a: signed and modular ints
1# 3a: signed and modular ints
2−### `++egcd`
3−
4−GCD
5−
6− ++ egcd :: schneier's egcd
7− |= [a=@ b=@]
8− =+ si
9− =+ [c=(sun a) d=(sun b)]
10− =+ [u=[c=(sun 1) d=--0] v=[c=--0 d=(sun 1)]]
11− |- ^- [d=@ u=@ v=@]
12− ?: =(--0 c)
13− [(abs d) d.u d.v]
14− :: ?> ?& =(c (sum (pro (sun a) c.u) (pro (sun b) c.v)))
15− :: =(d (sum (pro (sun a) d.u) (pro (sun b) d.v)))
16− :: ==
17− =+ q=(fra d c)
18− %= $
19− c (dif d (pro q c))
20− d c
21− u [(dif d.u (pro q c.u)) c.u]
22− v [(dif d.v (pro q c.v)) c.v]
23− ==
24− ::
25−
26−Greatest common denominator
27−
28− ~zod/try=> (egcd 20 15)
29− [d=5 u=2 v=1]
30− ~zod/try=> (egcd 24 16)
31− [d=8 u=2 v=1]
32− ~zod/try=> (egcd 7 5)
33− [d=1 u=3 v=6]
34− ~zod/try=> (egcd (shaf ~ %ham) (shaf ~ %sam))
35− [ d=1
36− u=59.983.396.314.566.203.239.184.568.129.921.874.787
37− v=38.716.650.351.034.402.960.165.718.823.532.275.722
38− ]
39−
40−
41−
42−***
43### `++fe` :: modulo bloq
2### `++fe` :: modulo bloq
44
3
45Modulo bloq
4Modulo bloq
@@ -49,22 +8,22 @@ Core containing XX
49Accepts
8Accepts
50-------
9-------
51
10
52−`a` is a [`++bloq`]().
11+`a` is a `++bloq`.
53
12
54Source
13Source
55------
14------
56
15
57− |_ a=bloq
16+ |_ a=bloq
58
17
59### `++dif`
18### `++dif`
60
19
61−Produces the difference between two [atom]()s in the modular basis
20+Produces the difference between two atoms in the modular basis
62representation.
21representation.
63
22
64Accepts
23Accepts
65-------
24-------
66
25
67−`a` is a [`++bloq`]().
26+`a` is a `++bloq`.
68
27
69`b` is an atom.
28`b` is an atom.
70
29
@@ -73,31 +32,31 @@ Accepts
73Produces
32Produces
74--------
33--------
75
34
76−A [`@s`]()
35+A `@s`
77
36
78Source
37Source
79------
38------
80
39
81− ++ dif |=([b=@ c=@] (sit (sub (add out (sit b)) (sit c))))
40+ ++ dif |=([b/@ c/@] (sit (sub (add out (sit b)) (sit c))))
82
41
83Examples
42Examples
84--------
43--------
85
44
86− ~zod/try=> (~(dif fe 3) 63 64)
45+ > (~(dif fe 3) 63 64)
87 255
46 255
88− ~zod/try=> (~(dif fe 3) 5 10)
47+ > (~(dif fe 3) 5 10)
89 251
48 251
90− ~zod/try=> (~(dif fe 3) 0 1)
49+ > (~(dif fe 3) 0 1)
91 255
50 255
92− ~zod/try=> (~(dif fe 0) 9 10)
51+ > (~(dif fe 0) 9 10)
93 1
52 1
94− ~zod/try=> (~(dif fe 0) 9 11)
53+ > (~(dif fe 0) 9 11)
95 0
54 0
96− ~zod/try=> (~(dif fe 0) 9 12)
55+ > (~(dif fe 0) 9 12)
97 1
56 1
98− ~zod/try=> (~(dif fe 2) 9 12)
57+ > (~(dif fe 2) 9 12)
99 13
58 13
100− ~zod/try=> (~(dif fe 2) 63 64)
59+ > (~(dif fe 2) 63 64)
101 15
60 15
102
61
103------------------------------------------------------------------------
62------------------------------------------------------------------------
@@ -111,7 +70,7 @@ Inverts the order of the modular field.
111Accepts
70Accepts
112-------
71-------
113
72
114−`b` is a [`++bloq`]().
73+`b` is a `++bloq`.
115
74
116Produces
75Produces
117--------
76--------
@@ -122,22 +81,22 @@ An atom.
122Source
81Source
123------
82------
124
83
125− ++ inv |=(b=@ (sub (dec out) (sit b)))
84+ ++ inv |=(b/@ (sub (dec out) (sit b)))
126
85
127Examples
86Examples
128--------
87--------
129
88
130− ~zod/try=> (~(inv fe 3) 255)
89+ > (~(inv fe 3) 255)
131 0
90 0
132− ~zod/try=> (~(inv fe 3) 256)
91+ > (~(inv fe 3) 256)
133 255
92 255
134− ~zod/try=> (~(inv fe 3) 0)
93+ > (~(inv fe 3) 0)
135 255
94 255
136− ~zod/try=> (~(inv fe 3) 1)
95+ > (~(inv fe 3) 1)
137 254
96 254
138− ~zod/try=> (~(inv fe 3) 2)
97+ > (~(inv fe 3) 2)
139 253
98 253
140− ~zod/try=> (~(inv fe 3) 55)
99+ > (~(inv fe 3) 55)
141 200
100 200
142
101
143------------------------------------------------------------------------
102------------------------------------------------------------------------
@@ -151,17 +110,17 @@ Revereses bytes within block.
151Accepts
110Accepts
152-------
111-------
153
112
154−`b` is a [`++bloq`]().
113+`b` is a `++bloq`.
155
114
156Produces
115Produces
157--------
116--------
158
117
159−An atom.=
118+An atom.
160
119
161Source
120Source
162------
121------
163
122
164− ++ net |= b=@ ^- @
123+ ++ net |= b/@ ^- @
165 => .(b (sit b))
124 => .(b (sit b))
166 ?: (lte a 3)
125 ?: (lte a 3)
167 b
126 b
@@ -173,51 +132,51 @@ Source
173Examples
132Examples
174--------
133--------
175
134
176− ~zod/try=> (~(net fe 3) 64)
135+ > (~(net fe 3) 64)
177 64
136 64
178− ~zod/try=> (~(net fe 3) 128)
137+ > (~(net fe 3) 128)
179 128
138 128
180− ~zod/try=> (~(net fe 3) 255)
139+ > (~(net fe 3) 255)
181 255
140 255
182− ~zod/try=> (~(net fe 3) 256)
141+ > (~(net fe 3) 256)
183 0
142 0
184− ~zod/try=> (~(net fe 3) 257)
143+ > (~(net fe 3) 257)
185 1
144 1
186− ~zod/try=> (~(net fe 3) 500)
145+ > (~(net fe 3) 500)
187 244
146 244
188− ~zod/try=> (~(net fe 3) 511)
147+ > (~(net fe 3) 511)
189 255
148 255
190− ~zod/try=> (~(net fe 3) 512)
149+ > (~(net fe 3) 512)
191 0
150 0
192− ~zod/try=> (~(net fe 3) 513)
151+ > (~(net fe 3) 513)
193 1
152 1
194− ~zod/try=> (~(net fe 3) 0)
153+ > (~(net fe 3) 0)
195 0
154 0
196− ~zod/try=> (~(net fe 3) 1)
155+ > (~(net fe 3) 1)
197 1
156 1
198− ~zod/try=> (~(net fe 0) 1)
157+ > (~(net fe 0) 1)
199 1
158 1
200− ~zod/try=> (~(net fe 0) 2)
159+ > (~(net fe 0) 2)
201 0
160 0
202− ~zod/try=> (~(net fe 0) 3)
161+ > (~(net fe 0) 3)
203 1
162 1
204− ~zod/try=> (~(net fe 6) 1)
163+ > (~(net fe 6) 1)
205 72.057.594.037.927.936
164 72.057.594.037.927.936
206− ~zod/try=> (~(net fe 6) 2)
165+ > (~(net fe 6) 2)
207 144.115.188.075.855.872
166 144.115.188.075.855.872
208− ~zod/try=> (~(net fe 6) 3)
167+ > (~(net fe 6) 3)
209 216.172.782.113.783.808
168 216.172.782.113.783.808
210− ~zod/try=> (~(net fe 6) 4)
169+ > (~(net fe 6) 4)
211 288.230.376.151.711.744
170 288.230.376.151.711.744
212− ~zod/try=> (~(net fe 6) 5)
171+ > (~(net fe 6) 5)
213 360.287.970.189.639.680
172 360.287.970.189.639.680
214− ~zod/try=> (~(net fe 6) 6)
173+ > (~(net fe 6) 6)
215 432.345.564.227.567.616
174 432.345.564.227.567.616
216− ~zod/try=> (~(net fe 6) 7)
175+ > (~(net fe 6) 7)
217 504.403.158.265.495.552
176 504.403.158.265.495.552
218− ~zod/try=> (~(net fe 6) 512)
177+ > (~(net fe 6) 512)
219 562.949.953.421.312
178 562.949.953.421.312
220− ~zod/try=> (~(net fe 6) 513)
179+ > (~(net fe 6) 513)
221 72.620.543.991.349.248
180 72.620.543.991.349.248
222
181
223------------------------------------------------------------------------
182------------------------------------------------------------------------
@@ -231,12 +190,12 @@ The maximum integer value that the current block can store.
231Accepts
190Accepts
232-------
191-------
233
192
234−A [`++bloq`]().
193+A `++bloq`.
235
194
236Produces
195Produces
237--------
196--------
238
197
239−An [atom]().
198+An atom.
240
199
241Source
200Source
242------
201------
@@ -246,17 +205,17 @@ Source
246Examples
205Examples
247--------
206--------
248
207
249− ~zod/try=> ~(out fe 0)
208+ > ~(out fe 0)
250 2
209 2
251− ~zod/try=> ~(out fe 1)
210+ > ~(out fe 1)
252 4
211 4
253− ~zod/try=> ~(out fe 2)
212+ > ~(out fe 2)
254 16
213 16
255− ~zod/try=> ~(out fe 3)
214+ > ~(out fe 3)
256 256
215 256
257− ~zod/try=> ~(out fe 4)
216+ > ~(out fe 4)
258 65.536
217 65.536
259− ~zod/try=> ~(out fe 10)
218+ > ~(out fe 10)
260 \/179.769.313.486.231.590.772.930.519.078.902.473.361.797.697.894.230.657.\/
219 \/179.769.313.486.231.590.772.930.519.078.902.473.361.797.697.894.230.657.\/
261 273.430.081.157.732.675.805.500.963.132.708.477.322.407.536.021.120.113.
220 273.430.081.157.732.675.805.500.963.132.708.477.322.407.536.021.120.113.
262 879.871.393.357.658.789.768.814.416.622.492.847.430.639.474.124.377.767.
221 879.871.393.357.658.789.768.814.416.622.492.847.430.639.474.124.377.767.
@@ -276,7 +235,7 @@ Roll `d` to the left by `c` `b`-sized blocks.
276Accepts
235Accepts
277-------
236-------
278
237
279−`a` is a [`++bloq`]().
238+`a` is a `++bloq`.
280
239
281`b` is a `++bloq`.
240`b` is a `++bloq`.
282
241
@@ -292,7 +251,7 @@ An atom.
292Source
251Source
293------
252------
294
253
295− ++ rol |= [b=bloq c=@ d=@] ^- @ :: roll left
254+ ++ rol |= [b/bloq c/@ d/@] ^- @ :: roll left
296 =+ e=(sit d)
255 =+ e=(sit d)
297 =+ f=(bex (sub a b))
256 =+ f=(bex (sub a b))
298 =+ g=(mod c f)
257 =+ g=(mod c f)
@@ -301,15 +260,15 @@ Source
301Examples
260Examples
302--------
261--------
303
262
304− ~zod/try=> `@ux`(~(rol fe 6) 4 3 0xabac.dedf.1213)
263+ > `@ux`(~(rol fe 6) 4 3 0xabac.dedf.1213)
305 0x1213.0000.abac.dedf
264 0x1213.0000.abac.dedf
306− ~zod/try=> `@ux`(~(rol fe 6) 4 2 0xabac.dedf.1213)
265+ > `@ux`(~(rol fe 6) 4 2 0xabac.dedf.1213)
307 0xdedf.1213.0000.abac
266 0xdedf.1213.0000.abac
308− ~zod/try=> `@t`(~(rol fe 5) 3 1 'dfgh')
267+ > `@t`(~(rol fe 5) 3 1 'dfgh')
309 'hdfg'
268 'hdfg'
310− ~zod/try=> `@t`(~(rol fe 5) 3 2 'dfgh')
269+ > `@t`(~(rol fe 5) 3 2 'dfgh')
311 'ghdf'
270 'ghdf'
312− ~zod/try=> `@t`(~(rol fe 5) 3 0 'dfgh')
271+ > `@t`(~(rol fe 5) 3 0 'dfgh')
313 'dfgh'
272 'dfgh'
314
273
315------------------------------------------------------------------------
274------------------------------------------------------------------------
@@ -323,11 +282,11 @@ Roll `d` to the right by `c` `b`-sized blocks.
323Accepts
282Accepts
324-------
283-------
325
284
326−`a` is a [`++bloq`]().
285+`a` is a `++bloq`.
327
286
328`b` is a `++bloq`.
287`b` is a `++bloq`.
329
288
330−`c` is an [atom]().
289+`c` is an atom.
331
290
332`d` is an atom.
291`d` is an atom.
333
292
@@ -339,26 +298,27 @@ An atom.
339Source
298Source
340------
299------
341
300
342− ++ ror |= [b=bloq c=@ d=@] ^- @ :: roll right
301+ ++ ror |= {b/bloq c/@ d/@} ^- @ :: roll right
343 =+ e=(sit d)
302 =+ e=(sit d)
344 =+ f=(bex (sub a b))
303 =+ f=(bex (sub a b))
345 =+ g=(mod c f)
304 =+ g=(mod c f)
346 (sit (con (rsh b g e) (lsh b (sub f g) e)))
305 (sit (con (rsh b g e) (lsh b (sub f g) e)))
347
306
307+
348Examples
308Examples
349--------
309--------
350
310
351− ~zod/try=> `@ux`(~(ror fe 6) 4 1 0xabac.dedf.1213)
311+ > `@ux`(~(ror fe 6) 4 1 0xabac.dedf.1213)
352 0x1213.0000.abac.dedf
312 0x1213.0000.abac.dedf
353− ~zod/try=> `@ux`(~(ror fe 6) 3 5 0xabac.dedf.1213)
313+ > `@ux`(~(ror fe 6) 3 5 0xabac.dedf.1213)
354 0xacde.df12.1300.00ab
314 0xacde.df12.1300.00ab
355− ~zod/try=> `@ux`(~(ror fe 6) 3 3 0xabac.dedf.1213)
315+ > `@ux`(~(ror fe 6) 3 3 0xabac.dedf.1213)
356 0xdf12.1300.00ab.acde
316 0xdf12.1300.00ab.acde
357− ~zod/try=> `@t`(~(rol fe 5) 3 0 'hijk')
317+ > `@t`(~(rol fe 5) 3 0 'hijk')
358 'hijk'
318 'hijk'
359− ~zod/try=> `@t`(~(rol fe 5) 3 1 'hijk')
319+ > `@t`(~(rol fe 5) 3 1 'hijk')
360 'khij'
320 'khij'
361− ~zod/try=> `@t`(~(rol fe 5) 3 2 'hijk')
321+ > `@t`(~(rol fe 5) 3 2 'hijk')
362 'jkhi'
322 'jkhi'
363
323
364------------------------------------------------------------------------
324------------------------------------------------------------------------
@@ -372,9 +332,9 @@ Sum two numbers in this modular field.
372Accepts
332Accepts
373-------
333-------
374
334
375−`a` is a [`++bloq`]().
335+`a` is a `++bloq`.
376
336
377−`b` is an [atom]().
337+`b` is an atom.
378
338
379`c` is an atom.
339`c` is an atom.
380
340
@@ -386,36 +346,36 @@ An atom.
386Source
346Source
387------
347------
388
348
389− ++ sum |=([b=@ c=@] (sit (add b c))) :: wrapping add
349+ ++ sum |=([b/@ c/@] (sit (add b c))) :: wrapping add
390
350
391Examples
351Examples
392--------
352--------
393
353
394− ~zod/try=> (~(sum fe 3) 10 250)
354+ > (~(sum fe 3) 10 250)
395 4
355 4
396− ~zod/try=> (~(sum fe 0) 0 1)
356+ > (~(sum fe 0) 0 1)
397 1
357 1
398− ~zod/try=> (~(sum fe 0) 0 2)
358+ > (~(sum fe 0) 0 2)
399 0
359 0
400− ~zod/try=> (~(sum fe 2) 14 2)
360+ > (~(sum fe 2) 14 2)
401 0
361 0
402− ~zod/try=> (~(sum fe 2) 14 3)
362+ > (~(sum fe 2) 14 3)
403 1
363 1
404− ~zod/try=> (~(sum fe 4) 10.000 256)
364+ > (~(sum fe 4) 10.000 256)
405 10.256
365 10.256
406− ~zod/try=> (~(sum fe 4) 10.000 100.000)
366+ > (~(sum fe 4) 10.000 100.000)
407 44.464
367 44.464
408
368
409### `++sit`
369### `++sit`
410
370
411Atom in mod block representation
371Atom in mod block representation
412
372
413−Produce an [atom]() in the current modular block representation.
373+Produce an atom in the current modular block representation.
414
374
415Accepts
375Accepts
416-------
376-------
417
377
418−`a` is a [`++bloq`]().
378+`a` is a `++bloq`.
419
379
420`b` is an atom.
380`b` is an atom.
421
381
@@ -427,32 +387,32 @@ An atom.
427Source
387Source
428------
388------
429
389
430− ++ sit |=(b=@ (end a 1 b)) :: enforce modulo
390+ ++ sit |=(b/@ (end a 1 b)) :: enforce modulo
431
391
432Examples
392Examples
433--------
393--------
434
394
435− ~zod/try=> (~(sit fe 3) 255)
395+ > (~(sit fe 3) 255)
436 255
396 255
437− ~zod/try=> (~(sit fe 3) 256)
397+ > (~(sit fe 3) 256)
438 0
398 0
439− ~zod/try=> (~(sit fe 3) 257)
399+ > (~(sit fe 3) 257)
440 1
400 1
441− ~zod/try=> (~(sit fe 2) 257)
401+ > (~(sit fe 2) 257)
442 1
402 1
443− ~zod/try=> (~(sit fe 2) 10.000)
403+ > (~(sit fe 2) 10.000)
444 0
404 0
445− ~zod/try=> (~(sit fe 2) 100)
405+ > (~(sit fe 2) 100)
446 4
406 4
447− ~zod/try=> (~(sit fe 2) 19)
407+ > (~(sit fe 2) 19)
448 3
408 3
449− ~zod/try=> (~(sit fe 2) 17)
409+ > (~(sit fe 2) 17)
450 1
410 1
451− ~zod/try=> (~(sit fe 0) 17)
411+ > (~(sit fe 0) 17)
452 1
412 1
453− ~zod/try=> (~(sit fe 0) 0)
413+ > (~(sit fe 0) 0)
454 0
414 0
455− ~zod/try=> (~(sit fe 0) 1)
415+ > (~(sit fe 0) 1)
456 1
416 1
457
417
458
418
@@ -476,26 +436,26 @@ Produces the absolute value of a signed integer.
476Accepts
436Accepts
477-------
437-------
478
438
479−`a` is a signed integer, [`@s`]().
439+`a` is a signed integer, `@s`.
480
440
481Produces
441Produces
482--------
442--------
483
443
484−An [atom]().
444+An atom.
485
445
486Source
446Source
487------
447------
488
448
489− ++ abs |=(a=@s (add (end 0 1 a) (rsh 0 1 a))) :: absolute value
449+ ++ abs |=(a/@s (add (end 0 1 a) (rsh 0 1 a))) :: absolute value
490
450
491Examples
451Examples
492--------
452--------
493
453
494− ~zod/try=> (abs:si -2)
454+ > (abs:si -2)
495 2
455 2
496− ~zod/try=> (abs:si -10.000)
456+ > (abs:si -10.000)
497 10.000
457 10.000
498− ~zod/try=> (abs:si --2)
458+ > (abs:si --2)
499 2
459 2
500
460
501------------------------------------------------------------------------
461------------------------------------------------------------------------
@@ -509,32 +469,32 @@ Produces the difference between two signed integers `b` and `c`.
509Accepts
469Accepts
510-------
470-------
511
471
512−`a` is a signed integer, [`@s`]().
472+`a` is a signed integer, `@s`.
513
473
514`b` is a signed integer, `@s`.
474`b` is a signed integer, `@s`.
515
475
516Produces
476Produces
517--------
477--------
518
478
519−A [`@s`]().
479+A `@s`.
520
480
521
481
522Source
482Source
523------
483------
524
484
525− ++ dif |= [a=@s b=@s] :: subtraction
485+ ++ dif |= [a/@s b/@s] :: subtraction
526 (sum a (new !(syn b) (abs b)))
486 (sum a (new !(syn b) (abs b)))
527
487
528Examples
488Examples
529--------
489--------
530
490
531− ~zod/try=> (dif:si --10 -7)
491+ > (dif:si --10 -7)
532 --17
492 --17
533− ~zod/try=> (dif:si --10 --7)
493+ > (dif:si --10 --7)
534 --3
494 --3
535− ~zod/try=> (dif:si `@s`0 --7)
495+ > (dif:si `@s`0 --7)
536 -7
496 -7
537− ~zod/try=> (dif:si `@s`0 `@s`7)
497+ > (dif:si `@s`0 `@s`7)
538 --4
498 --4
539
499
540------------------------------------------------------------------------
500------------------------------------------------------------------------
@@ -550,7 +510,7 @@ Accepts
550
510
551`a` is a signed integer, `@s`.
511`a` is a signed integer, `@s`.
552
512
553−`b` is an [atom]().
513+`b` is an atom.
554
514
555Produces
515Produces
556--------
516--------
@@ -560,21 +520,21 @@ An atom.
560Source
520Source
561------
521------
562
522
563− ++ dul |= [a=@s b=@] :: modulus
523+ ++ dul |= [a/@s b/@] :: modulus
564 =+(c=(old a) ?:(-.c (mod +.c b) (sub b +.c)))
524 =+(c=(old a) ?:(-.c (mod +.c b) (sub b +.c)))
565
525
566Examples
526Examples
567--------
527--------
568
528
569− ~zod/try=> (dul:si --9 3)
529+ > (dul:si --9 3)
570 0
530 0
571− ~zod/try=> (dul:si --9 4)
531+ > (dul:si --9 4)
572 1
532 1
573− ~zod/try=> (dul:si --9 5)
533+ > (dul:si --9 5)
574 4
534 4
575− ~zod/try=> (dul:si --9 6)
535+ > (dul:si --9 6)
576 3
536 3
577− ~zod/try=> (dul:si --90 --10)
537+ > (dul:si --90 --10)
578 10
538 10
579
539
580------------------------------------------------------------------------
540------------------------------------------------------------------------
@@ -588,27 +548,27 @@ Produces the quotient of two signed integers.
588Accepts
548Accepts
589-------
549-------
590
550
591−`a` is a signed integer, [`@s`].
551+`a` is a signed integer, `@s`.
592
552
593`b` is a signed integer, `@s`.
553`b` is a signed integer, `@s`.
594
554
595Produces
555Produces
596--------
556--------
597
557
598−An [atom]().
558+An atom.
599
559
600Source
560Source
601------
561------
602
562
603− ++ fra |= [a=@s b=@s] :: divide
563+ ++ fra |= [a/@s b/@s] :: divide
604 (new =(0 (mix (syn a) (syn b))) (div (abs a) (abs b)))
564 (new =(0 (mix (syn a) (syn b))) (div (abs a) (abs b)))
605
565
606Examples
566Examples
607--------
567--------
608
568
609− ~zod/try=> (fra:si --10 -2)
569+ > (fra:si --10 -2)
610 -5
570 -5
611− ~zod/try=> (fra:si -20 -5)
571+ > (fra:si -20 -5)
612 --4
572 --4
613
573
614------------------------------------------------------------------------
574------------------------------------------------------------------------
@@ -617,7 +577,7 @@ Examples
617
577
618Signed integer
578Signed integer
619
579
620−Produces a signed integer from a loobean sign value `a` and an [atom]() `b`.
580+Produces a signed integer from a loobean sign value `a` and an atom `b`.
621
581
622Accepts
582Accepts
623-------
583-------
@@ -629,60 +589,60 @@ Accepts
629Produces
589Produces
630--------
590--------
631
591
632−A [`@s`]()
592+A `@s`
633
593
634Source
594Source
635------
595------
636
596
637− ++ new |= [a=? b=@] :: [sign value] to @s
597+ ++ new |= [a/? b/@] :: [sign value] to @s
638 `@s`?:(a (mul 2 b) ?:(=(0 b) 0 +((mul 2 (dec b)))))
598 `@s`?:(a (mul 2 b) ?:(=(0 b) 0 +((mul 2 (dec b)))))
639
599
640Examples
600Examples
641--------
601--------
642
602
643− ~zod/try=> (new:si [& 10])
603+ > (new:si [& 10])
644 --10
604 --10
645− ~zod/try=> (new:si [| 10])
605+ > (new:si [| 10])
646 -10
606 -10
647− ~zod/try=> (new:si [%.y 7])
607+ > (new:si [%.y 7])
648 --7
608 --7
649
609
650------------------------------------------------------------------------
610------------------------------------------------------------------------
651
611
652### `++old`
612### `++old`
653
613
654−[sign value]
614+sign value
655
615
656Produces the cell `[sign value]` representations of a signed integer.
616Produces the cell `[sign value]` representations of a signed integer.
657
617
658Accepts
618Accepts
659-------
619-------
660
620
661−`a` is a [`@s`]().
621+`a` is a `@s`.
662
622
663Produces
623Produces
664--------
624--------
665
625
666−A cell of a boolean and an [atom]().
626+A cell of a boolean and an atom.
667
627
668Source
628Source
669------
629------
670
630
671− ++ old |=(a=@s [(syn a) (abs a)]) :: [sign value]
631+ ++ old |=(a/@s [(syn a) (abs a)]) :: [sign value]
672
632
673Examples
633Examples
674--------
634--------
675
635
676− ~zod/try=> (old:si 7)
636+ > (old:si 7)
677 ! type-fail
637 ! type-fail
678 ! exit
638 ! exit
679− ~zod/try=> (old:si -7)
639+ > (old:si -7)
680 [%.n 7]
640 [%.n 7]
681− ~zod/try=> (old:si --7)
641+ > (old:si --7)
682 [%.y 7]
642 [%.y 7]
683− ~zod/try=> (old:si `@s`7)
643+ > (old:si `@s`7)
684 [%.n 4]
644 [%.n 4]
685− ~zod/try=> (old:si -0)
645+ > (old:si -0)
686 [%.y 0]
646 [%.y 0]
687
647
688------------------------------------------------------------------------
648------------------------------------------------------------------------
@@ -696,7 +656,7 @@ Produces the product of two signed integers.
696Accepts
656Accepts
697-------
657-------
698
658
699−`a` is a [`@s`]().
659+`a` is a `@s`.
700
660
701`b` is a `@s`.
661`b` is a `@s`.
702
662
@@ -708,19 +668,19 @@ A `@s`.
708Source
668Source
709------
669------
710
670
711− ++ pro |= [a=@s b=@s] :: multiplication
671+ ++ pro |= [a/@s b/@s] :: multiplication
712 (new =(0 (mix (syn a) (syn b))) (mul (abs a) (abs b)))
672 (new =(0 (mix (syn a) (syn b))) (mul (abs a) (abs b)))
713
673
714Examples
674Examples
715--------
675--------
716
676
717− ~zod/try=> (pro:si -4 --2)
677+ > (pro:si -4 --2)
718 -8
678 -8
719− ~zod/try=> (pro:si -4 -2)
679+ > (pro:si -4 -2)
720 --8
680 --8
721− ~zod/try=> (pro:si --10.000.000 -10)
681+ > (pro:si --10.000.000 -10)
722 -100.000.000
682 -100.000.000
723− ~zod/try=> (pro:si -1.337 --0)
683+ > (pro:si -1.337 --0)
724 --0
684 --0
725
685
726------------------------------------------------------------------------
686------------------------------------------------------------------------
@@ -734,7 +694,7 @@ Produces the remainder from a division of two signed integers.
734Accepts
694Accepts
735-------
695-------
736
696
737−`a` is a [`@s`]().
697+`a` is a `@s`.
738
698
739`b` is a `@s`.
699`b` is a `@s`.
740
700
@@ -746,20 +706,20 @@ A `@sd`.
746Source
706Source
747------
707------
748
708
749− ++ rem |=([a=@s b=@s] (dif a (pro b (fra a b)))) :: remainder
709+ ++ rem |=([a/@s b/@s] (dif a (pro b (fra a b)))) :: remainder
750
710
751Examples
711Examples
752--------
712--------
753
713
754− ~zod/try=> (rem:si -10 -4)
714+ > (rem:si -10 -4)
755 -2
715 -2
756− ~zod/try=> (rem:si --10 --4)
716+ > (rem:si --10 --4)
757 --2
717 --2
758− ~zod/try=> (rem:si --10 -4)
718+ > (rem:si --10 -4)
759 --2
719 --2
760− ~zod/try=> (rem:si --7 --3)
720+ > (rem:si --7 --3)
761 --1
721 --1
762− ~zod/try=> (rem:si --0 --10.000)
722+ > (rem:si --0 --10.000)
763 --0
723 --0
764
724
765------------------------------------------------------------------------
725------------------------------------------------------------------------
@@ -773,7 +733,7 @@ Sum two signed integers.
773Accepts
733Accepts
774-------
734-------
775
735
776−`b` is a [`@s`]().
736+`b` is a `@s`.
777
737
778`c` is a signed integer `@s`.
738`c` is a signed integer `@s`.
779
739
@@ -785,7 +745,7 @@ A `@s`.
785Source
745Source
786------
746------
787
747
788− ++ sum |= [a=@s b=@s] :: addition
748+ ++ sum |= [a/@s b/@s] :: addition
789 ~| %si-sum
749 ~| %si-sum
790 =+ [c=(old a) d=(old b)]
750 =+ [c=(old a) d=(old b)]
791 ?: -.c
751 ?: -.c
@@ -803,13 +763,13 @@ Source
803Examples
763Examples
804--------
764--------
805
765
806− ~zod/try=> (sum:si --10 --10)
766+ > (sum:si --10 --10)
807 --20
767 --20
808− ~zod/try=> (sum:si --10 -0)
768+ > (sum:si --10 -0)
809 --10
769 --10
810− ~zod/try=> (sum:si -10 -7)
770+ > (sum:si -10 -7)
811 -17
771 -17
812− ~zod/try=> (sum:si -10 --7)
772+ > (sum:si -10 --7)
813 -3
773 -3
814
774
815------------------------------------------------------------------------
775------------------------------------------------------------------------
@@ -820,36 +780,36 @@ Signed from unsigned
820
780
821Produces a signed integer from an unsigned integer.
781Produces a signed integer from an unsigned integer.
822
782
823−Note that the result must be manually cast to some [`@s`]() odor to be
783+Note that the result must be manually cast to some `@s` odor to be
824inferred as an unsigned integer in the type system.
784inferred as an unsigned integer in the type system.
825
785
826Accepts
786Accepts
827-------
787-------
828
788
829−`a` is a [`@u`]().
789+`a` is a `@u`.
830
790
831Produces
791Produces
832--------
792--------
833
793
834−A [`@s`]().
794+A `@s`.
835
795
836Source
796Source
837------
797------
838
798
839− ++ sun |=(a=@u (mul 2 a)) :: @u to @s
799+ ++ sun |=(a/@u (mul 2 a)) :: @u to @s
840
800
841Examples
801Examples
842--------
802--------
843
803
844− ~zod/try=> `@s`10
804+ > `@s`10
845 --5
805 --5
846− ~zod/try=> (sun:si 10)
806+ > (sun:si 10)
847 20
807 20
848− ~zod/try=> `@s`(sun:si 10)
808+ > `@s`(sun:si 10)
849 --10
809 --10
850− ~zod/try=> `@sd`(sun:si 10)
810+ > `@sd`(sun:si 10)
851 --10
811 --10
852− ~zod/try=> `@sd`(sun:si 12.345)
812+ > `@sd`(sun:si 12.345)
853 --12.345
813 --12.345
854
814
855------------------------------------------------------------------------
815------------------------------------------------------------------------
@@ -863,7 +823,7 @@ Produce the sign of a signed integer, where `&` is posiitve, and `|` is negative
863Accepts
823Accepts
864-------
824-------
865
825
866−`a` is a [`@s`]().
826+`a` is a `@s`.
867
827
868Produces
828Produces
869--------
829--------
@@ -873,16 +833,16 @@ A boolean.
873Source
833Source
874------
834------
875
835
876− ++ syn |=(a=@s =(0 (end 0 1 a))) :: sign test
836+ ++ syn |=(a/@s =(0 (end 0 1 a))) :: sign test
877
837
878Examples
838Examples
879--------
839--------
880
840
881− ~zod/try=> (syn:si -2)
841+ > (syn:si -2)
882 %.n
842 %.n
883− ~zod/try=> (syn:si --2)
843+ > (syn:si --2)
884 %.y
844 %.y
885− ~zod/try=> (syn:si -0)
845+ > (syn:si -0)
886 %.y
846 %.y
887
847
888------------------------------------------------------------------------
848------------------------------------------------------------------------
@@ -896,7 +856,7 @@ Compare two signed integers.
896Accepts
856Accepts
897-------
857-------
898
858
899−`b` is a [`@s`]().
859+`b` is a `@s`.
900
860
901`c` is a `@s`.
861`c` is a `@s`.
902
862
@@ -908,7 +868,7 @@ A `@s`.
908Source
868Source
909------
869------
910
870
911− ++ cmp |= [a=@s b=@s] :: compare
871+ ++ cmp |= [a/@s b/@s] :: compare
912 ^- @s
872 ^- @s
913 ?: =(a b)
873 ?: =(a b)
914 --0
874 --0
@@ -927,14 +887,56 @@ Source
927Examples
887Examples
928--------
888--------
929
889
930− ~zod/try=> (cmp:si --10 --10)
890+ > (cmp:si --10 --10)
931 --0
891 --0
932− ~zod/try=> (cmp:si --10 -0)
892+ > (cmp:si --10 -0)
933 --1
893 --1
934− ~zod/try=> (cmp:si -10 -7)
894+ > (cmp:si -10 -7)
935 -1
895 -1
936− ~zod/try=> (cmp:si -10 --7)
896+ > (cmp:si -10 --7)
937 -1
897 -1
938
898
939
899
900+***
901+### `++egcd`
902+
903+GCD
904+
905+ ++ egcd !: :: schneier's egcd
906+ |= {a/@ b/@}
907+ =+ si
908+ =+ [c=(sun a) d=(sun b)]
909+ =+ [u=[c=(sun 1) d=--0] v=[c=--0 d=(sun 1)]]
910+ |- ^- {d/@ u/@s v/@s}
911+ ?: =(--0 c)
912+ [(abs d) d.u d.v]
913+ :: ?> ?& =(c (sum (pro (sun a) c.u) (pro (sun b) c.v)))
914+ :: =(d (sum (pro (sun a) d.u) (pro (sun b) d.v)))
915+ :: ==
916+ =+ q=(fra d c)
917+ %= $
918+ c (dif d (pro q c))
919+ d c
920+ u [(dif d.u (pro q c.u)) c.u]
921+ v [(dif d.v (pro q c.v)) c.v]
922+ ==
923+ ::
924+
925+
926+Greatest common denominator
927+
928+ > (egcd 20 15)
929+ [d=5 u=2 v=1]
930+ > (egcd 24 16)
931+ [d=8 u=2 v=1]
932+ > (egcd 7 5)
933+ [d=1 u=3 v=6]
934+ > (egcd (shaf ~ %ham) (shaf ~ %sam))
935+ [ d=1
936+ u=59.983.396.314.566.203.239.184.568.129.921.874.787
937+ v=38.716.650.351.034.402.960.165.718.823.532.275.722
938+ ]
939+
940+
941+
940***
942***
docs/system/hoon/library/3c.md+309−302
@@ -1,4 +1,262 @@
1# 3c: urbit time
1# 3c: urbit time
2+### `++yo`
3+
4+ ++ yo :: time constants core
5+
6+Useful constants for interacting with earth time.
7+
8+### `++cet`
9+
10+Days in a century. Derived by multiplying the number of days in a year
11+(365) by the number of years in a century (100), then adding the number
12+days from leap years in a century (24).
13+
14+Produces
15+--------
16+
17+An atom.
18+
19+Source
20+------
21+
22+ |% ++ cet 36.524 :: (add 24 (mul 100 365))
23+
24+Examples
25+--------
26+
27+ > cet:yo
28+ 36.524
29+ > (add 365 cet:yo)
30+ 36.889
31+ > (sub (add 24 (mul 100 365)) cet:yo)
32+ 0
33+
34+------------------------------------------------------------------------
35+
36+### `++day`
37+
38+Number of seconds in a day.
39+
40+Produces
41+--------
42+
43+An atom.
44+
45+Source
46+------
47+
48+ ++ day 86.400 :: (mul 24 hor)
49+
50+Examples
51+--------
52+
53+ > day:yo
54+ 86.400
55+ > (add 60 day:yo)
56+ 86.460
57+
58+------------------------------------------------------------------------
59+
60+### `++era`
61+
62+XX Revisit
63+
64+Produces
65+--------
66+
67+An atom.
68+
69+Source
70+------
71+
72+ ++ era 146.097 :: (add 1 (mul 4 cet))
73+
74+Examples
75+--------
76+
77+
78+------------------------------------------------------------------------
79+
80+### `++hor`
81+
82+Seconds in hour
83+
84+The number of seconds in an hour. Derived by multiplying the number of
85+seconds in a minute by the minutes in an hour.
86+
87+Produces
88+--------
89+
90+An atom.
91+
92+Source
93+------
94+
95+ ++ hor 3.600 :: (mul 60 mit)
96+
97+Examples
98+--------
99+
100+ > hor:yo
101+ 3.600
102+ > (div hor:yo 60)
103+ 60
104+
105+------------------------------------------------------------------------
106+
107+### `++jes`
108+
109+XX Revisit
110+
111+Produces
112+--------
113+
114+An atom.
115+
116+Source
117+------
118+
119+ ++ jes 106.751.991.084.417 :: (mul 730.692.561 era)
120+
121+Examples
122+--------
123+
124+ > jes:yo
125+ 106.751.991.084.417
126+
127+------------------------------------------------------------------------
128+
129+### `++mit`
130+
131+Seconds in minute
132+
133+The number of seconds in a minute.
134+
135+Produces
136+--------
137+
138+An atom.
139+
140+Source
141+------
142+
143+ ++ mit 60
144+
145+Examples
146+--------
147+
148+ > mit:yo
149+ 60
150+
151+------------------------------------------------------------------------
152+
153+### `++moh`
154+
155+Days in month
156+
157+The days in each month of the Gregorian common year. A list of unsigned
158+decimal atoms (Either 28, 30, or 31) denoting the number of days in the
159+month at the year at that index.
160+
161+Produces
162+--------
163+
164+A `++list` of `@ud`
165+
166+Source
167+------
168+
169+ ++ moh `(list @ud)`[31 28 31 30 31 30 31 31 30 31 30 31 ~]
170+
171+Examples
172+--------
173+
174+ > moh:yo
175+ ~[31 28 31 30 31 30 31 31 30 31 30 31]
176+ > (snag 4 moh:yo)
177+ 31
178+
179+------------------------------------------------------------------------
180+
181+### `++moy`
182+
183+Moh with leapyear
184+
185+The days in each month of the Gregorian leap-year. A list of unsigned
186+decimal atoms (Either 29,30, or 31) denoting the number of days in the
187+month at the leap-year at that index.
188+
189+Examples
190+--------
191+
192+A `++list` of `@ud`
193+
194+Source
195+------
196+
197+ ++ moy `(list @ud)`[31 29 31 30 31 30 31 31 30 31 30 31 ~]
198+
199+Examples
200+--------
201+
202+ > moy:yo
203+ ~[31 29 31 30 31 30 31 31 30 31 30 31]
204+ > (snag 1 moy:yo)
205+ 29
206+
207+------------------------------------------------------------------------
208+
209+### `++qad`
210+
211+Seconds in 4 years
212+
213+The number of seconds in four years. Derived by adding one second to the
214+number of seconds in four years.
215+
216+Produces
217+--------
218+
219+An atom.
220+
221+Source
222+------
223+
224+ ++ qad 126.144.001 :: (add 1 (mul 4 yer))
225+
226+Examples
227+--------
228+
229+ > qad:yo
230+ 126.144.001
231+
232+------------------------------------------------------------------------
233+
234+### `++yer`
235+
236+Seconds in year
237+
238+The number of seconds in a year. Derived by multiplying the number of
239+seconds in a day by 365.
240+
241+Produces
242+--------
243+
244+An atom.
245+
246+Source
247+------
248+
249+ ++ yer 31.536.000 :: (mul 365 day)
250+
251+Examples
252+--------
253+
254+ > yer:yo
255+ 31.536.000
256+
257+
258+
259+***
2### `++yall`
260### `++yall`
3
261
4Time since beginning of time
262Time since beginning of time
@@ -18,10 +276,10 @@ Produces
18Source
276Source
19------
277------
20
278
21− ++ yall :: day # to day of year
279+ ++ yall :: day / to day of year
22− |= day=@ud
280+ |= day/@ud
23− ^- [y=@ud m=@ud d=@ud]
281+ ^- {y/@ud m/@ud d/@ud}
24− =+ [era=0 cet=0 lep=_?]
282+ =+ [era=0 cet=0 lep=*?]
25 => .(era (div day era:yo), day (mod day era:yo))
283 => .(era (div day era:yo), day (mod day era:yo))
26 => ^+ .
284 => ^+ .
27 ?: (lth day +(cet:yo))
285 ?: (lth day +(cet:yo))
@@ -29,27 +287,28 @@ Source
29 => .(lep |, cet 1, day (sub day +(cet:yo)))
287 => .(lep |, cet 1, day (sub day +(cet:yo)))
30 .(cet (add cet (div day cet:yo)), day (mod day cet:yo))
288 .(cet (add cet (div day cet:yo)), day (mod day cet:yo))
31 =+ yer=(add (mul 400 era) (mul 100 cet))
289 =+ yer=(add (mul 400 era) (mul 100 cet))
32− |- ^- [y=@ud m=@ud d=@ud]
290+ |- ^- {y/@ud m/@ud d/@ud}
33 =+ dis=?:(lep 366 365)
291 =+ dis=?:(lep 366 365)
34 ?. (lth day dis)
292 ?. (lth day dis)
35 =+ ner=+(yer)
293 =+ ner=+(yer)
36 $(yer ner, day (sub day dis), lep =(0 (end 0 2 ner)))
294 $(yer ner, day (sub day dis), lep =(0 (end 0 2 ner)))
37− |- ^- [y=@ud m=@ud d=@ud]
295+ |- ^- {y/@ud m/@ud d/@ud}
38 =+ [mot=0 cah=?:(lep moy:yo moh:yo)]
296 =+ [mot=0 cah=?:(lep moy:yo moh:yo)]
39− |- ^- [y=@ud m=@ud d=@ud]
297+ |- ^- {y/@ud m/@ud d/@ud}
40 =+ zis=(snag mot cah)
298 =+ zis=(snag mot cah)
41 ?: (lth day zis)
299 ?: (lth day zis)
42 [yer +(mot) +(day)]
300 [yer +(mot) +(day)]
43 $(mot +(mot), day (sub day zis))
301 $(mot +(mot), day (sub day zis))
302+ ::
44
303
45Examples
304Examples
46--------
305--------
47
306
48− ~zod/try=> (yall 198)
307+ > (yall 198)
49 [y=0 m=7 d=17]
308 [y=0 m=7 d=17]
50− ~zod/try=> (yall 90.398)
309+ > (yall 90.398)
51 [y=247 m=7 d=3]
310 [y=247 m=7 d=3]
52− ~zod/try=> (yall 0)
311+ > (yall 0)
53 [y=0 m=1 d=1]
312 [y=0 m=1 d=1]
54
313
55
314
@@ -74,13 +333,13 @@ Accepts
74Produces
333Produces
75--------
334--------
76
335
77−A [`@ud`]().
336+A `@ud`.
78
337
79Source
338Source
80------
339------
81
340
82 ++ yawn :: days since Jesus
341 ++ yawn :: days since Jesus
83− |= [yer=@ud mot=@ud day=@ud]
342+ |= {yer/@ud mot/@ud day/@ud}
84 ^- @ud
343 ^- @ud
85 => .(mot (dec mot), day (dec day))
344 => .(mot (dec mot), day (dec day))
86 => ^+ .
345 => ^+ .
@@ -103,15 +362,16 @@ Source
103 =+ nec=(sub yer 100)
362 =+ nec=(sub yer 100)
104 $(yer nec, day (add day ?:((yelp nec) 36.525 36.524)))
363 $(yer nec, day (add day ?:((yelp nec) 36.525 36.524)))
105 (add day (mul (div yer 400) (add 1 (mul 4 36.524))))
364 (add day (mul (div yer 400) (add 1 (mul 4 36.524))))
365+ ::
106
366
107Examples
367Examples
108--------
368--------
109
369
110− ~zod/try=> (yawn 2.014 8 4)
370+ > (yawn 2.014 8 4)
111 735.814
371 735.814
112− ~zod/try=> (yawn 1.776 7 4)
372+ > (yawn 1.776 7 4)
113 648.856
373 648.856
114− ~zod/try=> (yawn 1.990 10 11)
374+ > (yawn 1.990 10 11)
115 727.116
375 727.116
116
376
117
377
@@ -125,30 +385,31 @@ its `@d`representation.
125Accepts
385Accepts
126-------
386-------
127
387
128−`det` is a [`++date`]()
388+`det` is a `++date`
129
389
130Produces
390Produces
131--------
391--------
132
392
133−A [`@d`]().
393+A `@d`.
134
394
135Source
395Source
136------
396------
137
397
138 ++ year :: date to @d
398 ++ year :: date to @d
139− |= det=date
399+ |= det/date
140− ^- @d
400+ ^- @da
141 =+ ^= yer
401 =+ ^= yer
142 ?: a.det
402 ?: a.det
143 (add 292.277.024.400 y.det)
403 (add 292.277.024.400 y.det)
144 (sub 292.277.024.400 (dec y.det))
404 (sub 292.277.024.400 (dec y.det))
145 =+ day=(yawn yer m.det d.t.det)
405 =+ day=(yawn yer m.det d.t.det)
146 (yule day h.t.det m.t.det s.t.det f.t.det)
406 (yule day h.t.det m.t.det s.t.det f.t.det)
407+ ::
147
408
148Examples
409Examples
149--------
410--------
150
411
151− ~zod/try=> (year [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=4 s=57 f=~[0xd940]]])
412+ > (year [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=4 s=57 f=~[0xd940]]])
152 0x8000000d227df4e9d940000000000000
413 0x8000000d227df4e9d940000000000000
153
414
154
415
@@ -164,12 +425,12 @@ Source
164------
425------
165
426
166 ++ yell :: tarp from @d
427 ++ yell :: tarp from @d
167− |= now=@d
428+ |= now/@d
168 ^- tarp
429 ^- tarp
169 =+ sec=(rsh 6 1 now)
430 =+ sec=(rsh 6 1 now)
170 =+ ^= fan
431 =+ ^= fan
171 =+ [muc=4 raw=(end 6 1 now)]
432 =+ [muc=4 raw=(end 6 1 now)]
172− |- ^- (list ,@ux)
433+ |- ^- (list @ux)
173 ?: |(=(0 raw) =(0 muc))
434 ?: |(=(0 raw) =(0 muc))
174 ~
435 ~
175 => .(muc (dec muc))
436 => .(muc (dec muc))
@@ -181,15 +442,17 @@ Source
181 =+ mit=(div sec mit:yo)
442 =+ mit=(div sec mit:yo)
182 => .(sec (mod sec mit:yo))
443 => .(sec (mod sec mit:yo))
183 [day hor mit sec fan]
444 [day hor mit sec fan]
445+ ::
446+
184
447
185Examples
448Examples
186--------
449--------
187
450
188− ~zod/try=> (yell ~2014.3.20..05.42.53..7456)
451+ > (yell ~2014.3.20..05.42.53..7456)
189 [d=106.751.991.820.094 h=5 m=42 s=53 f=~[0x7456]]
452 [d=106.751.991.820.094 h=5 m=42 s=53 f=~[0x7456]]
190− ~zod/try=> (yell ~2014.6.9..19.09.40..8b66)
453+ > (yell ~2014.6.9..19.09.40..8b66)
191 [d=106.751.991.820.175 h=19 m=9 s=40 f=~[0x8b66]]
454 [d=106.751.991.820.175 h=19 m=9 s=40 f=~[0x8b66]]
192− ~zod/try=> (yell ~1776.7.4)
455+ > (yell ~1776.7.4)
193 [d=106.751.991.733.273 h=0 m=0 s=0 f=~]
456 [d=106.751.991.733.273 h=0 m=0 s=0 f=~]
194
457
195
458
@@ -221,13 +484,13 @@ Source
221Examples
484Examples
222--------
485--------
223
486
224− ~zod/try=> (yelp 2.014)
487+ > (yelp 2.014)
225 %.n
488 %.n
226− ~zod/try=> (yelp 2.008)
489+ > (yelp 2.008)
227 %.y
490 %.y
228− ~zod/try=> (yelp 0)
491+ > (yelp 0)
229 %.y
492 %.y
230− ~zod/try=> (yelp 14.011)
493+ > (yelp 14.011)
231 %.n
494 %.n
232
495
233
496
@@ -245,13 +508,13 @@ Accepts
245Produces
508Produces
246--------
509--------
247
510
248−A [`++date`]().
511+A `++date`.
249
512
250Source
513Source
251------
514------
252
515
253 ++ yore :: @d to date
516 ++ yore :: @d to date
254− |= now=@d
517+ |= now/@da
255 ^- date
518 ^- date
256 =+ rip=(yell now)
519 =+ rip=(yell now)
257 =+ ger=(yall d.rip)
520 =+ ger=(yall d.rip)
@@ -259,13 +522,14 @@ Source
259 [a=& y=(sub y.ger 292.277.024.400)]
522 [a=& y=(sub y.ger 292.277.024.400)]
260 [a=| y=+((sub 292.277.024.400 y.ger))]
523 [a=| y=+((sub 292.277.024.400 y.ger))]
261 [m.ger d.ger h.rip m.rip s.rip f.rip]
524 [m.ger d.ger h.rip m.rip s.rip f.rip]
525+ ::
262
526
263Examples
527Examples
264--------
528--------
265
529
266− ~zod/try=> (yore -<-)
530+ > (yore -<-)
267 [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=17 s=1 f=~[0x700d]]]
531 [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=17 s=1 f=~[0x700d]]]
268− ~zod/try=> (yore -<-)
532+ > (yore -<-)
269 [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=28 s=53 f=~[0x7b82]]]
533 [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=28 s=53 f=~[0x7b82]]]
270
534
271
535
@@ -275,24 +539,24 @@ Examples
275
539
276Daily time to time atom
540Daily time to time atom
277
541
278−Accept a [`++tarp`](/doc/hoon/library/1#++tarp), a parsed daily time, and produces a time atom,
542+Accept a `++tarp`, a parsed daily time, and produces a time atom,
279`@d`.
543`@d`.
280
544
281Accepts
545Accepts
282-------
546-------
283
547
284−`rip` is a [`++tarp`](/doc/hoon/library/1#++tarp).
548+`rip` is a `++tarp`.
285
549
286Produces
550Produces
287--------
551--------
288
552
289−A [`@d`]().
553+A `@d`.
290
554
291Source
555Source
292------
556------
293
557
294 ++ yule :: time atom
558 ++ yule :: time atom
295− |= rip=tarp
559+ |= rip/tarp
296 ^- @d
560 ^- @d
297 =+ ^= sec ;: add
561 =+ ^= sec ;: add
298 (mul d.rip day:yo)
562 (mul d.rip day:yo)
@@ -307,282 +571,25 @@ Source
307 => .(muc (dec muc))
571 => .(muc (dec muc))
308 (add (lsh 4 muc i.f.rip) $(f.rip t.f.rip))
572 (add (lsh 4 muc i.f.rip) $(f.rip t.f.rip))
309 (con (lsh 6 1 sec) fac)
573 (con (lsh 6 1 sec) fac)
574+ ::
310
575
311Examples
576Examples
312--------
577--------
313
578
314− ~zod/try=> =murica (yell ~1776.7.4)
579+ > =murica (yell ~1776.7.4)
315− ~zod/try=> murica
580+ > murica
316 [d=106.751.991.733.273 h=0 m=0 s=0 f=~]
581 [d=106.751.991.733.273 h=0 m=0 s=0 f=~]
317− ~zod/try=> (yule murica)
582+ > (yule murica)
318 0x8000000b62aaf5800000000000000000
583 0x8000000b62aaf5800000000000000000
319− ~zod/try=> `@da`(yule murica)
584+ > `@da`(yule murica)
320 ~1776.7.4
585 ~1776.7.4
321− ~zod/try=> `@da`(yule (yell ~2014.3.20..05.42.53..7456))
586+ > `@da`(yule (yell ~2014.3.20..05.42.53..7456))
322 ~2014.3.20..05.42.53..7456
587 ~2014.3.20..05.42.53..7456
323− ~zod/try=> `tarp`[31 12 30 0 ~]
588+ > `tarp`[31 12 30 0 ~]
324 [d=31 h=12 m=30 s=0 f=~]
589 [d=31 h=12 m=30 s=0 f=~]
325− ~zod/try=> `@dr`(yule `tarp`[31 12 30 0 ~])
590+ > `@dr`(yule `tarp`[31 12 30 0 ~])
326 ~d31.h12.m30
591 ~d31.h12.m30
327
592
328
593
329
594
330−***
331−### `++yo`
332−
333− ++ yo :: time constants core
334−
335−Useful constants for interacting with earth time.
336−
337−### `++cet`
338−
339−Days in a century. Derived by multiplying the number of days in a year
340−(365) by the number of years in a century (100), then adding the number
341−days from leap years in a century (24).
342−
343−Produces
344−--------
345−
346−An [atom]().
347−
348−Source
349−------
350−
351− |% ++ cet 36.524 :: (add 24 (mul 100 365))
352−
353−Examples
354−--------
355−
356− ~zod/try=> cet:yo
357− 36.524
358− ~zod/try=> (add 365 cet:yo)
359− 36.889
360− ~zod/try=> (sub (add 24 (mul 100 365)) cet:yo)
361− 0
362−
363−------------------------------------------------------------------------
364−
365−### `++day`
366−
367−Number of seconds in a day.
368−
369−Produces
370−--------
371−
372−An [atom]().
373−
374−Source
375−------
376−
377− ++ day 86.400 :: (mul 24 hor)
378−
379−Examples
380−--------
381−
382− ~zod/try=> day:yo
383− 86.400
384− ~zod/try=> (add 60 day:yo)
385− 86.460
386−
387−------------------------------------------------------------------------
388−
389−### `++era`
390−
391−XX Revisit
392−
393−Produces
394−--------
395−
396−An [atom]().
397−
398−Source
399−------
400−
401− ++ era 146.097 :: (add 1 (mul 4 cet))
402−
403−Examples
404−--------
405−
406−
407−------------------------------------------------------------------------
408−
409−### `++hor`
410−
411−Seconds in hour
412−
413−The number of seconds in an hour. Derived by multiplying the number of
414−seconds in a minute by the minutes in an hour.
415−
416−Produces
417−--------
418−
419−An [atom]().
420−
421−Source
422−------
423−
424− ++ hor 3.600 :: (mul 60 mit)
425−
426−Examples
427−--------
428−
429− ~zod/try=> hor:yo
430− 3.600
431− ~zod/try=> (div hor:yo 60)
432− 60
433−
434−------------------------------------------------------------------------
435−
436−### `++jes`
437−
438−XX Revisit
439−
440−Produces
441−--------
442−
443−An atom.
444−
445−Source
446−------
447−
448− ++ jes 106.751.991.084.417 :: (mul 730.692.561 era)
449−
450−Examples
451−--------
452−
453− ~zod/try=> jes:yo
454− 106.751.991.084.417
455−
456−------------------------------------------------------------------------
457−
458−### `++mit`
459−
460−Seconds in minute
461−
462−The number of seconds in a minute.
463−
464−Produces
465−--------
466−
467−An [atom]().
468−
469−Source
470−------
471−
472− ++ mit 60
473−
474−Examples
475−--------
476−
477− ~zod/try=> mit:yo
478− 60
479−
480−------------------------------------------------------------------------
481−
482−### `++moh`
483−
484−Days in month
485−
486−The days in each month of the Gregorian common year. A list of unsigned
487−decimal atoms (Either 28, 30, or 31) denoting the number of days in the
488−month at the year at that index.
489−
490−Produces
491−--------
492−
493−A [`++list`]() of [`@ud`]()
494−
495−Source
496−------
497−
498− ++ moh `(list ,@ud)`[31 28 31 30 31 30 31 31 30 31 30 31 ~]
499−
500−Examples
501−--------
502−
503− ~zod/try=> moh:yo
504− ~[31 28 31 30 31 30 31 31 30 31 30 31]
505− ~zod/try=> (snag 4 moh:yo)
506− 31
507−
508−------------------------------------------------------------------------
509−
510−### `++moy`
511−
512−Moh with leapyear
513−
514−The days in each month of the Gregorian leap-year. A list of unsigned
515−decimal atoms (Either 29,30, or 31) denoting the number of days in the
516−month at the leap-year at that index.
517−
518−Examples
519−--------
520−
521−A [`++list`]() of [`@ud`]()
522−
523−Source
524−------
525−
526− ++ moy `(list ,@ud)`[31 29 31 30 31 30 31 31 30 31 30 31 ~]
527−
528−Examples
529−--------
530−
531− ~zod/try=> moy:yo
532− ~[31 29 31 30 31 30 31 31 30 31 30 31]
533− ~zod/try=> (snag 1 moy:yo)
534− 29
535−
536−------------------------------------------------------------------------
537−
538−### `++qad`
539−
540−Seconds in 4 years
541−
542−The number of seconds in four years. Derived by adding one second to the
543−number of seconds in four years.
544−
545−Produces
546−--------
547−
548−An [atom]().
549−
550−Source
551−------
552−
553− ++ qad 126.144.001 :: (add 1 (mul 4 yer))
554−
555−Examples
556−--------
557−
558− ~zod/try=> qad:yo
559− 126.144.001
560−
561−------------------------------------------------------------------------
562−
563−### `++yer`
564−
565−Seconds in year
566−
567−The number of seconds in a year. Derived by multiplying the number of
568−seconds in a day by 365.
569−
570−Produces
571−--------
572−
573−An [atom]().
574−
575−Source
576−------
577−
578− ++ yer 31.536.000 :: (mul 365 day)
579−
580−Examples
581−--------
582−
583− ~zod/try=> yer:yo
584− 31.536.000
585−
586−
587−
588***
595***
docs/system/hoon/library/3d.md+75−154
@@ -1,7 +1,65 @@
1# 3d: SHA hash family
1# 3d: SHA hash family
2+
3+### `++og`
4+
5+ ++ og :: shax-powered rng
6+ ~/ %og
7+ |_ a/@
8+
9+XX document
10+
11+### `++rad`
12+
13+ ++ rad :: random in range
14+ |= b/@ ^- @
15+ =+ c=(raw (met 0 b))
16+ ?:((lth c b) c $(a +(a)))
17+ ::
18+
19+XX document
20+
21+### `++rads`
22+
23+ ++ rads :: random continuation
24+ |= b/@
25+ =+ r=(rad b)
26+ [r +>.$(a (shas %og-s r))]
27+
28+XX document
29+
30+### `++raw`
31+
32+ ++ raw :: random bits
33+ ~/ %raw
34+ |= b/@ ^- @
35+ %+ can
36+ 0
37+ =+ c=(shas %og-a (mix b a))
38+ |- ^- (list [@ @])
39+ ?: =(0 b)
40+ ~
41+ =+ d=(shas %og-b (mix b (mix a c)))
42+ ?: (lth b 256)
43+ [[b (end 0 b d)] ~]
44+ [[256 d] $(c d, b (sub b 256))]
45+
46+XX document
47+
48+### `++raws`
49+
50+ ++ raws :: random bits continuation
51+ |= b/@
52+ =+ r=(raw b)
53+ [r +>.$(a (shas %og-s r))]
54+ --
55+
56+
57+
58+***
2### `++shad`
59### `++shad`
3
60
4− ++ shad |=(ruz=@ (shax (shax ruz))) :: double sha-256
61+ ++ shad |=(ruz/@ (shax (shax ruz))) :: double sha-256
62+
5
63
6XX document
64XX document
7
65
@@ -11,7 +69,7 @@ XX document
11### `++shaf`
69### `++shaf`
12
70
13 ++ shaf :: half sha-256
71 ++ shaf :: half sha-256
14− |= [sal=@ ruz=@]
72+ |= [sal/@ ruz/@]
15 =+ haz=(shas sal ruz)
73 =+ haz=(shas sal ruz)
16 (mix (end 7 1 haz) (rsh 7 1 haz))
74 (mix (end 7 1 haz) (rsh 7 1 haz))
17 ::
75 ::
@@ -24,7 +82,7 @@ XX document
24### `++shak`
82### `++shak`
25
83
26 ++ shak :: XX shd be PBKDF
84 ++ shak :: XX shd be PBKDF
27− |= [who=@p wud=@]
85+ |= [who/@p wud/@]
28 (shas (mix %shak who) wud)
86 (shas (mix %shak who) wud)
29 ::
87 ::
30
88
@@ -37,9 +95,9 @@ XX document
37
95
38 ++ shal :: sha-512 with length
96 ++ shal :: sha-512 with length
39 ~/ %shal
97 ~/ %shal
40− |= [len=@ ruz=@] ^- @
98+ |= {len/@ ruz/@} ^- @
41 => .(ruz (cut 3 [0 len] ruz))
99 => .(ruz (cut 3 [0 len] ruz))
42− =+ [few==>(fe .(a 6)) wac=|=([a=@ b=@] (cut 6 [a 1] b))]
100+ =+ [few==>(fe .(a 6)) wac=|=({a/@ b/@} (cut 6 [a 1] b))]
43 =+ [sum=sum.few ror=ror.few net=net.few inv=inv.few]
101 =+ [sum=sum.few ror=ror.few net=net.few inv=inv.few]
44 =+ ral=(lsh 0 3 len)
102 =+ ral=(lsh 0 3 len)
45 =+ ^= ful
103 =+ ^= ful
@@ -156,7 +214,7 @@ XX document
156### `++sham`
214### `++sham`
157
215
158 ++ sham :: noun hash
216 ++ sham :: noun hash
159− |= yux=* ^- @uvH ^- @
217+ |= yux/* ^- @uvH ^- @
160 ?@ yux
218 ?@ yux
161 (shaf %mash yux)
219 (shaf %mash yux)
162 (shaf %sham (jam yux))
220 (shaf %sham (jam yux))
@@ -170,8 +228,8 @@ XX document
170### `++shan`
228### `++shan`
171
229
172 ++ shan :: sha-1 (deprecated)
230 ++ shan :: sha-1 (deprecated)
173− |= ruz=@
231+ |= ruz/@
174− =+ [few==>(fe .(a 5)) wac=|=([a=@ b=@] (cut 5 [a 1] b))]
232+ =+ [few==>(fe .(a 5)) wac=|=({a/@ b/@} (cut 5 [a 1] b))]
175 =+ [sum=sum.few ror=ror.few rol=rol.few net=net.few inv=inv.few]
233 =+ [sum=sum.few ror=ror.few rol=rol.few net=net.few inv=inv.few]
176 =+ ral=(lsh 0 3 (met 3 ruz))
234 =+ ral=(lsh 0 3 (met 3 ruz))
177 =+ ^= ful
235 =+ ^= ful
@@ -234,6 +292,7 @@ XX document
234 :(sum (rol 0 5 a) fz e (wac 2 kbx) (wac j wox))
292 :(sum (rol 0 5 a) fz e (wac 2 kbx) (wac j wox))
235 :(sum (rol 0 5 a) fy e (wac 3 kbx) (wac j wox))
293 :(sum (rol 0 5 a) fy e (wac 3 kbx) (wac j wox))
236 $(j +(j), a tem, b a, c (rol 0 30 b), d c, e d)
294 $(j +(j), a tem, b a, c (rol 0 30 b), d c, e d)
295+ ::
237
296
238XX document
297XX document
239
298
@@ -243,7 +302,7 @@ XX document
243### `++shas`
302### `++shas`
244
303
245 ++ shas :: salted hash
304 ++ shas :: salted hash
246− |= [sal=@ ruz=@]
305+ |= [sal/@ ruz/@]
247 (shax (mix sal (shax ruz)))
306 (shax (mix sal (shax ruz)))
248 ::
307 ::
249
308
@@ -255,7 +314,7 @@ XX document
255### `++shaw`
314### `++shaw`
256
315
257 ++ shaw :: hash to nbits
316 ++ shaw :: hash to nbits
258− |= [sal=@ len=@ ruz=@]
317+ |= [sal/@ len/@ ruz/@]
259 (~(raw og (shas sal (mix len ruz))) len)
318 (~(raw og (shas sal (mix len ruz))) len)
260 ::
319 ::
261
320
@@ -264,92 +323,11 @@ XX document
264***
323***
265### `++shax`
324### `++shax`
266
325
267− ++ shax :: sha-256
326+++ shax :: sha-256
268− ~/ %shax
327+ ~/ %shax
269− |= ruz=@ ^- @
328+ |= ruz/@ ^- @
270− ~| %sha
271− =+ [few==>(fe .(a 5)) wac=|=([a=@ b=@] (cut 5 [a 1] b))]
272− =+ [sum=sum.few ror=ror.few net=net.few inv=inv.few]
273− =+ ral=(lsh 0 3 (met 3 ruz))
329+ (shay [(met 3 ruz) ruz])
274− =+ ^= ful
275− %+ can 0
276− :~ [ral ruz]
277− [8 128]
278− [(mod (sub 960 (mod (add 8 ral) 512)) 512) 0]
279− [64 (~(net fe 6) ral)]
280− ==
281− =+ lex=(met 9 ful)
282− =+ ^= kbx 0xc671.78f2.bef9.a3f7.a450.6ceb.90be.fffa.
283− 8cc7.0208.84c8.7814.78a5.636f.748f.82ee.
284− 682e.6ff3.5b9c.ca4f.4ed8.aa4a.391c.0cb3.
285− 34b0.bcb5.2748.774c.1e37.6c08.19a4.c116.
286− 106a.a070.f40e.3585.d699.0624.d192.e819.
287− c76c.51a3.c24b.8b70.a81a.664b.a2bf.e8a1.
288− 9272.2c85.81c2.c92e.766a.0abb.650a.7354.
289− 5338.0d13.4d2c.6dfc.2e1b.2138.27b7.0a85.
290− 1429.2967.06ca.6351.d5a7.9147.c6e0.0bf3.
291− bf59.7fc7.b003.27c8.a831.c66d.983e.5152.
292− 76f9.88da.5cb0.a9dc.4a74.84aa.2de9.2c6f.
293− 240c.a1cc.0fc1.9dc6.efbe.4786.e49b.69c1.
294− c19b.f174.9bdc.06a7.80de.b1fe.72be.5d74.
295− 550c.7dc3.2431.85be.1283.5b01.d807.aa98.
296− ab1c.5ed5.923f.82a4.59f1.11f1.3956.c25b.
297− e9b5.dba5.b5c0.fbcf.7137.4491.428a.2f98
298− =+ ^= hax 0x5be0.cd19.1f83.d9ab.9b05.688c.510e.527f.
299− a54f.f53a.3c6e.f372.bb67.ae85.6a09.e667
300− =+ i=0
301− |- ^- @
302− ?: =(i lex)
303− (rep 5 (turn (rip 5 hax) net))
304− =+ ^= wox
305− =+ dux=(cut 9 [i 1] ful)
306− =+ wox=(rep 5 (turn (rip 5 dux) net))
307− =+ j=16
308− |- ^- @
309− ?: =(64 j)
310− wox
311− =+ :* l=(wac (sub j 15) wox)
312− m=(wac (sub j 2) wox)
313− n=(wac (sub j 16) wox)
314− o=(wac (sub j 7) wox)
315− ==
316− =+ x=:(mix (ror 0 7 l) (ror 0 18 l) (rsh 0 3 l))
317− =+ y=:(mix (ror 0 17 m) (ror 0 19 m) (rsh 0 10 m))
318− =+ z=:(sum n x o y)
319− $(wox (con (lsh 5 j z) wox), j +(j))
320− =+ j=0
321− =+ :* a=(wac 0 hax)
322− b=(wac 1 hax)
323− c=(wac 2 hax)
324− d=(wac 3 hax)
325− e=(wac 4 hax)
326− f=(wac 5 hax)
327− g=(wac 6 hax)
328− h=(wac 7 hax)
329− ==
330− |- ^- @
331− ?: =(64 j)
332− %= ^$
333− i +(i)
334− hax %+ rep 5
335− :~ (sum a (wac 0 hax))
336− (sum b (wac 1 hax))
337− (sum c (wac 2 hax))
338− (sum d (wac 3 hax))
339− (sum e (wac 4 hax))
340− (sum f (wac 5 hax))
341− (sum g (wac 6 hax))
342− (sum h (wac 7 hax))
343− ==
344− ==
345− =+ l=:(mix (ror 0 2 a) (ror 0 13 a) (ror 0 22 a)) :: s0
346− =+ m=:(mix (dis a b) (dis a c) (dis b c)) :: maj
347− =+ n=(sum l m) :: t2
348− =+ o=:(mix (ror 0 6 e) (ror 0 11 e) (ror 0 25 e)) :: s1
349− =+ p=(mix (dis e f) (dis (inv e) g)) :: ch
350− =+ q=:(sum h o p (wac j kbx) (wac j wox)) :: t1
351− $(j +(j), a (sum q n), b a, c b, d c, e (sum d q), f e, g f, h g)
352− ::
330+::
353
331
354XX document
332XX document
355
333
@@ -359,66 +337,9 @@ XX document
359### `++shaz`
337### `++shaz`
360
338
361 ++ shaz :: sha-512
339 ++ shaz :: sha-512
362− |= ruz=@ ^- @
340+ |= ruz/@ ^- @
363 (shal [(met 3 ruz) ruz])
341 (shal [(met 3 ruz) ruz])
364
342
365
343
366
344
367−***
368−
369−### `++og`
370−
371− ++ og :: shax-powered rng
372− ~/ %og
373− |_ a=@
374−
375−XX document
376−
377−### `++rad`
378−
379− ++ rad :: random in range
380− |= b=@ ^- @
381− =+ c=(raw (met 0 b))
382− ?:((lth c b) c $(a +(a)))
383− ::
384−
385−XX document
386−
387−### `++rads`
388−
389− ++ rads :: random continuation
390− |= b=@
391− =+ r=(rad b)
392− [r +>.$(a (shas %og-s r))]
393−
394−XX document
395−
396−### `++raw`
397−
398− ++ raw :: random bits
399− ~/ %raw
400− |= b=@ ^- @
401− %+ can
402− 0
403− =+ c=(shas %og-a (mix b a))
404− |- ^- (list ,[@ @])
405− ?: =(0 b)
406− ~
407− =+ d=(shas %og-b (mix b (mix a c)))
408− ?: (lth b 256)
409− [[b (end 0 b d)] ~]
410− [[256 d] $(c d, b (sub b 256))]
411−
412−XX document
413−
414−### `++raws`
415−
416− ++ raws :: random bits continuation
417− |= b=@
418− =+ r=(raw b)
419− [r +>.$(a (shas %og-s r))]
420− --
421−
422−
423−
424***
345***
docs/system/hoon/library/3e.md+13−67
@@ -11,7 +11,7 @@ XX document
11
11
12 ++ en :: ECB enc
12 ++ en :: ECB enc
13 ~/ %en
13 ~/ %en
14− |= [a=@I b=@H] ^- @uxH
14+ |= [a/@I b/@H] ^- @uxH
15 =+ ahem
15 =+ ahem
16 (be & (ex a) b)
16 (be & (ex a) b)
17
17
@@ -21,7 +21,7 @@ XX document
21
21
22 ++ de :: ECB dec
22 ++ de :: ECB dec
23 ~/ %de
23 ~/ %de
24− |= [a=@I b=@H] ^- @uxH
24+ |= [a/@I b/@H] ^- @uxH
25 =+ ahem
25 =+ ahem
26 (be | (ix (ex a)) b)
26 (be | (ix (ex a)) b)
27 --
27 --
@@ -30,8 +30,6 @@ XX document
30
30
31### `++ahem`
31### `++ahem`
32
32
33− ++ ahem :: AES helpers
34− :: XX should be in aesc, isn't for performance reasons
35 =>
33 =>
36 =+ =+ [gr=(ga 8 0x11b 3) few==>(fe .(a 5))]
34 =+ =+ [gr=(ga 8 0x11b 3) few==>(fe .(a 5))]
37 =+ [pro=pro.gr dif=dif.gr pow=pow.gr ror=ror.few]
35 =+ [pro=pro.gr dif=dif.gr pow=pow.gr ror=ror.few]
@@ -45,65 +43,32 @@ XX document
45 ++ cipa :: AES params
43 ++ cipa :: AES params
46 $_ ^? |%
44 $_ ^? |%
47
45
46+
48XX document
47XX document
49
48
50### `++co`
49### `++co`
51
50
52− ++ co [0xe 0xb 0xd 0x9]
51+ ++ co *{p/@ q/@ r/@ s/@} :: col coefs
53
52
54XX document
53XX document
55
54
56### `++ix`
55### `++ix`
57
56
58− ++ ix :: key expand, inv
57+ ++ ix |~(a/@ *@) :: key index
59− |= a=@ ^- @
58+
60− =+ [i=1 j=_@ b=_@ c=co:pin]
61− |-
62− ?: =(nnr i)
63− a
64− => .(b (cut 7 [i 1] a))
65− => .(b (rep 5 (mcol (pode 5 4 b) c)))
66− => .(j (sub nnr i))
67− %= $
68− i +(i)
69− a
70− %+ can 7
71− :~ [i (cut 7 [0 i] a)]
72− [1 b]
73− [j (cut 7 [+(i) j] a)]
74− ==
75− ==
76− --
77− ::
78
59
79XX document
60XX document
80
61
81### `++ro`
62### `++ro`
82
63
83− ++ ro [0 3 2 1]
64+ ++ ro *{p/@ q/@ r/@ s/@} :: row shifts
65+
84
66
85XX document
67XX document
86
68
87### `++su`
69### `++su`
88
70
89− ++ su 0x7d0c.2155.6314.69e1.26d6.77ba.7e04.2b17.
71+ ++ su *@ :: s-box
90− 6199.5383.3cbb.ebc8.b0f5.2aae.4d3b.e0a0.
91− ef9c.c993.9f7a.e52d.0d4a.b519.a97f.5160.
92− 5fec.8027.5910.12b1.31c7.0788.33a8.dd1f.
93− f45a.cd78.fec0.db9a.2079.d2c6.4b3e.56fc.
94− 1bbe.18aa.0e62.b76f.89c5.291d.711a.f147.
95− 6edf.751c.e837.f9e2.8535.ade7.2274.ac96.
96− 73e6.b4f0.cecf.f297.eadc.674f.4111.913a.
97− 6b8a.1301.03bd.afc1.020f.3fca.8f1e.2cd0.
98− 0645.b3b8.0558.e4f7.0ad3.bc8c.00ab.d890.
99− 849d.8da7.5746.155e.dab9.edfd.5048.706c.
100− 92b6.655d.cc5c.a4d4.1698.6886.64f6.f872.
101− 25d1.8b6d.49a2.5b76.b224.d928.66a1.2e08.
102− 4ec3.fa42.0b95.4cee.3d23.c2a6.3294.7b54.
103− cbe9.dec4.4443.8e34.87ff.2f9b.8239.e37c.
104− fbd7.f381.9ea3.40bf.38a5.3630.d56a.0952
105− --
106− ::
107
72
108XX document
73XX document
109
74
@@ -117,38 +82,19 @@ XX document
117
82
118### `++co`
83### `++co`
119
84
120− ++ co [0xe 0xb 0xd 0x9]
85+ ++ co [0x2 0x3 1 1]
121
86
122XX document
87XX document
123
88
124### `++ix`
89### `++ix`
125
90
126− ++ ix :: key expand, inv
91+ ++ ix |~(a/@ *@) :: key index
127− |= a=@ ^- @
92+
128− =+ [i=1 j=_@ b=_@ c=co:pin]
129− |-
130− ?: =(nnr i)
131− a
132− => .(b (cut 7 [i 1] a))
133− => .(b (rep 5 (mcol (pode 5 4 b) c)))
134− => .(j (sub nnr i))
135− %= $
136− i +(i)
137− a
138− %+ can 7
139− :~ [i (cut 7 [0 i] a)]
140− [1 b]
141− [j (cut 7 [+(i) j] a)]
142− ==
143− ==
144− --
145− ::
146−
147XX document
93XX document
148
94
149### `++ro`
95### `++ro`
150
96
151− ++ ro [0 3 2 1]
97+ ++ ro *{p/@ q/@ r/@ s/@} :: row shifts
152
98
153XX document
99XX document
154
100
docs/system/hoon/library/3f.md+105−94
@@ -31,20 +31,23 @@ An atom.
31Source
31Source
32------
32------
33
33
34− ++ feen :: conceal structure v2
34+ ++ feen :: conceal structure v2
35− |= pyn=@ ^- @
35+ |= pyn/@ ^- @
36− ?: &((gte pyn 0x1.0000) (lte pyn 0xffff.ffff))
36+ ?: &((gte pyn 0x1.0000) (lte pyn 0xffff.ffff))
37− (add 0x1.0000 (fice (sub pyn 0x1.0000)))
37+ (add 0x1.0000 (fice (sub pyn 0x1.0000)))
38− ?: &((gte pyn 0x1.0000.0000) (lte pyn 0xffff.ffff.ffff.ffff))
38+ ?: &((gte pyn 0x1.0000.0000) (lte pyn 0xffff.ffff.ffff.ffff))
39− =+ lo=(dis pyn 0xffff.ffff)
39+ =+ lo=(dis pyn 0xffff.ffff)
40− =+ hi=(dis pyn 0xffff.ffff.0000.0000)
40+ =+ hi=(dis pyn 0xffff.ffff.0000.0000)
41− %+ con hi
41+ %+ con hi
42− (add 0x1.0000 (fice (sub lo 0x1.0000)))
42+ (add 0x1.0000 (fice (sub lo 0x1.0000)))
43− pyn
43+ pyn
44+ ::
45+
44
46
45Examples
47Examples
46--------
48--------
47
49
50+XX
48
51
49------------------------------------------------------------------------
52------------------------------------------------------------------------
50
53
@@ -55,7 +58,7 @@ XX
55Randomly permutes atoms that fit into 17 to 32 bits into one another, and
58Randomly permutes atoms that fit into 17 to 32 bits into one another, and
56randomly permutes the low 32 bits of atoms that fit into 33 to 64 bits;
59randomly permutes the low 32 bits of atoms that fit into 33 to 64 bits;
57otherwise, passes the atom through unchanged. The permutation is the inverse of
60otherwise, passes the atom through unchanged. The permutation is the inverse of
58−the one applied by [`++feen`]().
61+the one applied by `++feen`.
59
62
60Accepts
63Accepts
61-------
64-------
@@ -70,16 +73,17 @@ An atom.
70Source
73Source
71------
74------
72
75
73− ++ fend :: restore structure v2
76+ ++ fend :: restore structure v2
74− |= cry=@ ^- @
77+ |= cry/@ ^- @
75− ?: &((gte cry 0x1.0000) (lte cry 0xffff.ffff))
78+ ?: &((gte cry 0x1.0000) (lte cry 0xffff.ffff))
76− (add 0x1.0000 (teil (sub cry 0x1.0000)))
79+ (add 0x1.0000 (teil (sub cry 0x1.0000)))
77− ?: &((gte cry 0x1.0000.0000) (lte cry 0xffff.ffff.ffff.ffff))
80+ ?: &((gte cry 0x1.0000.0000) (lte cry 0xffff.ffff.ffff.ffff))
78− =+ lo=(dis cry 0xffff.ffff)
81+ =+ lo=(dis cry 0xffff.ffff)
79− =+ hi=(dis cry 0xffff.ffff.0000.0000)
82+ =+ hi=(dis cry 0xffff.ffff.0000.0000)
80− %+ con hi
83+ %+ con hi
81− (add 0x1.0000 (teil (sub lo 0x1.0000)))
84+ (add 0x1.0000 (teil (sub lo 0x1.0000)))
82− cry
85+ cry
86+ ::
83
87
84Examples
88Examples
85--------
89--------
@@ -90,7 +94,6 @@ Examples
90
94
91XX
95XX
92
96
93−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.
94
97
95Accepts
98Accepts
96-------
99-------
@@ -105,15 +108,17 @@ An atom.
105Source
108Source
106------
109------
107
110
108− ++ fice :: adapted from
111+ ++ fice :: adapted from
109− |= nor=@ :: black and rogaway
112+ |= nor/@ :: black and rogaway
110− ^- @ :: "ciphers with
113+ ^- @ :: "ciphers with
111− =+ ^= sel :: arbitrary finite
114+ =+ ^= sel :: arbitrary finite
112− %+ rynd 2 :: domains", 2002
115+ %+ rynd 2 :: domains", 2002
113− %+ rynd 1
116+ %+ rynd 1
114− %+ rynd 0
117+ %+ rynd 0
115− [(mod nor 65.535) (div nor 65.535)]
118+ [(mod nor 65.535) (div nor 65.535)]
116− (add (mul 65.535 -.sel) +.sel)
119+ (add (mul 65.535 -.sel) +.sel)
120+ ::
121+
117
122
118Examples
123Examples
119--------
124--------
@@ -124,7 +129,7 @@ Examples
124
129
125XX
130XX
126
131
127−Applies the reverse of the Feistel-like cipher applied by [`++fice`](). Unlike
132+Applies the reverse of the Feistel-like cipher applied by `++fice`. Unlike
128a conventional Feistel cipher that is its own inverse if keys are used in
133a conventional Feistel cipher that is its own inverse if keys are used in
129reverse order, this Feistel-like cipher uses two moduli that must be swapped
134reverse order, this Feistel-like cipher uses two moduli that must be swapped
130when applying the reverse transformation.
135when applying the reverse transformation.
@@ -142,15 +147,18 @@ An atom.
142Source
147Source
143------
148------
144
149
145− ++ teil :: reverse ++fice
150+ ++ teil :: reverse ++fice
146− |= vip=@
151+ |= vip/@
147− ^- @
152+ ^- @
148− =+ ^= sel
153+ =+ ^= sel
149− %+ rund 0
154+ %+ rund 0
150− %+ rund 1
155+ %+ rund 1
151− %+ rund 2
156+ %+ rund 2
152− [(mod vip 65.535) (div vip 65.535)]
157+ [(mod vip 65.535) (div vip 65.535)]
153− (add (mul 65.535 -.sel) +.sel)
158+ (add (mul 65.535 -.sel) +.sel)
159+ ::
160+
161+
154
162
155Examples
163Examples
156--------
164--------
@@ -161,7 +169,7 @@ Examples
161
169
162XX
170XX
163
171
164−A single round of the Feistel-like cipher [`++fice`](). AES ([`++aesc`]()) is
172+A single round of the Feistel-like cipher `++fice`. AES (`++aesc`) is
165used as the round function.
173used as the round function.
166
174
167Accepts
175Accepts
@@ -178,7 +186,7 @@ Source
178------
186------
179
187
180 ++ rynd :: feistel round
188 ++ rynd :: feistel round
181− |= [n=@ l=@ r=@]
189+ |= [n/@ l/@ r/@]
182 ^- [@ @]
190 ^- [@ @]
183 :- r
191 :- r
184 ?~ (mod n 2)
192 ?~ (mod n 2)
@@ -194,7 +202,7 @@ Examples
194
202
195XX
203XX
196
204
197−A single round of the Feistel-like reverse cipher [`++teil`]().
205+A single round of the Feistel-like reverse cipher `++teil`.
198
206
199Accepts
207Accepts
200-------
208-------
@@ -209,13 +217,13 @@ A cell of two atoms.
209Source
217Source
210------
218------
211
219
212− ++ rund :: reverse round
220+ ++ rund :: reverse round
213− |= [n=@ l=@ r=@]
221+ |= {n/@ l/@ r/@}
214− ^- [@ @]
222+ ^- {@ @}
215− :- r
223+ :- r
216− ?~ (mod n 2)
224+ ?~ (mod n 2)
217− (~(dif fo 65.535) l (en:aesc (snag n raku) r))
225+ (~(dif fo 65.535) l (en:aesc (snag n raku) r))
218− (~(dif fo 65.536) l (en:aesc (snag n raku) r))
226+ (~(dif fo 65.536) l (en:aesc (snag n raku) r))
219
227
220Examples
228Examples
221--------
229--------
@@ -230,12 +238,12 @@ XX
230Accepts
238Accepts
231-------
239-------
232
240
233−A list of atoms of [odor]() [`@ux`]() (hexadecimal).
241+A list of atoms of odor `@ux` (hexadecimal).
234
242
235Produces
243Produces
236--------
244--------
237
245
238−Arbitrary keys for use with [`++aesc`]().
246+Arbitrary keys for use with `++aesc`.
239
247
240Source
248Source
241------
249------
@@ -279,26 +287,28 @@ on the result, pushing it forward. Produces an atom.
279Accepts
287Accepts
280-------
288-------
281
289
282−`pyn` is an [atom]().
290+`pyn` is an atom.
283
291
284
292
285Produces
293Produces
286--------
294--------
287
295
296+An atom.
297+
288Source
298Source
289------
299------
290
300
291 ++ wren :: conceal structure
301 ++ wren :: conceal structure
292− |= pyn=@ ^- @
302+ |= pyn/@ ^- @
293 =+ len=(met 3 pyn)
303 =+ len=(met 3 pyn)
294 ?: =(0 len)
304 ?: =(0 len)
295 0
305 0
296 => .(len (dec len))
306 => .(len (dec len))
297 =+ mig=(zaft (xafo len (cut 3 [len 1] pyn)))
307 =+ mig=(zaft (xafo len (cut 3 [len 1] pyn)))
298 %+ can 3
308 %+ can 3
299− %- flop ^- (list ,[@ @])
309+ %- flop ^- (list {@ @})
300 :- [1 mig]
310 :- [1 mig]
301− |- ^- (list ,[@ @])
311+ |- ^- (list {@ @})
302 ?: =(0 len)
312 ?: =(0 len)
303 ~
313 ~
304 => .(len (dec len))
314 => .(len (dec len))
@@ -306,14 +316,15 @@ Source
306 [[1 mog] $(mig mog)]
316 [[1 mog] $(mig mog)]
307 ::
317 ::
308
318
319+
309Examples
320Examples
310--------
321--------
311
322
312− ~zod/try=> `@ux`(wren:un 'testing')
323+ > `@ux`(wren:un 'testing')
313 0x30.bf6a.b9fe.7d8f
324 0x30.bf6a.b9fe.7d8f
314− ~zod/try=> `@ux`'testing'
325+ > `@ux`'testing'
315 0x67.6e69.7473.6574
326 0x67.6e69.7473.6574
316− ~zod/try=> `@da`(wred:un (wren:un ~2001.2.5))
327+ > `@da`(wred:un (wren:un ~2001.2.5))
317 ~2001.2.5
328 ~2001.2.5
318
329
319------------------------------------------------------------------------
330------------------------------------------------------------------------
@@ -329,7 +340,7 @@ on the result, pushing it forward. Produces an atom.
329Accepts
340Accepts
330-------
341-------
331
342
332−`cry` is an [atom]().
343+`cry` is an atom.
333
344
334Produces
345Produces
335--------
346--------
@@ -338,16 +349,16 @@ Source
338------
349------
339
350
340 ++ wred :: restore structure
351 ++ wred :: restore structure
341− |= cry=@ ^- @
352+ |= cry/@ ^- @
342 =+ len=(met 3 cry)
353 =+ len=(met 3 cry)
343 ?: =(0 len)
354 ?: =(0 len)
344 0
355 0
345 => .(len (dec len))
356 => .(len (dec len))
346 =+ mig=(cut 3 [len 1] cry)
357 =+ mig=(cut 3 [len 1] cry)
347 %+ can 3
358 %+ can 3
348− %- flop ^- (list ,[@ @])
359+ %- flop ^- (list {@ @})
349 :- [1 (xaro len (zart mig))]
360 :- [1 (xaro len (zart mig))]
350− |- ^- (list ,[@ @])
361+ |- ^- (list {@ @})
351 ?: =(0 len)
362 ?: =(0 len)
352 ~
363 ~
353 => .(len (dec len))
364 => .(len (dec len))
@@ -358,11 +369,11 @@ Source
358Examples
369Examples
359--------
370--------
360
371
361− ~zod/try=> (wred:un 0x30.bf6a.b9fe.7d8f)
372+ > (wred:un 0x30.bf6a.b9fe.7d8f)
362 29.113.321.805.538.676
373 29.113.321.805.538.676
363− ~zod/try=> `@t`(wred:un 0x30.bf6a.b9fe.7d8f)
374+ > `@t`(wred:un 0x30.bf6a.b9fe.7d8f)
364 'testing'
375 'testing'
365− ~zod/try=> (wred:un (wren:un 200.038.426))
376+ > (wred:un (wren:un 200.038.426))
366 200.038.426
377 200.038.426
367
378
368------------------------------------------------------------------------
379------------------------------------------------------------------------
@@ -381,14 +392,14 @@ A cell of two atoms, `a` and `b`.
381Source
392Source
382------
393------
383
394
384− ++ xafo |=([a=@ b=@] +((mod (add (dec b) a) 255)))
395+ ++ xafo |=([a/@ b/@] +((mod (add (dec b) a) 255)))
385
396
386Examples
397Examples
387--------
398--------
388
399
389− ~zod/try=> (xafo:un 5 6)
400+ > (xafo:un 5 6)
390 11
401 11
391− ~zod/try=> (xafo:un 256 20)
402+ > (xafo:un 256 20)
392 21
403 21
393
404
394------------------------------------------------------------------------
405------------------------------------------------------------------------
@@ -413,14 +424,14 @@ An atom.
413Source
424Source
414------
425------
415
426
416− ++ xaro |=([a=@ b=@] +((mod (add (dec b) (sub 255 (mod a 255))) 255)))
427+ ++ xaro |=([a/@ b/@] +((mod (add (dec b) (sub 255 (mod a 255))) 255)))
417
428
418Examples
429Examples
419--------
430--------
420
431
421− ~zod/try=> (xaro:un 17 57)
432+ > (xaro:un 17 57)
422 40
433 40
423− ~zod/try=> (xaro:un 265 12)
434+ > (xaro:un 265 12)
424 2
435 2
425
436
426------------------------------------------------------------------------
437------------------------------------------------------------------------
@@ -429,7 +440,7 @@ Examples
429
440
430Look up in 255 sub box
441Look up in 255 sub box
431
442
432−The inverse of [`++zart`](). Looks up a nonzero byte`a\` in a substiution
443+The inverse of `++zart`. Looks up a nonzero byte `a`in a substiution
433box with 255 values, producing a unique nonzero byte.
444box with 255 values, producing a unique nonzero byte.
434
445
435Accepts
446Accepts
@@ -447,7 +458,7 @@ Source
447------
458------
448
459
449 ++ zaft :: forward 255-sbox
460 ++ zaft :: forward 255-sbox
450− |= a=@D
461+ |= a/@D
451 =+ ^= b
462 =+ ^= b
452 0xcc.75bc.86c8.2fb1.9a42.f0b3.79a0.92ca.21f6.1e41.cde5.fcc0.
463 0xcc.75bc.86c8.2fb1.9a42.f0b3.79a0.92ca.21f6.1e41.cde5.fcc0.
453 7e85.51ae.1005.c72d.1246.07e8.7c64.a914.8d69.d9f4.59c2.8038.
464 7e85.51ae.1005.c72d.1246.07e8.7c64.a914.8d69.d9f4.59c2.8038.
@@ -466,11 +477,11 @@ Source
466Examples
477Examples
467--------
478--------
468
479
469− ~zod/try=> (zaft:un 0x12)
480+ > (zaft:un 0x12)
470 42
481 42
471− ~zod/try=> (zaft:un 0xff)
482+ > (zaft:un 0xff)
472 204
483 204
473− ~zod/try=> (zaft:un 0x0)
484+ > (zaft:un 0x0)
474 ! decrement-underflow
485 ! decrement-underflow
475 ! exit
486 ! exit
476
487
@@ -480,7 +491,7 @@ Examples
480
491
481Reverse look up in 255 sub box
492Reverse look up in 255 sub box
482
493
483−The inverse of [`++zaft`](). Looks up the index of a nonzero byte `a` in
494+The inverse of `++zaft`. Looks up the index of a nonzero byte `a` in
484the substitution box with 255 values, producing a unique nonzero byte.
495the substitution box with 255 values, producing a unique nonzero byte.
485
496
486Accepts
497Accepts
@@ -497,7 +508,7 @@ Source
497------
508------
498
509
499 ++ zart :: reverse 255-sbox
510 ++ zart :: reverse 255-sbox
500− |= a=@D
511+ |= a/@D
501 =+ ^= b
512 =+ ^= b
502 0x68.4f07.ea1c.73c9.75c2.efc8.d559.5125.f621.a7a8.8591.5613.
513 0x68.4f07.ea1c.73c9.75c2.efc8.d559.5125.f621.a7a8.8591.5613.
503 dd52.40eb.65a2.60b7.4bcb.1123.ceb0.1bd6.3c84.2906.b164.19b3.
514 dd52.40eb.65a2.60b7.4bcb.1123.ceb0.1bd6.3c84.2906.b164.19b3.
@@ -516,9 +527,9 @@ Source
516Examples
527Examples
517--------
528--------
518
529
519− ~zod/try=> `@ux`(zart:un 204)
530+ > `@ux`(zart:un 204)
520 0xff
531 0xff
521− ~zod/try=> `@ux`(zart:un 42)
532+ > `@ux`(zart:un 42)
522 0x12
533 0x12
523
534
524------------------------------------------------------------------------
535------------------------------------------------------------------------
@@ -527,13 +538,13 @@ Examples
527
538
528Lookup byte in 256 sub box
539Lookup byte in 256 sub box
529
540
530−The inverse of [`++zyrt`](). Looks up a byte `a` in a substituion box
541+The inverse of `++zyrt`. Looks up a byte `a` in a substituion box
531with 256 values, producing a byte.
542with 256 values, producing a byte.
532
543
533Accepts
544Accepts
534-------
545-------
535
546
536−`a` is an [atom]() of one byte in length.
547+`a` is an atom of one byte in length.
537
548
538Produces
549Produces
539--------
550--------
@@ -544,7 +555,7 @@ Source
544------
555------
545
556
546 ++ zyft :: forward 256-sbox
557 ++ zyft :: forward 256-sbox
547− |= a=@D
558+ |= a/@D
548 =+ ^= b
559 =+ ^= b
549 0xbb49.b71f.b881.b402.17e4.6b86.69b5.1647.115f.dddb.7ca5.
560 0xbb49.b71f.b881.b402.17e4.6b86.69b5.1647.115f.dddb.7ca5.
550 8371.4bd5.19a9.b092.605d.0d9b.e030.a0cc.78ba.5706.4d2d.
561 8371.4bd5.19a9.b092.605d.0d9b.e030.a0cc.78ba.5706.4d2d.
@@ -564,11 +575,11 @@ Source
564Examples
575Examples
565--------
576--------
566
577
567− ~zod/try=> (zyft:un 0x12)
578+ > (zyft:un 0x12)
568 57
579 57
569− ~zod/try=> (zyft:un 0x0)
580+ > (zyft:un 0x0)
570 225
581 225
571− ~zod/try=> (zyft:un 0xff)
582+ > (zyft:un 0xff)
572 187
583 187
573
584
574------------------------------------------------------------------------
585------------------------------------------------------------------------
@@ -577,13 +588,13 @@ Examples
577
588
578Reverse lookup byte in 256 sub box
589Reverse lookup byte in 256 sub box
579
590
580−The inverse of [`++zyft`](/doc/hoon/library/2en#++zyft). Looks up a byte `a` in a substituion box
591+The inverse of `++zyft`. Looks up a byte `a` in a substituion box
581with 256 values, producing a byte.
592with 256 values, producing a byte.
582
593
583Accepts
594Accepts
584-------
595-------
585
596
586−`a` is an [atom]() of one byte in length.
597+`a` is an atom of one byte in length.
587
598
588Produces
599Produces
589--------
600--------
@@ -594,7 +605,7 @@ Source
594------
605------
595
606
596 ++ zyrt :: reverse 256-sbox
607 ++ zyrt :: reverse 256-sbox
597− |= a=@D
608+ |= a/@D
598 =+ ^= b
609 =+ ^= b
599 0x9fc8.2753.6e02.8fcf.8b35.2b20.5598.7caa.c9a9.30b0.9b48.
610 0x9fc8.2753.6e02.8fcf.8b35.2b20.5598.7caa.c9a9.30b0.9b48.
600 47ce.6371.80f6.407d.00dd.0aa5.ed10.ecb7.0f5a.5c3a.e605.
611 47ce.6371.80f6.407d.00dd.0aa5.ed10.ecb7.0f5a.5c3a.e605.
@@ -613,11 +624,11 @@ Source
613Examples
624Examples
614--------
625--------
615
626
616− ~zod/try=> `@ux`(zyrt:un 57)
627+ > `@ux`(zyrt:un 57)
617 0x12
628 0x12
618− ~zod/try=> `@ux`(zyrt:un 225)
629+ > `@ux`(zyrt:un 225)
619 0x0
630 0x0
620− ~zod/try=> `@ux`(zyrt:un 187)
631+ > `@ux`(zyrt:un 187)
621 0xff
632 0xff
622
633
623
634
docs/system/hoon/library/3g.md+74−59
@@ -4,34 +4,34 @@
4Noun literal syntax cases
4Noun literal syntax cases
5
5
6Noun literal syntax cases: atoms, jammed nouns, and nestable tuples.
6Noun literal syntax cases: atoms, jammed nouns, and nestable tuples.
7−Parsed and printed using [`++so`]() and [`++co`]() cores.
7+Parsed and printed using `++so` and `++co` cores.
8
8
9Source
9Source
10------
10------
11
11
12− ++ coin $% [%$ p=dime] ::
12+ ++ coin $% {$$ p/dime} ::
13− [%blob p=*] ::
13+ {$blob p/*} ::
14− [%many p=(list coin)] ::
14+ {$many p/(list coin)} ::
15 == ::
15 == ::
16
16
17Examples
17Examples
18--------
18--------
19
19
20− ~zod/try=> `coin`(need (slay '~s1'))
20+ > `coin`(need (slay '~s1'))
21 [%$ p=[p=~.dr q=18.446.744.073.709.551.616]]
21 [%$ p=[p=~.dr q=18.446.744.073.709.551.616]]
22− ~zod/try=> `coin`(need (slay '0x2b59'))
22+ > `coin`(need (slay '0x2b59'))
23 [%$ p=[p=~.ux q=11.097]]
23 [%$ p=[p=~.ux q=11.097]]
24
24
25− ~zod/try=> ~(rend co [%many ~[[%$ %ud 1] [%$ %tas 'a'] [%$ %s -2]]])
25+ > ~(rend co [%many ~[[%$ %ud 1] [%$ %tas 'a'] [%$ %s -2]]])
26 "._1_a_-2__"
26 "._1_a_-2__"
27− ~zod/try=> ._1_a_-2__
27+ > ._1_a_-2__
28 [1 %a -2]
28 [1 %a -2]
29
29
30− ~zod/try=> `@uv`(jam [3 4])
30+ > `@uv`(jam [3 4])
31 0v2cd1
31 0v2cd1
32− ~zod/try=> (slay '~02cd1')
32+ > (slay '~02cd1')
33 [~ [%blob p=[3 4]]]
33 [~ [%blob p=[3 4]]]
34− ~zod/try=> ~02cd1
34+ > ~02cd1
35 [3 4]
35 [3 4]
36
36
37
37
@@ -41,20 +41,21 @@ Examples
41
41
42Odor-atom pair
42Odor-atom pair
43
43
44−Used in [`++coin`](). Convenience methods [`++scot`]() and [`++scow`]() (in
44+Used in `++coin`. Convenience methods `++scot` and `++scow` (in
45−Section 2eL) print dimes as [`++cord`]() and [`++tape`](), respectively.
45+Section 2eL) print dimes as `++cord` and `++tape`, respectively.
46−[`++slat`](), [`++slav`](), and [`++slaw`]() are used to parse atoms of
46+`++slat`, `++slav`, and `++slaw` are used to parse atoms of
47−specific [odor]()s.
47+specific odors.
48
48
49Source
49Source
50------
50------
51
51
52− ++ dime ,[p=@ta q=@] ::
52+ ++ dime {p/@ta q/@} ::
53+
53
54
54Examples
55Examples
55--------
56--------
56
57
57− ~zod/try=> +>:(slay '0x123')
58+ > +>:(slay '0x123')
58 p=[p=~.ux q=291]
59 p=[p=~.ux q=291]
59
60
60
61
@@ -69,16 +70,17 @@ Optional result `p` and parsing continuation `q`.
69Source
70Source
70------
71------
71
72
72− ++ edge ,[p=hair q=(unit ,[p=* q=nail])] :: parsing output
73+ ++ hair {p/@ud q/@ud} :: parsing trace
74+
73
75
74Examples
76Examples
75--------
77--------
76
78
77−See also: Section 2eD, [`++rule`]()
79+See also: Section 2eD, `++rule`
78
80
79− ~zod/try=> *edge
81+ > *edge
80 [p=[p=0 q=0] q=~]
82 [p=[p=0 q=0] q=~]
81− ~zod/try=> (tall:vast [1 1] "a b")
83+ > (tall:vast [1 1] "a b")
82 [p=[p=1 q=2] q=[~ [p=[%cnzz p=~[%a]] q=[p=[p=1 q=2] q=" b"]]]]
84 [p=[p=1 q=2] q=[~ [p=[%cnzz p=~[%a]] q=[p=[p=1 q=2] q=" b"]]]]
83
85
84
86
@@ -93,19 +95,20 @@ A pair of two [`@ud`]() used in parsing indicating line and column number.
93Source
95Source
94------
96------
95
97
96− ++ hair ,[p=@ud q=@ud] :: parsing trace
98+ ++ hair {p/@ud q/@ud} :: parsing trace
99+
97
100
98Examples
101Examples
99--------
102--------
100
103
101− ~zod/try=> *hair
104+ > *hair
102 [p=0 q=0]
105 [p=0 q=0]
103
106
104− ~zod/try=> `hair`[1 1] :: parsing starts at [1 1] as a convention.
107+ > `hair`[1 1] :: parsing starts at [1 1] as a convention.
105 [p=1 q=1]
108 [p=1 q=1]
106− ~zod/try=> ((plus ace) [1 1] " --")
109+ > ((plus ace) [1 1] " --")
107 [p=[p=1 q=4] q=[~ u=[p=[~~. " "] q=[p=[p=1 q=4] q="--"]]]]
110 [p=[p=1 q=4] q=[~ u=[p=[~~. " "] q=[p=[p=1 q=4] q="--"]]]]
108− ~zod/try=> `hair`p:((plus ace) [1 1] " --")
111+ > `hair`p:((plus ace) [1 1] " --")
109 [p=1 q=4]
112 [p=1 q=4]
110
113
111
114
@@ -120,21 +123,25 @@ Mold generator for an edge
120Source
123Source
121------
124------
122
125
123− ++ like |* a=_,* :: generic edge
126+ ++ like |* a/$-(* *) :: generic edge
127+ |= b/_`*`[(hair) ~] ::
128+ :- p=(hair -.b) ::
129+ ^= q ::
124 ?@ +.b ~ ::
130 ?@ +.b ~ ::
125 :- ~ ::
131 :- ~ ::
126 u=[p=(a +>-.b) q=[p=(hair -.b) q=(tape +.b)]] ::
132 u=[p=(a +>-.b) q=[p=(hair -.b) q=(tape +.b)]] ::
127
133
134+
128Examples
135Examples
129--------
136--------
130− ~zod/try=> *(like char)
137+ > *(like char)
131 [p=[p=0 q=0] q=~]
138 [p=[p=0 q=0] q=~]
132
139
133− ~zod/try=> (ace [1 1] " a")
140+ > (ace [1 1] " a")
134 [p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q="a"]]]]
141 [p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q="a"]]]]
135− ~zod/try=> `(like char)`(ace [1 1] " a")
142+ > `(like char)`(ace [1 1] " a")
136 [p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q="a"]]]]
143 [p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q="a"]]]]
137− ~zod/try=> `(like ,@)`(ace [1 1] " a")
144+ > `(like ,@)`(ace [1 1] " a")
138 [p=[p=1 q=2] q=[~ [p=32 q=[p=[p=1 q=2] q="a"]]]]
145 [p=[p=1 q=2] q=[~ [p=32 q=[p=[p=1 q=2] q="a"]]]]
139
146
140
147
@@ -149,14 +156,15 @@ Indicates parsing position `p`, and remaining text to be parsed `q`.
149Source
156Source
150------
157------
151
158
152− ++ nail ,[p=hair q=tape] :: parsing input
159+ ++ nail {p/hair q/tape} :: parsing input
160+
153
161
154Examples
162Examples
155--------
163--------
156
164
157− ~zod/try=> +<:;~(plug cab cab)
165+ > +<:;~(plug cab cab)
158 c=tub=[p=[p=0 q=0] q=""]
166 c=tub=[p=[p=0 q=0] q=""]
159− ~zod/try=> :: tub is a ++nail
167+ > :: tub is a ++nail
160
168
161
169
162
170
@@ -165,18 +173,19 @@ Examples
165
173
166Filesystem path
174Filesystem path
167
175
168−A `++path` is a list of [`++span`]()s aka [`@ta`](). Used in
176+A `++path` is a list of `++span`s aka `@ta`. Used in
169`%clay` and `%eyre` extensively.
177`%clay` and `%eyre` extensively.
170
178
171Source
179Source
172------
180------
173
181
174− ++ path (list span) :: filesys location
182+ ++ path (list knot) :: filesys location
183+
175
184
176Examples
185Examples
177--------
186--------
178
187
179− ~zod/try=> `path`"abc"
188+ > `path`"abc"
180 /a/b/c
189 /a/b/c
181
190
182
191
@@ -187,20 +196,21 @@ Examples
187Parsing range
196Parsing range
188
197
189Mostly used for stacktraces. A `++pint` is a pair of
198Mostly used for stacktraces. A `++pint` is a pair of
190−[`++hair`](), indicating from `p` to `q`.
199+`++hair`, indicating from `p` to `q`.
191
200
192Source
201Source
193------
202------
194
203
195− ++ pint ,[p=[p=@ q=@] q=[p=@ q=@]] :: line/column range
204+ ++ pint {p/{p/@ q/@} q/{p/@ q/@}} :: line+column range
205+
196
206
197Examples
207Examples
198--------
208--------
199
209
200− ~zod/try=> !:(!!)
210+ > !:(!!)
201 ! /~zod/try/~2014.9.20..01.22.04..52e3/:<[1 4].[1 6]>
211 ! /~zod/try/~2014.9.20..01.22.04..52e3/:<[1 4].[1 6]>
202− ~zod/try=> :: !! always produces a crash
212+ > :: !! always produces a crash
203− ~zod/try=> `pint`[[1 4] [1 6]]
213+ > `pint`[[1 4] [1 6]]
204 [p=[p=1 q=4] q=[p=1 q=6]]
214 [p=[p=1 q=4] q=[p=1 q=6]]
205
215
206
216
@@ -217,19 +227,20 @@ that parsing rules match this with `_`.
217Source
227Source
218------
228------
219
229
220− ++ rule |=(tub=nail `edge`[p.tub ~ ~ tub]) :: parsing rule
230+ ++ rule _|=(nail *edge) :: parsing rule
231+
221
232
222Examples
233Examples
223--------
234--------
224
235
225− ~zod/try=> *rule
236+ > *rule
226 [p=[p=0 q=0] q=[~ [p=0 q=[p=[p=0 q=0] q=""]]]]
237 [p=[p=0 q=0] q=[~ [p=0 q=[p=[p=0 q=0] q=""]]]]
227
238
228− ~zod/try=> ^+(rule [|=(a=nail [p.a ~])]:|6)
239+ > ^+(rule [|=(a=nail [p.a ~])]:|6)
229 <1.dww [tub=[p=[p=@ud q=@ud] q=""] <101.jzo 1.ypj %164>]>
240 <1.dww [tub=[p=[p=@ud q=@ud] q=""] <101.jzo 1.ypj %164>]>
230− ~zod/try=> (^+(rule [|=(a=nail [p.a ~ u=['a' a]])]:|6) [1 1] "hi")
241+ > (^+(rule [|=(a=nail [p.a ~ u=['a' a]])]:|6) [1 1] "hi")
231 [p=[p=1 q=1] q=[~ [p=97 q=[p=[p=1 q=1] q="hi"]]]]
242 [p=[p=1 q=1] q=[~ [p=97 q=[p=[p=1 q=1] q="hi"]]]]
232− ~zod/try=> ([|=(a=nail [p.a ~ u=['a' a]])]:|6 [1 1] "hi")
243+ > ([|=(a=nail [p.a ~ u=['a' a]])]:|6 [1 1] "hi")
233 [[p=1 q=1] ~ u=['a' p=[p=1 q=1] q="hi"]]
244 [[p=1 q=1] ~ u=['a' p=[p=1 q=1] q="hi"]]
234
245
235
246
@@ -239,19 +250,20 @@ Examples
239
250
240Stack trace line
251Stack trace line
241
252
242−A [`++spot`]() is what we print after crashing.
253+A `++spot` is what we print after crashing.
243
254
244Source
255Source
245------
256------
246
257
247− ++ spot ,[p=path q=pint] :: range in file
258+ ++ spot {p/path q/pint} :: range in file
259+
248
260
249Examples
261Examples
250--------
262--------
251
263
252− ~zod/try=> :into /=main=/bin/fail/hoon '!: !!'
264+ > :into /=main=/bin/fail/hoon '!: !!'
253 + /~zod/main/359/bin/fail/hoon
265 + /~zod/main/359/bin/fail/hoon
254− ~zod/try=> :fail
266+ > :fail
255 ! /~zod/main/~2014.9.22..18.40.56..ef04/bin/fail/:<[1 5].[1 7]>
267 ! /~zod/main/~2014.9.22..18.40.56..ef04/bin/fail/:<[1 5].[1 7]>
256 ! exit
268 ! exit
257
269
@@ -268,19 +280,22 @@ failure with stack trace (`%2`).
268Source
280Source
269------
281------
270
282
271− ++ toon $% [%0 p=*] :: success
283+ ++ toon $% {$0 p/*} :: success
284+ {$1 p/(list)} :: blocks
285+ {$2 p/(list tank)} :: stack trace
286+ == ::
287+
272
288
273Examples
289Examples
274--------
290--------
275− ~zod/try=> (mock [[20 21] 0 3] ,~)
291+ > (mock [[20 21] 0 3] $~)
276 [%0 p=21]
292 [%0 p=21]
277−
278− ~zod/try=> (mock [[0] !=(.^(cy//=main/1))] ,~)
293+ > (mock [[0] !=(.^(cy//=main/1))] ,~)
279 [%1 p=~[[31.075 1.685.027.454 1.852.399.981 49 0]]]
294 [%1 p=~[[31.075 1.685.027.454 1.852.399.981 49 0]]]
280− ~zod/try=> (path [31.075 1.685.027.454 1.852.399.981 49 0])
295+ > (path [31.075 1.685.027.454 1.852.399.981 49 0])
281 /cy/~zod/main/1
296 /cy/~zod/main/1
282
297
283− ~zod/try=> (mock [[1 2] !=(!:(+(.)))] ,~)
298+ > (mock [[1 2] !=(!:(+(.)))] ,~)
284 [%2 p=~[[%leaf p="/~zod/try/~2014.9.23..18.34.32..d3c5/:<[1 20].[1 24]>"]]]
299 [%2 p=~[[%leaf p="/~zod/try/~2014.9.23..18.34.32..d3c5/:<[1 20].[1 24]>"]]]
285
300
286
301
@@ -302,7 +317,7 @@ Examples
302
317
303See also: [`++edge`]()
318See also: [`++edge`]()
304
319
305− ~zod/try=> (wide:vast [1 1] "(add 2 2)")
320+ > (wide:vast [1 1] "(add 2 2)")
306 [ p=[p=1 q=10]
321 [ p=[p=1 q=10]
307 q
322 q
308 [ ~
323 [ ~
@@ -311,7 +326,7 @@ See also: [`++edge`]()
311 ]
326 ]
312 ]
327 ]
313 ]
328 ]
314− ~zod/try=> (wonk (wide:vast [1 1] "(add 2 2)"))
329+ > (wonk (wide:vast [1 1] "(add 2 2)"))
315 [%cnhp p=[%cnzz p=~[%add]] q=~[[%dtzy p=%ud q=2] [%dtzy p=%ud q=2]]]
330 [%cnhp p=[%cnzz p=~[%add]] q=~[[%dtzy p=%ud q=2] [%dtzy p=%ud q=2]]]
316
331
317
332
docs/system/hoon/library/4a.md+72−69
@@ -1,43 +1,43 @@
1# 4a: exotic bases
1# 4a: exotic bases
2### `++po`
2### `++po`
3
3
4−++ po
4+ ++ po
5− ~/ %po
5+ ~/ %po
6− =+ :- ^= sis :: prefix syllables
6+ =+ :- ^= sis :: prefix syllables
7− 'dozmarbinwansamlitsighidfidlissogdirwacsabwissib\
7+ 'dozmarbinwansamlitsighidfidlissogdirwacsabwissib\
8− /rigsoldopmodfoglidhopdardorlorhodfolrintogsilmir\
8+ /rigsoldopmodfoglidhopdardorlorhodfolrintogsilmir\
9− /holpaslacrovlivdalsatlibtabhanticpidtorbolfosdot\
9+ /holpaslacrovlivdalsatlibtabhanticpidtorbolfosdot\
10− /losdilforpilramtirwintadbicdifrocwidbisdasmidlop\
10+ /losdilforpilramtirwintadbicdifrocwidbisdasmidlop\
11− /rilnardapmolsanlocnovsitnidtipsicropwitnatpanmin\
11+ /rilnardapmolsanlocnovsitnidtipsicropwitnatpanmin\
12− /ritpodmottamtolsavposnapnopsomfinfonbanporworsip\
12+ /ritpodmottamtolsavposnapnopsomfinfonbanporworsip\
13− /ronnorbotwicsocwatdolmagpicdavbidbaltimtasmallig\
13+ /ronnorbotwicsocwatdolmagpicdavbidbaltimtasmallig\
14− /sivtagpadsaldivdactansidfabtarmonranniswolmispal\
14+ /sivtagpadsaldivdactansidfabtarmonranniswolmispal\
15− /lasdismaprabtobrollatlonnodnavfignomnibpagsopral\
15+ /lasdismaprabtobrollatlonnodnavfignomnibpagsopral\
16− /bilhaddocridmocpacravripfaltodtiltinhapmicfanpat\
16+ /bilhaddocridmocpacravripfaltodtiltinhapmicfanpat\
17− /taclabmogsimsonpinlomrictapfirhasbosbatpochactid\
17+ /taclabmogsimsonpinlomrictapfirhasbosbatpochactid\
18− /havsaplindibhosdabbitbarracparloddosbortochilmac\
18+ /havsaplindibhosdabbitbarracparloddosbortochilmac\
19− /tomdigfilfasmithobharmighinradmashalraglagfadtop\
19+ /tomdigfilfasmithobharmighinradmashalraglagfadtop\
20− /mophabnilnosmilfopfamdatnoldinhatnacrisfotribhoc\
20+ /mophabnilnosmilfopfamdatnoldinhatnacrisfotribhoc\
21− /nimlarfitwalrapsarnalmoslandondanladdovrivbacpol\
21+ /nimlarfitwalrapsarnalmoslandondanladdovrivbacpol\
22− /laptalpitnambonrostonfodponsovnocsorlavmatmipfap'
22+ /laptalpitnambonrostonfodponsovnocsorlavmatmipfap'
23− ^= dex :: suffix syllables
23+ ^= dex :: suffix syllables
24− 'zodnecbudwessevpersutletfulpensytdurwepserwylsun\
24+ 'zodnecbudwessevpersutletfulpensytdurwepserwylsun\
25− /rypsyxdyrnuphebpeglupdepdysputlughecryttyvsydnex\
25+ /rypsyxdyrnuphebpeglupdepdysputlughecryttyvsydnex\
26− /lunmeplutseppesdelsulpedtemledtulmetwenbynhexfeb\
26+ /lunmeplutseppesdelsulpedtemledtulmetwenbynhexfeb\
27− /pyldulhetmevruttylwydtepbesdexsefwycburderneppur\
27+ /pyldulhetmevruttylwydtepbesdexsefwycburderneppur\
28− /rysrebdennutsubpetrulsynregtydsupsemwynrecmegnet\
28+ /rysrebdennutsubpetrulsynregtydsupsemwynrecmegnet\
29− /secmulnymtevwebsummutnyxrextebfushepbenmuswyxsym\
29+ /secmulnymtevwebsummutnyxrextebfushepbenmuswyxsym\
30− /selrucdecwexsyrwetdylmynmesdetbetbeltuxtugmyrpel\
30+ /selrucdecwexsyrwetdylmynmesdetbetbeltuxtugmyrpel\
31− /syptermebsetdutdegtexsurfeltudnuxruxrenwytnubmed\
31+ /syptermebsetdutdegtexsurfeltudnuxruxrenwytnubmed\
32− /lytdusnebrumtynseglyxpunresredfunrevrefmectedrus\
32+ /lytdusnebrumtynseglyxpunresredfunrevrefmectedrus\
33− /bexlebduxrynnumpyxrygryxfeptyrtustyclegnemfermer\
33+ /bexlebduxrynnumpyxrygryxfeptyrtustyclegnemfermer\
34− /tenlusnussyltecmexpubrymtucfyllepdebbermughuttun\
34+ /tenlusnussyltecmexpubrymtucfyllepdebbermughuttun\
35− /bylsudpemdevlurdefbusbeprunmelpexdytbyttyplevmyl\
35+ /bylsudpemdevlurdefbusbeprunmelpexdytbyttyplevmyl\
36− /wedducfurfexnulluclennerlexrupnedlecrydlydfenwel\
36+ /wedducfurfexnulluclennerlexrupnedlecrydlydfenwel\
37− /nydhusrelrudneshesfetdesretdunlernyrsebhulryllud\
37+ /nydhusrelrudneshesfetdesretdunlernyrsebhulryllud\
38− /remlysfynwerrycsugnysnyllyndyndemluxfedsedbecmun\
38+ /remlysfynwerrycsugnysnyllyndyndemluxfedsedbecmun\
39− /lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes'
39+ /lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes'
40− |%
40+ |%
41
41
42Provides the phonetic syllables and name generators for the Urbit naming
42Provides the phonetic syllables and name generators for the Urbit naming
43system. The two faces, `sis` and `dex` are available to the arms
43system. The two faces, `sis` and `dex` are available to the arms
@@ -55,30 +55,30 @@ Produces the byte of the right-hand syllable `a`.
55Accepts
55Accepts
56-------
56-------
57
57
58−`a` is an [atom]().
58+`a` is an atom.
59
59
60Produces
60Produces
61--------
61--------
62
62
63−A [`++unit`]() of an atom.
63+A `++unit` of an atom.
64
64
65Source
65Source
66------
66------
67
67
68− ++ ind ~/ %ind :: parse prefix
68+ ++ ind ~/ %ind :: parse suffix
69− |= a=@
69+ |= a/@tas
70 =+ b=0
70 =+ b=0
71− |- ^- (unit ,@)
71+ |- ^- (unit @)
72 ?:(=(256 b) ~ ?:(=(a (tod b)) [~ b] $(b +(b))))
72 ?:(=(256 b) ~ ?:(=(a (tod b)) [~ b] $(b +(b))))
73
73
74Examples
74Examples
75--------
75--------
76
76
77− ~zod/try=> (ind:po 'zod')
77+ > (ind:po 'zod')
78 [~ 0]
78 [~ 0]
79− ~zod/try=> (ind:po 'zam')
79+ > (ind:po 'zam')
80 ~
80 ~
81− ~zod/try=> (ind:po 'del')
81+ > (ind:po 'del')
82 [~ 37]
82 [~ 37]
83
83
84------------------------------------------------------------------------
84------------------------------------------------------------------------
@@ -92,31 +92,32 @@ Produces the byte of the left-hand phonetic syllable `b`.
92Accepts
92Accepts
93-------
93-------
94
94
95−`a` is an [atom]().
95+`a` is an atom.
96
96
97Produces
97Produces
98--------
98--------
99−A [`++unit`]() of an atom.
99+A `++unit` of an atom.
100
100
101Source
101Source
102------
102------
103
103
104− ++ ins ~/ %ins :: parse suffix
104+ ++ ins ~/ %ins :: parse prefix
105− |= a=@
105+ |= a/@tas
106 =+ b=0
106 =+ b=0
107− |- ^- (unit ,@)
107+ |- ^- (unit @)
108 ?:(=(256 b) ~ ?:(=(a (tos b)) [~ b] $(b +(b))))
108 ?:(=(256 b) ~ ?:(=(a (tos b)) [~ b] $(b +(b))))
109
109
110+
110Examples
111Examples
111--------
112--------
112
113
113− ~zod/try=> (ins:po 'mar')
114+ > (ins:po 'mar')
114 [~ 1]
115 [~ 1]
115− ~zod/try=> (ins:po 'son')
116+ > (ins:po 'son')
116 [~ 164]
117 [~ 164]
117− ~zod/try=> (ins:po 'pit')
118+ > (ins:po 'pit')
118 [~ 242]
119 [~ 242]
119− ~zod/try=> (ins:po 'pok')
120+ > (ins:po 'pok')
120 ~
121 ~
121
122
122------------------------------------------------------------------------
123------------------------------------------------------------------------
@@ -126,7 +127,7 @@ Examples
126Fetch prefix
127Fetch prefix
127
128
128Produces the phonetic prefix syllable from index `a` within `dex` as an
129Produces the phonetic prefix syllable from index `a` within `dex` as an
129−[atom]().
130+atom.
130
131
131Accepts
132Accepts
132-------
133-------
@@ -142,23 +143,25 @@ An atom.
142Source
143Source
143------
144------
144
145
145− ++ tod ~/ %tod :: fetch prefix
146+ ++ tod ~/ %tod :: fetch suffix
146− |=(a=@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] dex)))
147+ |=(a/@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] dex)))
148+
149+
147
150
148Examples
151Examples
149--------
152--------
150
153
151− ~zod/try=> `@t`(tod:po 1)
154+ > `@t`(tod:po 1)
152 'nec'
155 'nec'
153− ~zod/try=> `@t`(tod:po 98)
156+ > `@t`(tod:po 98)
154 'dec'
157 'dec'
155− ~zod/try=> `@t`(tod:po 0)
158+ > `@t`(tod:po 0)
156 'zod'
159 'zod'
157− ~zod/try=> `@t`(tod:po 150)
160+ > `@t`(tod:po 150)
158 'ryg'
161 'ryg'
159− ~zod/try=> `@t`(tod:po 255)
162+ > `@t`(tod:po 255)
160 'fes'
163 'fes'
161− ~zod/try=> `@t`(tod:po 256)
164+ > `@t`(tod:po 256)
162 ! exit
165 ! exit
163
166
164------------------------------------------------------------------------
167------------------------------------------------------------------------
@@ -168,7 +171,7 @@ Examples
168Fetch suffix
171Fetch suffix
169
172
170Produces the phonetic prefix syllable from index `a` within `sis` as an
173Produces the phonetic prefix syllable from index `a` within `sis` as an
171−[atom]().
174+atom.
172
175
173Accepts
176Accepts
174-------
177-------
@@ -184,18 +187,18 @@ Source
184------
187------
185
188
186 ++ tos ~/ %tos :: fetch suffix
189 ++ tos ~/ %tos :: fetch suffix
187− |=(a=@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] sis)))
190+ |=(a/@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] sis)))
188
191
189Examples
192Examples
190--------
193--------
191
194
192− ~zod/try=> `@t`(tos:po 0)
195+ > `@t`(tos:po 0)
193 'doz'
196 'doz'
194− ~zod/try=> `@t`(tos:po 120)
197+ > `@t`(tos:po 120)
195 'fab'
198 'fab'
196− ~zod/try=> `@t`(tos:po 43)
199+ > `@t`(tos:po 43)
197 'pid'
200 'pid'
198− ~zod/try=> `@t`(tos:po 253)
201+ > `@t`(tos:po 253)
199 'mat'
202 'mat'
200
203
201------------------------------------------------------------------------
204------------------------------------------------------------------------
docs/system/hoon/library/4b.md+303−300
@@ -1,4 +1,154 @@
1# 4b: text processing
1# 4b: text processing
2+### `++at`
3+
4+ ++ at
5+ |_ a/@
6+
7+XX document
8+
9+### `++r`
10+
11+ ++ r
12+ ?: ?& (gte (met 3 a) 2)
13+ |-
14+ ?: =(0 a)
15+ &
16+ =+ vis=(end 3 1 a)
17+ ?& ?|(=('-' vis) ?&((gte vis 'a') (lte vis 'z')))
18+ $(a (rsh 3 1 a))
19+ ==
20+ ==
21+ rtam
22+ ?: (lte (met 3 a) 2)
23+ rud
24+ rux
25+ ::
26+
27+XX document
28+
29+### `++rf`
30+
31+ ++ rf `tape`[?-(a $& '&', $| '|', * !!) ~]
32+
33+
34+XX document
35+
36+### `++rn`
37+
38+ ++ rn `tape`[?>(=(0 a) '~') ~]
39+
40+XX document
41+
42+### `++rt`
43+
44+ ++ rt `tape`['\'' (weld (mesc (trip a)) `tape`['\'' ~])]
45+
46+XX document
47+
48+### `++rta`
49+
50+ ++ rta rt
51+
52+XX document
53+
54+### `++rtam`
55+
56+ ++ rtam `tape`['%' (trip a)]
57+
58+XX document
59+
60+### `++rub`
61+
62+ ++ rub `tape`['0' 'b' (rum 2 ~ |=(b/@ (add '0' b)))]
63+
64+XX document
65+
66+### `++rud`
67+
68+ ++ rud (rum 10 ~ |=(b/@ (add '0' b)))
69+
70+XX document
71+
72+### `++rum`
73+
74+ ++ rum
75+ |= {b/@ c/tape d/$-(@ @)}
76+ ^- tape
77+ ?: =(0 a)
78+ [(d 0) c]
79+ =+ e=0
80+ |- ^- tape
81+ ?: =(0 a)
82+ c
83+ =+ f=&(!=(0 e) =(0 (mod e ?:(=(10 b) 3 4))))
84+ %= $
85+ a (div a b)
86+ c [(d (mod a b)) ?:(f [?:(=(10 b) ',' '-') c] c)]
87+ e +(e)
88+ ==
89+ ::
90+
91+
92+XX document
93+
94+### `++rup`
95+
96+ ++ rup
97+ =+ b=(met 3 a)
98+ ^- tape
99+ :- '-'
100+ |- ^- tape
101+ ?: (gth (met 5 a) 1)
102+ %+ weld
103+ $(a (rsh 5 1 a), b (sub b 4))
104+ `tape`['-' '-' $(a (end 5 1 a), b 4)]
105+ ?: =(0 b)
106+ ['~' ~]
107+ ?: (lte b 1)
108+ (trip (tos:po a))
109+ |- ^- tape
110+ ?: =(2 b)
111+ =+ c=(rsh 3 1 a)
112+ =+ d=(end 3 1 a)
113+ (weld (trip (tod:po c)) (trip (tos:po (mix c d))))
114+ =+ c=(rsh 3 2 a)
115+ =+ d=(end 3 2 a)
116+ (weld ^$(a c, b (met 3 c)) `tape`['-' $(a (mix c d), b 2)])
117+ ::
118+
119+XX document
120+
121+### `++ruv`
122+
123+ ++ ruv
124+ ^- tape
125+ :+ '0'
126+ 'v'
127+ %^ rum
128+ 64
129+ ~
130+ |= b/@
131+ ?: =(63 b)
132+ '+'
133+ ?: =(62 b)
134+ '-'
135+ ?:((lth b 26) (add 65 b) ?:((lth b 52) (add 71 b) (sub b 4)))
136+ ::
137+
138+XX document
139+
140+### `++rux`
141+
142+ ++ rux `tape`['0' 'x' (rum 16 ~ |=(b/@ (add b ?:((lth b 10) 48 87))))]
143+ --
144+ :::::::::::::::::::::::::::::::::::::::::::::::::::::: ::
145+
146+XX document
147+
148+------------------------------------------------------------------------
149+
150+
151+***
2
152
3### `++cass`
153### `++cass`
4
154
@@ -20,21 +170,20 @@ Source
20------
170------
21
171
22 ++ cass :: lowercase
172 ++ cass :: lowercase
23− |= vib=tape
173+ |= vib/tape
24 %+ rap 3
174 %+ rap 3
25− (turn vib |=(a=@ ?.(&((gte a 'A') (lte a 'Z')) a (add 32 a))))
175+ (turn vib |=(a/@ ?.(&((gte a 'A') (lte a 'Z')) a (add 32 a))))
26− ::
27
176
28Examples
177Examples
29--------
178--------
30
179
31− ~zod/try=> (cass "john doe")
180+ > (cass "john doe")
32 7.309.170.810.699.673.450
181 7.309.170.810.699.673.450
33− ~zod/try=> `cord`(cass "john doe")
182+ > `cord`(cass "john doe")
34 'john doe'
183 'john doe'
35− ~zod/try=> (cass "abc, 123, !@#")
184+ > (cass "abc, 123, !@#")
36 2.792.832.775.110.938.439.066.079.945.313
185 2.792.832.775.110.938.439.066.079.945.313
37− ~zod/try=> `cord`(cass "abc, 123, !@#")
186+ > `cord`(cass "abc, 123, !@#")
38 'abc, 123, !@#'
187 'abc, 123, !@#'
39
188
40
189
@@ -43,7 +192,7 @@ Examples
43
192
44Tape to cord
193Tape to cord
45
194
46−Produce a [`++cord`]() from a [`++tape`]().
195+Produce a `++cord` from a `++tape`.
47
196
48Accepts
197Accepts
49-------
198-------
@@ -63,11 +212,11 @@ Source
63Examples
212Examples
64--------
213--------
65
214
66− ~zod/try=> (crip "john doe")
215+ > (crip "john doe")
67 'john doe'
216 'john doe'
68− ~zod/try=> (crip "abc 123 !@#")
217+ > (crip "abc 123 !@#")
69 'abc 123 !@#'
218 'abc 123 !@#'
70− ~zod/try=> `@ud`(crip "abc")
219+ > `@ud`(crip "abc")
71 6.513.249
220 6.513.249
72
221
73
222
@@ -76,8 +225,8 @@ Examples
76
225
77To uppercase
226To uppercase
78
227
79−Turn all occurances of lowercase letters in any [`++tape`]() into uppercase
228+Turn all occurances of lowercase letters in any `++tape` into uppercase
80−letters, as a [`++cord`]().
229+letters, as a `++cord`.
81
230
82Accepts
231Accepts
83-------
232-------
@@ -102,13 +251,13 @@ Source
102Examples
251Examples
103--------
252--------
104
253
105− ~zod/try=> (cuss "john doe")
254+ > (cuss "john doe")
106 'JOHN DOE'
255 'JOHN DOE'
107− ~zod/try=> (cuss "abc ABC 123 !@#")
256+ > (cuss "abc ABC 123 !@#")
108 'ABC ABC 123 !@#'
257 'ABC ABC 123 !@#'
109− ~zod/try=> `@ud`(cuss "abc")
258+ > `@ud`(cuss "abc")
110 4.407.873
259 4.407.873
111− ~zod/try=> (cuss "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsQqRrVvWwXxYyZz")
260+ > (cuss "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsQqRrVvWwXxYyZz")
112 'AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSQQRRVVWWXXYYZZ'
261 'AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSQQRRVVWWXXYYZZ'
113
262
114
263
@@ -117,12 +266,12 @@ Examples
117
266
118Escape special chars
267Escape special chars
119
268
120−Escape special characters, used in [`++show`](/doc/hoon/library/2ez#++show)
269+Escape special characters, used in `++show`.
121
270
122Accepts
271Accepts
123-------
272-------
124
273
125−`vib` is a [`++tape`]().
274+`vib` is a `++tape`.
126
275
127Produces
276Produces
128--------
277--------
@@ -133,13 +282,13 @@ Source
133------
282------
134
283
135 ++ mesc :: ctrl code escape
284 ++ mesc :: ctrl code escape
136− |= vib=tape
285+ |= vib/tape
137 ^- tape
286 ^- tape
138 ?~ vib
287 ?~ vib
139 ~
288 ~
140 ?: =('\\' i.vib)
289 ?: =('\\' i.vib)
141 ['\\' '\\' $(vib t.vib)]
290 ['\\' '\\' $(vib t.vib)]
142− ?: ?|((gth i.vib 126) (lth i.vib 32) =(39 i.vib))
291+ ?: ?|((gth i.vib 126) (lth i.vib 32) =(`@`39 i.vib))
143 ['\\' (welp ~(rux at i.vib) '/' $(vib t.vib))]
292 ['\\' (welp ~(rux at i.vib) '/' $(vib t.vib))]
144 [i.vib $(vib t.vib)]
293 [i.vib $(vib t.vib)]
145 ::
294 ::
@@ -147,11 +296,11 @@ Source
147Examples
296Examples
148--------
297--------
149
298
150− /~zod/try=> (mesc "ham lus")
299+ /> (mesc "ham lus")
151 "ham lus"
300 "ham lus"
152− /~zod/try=> (mesc "bas\\hur")
301+ /> (mesc "bas\\hur")
153 "bas\\\\hur"
302 "bas\\\\hur"
154− /~zod/try=> (mesc "as'saß")
303+ /> (mesc "as'saß")
155 "as\0x27/sa\0xc3/\0x9f/"
304 "as\0x27/sa\0xc3/\0x9f/"
156
305
157
306
@@ -161,7 +310,7 @@ Examples
161
310
162Prepend `n` times
311Prepend `n` times
163
312
164−Add `a` repetitions of character `b` to the head of [`++tape`]() `c`.
313+Add `a` repetitions of character `b` to the head of `++tape` `c`.
165
314
166Accepts
315Accepts
167-------
316-------
@@ -179,7 +328,7 @@ Source
179------
328------
180
329
181 ++ runt :: prepend repeatedly
330 ++ runt :: prepend repeatedly
182− |= [[a=@ b=@] c=tape]
331+ |= [[a/@ b/@] c/tape]
183 ^- tape
332 ^- tape
184 ?: =(0 a)
333 ?: =(0 a)
185 c
334 c
@@ -189,9 +338,9 @@ Source
189Examples
338Examples
190--------
339--------
191
340
192− /~zod/try=> (runt [2 '/'] "ham")
341+ /> (runt [2 '/'] "ham")
193 "//ham"
342 "//ham"
194− /~zod/try=> (runt [10 'a'] "")
343+ /> (runt [10 'a'] "")
195 "aaaaaaaaaa"
344 "aaaaaaaaaa"
196
345
197
346
@@ -201,35 +350,35 @@ Examples
201
350
202Soft-cast by odor
351Soft-cast by odor
203
352
204−Soft-cast validity by [odor]().
353+Soft-cast validity by odor.
205
354
206Accepts
355Accepts
207-------
356-------
208
357
209−`a` is a [`++span`]() (`@ta`).
358+`a` is a `++span` (`@ta`).
210
359
211`b` is an atom.
360`b` is an atom.
212
361
213Produces
362Produces
214--------
363--------
215
364
216−A `(unit ,@)`.
365+A `(unit @)`.
217
366
218Source
367Source
219------
368------
220
369
221 ++ sand :: atom sanity
370 ++ sand :: atom sanity
222− |= a=@ta
371+ |= a/@ta
223− |= b=@ ^- (unit ,@)
372+ |= b/@ ^- (unit @)
224 ?.(((sane a) b) ~ [~ b])
373 ?.(((sane a) b) ~ [~ b])
225 ::
374 ::
226
375
227Examples
376Examples
228--------
377--------
229
378
230− /~zod/try=> `(unit ,@ta)`((sand %ta) 'sym-som')
379+ /> `(unit @ta)`((sand %ta) 'sym-som')
231 [~ ~.sym-som]
380 [~ ~.sym-som]
232− /~zod/try=> `(unit ,@ta)`((sand %ta) 'err!')
381+ /> `(unit @ta)`((sand %ta) 'err!')
233 ~
382 ~
234
383
235
384
@@ -239,14 +388,14 @@ Examples
239
388
240Check odor validity
389Check odor validity
241
390
242−Check validity by [odor](). Produces a [gate]().
391+Check validity by odor. Produces a gate.
243
392
244Accepts
393Accepts
245-------
394-------
246
395
247−`a` is a [`++span`]() (`@ta`).
396+`a` is a `++span` (`@ta`).
248
397
249−`b` is an [atom]().
398+`b` is an atom.
250
399
251Produces
400Produces
252--------
401--------
@@ -257,8 +406,8 @@ Source
257------
406------
258
407
259 ++ sane :: atom sanity
408 ++ sane :: atom sanity
260− |= a=@ta
409+ |= a/@ta
261− |= b=@ ^- ?
410+ |= b/@ ^- ?
262 ?. =(%t (end 3 1 a))
411 ?. =(%t (end 3 1 a))
263 ~|(%sane-stub !!)
412 ~|(%sane-stub !!)
264 =+ [inx=0 len=(met 3 b)]
413 =+ [inx=0 len=(met 3 b)]
@@ -295,11 +444,11 @@ Source
295Examples
444Examples
296--------
445--------
297
446
298− /~zod/try=> ((sane %tas) %mol)
447+ /> ((sane %tas) %mol)
299 %.y
448 %.y
300− /~zod/try=> ((sane %tas) 'lam')
449+ /> ((sane %tas) 'lam')
301 %.y
450 %.y
302− /~zod/try=> ((sane %tas) 'more ace')
451+ /> ((sane %tas) 'more ace')
303 %.n
452 %.n
304
453
305
454
@@ -314,7 +463,7 @@ Produces the number of utf8 bytes.
314Accepts
463Accepts
315-------
464-------
316
465
317−`a` is a [`@t`]().
466+`a` is a `@t`.
318
467
319Produces
468Produces
320--------
469--------
@@ -324,21 +473,20 @@ An atom.
324Source
473Source
325------
474------
326
475
327− ++ teff :: length utf8
328− |= a=@t ^- @
476+ |= a/@t ^- @
329 =+ b=(end 3 1 a)
477 =+ b=(end 3 1 a)
478+ ~| %bad-utf8
330 ?: =(0 b)
479 ?: =(0 b)
331− ?>(=(0 a) 0)
480+ ?>(=(`@`0 a) 0)
332 ?> |((gte b 32) =(10 b))
481 ?> |((gte b 32) =(10 b))
333 ?:((lte b 127) 1 ?:((lte b 223) 2 ?:((lte b 239) 3 4)))
482 ?:((lte b 127) 1 ?:((lte b 223) 2 ?:((lte b 239) 3 4)))
334− ::
335
483
336Examples
484Examples
337--------
485--------
338
486
339− /~zod/try=> (teff 'a')
487+ /> (teff 'a')
340 1
488 1
341− /~zod/try=> (teff 'ß')
489+ /> (teff 'ß')
342 2
490 2
343
491
344
492
@@ -348,7 +496,7 @@ Examples
348
496
349Tape split
497Tape split
350
498
351−Split first `a` characters off [`++tape`]() `b`.
499+Split first `a` characters off `++tape` `b`.
352
500
353Accepts
501Accepts
354-------
502-------
@@ -365,23 +513,23 @@ A cell of `++tape`s, `p` and `q`.
365Source
513Source
366------
514------
367
515
368− ++ trim :: tape split
516+ ++ trim :: 31-bit nonzero
369− |= [a=@ b=tape]
517+ |= key/@
370− ^- [p=tape q=tape]
518+ =+ syd=0xcafe.babe
371− ?~ b
519+ |- ^- @
372− [~ ~]
520+ =+ haz=(spec syd key)
373− ?: =(0 a)
521+ =+ ham=(mix (rsh 0 31 haz) (end 0 31 haz))
374− [~ b]
522+ ?.(=(0 ham) ham $(syd +(syd)))
375− =+ c=$(a (dec a), b t.b)
523+ --
376− [[i.b p.c] q.c]
377 ::
524 ::
378
525
526+
379Examples
527Examples
380--------
528--------
381
529
382− /~zod/try=> (trim 5 "lasok termun")
530+ /> (trim 5 "lasok termun")
383 [p="lasok" q=" termun"]
531 [p="lasok" q=" termun"]
384− /~zod/try=> (trim 5 "zam")
532+ /> (trim 5 "zam")
385 [p="zam" q=""]
533 [p="zam" q=""]
386
534
387
535
@@ -391,7 +539,7 @@ Examples
391
539
392Cord to tape
540Cord to tape
393
541
394−Produce a [`++tape`]() from [`++cord`]().
542+Produce a `++tape` from `++cord`.
395
543
396Accepts
544Accepts
397-------
545-------
@@ -408,20 +556,21 @@ Source
408
556
409 ++ trip :: cord to tape
557 ++ trip :: cord to tape
410 ~/ %trip
558 ~/ %trip
411− |= a=@ ^- tape
559+ |= a/@ ^- tape
412 ?: =(0 (met 3 a))
560 ?: =(0 (met 3 a))
413 ~
561 ~
414 [^-(@ta (end 3 1 a)) $(a (rsh 3 1 a))]
562 [^-(@ta (end 3 1 a)) $(a (rsh 3 1 a))]
415 ::
563 ::
416
564
565+
417Examples
566Examples
418--------
567--------
419
568
420− /~zod/try=> (trip 'john doe')
569+ /> (trip 'john doe')
421 "john doe"
570 "john doe"
422− /~zod/try=> (trip 'abc 123 !@#')
571+ /> (trip 'abc 123 !@#')
423 "abc 123 !@#"
572 "abc 123 !@#"
424− /~zod/try=> (trip 'abc')
573+ /> (trip 'abc')
425 "abc"
574 "abc"
426
575
427
576
@@ -431,7 +580,7 @@ Examples
431
580
432UTF8 to UTF32 tape
581UTF8 to UTF32 tape
433
582
434−Convert [`++tape`]() to a [`++list`]() of codepoints ([`@c`]()).
583+Convert `++tape` to a `++list` of codepoints (`@c`).
435
584
436Accepts
585Accepts
437-------
586-------
@@ -441,23 +590,23 @@ Accepts
441Produces
590Produces
442--------
591--------
443
592
444−A `++list` of codepoints [`@c`]().
593+A `++list` of codepoints `@c`.
445
594
446Source
595Source
447------
596------
448
597
449 ++ tuba :: utf8 to utf32 tape
598 ++ tuba :: utf8 to utf32 tape
450− |= a=tape
599+ |= a/tape
451− ^- (list ,@c)
600+ ^- (list @c)
452 (rip 5 (turf (rap 3 a))) :: XX horrible
601 (rip 5 (turf (rap 3 a))) :: XX horrible
453 ::
602 ::
454
603
455Examples
604Examples
456--------
605--------
457
606
458− /~zod/try=> (tuba "я тут")
607+ /> (tuba "я тут")
459 ~[~-~44f. ~-. ~-~442. ~-~443. ~-~442.]
608 ~[~-~44f. ~-. ~-~442. ~-~443. ~-~442.]
460− /~zod/try=> (tuba "chars")
609+ /> (tuba "chars")
461 ~[~-c ~-h ~-a ~-r ~-s]
610 ~[~-c ~-h ~-a ~-r ~-s]
462
611
463
612
@@ -467,12 +616,12 @@ Examples
467
616
468UTF32 to UTF8 tape
617UTF32 to UTF8 tape
469
618
470−Wrap a [`++list`]() of utf32 codepoints into a utf8 [`++tape`]().
619+Wrap a `++list` of utf32 codepoints into a utf8 `++tape`.
471
620
472Accepts
621Accepts
473-------
622-------
474
623
475−`a` is a `++list` of [`@c`]().
624+`a` is a `++list` of `@c`.
476
625
477Produces
626Produces
478--------
627--------
@@ -483,7 +632,7 @@ Source
483------
632------
484
633
485 ++ tufa :: utf32 to utf8 tape
634 ++ tufa :: utf32 to utf8 tape
486− |= a=(list ,@c)
635+ |= a=(list @c)
487 ^- tape
636 ^- tape
488 ?~ a ""
637 ?~ a ""
489 (weld (rip 3 (tuft i.a)) $(a t.a))
638 (weld (rip 3 (tuft i.a)) $(a t.a))
@@ -492,9 +641,9 @@ Source
492Examples
641Examples
493--------
642--------
494
643
495− /~zod/try=> (tufa ~[~-~44f. ~-. ~-~442. ~-~443. ~-~442.])
644+ /> (tufa ~[~-~44f. ~-. ~-~442. ~-~443. ~-~442.])
496 "я тут"
645 "я тут"
497− /~zod/try=> (tufa ((list ,@c) ~[%a %b 0xb1 %c]))
646+ /> (tufa ((list @c) ~[%a %b 0xb1 %c]))
498 "ab±c"
647 "ab±c"
499
648
500
649
@@ -505,12 +654,12 @@ Examples
505UTF32 to UTF8 text
654UTF32 to UTF8 text
506
655
507Convert utf32 glyph to
656Convert utf32 glyph to
508−[LSB](http://en.wikipedia.org/wiki/Least_significant_bit) utf8 [`++cord`]().
657+LSB utf8 `++cord`.
509
658
510Accepts
659Accepts
511-------
660-------
512
661
513−`a` is a codepoint ([`@c`]()).
662+`a` is a codepoint (`@c`).
514
663
515Produces
664Produces
516--------
665--------
@@ -521,22 +670,22 @@ Source
521------
670------
522
671
523 ++ tuft :: utf32 to utf8 text
672 ++ tuft :: utf32 to utf8 text
524− |= a=@c
673+ |= a/@c
525 ^- @t
674 ^- @t
526 %+ rap 3
675 %+ rap 3
527− |- ^- (list ,@)
676+ |- ^- (list @)
528− ?: =(0 a)
677+ ?: =(`@`0 a)
529 ~
678 ~
530 =+ b=(end 5 1 a)
679 =+ b=(end 5 1 a)
531 =+ c=$(a (rsh 5 1 a))
680 =+ c=$(a (rsh 5 1 a))
532− ?: (lth b 0x7f)
681+ ?: (lte b 0x7f)
533 [b c]
682 [b c]
534− ?: (lth b 0x7ff)
683+ ?: (lte b 0x7ff)
535 :* (mix 0b1100.0000 (cut 0 [6 5] b))
684 :* (mix 0b1100.0000 (cut 0 [6 5] b))
536 (mix 0b1000.0000 (end 0 6 b))
685 (mix 0b1000.0000 (end 0 6 b))
537 c
686 c
538 ==
687 ==
539− ?: (lth b 0xffff)
688+ ?: (lte b 0xffff)
540 :* (mix 0b1110.0000 (cut 0 [12 4] b))
689 :* (mix 0b1110.0000 (cut 0 [12 4] b))
541 (mix 0b1000.0000 (cut 0 [6 6] b))
690 (mix 0b1000.0000 (cut 0 [6 6] b))
542 (mix 0b1000.0000 (end 0 6 b))
691 (mix 0b1000.0000 (end 0 6 b))
@@ -553,9 +702,9 @@ Source
553Examples
702Examples
554--------
703--------
555
704
556− /~zod/try=> (tuft `@c`%a)
705+ /> (tuft `@c`%a)
557 'a'
706 'a'
558− /~zod/try=> (tuft `@c`0xb6)
707+ /> (tuft `@c`0xb6)
559 '¶'
708 '¶'
560
709
561
710
@@ -565,53 +714,55 @@ Examples
565
714
566UTF8 to UTF32 cord
715UTF8 to UTF32 cord
567
716
568−Convert utf8 ([`++cord`]()) to utf32 codepoints.
717+Convert utf8 (`++cord`) to utf32 codepoints.
569
718
570Accepts
719Accepts
571-------
720-------
572
721
573−`a` is a [`@t`]().
722+`a` is a `@t`.
574
723
575Produces
724Produces
576--------
725--------
577
726
578−A [`@c`](), UTF-32 codepoint.
727+A `@c`, UTF-32 codepoint.
579
728
580Source
729Source
581------
730------
582
731
583 ++ turf :: utf8 to utf32
732 ++ turf :: utf8 to utf32
584− |= a=@t
733+ |= a/@t
585 ^- @c
734 ^- @c
586 %+ rap 5
735 %+ rap 5
587− |- ^- (list ,@c)
736+ |- ^- (list @c)
588 =+ b=(teff a)
737 =+ b=(teff a)
589 ?: =(0 b) ~
738 ?: =(0 b) ~
739+ =+ ^= c
590− :- %+ can 0
740+ %+ can 0
591 %+ turn
741 %+ turn
592− ^- (list ,[p=@ q=@])
742+ ^- (list {p/@ q/@})
593 ?+ b !!
743 ?+ b !!
594− 1 [[0 7] ~]
744+ $1 [[0 7] ~]
595− 2 [[8 6] [0 5] ~]
745+ $2 [[8 6] [0 5] ~]
596− 3 [[16 6] [8 6] [0 4] ~]
746+ $3 [[16 6] [8 6] [0 4] ~]
597− 4 [[24 6] [16 6] [8 6] [0 3] ~]
747+ $4 [[24 6] [16 6] [8 6] [0 3] ~]
598 ==
748 ==
599− |=([p=@ q=@] [q (cut 0 [p q] a)])
749+ |=({p/@ q/@} [q (cut 0 [p q] a)])
750+ ?. =((tuft c) (end 3 b a)) ~|(%bad-utf8 !!)
600− $(a (rsh 3 b a))
751+ [c $(a (rsh 3 b a))]
601 ::
752 ::
602
753
603Examples
754Examples
604--------
755--------
605
756
606− /~zod/try=> (turf 'my ßam')
757+ /> (turf 'my ßam')
607 ~-my.~df.am
758 ~-my.~df.am
608− /~zod/try=> 'я тут'
759+ /> 'я тут'
609 'я тут'
760 'я тут'
610− /~zod/try=> (turf 'я тут')
761+ /> (turf 'я тут')
611 ~-~44f..~442.~443.~442.
762 ~-~44f..~442.~443.~442.
612− /~zod/try=> `@ux`'я тут'
763+ /> `@ux`'я тут'
613 0x82.d183.d182.d120.8fd1
764 0x82.d183.d182.d120.8fd1
614− /~zod/try=> `@ux`(turf 'я тут')
765+ /> `@ux`(turf 'я тут')
615 0x442.0000.0443.0000.0442.0000.0020.0000.044f
766 0x442.0000.0443.0000.0442.0000.0020.0000.044f
616
767
617
768
@@ -621,7 +772,7 @@ Examples
621
772
622Coin format encode
773Coin format encode
623
774
624−Escape [`++span`]() `~` as `~~` and `_` as `~-`. Used for printing.
775+Escape `++span` `~` as `~~` and `_` as `~-`. Used for printing.
625
776
626Accepts
777Accepts
627-------
778-------
@@ -631,13 +782,13 @@ Accepts
631Produces
782Produces
632--------
783--------
633
784
634−A [`++span`]() (`@ta`).
785+A `++span` (`@ta`).
635
786
636Source
787Source
637------
788------
638
789
639 ++ wack :: coin format
790 ++ wack :: coin format
640− |= a=@ta
791+ |= a/@ta
641 ^- @ta
792 ^- @ta
642 =+ b=(rip 3 a)
793 =+ b=(rip 3 a)
643 %+ rap 3
794 %+ rap 3
@@ -652,13 +803,13 @@ Source
652Examples
803Examples
653--------
804--------
654
805
655− /~zod/try=> (wack '~20_sam~')
806+ /> (wack '~20_sam~')
656 ~.~~20~-sam~~
807 ~.~~20~-sam~~
657− /~zod/try=> `@t`(wack '~20_sam~')
808+ /> `@t`(wack '~20_sam~')
658 '~~20~-sam~~'
809 '~~20~-sam~~'
659− ~zod/try=> ~(rend co %many ~[`ud/5 `ta/'~20_sam'])
810+ > ~(rend co %many ~[`ud/5 `ta/'~20_sam'])
660 "._5_~~.~~20~-sam__"
811 "._5_~~.~~20~-sam__"
661− ~zod/try=> ._5_~~.~~20~-sam__
812+ > ._5_~~.~~20~-sam__
662 [5 ~.~20_sam]
813 [5 ~.~20_sam]
663
814
664
815
@@ -668,41 +819,45 @@ Examples
668
819
669Coin format decode
820Coin format decode
670
821
671−Unescape [`++span`]() `~~` as `~` and `~-` as `_`.
822+Unescape `++span` `~~` as `~` and `~-` as `_`.
672
823
673Accepts
824Accepts
674-------
825-------
675
826
676−`a` is a an [atom]().
827+`a` is a an atom.
677
828
678Produces
829Produces
679--------
830--------
680
831
681−A [`++span`]() `@ta`.
832+A `++span` `@ta`.
682
833
683Source
834Source
684------
835------
685
836
686− ++ wick :: coin format
837+ ++ wick :: knot format
687− |= a=@
838+ |= a/@
688− ^- @ta
839+ ^- (unit @ta)
689 =+ b=(rip 3 a)
840 =+ b=(rip 3 a)
690− %+ rap 3
841+ =- ?^(b ~ (some (rap 3 (flop c))))
842+ =| c/tape
691− |- ^- tape
843+ |- ^- {b/tape c/tape}
692− ?~ b
844+ ?~ b [~ c]
693− ~
694− ?: =('~' i.b)
845+ ?. =('~' i.b)
846+ $(b t.b, c [i.b c])
695− ?~ t.b !!
847+ ?~ t.b [b ~]
696− [?:(=('~' i.t.b) '~' ?>(=('-' i.t.b) '_')) $(b t.t.b)]
848+ ?- i.t.b
697− [i.b $(b t.b)]
849+ $'~' $(b t.t.b, c ['~' c])
850+ $'-' $(b t.t.b, c ['_' c])
851+ @ [b ~]
852+ ==
698 ::
853 ::
699
854
700Examples
855Examples
701--------
856--------
702
857
703− /~zod/try=> `@t`(wick '~-ams~~lop')
858+ /> `@t`(wick '~-ams~~lop')
704 '_ams~lop'
859 '_ams~lop'
705− /~zod/try=> `@t`(wick (wack '~20_sam~'))
860+ /> `@t`(wick (wack '~20_sam~'))
706 '~20_sam~'
861 '~20_sam~'
707
862
708
863
@@ -712,27 +867,27 @@ Examples
712
867
713Unescape cord
868Unescape cord
714
869
715−Unescape [`++cord`]() codepoints.
870+Unescape `++cord` codepoints.
716
871
717Accepts
872Accepts
718-------
873-------
719
874
720−`a` is a [`@ta`]().
875+`a` is a `@ta`.
721
876
722Produces
877Produces
723--------
878--------
724
879
725−A [`++cord`]().
880+A `++cord`.
726
881
727Source
882Source
728------
883------
729
884
730 ++ woad :: cord format
885 ++ woad :: cord format
731− |= a=@ta
886+ |= a/@ta
732 ^- @t
887 ^- @t
733 %+ rap 3
888 %+ rap 3
734− |- ^- (list ,@)
889+ |- ^- (list @)
735− ?: =(0 a)
890+ ?: =(`@`0 a)
736 ~
891 ~
737 =+ b=(end 3 1 a)
892 =+ b=(end 3 1 a)
738 =+ c=(rsh 3 1 a)
893 =+ c=(rsh 3 1 a)
@@ -744,7 +899,7 @@ Source
744 ?+ b =- (weld (rip 3 (tuft p.d)) $(a q.d))
899 ?+ b =- (weld (rip 3 (tuft p.d)) $(a q.d))
745 ^= d
900 ^= d
746 =+ d=0
901 =+ d=0
747− |- ^- [p=@ q=@]
902+ |- ^- {p/@ q/@}
748 ?: =('.' b)
903 ?: =('.' b)
749 [d c]
904 [d c]
750 ?< =(0 c)
905 ?< =(0 c)
@@ -756,15 +911,15 @@ Source
756 ?: &((gte b '0') (lte b '9')) 48
911 ?: &((gte b '0') (lte b '9')) 48
757 ?>(&((gte b 'a') (lte b 'z')) 87)
912 ?>(&((gte b 'a') (lte b 'z')) 87)
758 ==
913 ==
759− %'.' ['.' $(a c)]
914+ $'.' ['.' $(a c)]
760− %'~' ['~' $(a c)]
915+ $'~' ['~' $(a c)]
761 ==
916 ==
762 ::
917 ::
763
918
764Examples
919Examples
765--------
920--------
766
921
767− /~zod/try=> (woad ~.~b6.20.as)
922+ /> (woad ~.~b6.20.as)
768 '¶20 as'
923 '¶20 as'
769
924
770
925
@@ -774,204 +929,52 @@ Examples
774
929
775Escape cord
930Escape cord
776
931
777−Escape [`++cord`]() codepoints.
932+Escape `++cord` codepoints.
778
933
779Accepts
934Accepts
780-------
935-------
781
936
782−`a` is a [`++span`]() (`@ta`).
937+`a` is a `++span` (`@ta`).
783
938
784Produces
939Produces
785--------
940--------
786
941
787−A [`++span`]() (`@ta`).
942+A `++span` (`@ta`).
788
943
789Source
944Source
790------
945------
791
946
792 ++ wood :: cord format
947 ++ wood :: cord format
793− |= a=@t
948+ |= a/@t
794 ^- @ta
949 ^- @ta
795 %+ rap 3
950 %+ rap 3
796− |- ^- (list ,@)
951+ |- ^- (list @)
797− ?: =(0 a)
952+ ?: =(`@`0 a)
798 ~
953 ~
799 =+ b=(teff a)
954 =+ b=(teff a)
800 =+ c=(turf (end 3 b a))
955 =+ c=(turf (end 3 b a))
801 =+ d=$(a (rsh 3 b a))
956 =+ d=$(a (rsh 3 b a))
802 ?: ?| &((gte c 'a') (lte c 'z'))
957 ?: ?| &((gte c 'a') (lte c 'z'))
803 &((gte c '0') (lte c '9'))
958 &((gte c '0') (lte c '9'))
804− =('-' c)
959+ =(`@`'-' c)
805 ==
960 ==
806 [c d]
961 [c d]
807 ?+ c
962 ?+ c
808 :- '~'
963 :- '~'
809 =+ e=(met 2 c)
964 =+ e=(met 2 c)
810 |- ^- tape
965 |- ^- tape
811− ?: =(0 c)
966+ ?: =(0 e)
812 ['.' d]
967 ['.' d]
813 =. e (dec e)
968 =. e (dec e)
814 =+ f=(rsh 2 e c)
969 =+ f=(rsh 2 e c)
815 [(add ?:((lte f 9) 48 87) f) $(c (end 2 e c))]
970 [(add ?:((lte f 9) 48 87) f) $(c (end 2 e c))]
816 ::
971 ::
817− %' ' ['.' d]
818− %'.' ['~' '.' d]
819− %'~' ['~' '~' d]
820− ==
821
972
822Examples
973Examples
823--------
974--------
824
975
825− /~zod/try=> (wood 'my ßam')
976+ /> (wood 'my ßam')
826 ~.my.~df.am
977 ~.my.~df.am
827
978
828
979
829−***
830−### `++at`
831−
832− ++ at
833− |_ a=@
834−
835−XX document
836−
837−### `++r`
838−
839− ++ r
840− ?: ?& (gte (met 3 a) 2)
841− |-
842− ?: =(0 a)
843− &
844− =+ vis=(end 3 1 a)
845− ?& ?|(=('-' vis) ?&((gte vis 'a') (lte vis 'z')))
846− $(a (rsh 3 1 a))
847− ==
848− ==
849− rtam
850− ?: (lte (met 3 a) 2)
851− rud
852− rux
853− ::
854−
855−XX document
856−
857−### `++rf`
858−
859− ++ rf `tape`[?-(a & '&', | '|', * !!) ~]
860−
861−XX document
862−
863−### `++rn`
864−
865− ++ rn `tape`[?>(=(0 a) '~') ~]
866−
867−XX document
868−
869−### `++rt`
870−
871− ++ rt `tape`['\'' (weld (mesc (trip a)) `tape`['\'' ~])]
872−
873−XX document
874−
875−### `++rta`
876−
877− ++ rta rt
878−
879−XX document
880−
881−### `++rtam`
882−
883− ++ rtam `tape`['%' (trip a)]
884−
885−XX document
886−
887−### `++rub`
888−
889− ++ rub `tape`['0' 'b' (rum 2 ~ |=(b=@ (add '0' b)))]
890−
891−XX document
892−
893−### `++rud`
894−
895− ++ rud (rum 10 ~ |=(b=@ (add '0' b)))
896−
897−XX document
898−
899−### `++rum`
900−
901− ++ rum
902− |= [b=@ c=tape d=$+(@ @)]
903− ^- tape
904− ?: =(0 a)
905− [(d 0) c]
906− =+ e=0
907− |- ^- tape
908− ?: =(0 a)
909− c
910− =+ f=&(!=(0 e) =(0 (mod e ?:(=(10 b) 3 4))))
911− %= $
912− a (div a b)
913− c [(d (mod a b)) ?:(f [?:(=(10 b) ',' '-') c] c)]
914− e +(e)
915− ==
916− ::
917−
918−XX document
919−
920−### `++rup`
921−
922− ++ rup
923− =+ b=(met 3 a)
924− ^- tape
925− :- '-'
926− |- ^- tape
927− ?: (gth (met 5 a) 1)
928− %+ weld
929− $(a (rsh 5 1 a), b (sub b 4))
930− `tape`['-' '-' $(a (end 5 1 a), b 4)]
931− ?: =(0 b)
932− ['~' ~]
933− ?: (lte b 1)
934− (trip (tos:po a))
935− |- ^- tape
936− ?: =(2 b)
937− =+ c=(rsh 3 1 a)
938− =+ d=(end 3 1 a)
939− (weld (trip (tod:po c)) (trip (tos:po (mix c d))))
940− =+ c=(rsh 3 2 a)
941− =+ d=(end 3 2 a)
942− (weld ^$(a c, b (met 3 c)) `tape`['-' $(a (mix c d), b 2)])
943− ::
944−
945−XX document
946−
947−### `++ruv`
948−
949− ++ ruv
950− ^- tape
951− :+ '0'
952− 'v'
953− %^ rum
954− 64
955− ~
956− |= b=@
957− ?: =(63 b)
958− '+'
959− ?: =(62 b)
960− '-'
961− ?:((lth b 26) (add 65 b) ?:((lth b 52) (add 71 b) (sub b 4)))
962− ::
963−
964−XX document
965−
966−### `++rux`
967−
968− ++ rux `tape`['0' 'x' (rum 16 ~ |=(b=@ (add b ?:((lth b 10) 48 87))))]
969− --
970− :::::::::::::::::::::::::::::::::::::::::::::::::::::: ::
971−
972−XX document
973−
974−------------------------------------------------------------------------
975−
976−
977***
980***
docs/system/hoon/library/4c.md+135−147
@@ -1,114 +1,9 @@
1# 4c: tank printer
1# 4c: tank printer
2−### `++show`
3−
4− ++ show :: XX deprecated, use type
5− |= vem=*
6− |^ ^- tank
7− ?: ?=(@ vem)
8− [%leaf (mesc (trip vem))]
9− ?- vem
10− [s=~ c=*]
11− [%leaf '\'' (weld (mesc (tape +.vem)) `tape`['\'' ~])]
12− ::
13− [s=%a c=@] [%leaf (mesc (trip c.vem))]
14− [s=%b c=*] (shop c.vem |=(a=@ ~(rub at a)))
15− [s=[%c p=@] c=*]
16− :+ %palm
17− [['.' ~] ['-' ~] ~ ~]
18− [[%leaf (mesc (trip p.s.vem))] $(vem c.vem) ~]
19− ::
20− [s=%d c=*] (shop c.vem |=(a=@ ~(rud at a)))
21− [s=%k c=*] (tank c.vem)
22− [s=%h c=*]
23− ?: =(0 c.vem) :: XX remove after 220
24− [%leaf '#' ~]
25− :+ %rose
26− [['/' ~] ['/' ~] ~]
27− =+ yol=((list ,@ta) c.vem)
28− (turn yol |=(a=@ta [%leaf (trip a)]))
29− ::
30− [s=%o c=*]
31− %= $
32− vem
33− :- [%m '%h:<[%d %d].[%d %d]>']
34− [-.c.vem +<-.c.vem +<+.c.vem +>-.c.vem +>+.c.vem ~]
35− ==
36− ::
37− [s=%p c=*] (shop c.vem |=(a=@ ~(rup at a)))
38− [s=%q c=*] (shop c.vem |=(a=@ ~(r at a)))
39− [s=%r c=*] $(vem [[%r ' ' '{' '}'] c.vem])
40− [s=%t c=*] (shop c.vem |=(a=@ ~(rt at a)))
41− [s=%v c=*] (shop c.vem |=(a=@ ~(ruv at a)))
42− [s=%x c=*] (shop c.vem |=(a=@ ~(rux at a)))
43− [s=[%m p=@] c=*] (shep p.s.vem c.vem)
44− [s=[%r p=@] c=*]
45− $(vem [[%r ' ' (cut 3 [0 1] p.s.vem) (cut 3 [1 1] p.s.vem)] c.vem])
46− ::
47− [s=[%r p=@ q=@ r=@] c=*]
48− :+ %rose
49− :* p=(mesc (trip p.s.vem))
50− q=(mesc (trip q.s.vem))
51− r=(mesc (trip r.s.vem))
52− ==
53− |- ^- (list tank)
54− ?@ c.vem
55− ~
56− [^$(vem -.c.vem) $(c.vem +.c.vem)]
57− ::
58− [s=%z c=*] $(vem [[%r %$ %$ %$] c.vem])
59− * !!
60− ==
61−
62−XX document
63−
64−### `++shep`
65−
66− ++ shep
67− |= [fom=@ gar=*]
68− ^- tank
69− =+ l=(met 3 fom)
70− =+ i=0
71− :- %leaf
72− |- ^- tape
73− ?: (gte i l)
74− ~
75− =+ c=(cut 3 [i 1] fom)
76− ?. =(37 c)
77− (weld (mesc [c ~]) $(i +(i)))
78− =+ d=(cut 3 [+(i) 1] fom)
79− ?. .?(gar)
80− ['\\' '#' $(i (add 2 i))]
81− (weld ~(ram re (show d -.gar)) $(i (add 2 i), gar +.gar))
82− ::
83−
84−XX document
85−
86−### `++shop`
87−
88− ++ shop
89− |= [aug=* vel=$+(a=@ tape)]
90− ^- tank
91− ?: ?=(@ aug)
92− [%leaf (vel aug)]
93− :+ %rose
94− [[' ' ~] ['[' ~] [']' ~]]
95− => .(aug `*`aug)
96− |- ^- (list tank)
97− ?: ?=(@ aug)
98− [^$ ~]
99− [^$(aug -.aug) $(aug +.aug)]
100− --
101−
102−XX document
103−
104−
105−
106−***
107### `++re`
2### `++re`
108
3
109Pretty-printing engine
4Pretty-printing engine
110
5
111−Pretty-printing engine that accepts a [`++tank`](/doc/hoon/library/1#++tank) [sample]() and contains arms that perform computation on it.
6+Pretty-printing engine that accepts a `++tank` sample and contains arms that perform computation on it.
112
7
113Accepts
8Accepts
114-------
9-------
@@ -119,24 +14,24 @@ Produces
119--------
14--------
120
15
121 ++ re
16 ++ re
122− |_ tac=tank
17+ |_ tac/tank
123
18
124Examples
19Examples
125--------
20--------
126
21
127− /~zod/try=> ~(. re leaf/"ham")
22+ /> ~(. re leaf+"ham")
128− <2.ghl [[%leaf ""] <414.gly 100.xkc 1.ypj %164>]>
23+ <2.gdc {tac/{$leaf ""} <402.arm 110.jyx 1.ztu $151>}>
129
24
130### `++ram`
25### `++ram`
131
26
132Flatten to tape
27Flatten to tape
133
28
134−Flatten [`++tank`]() out into a [`++tape`]().
29+Flatten `++tank` out into a `++tape`.
135
30
136Accepts
31Accepts
137-------
32-------
138
33
139−`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
34+`tac` is a `++tank`, taken from sample of `++re` core.
140
35
141Produces
36Produces
142--------
37--------
@@ -149,9 +44,9 @@ Source
149 ++ ram
44 ++ ram
150 ^- tape
45 ^- tape
151 ?- -.tac
46 ?- -.tac
152− %leaf p.tac
47+ $leaf p.tac
153− %palm ram(tac [%rose [p.p.tac (weld q.p.tac r.p.tac) s.p.tac] q.tac])
48+ $palm ram(tac [%rose [p.p.tac (weld q.p.tac r.p.tac) s.p.tac] q.tac])
154− %rose
49+ $rose
155 %+ weld
50 %+ weld
156 q.p.tac
51 q.p.tac
157 |- ^- tape
52 |- ^- tape
@@ -165,9 +60,9 @@ Source
165Examples
60Examples
166--------
61--------
167
62
168− /~zod/try=> ~(ram re leaf/"foo")
63+ /> ~(ram re leaf+"foo")
169 "foo"
64 "foo"
170− /~zod/try=> ~(ram re rose/["." "(" ")"]^~[leaf/"bar" leaf/"baz" leaf/"bam"])
65+ /> ~(ram re rose+["." "(" ")"]^~[leaf+"bar" leaf+"baz" leaf+"bam"])
171 "(bar.baz.bam)"
66 "(bar.baz.bam)"
172
67
173### `++win`
68### `++win`
@@ -179,25 +74,25 @@ Render at indent level `tab` and width `edg`.
179Accepts
74Accepts
180-------
75-------
181
76
182−`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
77+`tac` is a `++tank`, taken from sample of `++re` core.
183
78
184`tab` and `edg` are atoms.
79`tab` and `edg` are atoms.
185
80
186Produces
81Produces
187--------
82--------
188
83
189−A [`++wall`]() ([`++list`]() of [`++tapes`]()).
84+A `++wall` (`++list` of `++tapes`).
190
85
191Source
86Source
192------
87------
193
88
194 ++ win
89 ++ win
195− |= [tab=@ edg=@]
90+ |= {tab/@ edg/@}
196 =+ lug=`wall`~
91 =+ lug=`wall`~
197 |^ |- ^- wall
92 |^ |- ^- wall
198 ?- -.tac
93 ?- -.tac
199− %leaf (rig p.tac)
94+ $leaf (rig p.tac)
200− %palm
95+ $palm
201 ?: fit
96 ?: fit
202 (rig ram)
97 (rig ram)
203 ?~ q.tac
98 ?~ q.tac
@@ -217,30 +112,17 @@ Source
217 ==
112 ==
218 (wig(lug qyr) q.p.tac)
113 (wig(lug qyr) q.p.tac)
219 ::
114 ::
220− %rose
221− ?: fit
222− (rig ram)
223− =+ ^= gyl
224− |- ^- wall
225− ?~ q.tac
226− ?:(=(%$ r.p.tac) lug (rig r.p.tac))
227− ^$(tac i.q.tac, lug $(q.tac t.q.tac), tab din)
228− ?: =(%$ q.p.tac)
229− gyl
230− (wig(lug gyl) q.p.tac)
231− ==
232− ::
233
115
234Examples
116Examples
235--------
117--------
236
118
237− /~zod/try=> (~(win re leaf/"samoltekon-lapdok") 0 20)
119+ /> (~(win re leaf+"samoltekon-lapdok") 0 20)
238 <<"samoltekon-lapdok">>
120 <<"samoltekon-lapdok">>
239− /~zod/try=> (~(win re leaf/"samoltekon-lapdok") 0 10)
121+ /> (~(win re leaf+"samoltekon-lapdok") 0 10)
240 <<"\/samolt\/" " ekon-l" " apdok" "\/ \/">>
122 <<"\/samolt\/" " ekon-l" " apdok" "\/ \/">>
241− /~zod/try=> (~(win re rose/["--" "[" "]"]^~[leaf/"1423" leaf/"2316"]) 0 20)
123+ /> (~(win re rose+["--" "[" "]"]^~[leaf+"1423" leaf+"2316"]) 0 20)
242 <<"[1423--2316]">>
124 <<"[1423--2316]">>
243− /~zod/try=> (~(win re rose/["--" "[" "]"]^~[leaf/"1423" leaf/"2316"]) 0 10)
125+ /> (~(win re rose+["--" "[" "]"]^~[leaf+"1423" leaf+"2316"]) 0 10)
244 <<"[ 1423" " 2316" "]">>
126 <<"[ 1423" " 2316" "]">>
245
127
246### `++din`
128### `++din`
@@ -291,28 +173,28 @@ Examples
291
173
292Wrap in `\/`
174Wrap in `\/`
293
175
294−Wrap [`++tape`]() in `\/` if it doesn't fit at current indentation. Internal to
176+Wrap `++tape` in `\/` if it doesn't fit at current indentation. Internal to
295−[`++win`]()
177+`++win`
296
178
297Accepts
179Accepts
298-------
180-------
299
181
300−`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
182+`tac` is a `++tank`, taken from sample of `++re` core.
301
183
302`hom` is a `++tape`.
184`hom` is a `++tape`.
303
185
304Produces
186Produces
305--------
187--------
306
188
307−A [`++wall`]() (list of `++tape`s).
189+A `++wall` (list of `++tape`s).
308
190
309Source
191Source
310------
192------
311
193
312 ++ rig
194 ++ rig
313− |= hom=tape
195+ |= hom/tape
314 ^- wall
196 ^- wall
315− ?: (lte (lent hom) (sub edg tab))
197+ ?: & ::(lte (lent hom) (sub edg tab))
316 [(runt [tab ' '] hom) lug]
198 [(runt [tab ' '] hom) lug]
317 => .(tab (add tab 2), edg (sub edg 2))
199 => .(tab (add tab 2), edg (sub edg 2))
318 =+ mut=(trim (sub edg tab) hom)
200 =+ mut=(trim (sub edg tab) hom)
@@ -335,12 +217,12 @@ Examples
335
217
336`++win` render tape
218`++win` render tape
337
219
338−Render [`++tape`](). Internal to [`++win`]().
220+Render `++tape`. Internal to `++win`.
339
221
340Accepts
222Accepts
341-------
223-------
342
224
343−`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
225+`tac` is a `++tank`, taken from sample of `++re` core.
344
226
345`hom` is a `++tape`.
227`hom` is a `++tape`.
346
228
@@ -348,7 +230,7 @@ Produces
348--------
230--------
349
231
350 ++ wig
232 ++ wig
351− |= hom=tape
233+ |= hom/tape
352 ^- wall
234 ^- wall
353 ?~ lug
235 ?~ lug
354 (rig hom)
236 (rig hom)
@@ -365,4 +247,110 @@ Produces
365
247
366
248
367
249
250+
251+***
252+### `++show`
253+
254+ ++ show :: XX deprecated, use span
255+ |= vem/*
256+ |^ ^- tank
257+ ?: ?=(@ vem)
258+ [%leaf (mesc (trip vem))]
259+ ?- vem
260+ {s/$~ c/*}
261+ [%leaf '\'' (weld (mesc (tape +.vem)) `tape`['\'' ~])]
262+ ::
263+ {s/$a c/@} [%leaf (mesc (trip c.vem))]
264+ {s/$b c/*} (shop c.vem |=(a/@ ~(rub at a)))
265+ {s/{$c p/@} c/*}
266+ :+ %palm
267+ [['.' ~] ['-' ~] ~ ~]
268+ [[%leaf (mesc (trip p.s.vem))] $(vem c.vem) ~]
269+ ::
270+ {s/$d c/*} (shop c.vem |=(a/@ ~(rud at a)))
271+ {s/$k c/*} (tank c.vem)
272+ {s/$h c/*}
273+ :+ %rose
274+ [['/' ~] ['/' ~] ~]
275+ =+ yol=((list @ta) c.vem)
276+ (turn yol |=(a/@ta [%leaf (trip a)]))
277+ ::
278+ {s/$l c/*} (shol c.vem)
279+ {s/$o c/*}
280+ %= $
281+ vem
282+ :- [%m '%h:<[%d %d].[%d %d]>']
283+ [-.c.vem +<-.c.vem +<+.c.vem +>-.c.vem +>+.c.vem ~]
284+ ==
285+ ::
286+ {s/$p c/*} (shop c.vem |=(a/@ ~(rup at a)))
287+ {s/$q c/*} (shop c.vem |=(a/@ ~(r at a)))
288+ {s/$r c/*} $(vem [[%r ' ' '{' '}'] c.vem])
289+ {s/$t c/*} (shop c.vem |=(a/@ ~(rt at a)))
290+ {s/$v c/*} (shop c.vem |=(a/@ ~(ruv at a)))
291+ {s/$x c/*} (shop c.vem |=(a/@ ~(rux at a)))
292+ {s/{$m p/@} c/*} (shep p.s.vem c.vem)
293+ {s/{$r p/@} c/*}
294+ $(vem [[%r ' ' (cut 3 [0 1] p.s.vem) (cut 3 [1 1] p.s.vem)] c.vem])
295+ ::
296+ {s/{$r p/@ q/@ r/@} c/*}
297+ :+ %rose
298+ :* p=(mesc (trip p.s.vem))
299+ q=(mesc (trip q.s.vem))
300+ r=(mesc (trip r.s.vem))
301+ ==
302+ |- ^- (list tank)
303+ ?@ c.vem
304+ ~
305+ [^$(vem -.c.vem) $(c.vem +.c.vem)]
306+ ::
307+ {s/$z c/*} $(vem [[%r %$ %$ %$] c.vem])
308+ * !!
309+ ==
310+
311+XX document
312+
313+### `++shep`
314+
315+ ++ shep
316+ |= {fom/@ gar/*}
317+ ^- tank
318+ =+ l=(met 3 fom)
319+ =+ i=0
320+ :- %leaf
321+ |- ^- tape
322+ ?: (gte i l)
323+ ~
324+ =+ c=(cut 3 [i 1] fom)
325+ ?. =(37 c)
326+ (weld (mesc [c ~]) $(i +(i)))
327+ =+ d=(cut 3 [+(i) 1] fom)
328+ ?. .?(gar)
329+ ['\\' '#' $(i (add 2 i))]
330+ (weld ~(ram re (show d -.gar)) $(i (add 2 i), gar +.gar))
331+ ::
332+
333+XX document
334+
335+### `++shop`
336+
337+ ++ shop
338+ |= {aug/* vel/$-(a/@ tape)}
339+ ^- tank
340+ ?: ?=(@ aug)
341+ [%leaf (vel aug)]
342+ :+ %rose
343+ [[' ' ~] ['[' ~] [']' ~]]
344+ => .(aug `*`aug)
345+ |- ^- (list tank)
346+ ?: ?=(@ aug)
347+ [^$ ~]
348+ [^$(aug -.aug) $(aug +.aug)]
349+ ::
350+
351+
352+XX document
353+
354+
355+
368***
356***
docs/system/hoon/library/4d.md+17−17
@@ -3,15 +3,15 @@
3
3
4Farther trace
4Farther trace
5
5
6−Compares two line-column pairs, called [`++hair`]()s, `zyc` and `naz`, producing whichever
6+Compares two line-column pairs, called `++hair`s, `zyc` and `naz`, producing whichever
7is further along.
7is further along.
8
8
9Accepts
9Accepts
10-------
10-------
11
11
12−`naz` is a [hair]().
12+`naz` is a hair.
13
13
14−`zyc` is a [hair]().
14+`zyc` is a hair.
15
15
16Produces
16Produces
17--------
17--------
@@ -21,24 +21,23 @@ a `++hair`.
21Source
21Source
22------
22------
23
23
24− ++ last |= [zyc=hair naz=hair] :: farther trace
24+ ++ last |= {zyc/hair naz/hair} :: farther trace
25 ^- hair
25 ^- hair
26 ?: =(p.zyc p.naz)
26 ?: =(p.zyc p.naz)
27 ?:((gth q.zyc q.naz) zyc naz)
27 ?:((gth q.zyc q.naz) zyc naz)
28 ?:((gth p.zyc p.naz) zyc naz)
28 ?:((gth p.zyc p.naz) zyc naz)
29− ::
30
29
31
30
32Examples
31Examples
33--------
32--------
34
33
35− ~zod/try=> (last [1 1] [1 2])
34+ > (last [1 1] [1 2])
36 [p=1 q=2]
35 [p=1 q=2]
37− ~zod/try=> (last [2 1] [1 2])
36+ > (last [2 1] [1 2])
38 [p=2 q=1]
37 [p=2 q=1]
39− ~zod/try=> (last [0 0] [99 0])
38+ > (last [0 0] [99 0])
40 [p=99 q=0]
39 [p=99 q=0]
41− ~zod/try=> (last [7 7] [7 7])
40+ > (last [7 7] [7 7])
42 [p=7 q=7]
41 [p=7 q=7]
43
42
44
43
@@ -48,7 +47,7 @@ Examples
48
47
49Detect newline
48Detect newline
50
49
51−Advances the [`++hair`]() `naz` by a row if the [`++char`]() `weq` is a newline, or by a
50+Advances the `++hair` `naz` by a row if the `++char` `weq` is a newline, or by a
52column if `weq` is any other character.
51column if `weq` is any other character.
53
52
54Accepts
53Accepts
@@ -66,23 +65,24 @@ A hair.
66Source
65Source
67------
66------
68
67
69− ++ lust |= [weq=char naz=hair] :: detect newline
68+ ++ lust |= {weq/char naz/hair} :: detect newline
70 ^- hair
69 ^- hair
71− ?:(=(10 weq) [+(p.naz) 1] [p.naz +(q.naz)])
70+ ?:(=(`@`10 weq) [+(p.naz) 1] [p.naz +(q.naz)])
71+
72
72
73
73
74Examples
74Examples
75--------
75--------
76
76
77− ~zod/try=> (lust `a` [1 1])
77+ > (lust `a` [1 1])
78 [p=1 q=2]
78 [p=1 q=2]
79− ~zod/try=> (lust `@t`10 [1 1])
79+ > (lust `@t`10 [1 1])
80 [p=2 q=1]
80 [p=2 q=1]
81− ~zod/try=> (lust '9' [10 10])
81+ > (lust '9' [10 10])
82 [p=10 q=11]
82 [p=10 q=11]
83− /~zod/try=> (roll "maze" [.(+<+ [1 1])]:lust)
83+ /> (roll "maze" [.(+<+ [1 1])]:lust)
84 [1 5]
84 [1 5]
85− /~zod/try=> %- roll :_ [.(+<+ [1 1])]:lust
85+ /> %- roll :_ [.(+<+ [1 1])]:lust
86 """
86 """
87 Sam
87 Sam
88 lokes
88 lokes
docs/system/hoon/library/4e.md+75−72
@@ -3,8 +3,8 @@
3
3
4Conditional composer
4Conditional composer
5
5
6−Parsing composer: connects the [`++edge`]() `vex` with the subsequent [`++rule`]() `sab`
6+Parsing composer: connects the `++edge` `vex` with the subsequent `++rule` `sab`
7−as an optional suffix, using [gate]() `raq` to compose or reject its
7+as an optional suffix, using gate `raq` to compose or reject its
8result. If there is no suffix, or if the suffix fails to be composed
8result. If there is no suffix, or if the suffix fails to be composed
9with the current result, the current result is produced. Used to map a
9with the current result, the current result is produced. Used to map a
10group of rules to a specified output.
10group of rules to a specified output.
@@ -12,25 +12,25 @@ group of rules to a specified output.
12Accepts
12Accepts
13-------
13-------
14
14
15−`raq` is a [gate]().
15+`raq` is a gate.
16
16
17−`sab` is a [rule]().
17+`sab` is a rule.
18
18
19−`vex` is an [edge]().
19+`vex` is an edge.
20
20
21Produces
21Produces
22--------
22--------
23
23
24−A [`++rule`]().
24+A `++rule`.
25
25
26Source
26Source
27------
27------
28
28
29 ++ bend :: conditional comp
29 ++ bend :: conditional comp
30 ~/ %bend
30 ~/ %bend
31− |* raq=_|*([a=* b=*] [~ u=[a b]])
31+ |* raq/_|*({a/* b/*} [~ u=[a b]])
32 ~/ %fun
32 ~/ %fun
33− |* [vex=edge sab=_rule]
33+ |* {vex/edge sab/rule}
34 ?~ q.vex
34 ?~ q.vex
35 vex
35 vex
36 =+ yit=(sab q.u.q.vex)
36 =+ yit=(sab q.u.q.vex)
@@ -46,18 +46,18 @@ Source
46Examples
46Examples
47--------
47--------
48
48
49− ~zod/try=> (;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qs")
49+ > (;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qs")
50 [p=[p=1 q=3] q=[~ u=[p=~~q q=[p=[p=1 q=2] q="s"]]]]
50 [p=[p=1 q=3] q=[~ u=[p=~~q q=[p=[p=1 q=2] q="s"]]]]
51− ~zod/try=> (;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qqq")
51+ > (;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qqq")
52 [p=[p=1 q=3] q=[~ u=[p=~~r q=[p=[p=1 q=3] q="q"]]]]
52 [p=[p=1 q=3] q=[~ u=[p=~~r q=[p=[p=1 q=3] q="q"]]]]
53− ~zod/try=> (scan "aa" ;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn))
53+ > (scan "aa" ;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn))
54 ~~b
54 ~~b
55− ~zod/try=> (scan "ba" ;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn))
55+ > (scan "ba" ;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn))
56 ! {1 3}
56 ! {1 3}
57 ! exit
57 ! exit
58− ~zod/try=> `(unit ,@tas)`(scan "" ;~((bend) (easy ~) sym))
58+ > `(unit @tas)`(scan "" ;~((bend) (easy ~) sym))
59 ~
59 ~
60− ~zod/try=> `(unit ,@tas)`(scan "sep" ;~((bend) (easy ~) sym))
60+ > `(unit @tas)`(scan "sep" ;~((bend) (easy ~) sym))
61 [~ %sep]
61 [~ %sep]
62
62
63
63
@@ -67,14 +67,14 @@ Examples
67
67
68Arbitrary compose
68Arbitrary compose
69
69
70−Parsing composer: connects the [`++edge`]() `vex` with a following [`++rule`]() `sab`,
70+Parsing composer: connects the `++edge` `vex` with a following `++rule` `sab`,
71combining the contents of `vex` with the result of `sab` using a binary
71combining the contents of `vex` with the result of `sab` using a binary
72−[gate]() `raq`. Used to fold over the results of several `++rules`.
72+gate `raq`. Used to fold over the results of several `++rules`.
73
73
74Accepts
74Accepts
75-------
75-------
76
76
77−`raq` is a gate that accepts a cell of two [nouns](), `a` and `b`, and
77+`raq` is a gate that accepts a cell of two nouns, `a` and `b`, and
78produces a cell of two nouns.
78produces a cell of two nouns.
79
79
80`sab` is a rule.
80`sab` is a rule.
@@ -84,16 +84,17 @@ produces a cell of two nouns.
84Produces
84Produces
85--------
85--------
86
86
87−A [`++rule`]().
87+A `++rule`.
88
88
89Source
89Source
90------
90------
91
91
92 ++ comp
92 ++ comp
93 ~/ %comp
93 ~/ %comp
94− |* raq=_|*([a=* b=*] [a b]) :: arbitrary compose
94+ |* raq/_|*({a/* b/*} [a b]) :: arbitrary compose
95 ~/ %fun
95 ~/ %fun
96− |* [vex=edge sab=_rule]
96+ |* {vex/edge sab/rule}
97+ ~! +<
97 ?~ q.vex
98 ?~ q.vex
98 vex
99 vex
99 =+ yit=(sab q.u.q.vex)
100 =+ yit=(sab q.u.q.vex)
@@ -106,9 +107,9 @@ Source
106Examples
107Examples
107--------
108--------
108
109
109− ~zod/try=> (scan "123" ;~((comp |=([a=@u b=@u] (add a b))) dit dit dit))
110+ > (scan "123" ;~((comp |=([a/@u b/@u] (add a b))) dit dit dit))
110 6
111 6
111− ~zod/try=> (scan "12" ;~((comp |=([a=@u b=@u] (add a b))) dit dit dit))
112+ > (scan "12" ;~((comp |=([a/@u b/@u] (add a b))) dit dit dit))
112 ! {1 3}
113 ! {1 3}
113 ! exit
114 ! exit
114
115
@@ -117,13 +118,13 @@ Examples
117
118
118Never parse
119Never parse
119
120
120−Produces an [`++edge`]() at the same text position ([`++hair`]()) with a failing
121+Produces an `++edge` at the same text position (`++hair`) with a failing
121result (`q=~`).
122result (`q=~`).
122
123
123Accepts
124Accepts
124-------
125-------
125
126
126−`tub` is a [`++nail`]().
127+`tub` is a `++nail`.
127
128
128Produces
129Produces
129--------
130--------
@@ -133,14 +134,14 @@ An `++edge`.
133Source
134Source
134------
135------
135
136
136− ++ fail |=(tub=nail [p=p.tub q=~]) :: never parse
137+ ++ fail |=(tub/nail [p=p.tub q=~]) :: never parse
137
138
138Examples
139Examples
139--------
140--------
140
141
141− ~zod/try=> (fail [[1 1] "abc"])
142+ > (fail [[1 1] "abc"])
142 [p=[p=1 q=1] q=~]
143 [p=[p=1 q=1] q=~]
143− ~zod/try=> (fail [[p=1.337 q=70] "Parse me, please?"])
144+ > (fail [[p=1.337 q=70] "Parse me, please?"])
144 [p=[p=1.337 q=70] q=~]
145 [p=[p=1.337 q=70] q=~]
145
146
146
147
@@ -150,7 +151,7 @@ Examples
150
151
151Skip delimiter
152Skip delimiter
152
153
153−Parsing composer: connects an [`++edge`]() `vex` with a following [`++rule`]() `sab` by
154+Parsing composer: connects an `++edge` `vex` with a following `++rule` `sab` by
154parsing the `++rule` `bus` (the delimiting symbol) and throwing out the
155parsing the `++rule` `bus` (the delimiting symbol) and throwing out the
155result.
156result.
156
157
@@ -173,22 +174,22 @@ Source
173
174
174 ++ glue :: add rule
175 ++ glue :: add rule
175 ~/ %glue
176 ~/ %glue
176− |* bus=_rule
177+ |* bus/rule
177 ~/ %fun
178 ~/ %fun
178− |* [vex=edge sab=_rule]
179+ |* {vex/edge sab/rule}
179 (plug vex ;~(pfix bus sab))
180 (plug vex ;~(pfix bus sab))
180 ::
181 ::
181
182
182Examples
183Examples
183--------
184--------
184
185
185− ~zod/try=> (scan "200|mal|bon" ;~((glue bar) dem sym sym))
186+ > (scan "200|mal|bon" ;~((glue bar) dem sym sym))
186 [q=200 7.102.829 7.237.474]
187 [q=200 7.102.829 7.237.474]
187− ~zod/try=> `[@u @tas @tas]`(scan "200|mal|bon" ;~((glue bar) dem sym sym))
188+ > `[@u @tas @tas]`(scan "200|mal|bon" ;~((glue bar) dem sym sym))
188 [200 %mal %bon]
189 [200 %mal %bon]
189− ~zod/try=> (scan "200|;|bon" ;~((glue bar) dem sem sym))
190+ > (scan "200|;|bon" ;~((glue bar) dem sem sym))
190 [q=200 ~~~3b. 7.237.474]
191 [q=200 ~~~3b. 7.237.474]
191− ~zod/try=> (scan "200.;.bon" ;~((glue dot) dem sem sym))
192+ > (scan "200.;.bon" ;~((glue dot) dem sem sym))
192 [q=200 ~~~3b. 7.237.474]
193 [q=200 ~~~3b. 7.237.474]
193
194
194
195
@@ -198,8 +199,8 @@ Examples
198
199
199Parse unless
200Parse unless
200
201
201−Parsing composer: if an [`++edge`]() `vex` reflects a success, fail. Otherwise,
202+Parsing composer: if an `++edge` `vex` reflects a success, fail. Otherwise,
202−connect `vex` with the following [`++rule`]().
203+connect `vex` with the following `++rule`.
203
204
204Accepts
205Accepts
205-------
206-------
@@ -217,22 +218,22 @@ Source
217------
218------
218
219
219 ++ less :: no first and second
220 ++ less :: no first and second
220− |* [vex=edge sab=_rule]
221+ |* {vex/edge sab/rule}
221 ?~ q.vex
222 ?~ q.vex
222 =+ roq=(sab)
223 =+ roq=(sab)
223 [p=(last p.vex p.roq) q=q.roq]
224 [p=(last p.vex p.roq) q=q.roq]
224− vex(q ~)
225+ (fail +<.sab)
225 ::
226 ::
226
227
227Examples
228Examples
228--------
229--------
229
230
230− ~zod/try=> (scan "sas-/lo" (star ;~(less lus bar prn)))
231+ > (scan "sas-/lo" (star ;~(less lus bar prn)))
231 "sas-/lo"
232 "sas-/lo"
232− ~zod/try=> (scan "sas-/l+o" (star ;~(less lus bar prn)))
233+ > (scan "sas-/l+o" (star ;~(less lus bar prn)))
233 ! {1 8}
234 ! {1 8}
234 ! exit
235 ! exit
235− ~zod/try=> (scan "sas|-/lo" (star ;~(less lus bar prn)))
236+ > (scan "sas|-/lo" (star ;~(less lus bar prn)))
236 ! {1 5}
237 ! {1 5}
237 ! exit
238 ! exit
238
239
@@ -243,13 +244,13 @@ Examples
243
244
244Discard first rule
245Discard first rule
245
246
246−Parsing composer: connects an [`++edge`]() `vex` with two subsequent [`++rule`]()s,
247+Parsing composer: connects an `++edge` `vex` with two subsequent `++rule`s,
247ignoring the result of the first and producing the result of the second.
248ignoring the result of the first and producing the result of the second.
248
249
249Accepts
250Accepts
250-------
251-------
251
252
252−`vex` is an [edge]().
253+`vex` is an edge.
253
254
254Produces
255Produces
255--------
256--------
@@ -261,15 +262,14 @@ Source
261
262
262 ++ pfix :: discard first rule
263 ++ pfix :: discard first rule
263 ~/ %pfix
264 ~/ %pfix
264− (comp |*([a=* b=*] b))
265+ (comp |*({a/* b/*} b))
265− ::
266
266
267Examples
267Examples
268--------
268--------
269
269
270− ~zod/try=> `@t`(scan "%him" ;~(pfix cen sym))
270+ > `@t`(scan "%him" ;~(pfix cen sym))
271 'him'
271 'him'
272− ~zod/try=> (scan "+++10" ;~(pfix (star lus) dem))
272+ > (scan "+++10" ;~(pfix (star lus) dem))
273 q=10
273 q=10
274
274
275
275
@@ -279,8 +279,8 @@ Examples
279
279
280Parse to tuple
280Parse to tuple
281
281
282−Parsing composer: connects an [`++edge`]() `vex` with a following [`++rule`]() `sab`, producing
282+Parsing composer: connects an `++edge` `vex` with a following `++rule` `sab`, producing
283−a cell of both the results. See also: the monad applicator [;\~]() for a
283+a cell of both the results. See also: the monad applicator ;\~ for a
284more detailed explanation.
284more detailed explanation.
285
285
286Accepts
286Accepts
@@ -300,7 +300,7 @@ Source
300
300
301 ++ plug :: first then second
301 ++ plug :: first then second
302 ~/ %plug
302 ~/ %plug
303− |* [vex=edge sab=_rule]
303+ |* {vex/edge sab/rule}
304 ?~ q.vex
304 ?~ q.vex
305 vex
305 vex
306 =+ yit=(sab q.u.q.vex)
306 =+ yit=(sab q.u.q.vex)
@@ -313,11 +313,11 @@ Source
313Examples
313Examples
314--------
314--------
315
315
316− ~zod/try=> (scan "1..20" ;~(plug dem dot dot dem))
316+ > (scan "1..20" ;~(plug dem dot dot dem))
317 [q=1 ~~~. ~~~. q=20]
317 [q=1 ~~~. ~~~. q=20]
318− ~zod/try=> (scan "moke/~2014.1.1" ;~(plug sym fas nuck:so))
318+ > (scan "moke/~2014.1.1" ;~(plug sym fas nuck:so))
319 [1.701.539.693 ~~~2f. [% p=[p=~.da q=170.141.184.500.766.106.671.844.917.172.921.958.400]]]
319 [1.701.539.693 ~~~2f. [% p=[p=~.da q=170.141.184.500.766.106.671.844.917.172.921.958.400]]]
320− ~zod/try=> ;;(,[@tas @t ~ %da @da] (scan "moke/~2014.1.1" ;~(plug sym fas nuck:so)))
320+ > ;;(,[@tas @t ~ %da @da] (scan "moke/~2014.1.1" ;~(plug sym fas nuck:so)))
321 [%moke '/' ~ %da ~2014.1.1]
321 [%moke '/' ~ %da ~2014.1.1]
322
322
323
323
@@ -328,14 +328,14 @@ Examples
328Parse options
328Parse options
329
329
330Parsing composer: if `vex` reflects a failure, connect it with the
330Parsing composer: if `vex` reflects a failure, connect it with the
331−following rule `sab`. See also: the monad applicator [;\~]()
331+following rule `sab`. See also: the monad applicator ;\~
332
332
333Accepts
333Accepts
334-------
334-------
335
335
336−`sab` is a [`++rule`]().
336+`sab` is a `++rule`.
337
337
338−`vex` is an [`++edge`]().
338+`vex` is an `++edge`.
339
339
340Produces
340Produces
341--------
341--------
@@ -347,22 +347,24 @@ Source
347
347
348 ++ pose :: first or second
348 ++ pose :: first or second
349 ~/ %pose
349 ~/ %pose
350− |* [vex=edge sab=_rule]
350+ |* {vex/edge sab/rule}
351 ?~ q.vex
351 ?~ q.vex
352 =+ roq=(sab)
352 =+ roq=(sab)
353 [p=(last p.vex p.roq) q=q.roq]
353 [p=(last p.vex p.roq) q=q.roq]
354 vex
354 vex
355+ ::
356+
355
357
356Examples
358Examples
357--------
359--------
358
360
359− ~zod/try=> `@t`(scan "+" ;~(pose lus tar cen))
361+ > `@t`(scan "+" ;~(pose lus tar cen))
360 '+'
362 '+'
361− ~zod/try=> `@t`(scan "*" ;~(pose lus tar cen))
363+ > `@t`(scan "*" ;~(pose lus tar cen))
362 '*'
364 '*'
363− ~zod/try=> `@t`(scan "%" ;~(pose lus tar cen))
365+ > `@t`(scan "%" ;~(pose lus tar cen))
364 '%'
366 '%'
365− ~zod/try=> `@t`(scan "-" ;~(pose lus tar cen))
367+ > `@t`(scan "-" ;~(pose lus tar cen))
366 ! {1 1}
368 ! {1 1}
367 ! exit
369 ! exit
368
370
@@ -373,7 +375,7 @@ Examples
373
375
374Discard second rule
376Discard second rule
375
377
376−Parsing composer: connects [`++edge`]()s `vex` with two subsequent [`++rule`]()s returning the
378+Parsing composer: connects `++edge`s `vex` with two subsequent `++rule`s returning the
377result of the first and discarding the result of the second.
379result of the first and discarding the result of the second.
378
380
379Accepts
381Accepts
@@ -393,14 +395,15 @@ Source
393
395
394 ++ sfix :: discard second rule
396 ++ sfix :: discard second rule
395 ~/ %sfix
397 ~/ %sfix
396− (comp |*([a=* b=*] a))
398+ (comp |*({a/* b/*} a))
399+
397
400
398Examples
401Examples
399--------
402--------
400
403
401− ~zod/try=> `@t`(scan "him%" ;~(sfix sym cen))
404+ > `@t`(scan "him%" ;~(sfix sym cen))
402 'him'
405 'him'
403− ~zod/try=> (scan "10+++" ;~(sfix dem (star lus)))
406+ > (scan "10+++" ;~(sfix dem (star lus)))
404 q=10
407 q=10
405
408
406
409
@@ -410,8 +413,8 @@ Examples
410
413
411First and second
414First and second
412
415
413−Parsing composer: if an [`++edge`]() `vex` reflects a failure, fail. Otherwise,
416+Parsing composer: if an `++edge` `vex` reflects a failure, fail. Otherwise,
414−connect `vex` with the following [`++rule`]().
417+connect `vex` with the following `++rule`.
415
418
416Accepts
419Accepts
417-------
420-------
@@ -429,7 +432,7 @@ Source
429------
432------
430
433
431 ++ simu :: first and second
434 ++ simu :: first and second
432− |* [vex=edge sab=_rule]
435+ |* {vex/edge sab/rule}
433 ?~ q.vex
436 ?~ q.vex
434 vex
437 vex
435 =+ roq=(sab)
438 =+ roq=(sab)
@@ -439,13 +442,13 @@ Source
439Examples
442Examples
440--------
443--------
441
444
442− ~zod/try=> (scan "~zod" scat:vast)
445+ > (scan "~zod" scat:vast)
443 [%dtzy p=%p q=0]
446 [%dtzy p=%p q=0]
444− ~zod/try=> (scan "%zod" scat:vast)
447+ > (scan "%zod" scat:vast)
445 [%dtzz p=%tas q=6.582.138]
448 [%dtzz p=%tas q=6.582.138]
446− ~zod/try=> (scan "%zod" ;~(simu cen scat:vast))
449+ > (scan "%zod" ;~(simu cen scat:vast))
447 [%dtzz p=%tas q=6.582.138]
450 [%dtzz p=%tas q=6.582.138]
448− ~zod/try=> (scan "~zod" ;~(simu cen scat:vast))
451+ > (scan "~zod" ;~(simu cen scat:vast))
449 ! {1 1}
452 ! {1 1}
450 ! exit
453 ! exit
451
454
docs/system/hoon/library/4f.md+221−201
@@ -1,41 +1,43 @@
1# 4f: parsing (rule builders)
1# 4f: parsing (rule builders)
2### `++bass`
2### `++bass`
3
3
4−Parser modifier: [LSB](http://en.wikipedia.org/wiki/Least_significant_bit)
4+Parser modifier: LSB
5−ordered [`++list`]() as atom of a [`++base`]().
5+ordered `++list` as atom of a `++base`.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10`wuc` is an atom.
10`wuc` is an atom.
11
11
12−`tyd` is a [`++rule`]().
12+`tyd` 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 ++ bass
22 ++ bass
23− |* [wuc=@ tyd=_rule]
23+ |* {wuc/@ tyd/rule}
24 %+ cook
24 %+ cook
25− |= waq=(list ,@)
25+ |= waq/(list @)
26 %+ roll
26 %+ roll
27 waq
27 waq
28− =|([p=@ q=@] |.((add p (mul wuc q))))
28+ =|({p/@ q/@} |.((add p (mul wuc q))))
29 tyd
29 tyd
30+ ::
31+
30
32
31Examples
33Examples
32--------
34--------
33
35
34− ~zod/try=> (scan "123" (bass 10 (star dit)))
36+ > (scan "123" (bass 10 (star dit)))
35 q=123
37 q=123
36− ~zod/try=> (scan "123" (bass 8 (star dit)))
38+ > (scan "123" (bass 8 (star dit)))
37 q=83
39 q=83
38− ~zod/try=> `@ub`(scan "123" (bass 8 (star dit)))
40+ > `@ub`(scan "123" (bass 8 (star dit)))
39 0b101.0011
41 0b101.0011
40
42
41
43
@@ -44,41 +46,43 @@ Examples
44
46
45### `++boss`
47### `++boss`
46
48
47−Parser modifier: [LSB](http://en.wikipedia.org/wiki/Least_significant_bit)
49+Parser modifier: LSB
50+
48−ordered [`++list`]() as atom of a [`++base`]().
51+Ordered `++list` as atom of a `++base`.
49
52
50Accepts
53Accepts
51-------
54-------
52
55
53`wuc` is an atom.
56`wuc` is an atom.
54
57
55−`tyd` is a [`++rule`]().
58+`tyd` is a `++rule`.
56
59
57Produces
60Produces
58--------
61--------
59
62
60−A [`++rule`]().
63+A `++rule`.
61
64
62Source
65Source
63------
66------
64
67
65 ++ boss
68 ++ boss
66− |* [wuc=@ tyd=_rule]
69+ |* {wuc/@ tyd/rule}
67 %+ cook
70 %+ cook
68− |= waq=(list ,@)
71+ |= waq/(list @)
69 %+ reel
72 %+ reel
70 waq
73 waq
71− =|([p=@ q=@] |.((add p (mul wuc q))))
74+ =|({p/@ q/@} |.((add p (mul wuc q))))
72 tyd
75 tyd
76+ ::
73
77
74Examples
78Examples
75--------
79--------
76
80
77− ~zod/try=> (scan "123" (boss 10 (star dit)))
81+ > (scan "123" (boss 10 (star dit)))
78 q=321
82 q=321
79− ~zod/try=> `@t`(scan "bam" (boss 256 (star alp)))
83+ > `@t`(scan "bam" (boss 256 (star alp)))
80 'bam'
84 'bam'
81− ~zod/try=> `@ux`(scan "bam" (boss 256 (star alp)))
85+ > `@ux`(scan "bam" (boss 256 (star alp)))
82 0x6d.6162
86 0x6d.6162
83
87
84
88
@@ -87,41 +91,40 @@ Examples
87
91
88Replace with constant
92Replace with constant
89
93
90−Parser modifier. Accepts a [`++rule`]() `sef` and produces a parser that
94+Parser modifier. Accepts a `++rule` `sef` and produces a parser that
91produces a constant `cus`, assuming `sef` is successful.
95produces a constant `cus`, assuming `sef` is successful.
92
96
93Accepts
97Accepts
94-------
98-------
95
99
96−`cus` is a constant [noun]().
100+`cus` is a constant noun.
97
101
98`sef` is a `++rule`.
102`sef` is a `++rule`.
99
103
100Produces
104Produces
101--------
105--------
102
106
103−An [`++edge`]().
107+An `++edge`.
104
108
105Source
109Source
106------
110------
107
111
108− ++ cold :: replace w/ constant
112+ ++ cold :: replace w+ constant
109 ~/ %cold
113 ~/ %cold
110− |* [cus=* sef=_rule]
114+ |* {cus/* sef/rule}
111 ~/ %fun
115 ~/ %fun
112− |= tub=nail
116+ |= tub/nail
113 =+ vex=(sef tub)
117 =+ vex=(sef tub)
114 ?~ q.vex
118 ?~ q.vex
115 vex
119 vex
116 [p=p.vex q=[~ u=[p=cus q=q.u.q.vex]]]
120 [p=p.vex q=[~ u=[p=cus q=q.u.q.vex]]]
117− ::
118
121
119Examples
122Examples
120--------
123--------
121
124
122− ~zod/try=> ((cold %foo (just 'a')) [[1 1] "abc"])
125+ > ((cold %foo (just 'a')) [[1 1] "abc"])
123 [p=[p=1 q=2] q=[~ u=[p=%foo q=[p=[p=1 q=2] q="bc"]]]]
126 [p=[p=1 q=2] q=[~ u=[p=%foo q=[p=[p=1 q=2] q="bc"]]]]
124− ~zod/try=> ((cold %foo (just 'a')) [[1 1] "bc"])
127+ > ((cold %foo (just 'a')) [[1 1] "bc"])
125 [p=[p=1 q=1] q=~]
128 [p=[p=1 q=1] q=~]
126
129
127
130
@@ -132,28 +135,28 @@ Examples
132Apply gate
135Apply gate
133
136
134Parser modifier. Produces a parser that takes a (successful) result of a
137Parser modifier. Produces a parser that takes a (successful) result of a
135−[`++rule`]() `sef` and slams it through `poq`.
138+`++rule` `sef` and slams it through `poq`.
136
139
137Accepts
140Accepts
138-------
141-------
139
142
140−`poq` is a [gate]().
143+`poq` is a gate.
141
144
142−`sef` is a [`++rule`]().
145+`sef` is a `++rule`.
143
146
144Produces
147Produces
145--------
148--------
146
149
147−An [`++rule`]().
150+An `++rule`.
148
151
149Source
152Source
150------
153------
151
154
152 ++ cook :: apply gate
155 ++ cook :: apply gate
153 ~/ %cook
156 ~/ %cook
154− |* [poq=_,* sef=_rule]
157+ |* {poq/$-(* *) sef/rule}
155 ~/ %fun
158 ~/ %fun
156− |= tub=nail
159+ |= tub/nail
157 =+ vex=(sef tub)
160 =+ vex=(sef tub)
158 ?~ q.vex
161 ?~ q.vex
159 vex
162 vex
@@ -163,13 +166,13 @@ Source
163Examples
166Examples
164--------
167--------
165
168
166− ~zod/try=> ((cook ,@ud (just 'a')) [[1 1] "abc"])
169+ > ((cook ,@ud (just 'a')) [[1 1] "abc"])
167 [p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]]
170 [p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]]
168− ~zod/try=> ((cook ,@tas (just 'a')) [[1 1] "abc"])
171+ > ((cook ,@tas (just 'a')) [[1 1] "abc"])
169 [p=[p=1 q=2] q=[~ u=[p=%a q=[p=[p=1 q=2] q="bc"]]]]
172 [p=[p=1 q=2] q=[~ u=[p=%a q=[p=[p=1 q=2] q="bc"]]]]
170− ~zod/try=> ((cook |=(a=@ +(a)) (just 'a')) [[1 1] "abc"])
173+ > ((cook |=(a=@ +(a)) (just 'a')) [[1 1] "abc"])
171 [p=[p=1 q=2] q=[~ u=[p=98 q=[p=[p=1 q=2] q="bc"]]]]
174 [p=[p=1 q=2] q=[~ u=[p=98 q=[p=[p=1 q=2] q="bc"]]]]
172− ~zod/try=> ((cook |=(a=@ `@t`+(a)) (just 'a')) [[1 1] "abc"])
175+ > ((cook |=(a=@ `@t`+(a)) (just 'a')) [[1 1] "abc"])
173 [p=[p=1 q=2] q=[~ u=[p='b' q=[p=[p=1 q=2] q="bc"]]]]
176 [p=[p=1 q=2] q=[~ u=[p='b' q=[p=[p=1 q=2] q="bc"]]]]
174
177
175
178
@@ -179,7 +182,7 @@ Examples
179
182
180Always parse
183Always parse
181
184
182−Parser generator. Produces a parser that succeeds with given [noun]() `huf`
185+Parser generator. Produces a parser that succeeds with given noun `huf`
183without consuming any text.
186without consuming any text.
184
187
185Accepts
188Accepts
@@ -190,7 +193,7 @@ Accepts
190Produces
193Produces
191--------
194--------
192
195
193−A [`++rule`]().
196+A `++rule`.
194
197
195Source
198Source
196------
199------
@@ -207,11 +210,11 @@ Source
207Examples
210Examples
208--------
211--------
209
212
210− ~zod/try=> ((easy %foo) [[1 1] "abc"])
213+ > ((easy %foo) [[1 1] "abc"])
211 [p=[p=1 q=1] q=[~ [p=%foo q=[p=[p=1 q=1] q="abc"]]]]
214 [p=[p=1 q=1] q=[~ [p=%foo q=[p=[p=1 q=1] q="abc"]]]]
212− ~zod/try=> ((easy %foo) [[1 1] "bc"])
215+ > ((easy %foo) [[1 1] "bc"])
213 [p=[p=1 q=1] q=[~ [p=%foo q=[p=[p=1 q=1] q="bc"]]]]
216 [p=[p=1 q=1] q=[~ [p=%foo q=[p=[p=1 q=1] q="bc"]]]]
214− ~zod/try=> ((easy 'a') [[1 1] "bc"])
217+ > ((easy 'a') [[1 1] "bc"])
215 [p=[p=1 q=1] q=[~ [p='a' q=[p=[p=1 q=1] q="bc"]]]]
218 [p=[p=1 q=1] q=[~ [p='a' q=[p=[p=1 q=1] q="bc"]]]]
216
219
217
220
@@ -221,13 +224,13 @@ Examples
221
224
222Parse to end
225Parse to end
223
226
224−Parser modifier. Accepts a [`++rule`]() `sef`, and produces a parser that succeeds only
227+Parser modifier. Accepts a `++rule` `sef`, and produces a parser that succeeds only
225when the of `tub` is fully consumed using `sef`.
228when the of `tub` is fully consumed using `sef`.
226
229
227Accepts
230Accepts
228-------
231-------
229
232
230−`sef` is a [`++rule`]().
233+`sef` is a `++rule`.
231
234
232Produces
235Produces
233--------
236--------
@@ -247,11 +250,11 @@ Source
247Examples
250Examples
248--------
251--------
249
252
250− ~zod/try=> ((full (just 'a')) [[1 1] "ab"])
253+ > ((full (just 'a')) [[1 1] "ab"])
251 [p=[p=1 q=2] q=~]
254 [p=[p=1 q=2] q=~]
252− ~zod/try=> ((full (jest 'ab')) [[1 1] "ab"])
255+ > ((full (jest 'ab')) [[1 1] "ab"])
253 [p=[p=1 q=3] q=[~ u=[p='ab' q=[p=[p=1 q=3] q=""]]]]
256 [p=[p=1 q=3] q=[~ u=[p='ab' q=[p=[p=1 q=3] q=""]]]]
254− ~zod/try=> ((full ;~(plug (just 'a') (just 'b'))) [[1 1] "ab"])
257+ > ((full ;~(plug (just 'a') (just 'b'))) [[1 1] "ab"])
255 [p=[p=1 q=3] q=[~ u=[p=[~~a ~~b] q=[p=[p=1 q=3] q=""]]]]
258 [p=[p=1 q=3] q=[~ u=[p=[~~a ~~b] q=[p=[p=1 q=3] q=""]]]]
256
259
257
260
@@ -261,14 +264,14 @@ Examples
261
264
262Add to tape
265Add to tape
263
266
264−Parser modifier: prepend text to [`++tape`]() before applying parser.
267+Parser modifier: prepend text to `++tape` before applying parser.
265
268
266Accepts
269Accepts
267-------
270-------
268
271
269`pre` is a `++tape`
272`pre` is a `++tape`
270
273
271−`sef` is a [`++rule`]()
274+`sef` is a `++rule`
272
275
273Produces
276Produces
274--------
277--------
@@ -279,17 +282,16 @@ Source
279------
282------
280
283
281 ++ funk :: add to tape first
284 ++ funk :: add to tape first
282− |* [pre=tape sef=_rule]
285+ |* {pre/tape sef/rule}
283− |= tub=nail
286+ |= tub/nail
284 (sef p.tub (weld pre q.tub))
287 (sef p.tub (weld pre q.tub))
285− ::
286
288
287Examples
289Examples
288--------
290--------
289
291
290− ~zod/try=> ((funk "abc prefix-" (jest 'abc')) [[1 1] "to be parsed"])
292+ > ((funk "abc prefix-" (jest 'abc')) [[1 1] "to be parsed"])
291 [p=[p=1 q=4] q=[~ [p='abc' q=[p=[p=1 q=4] q=" prefix-to be parsed"]]]]
293 [p=[p=1 q=4] q=[~ [p='abc' q=[p=[p=1 q=4] q=" prefix-to be parsed"]]]]
292− ~zod/try=> ((funk "parse" (just 'a')) [[1 4] " me"])
294+ > ((funk "parse" (just 'a')) [[1 4] " me"])
293 [p=[p=1 q=4] q=~]
295 [p=[p=1 q=4] q=~]
294
296
295
297
@@ -299,16 +301,16 @@ Examples
299
301
300Place-based apply
302Place-based apply
301
303
302−Parser modifier. Similar to [`++cook`]() in that it produces a parser that takes a
304+Parser modifier. Similar to `++cook` in that it produces a parser that takes a
303(successful) result of `sef` and slams it through `hez`. `hez` accepts a
305(successful) result of `sef` and slams it through `hez`. `hez` accepts a
304−[`++pint`]() `a` and a [noun]() `b`, which is what the parser parsed.
306+`++pint` `a` and a noun `b`, which is what the parser parsed.
305
307
306Accepts
308Accepts
307-------
309-------
308
310
309−`hez` is a [gate]().
311+`hez` is a gate.
310
312
311−`sef` is a [`++rule`]()
313+`sef` is a `++rule`
312
314
313Produces
315Produces
314--------
316--------
@@ -320,9 +322,9 @@ Source
320
322
321 ++ here :: place-based apply
323 ++ here :: place-based apply
322 ~/ %here
324 ~/ %here
323− |* [hez=_|=([a=pint b=*] [a b]) sef=_rule]
325+ |* {hez/_|=({a/pint b/*} [a b]) sef/rule}
324 ~/ %fun
326 ~/ %fun
325− |= tub=nail
327+ |= tub/nail
326 =+ vex=(sef tub)
328 =+ vex=(sef tub)
327 ?~ q.vex
329 ?~ q.vex
328 vex
330 vex
@@ -332,11 +334,11 @@ Source
332Examples
334Examples
333--------
335--------
334
336
335− ~zod/try=> (scan "abc" (star alf))
337+ > (scan "abc" (star alf))
336 "abc"
338 "abc"
337− ~zod/try=> (scan "abc" (here |*(^ +<) (star alf)))
339+ > (scan "abc" (here |*(^ +<) (star alf)))
338 [[[p=1 q=1] p=1 q=4] "abc"]
340 [[[p=1 q=1] p=1 q=4] "abc"]
339− ~zod/try=> (scan "abc" (star (here |*(^ +<) alf)))
341+ > (scan "abc" (star (here |*(^ +<) alf)))
340 ~[[[[p=1 q=1] p=1 q=2] ~~a] [[[p=1 q=2] p=1 q=3] ~~b] [[[p=1 q=3] p=1 q=4] ~~c]]
342 ~[[[[p=1 q=1] p=1 q=2] ~~a] [[[p=1 q=2] p=1 q=3] ~~b] [[[p=1 q=3] p=1 q=4] ~~c]]
341
343
342
344
@@ -346,7 +348,7 @@ Examples
346
348
347Infix
349Infix
348
350
349−Parser modifier: surround with pair of [`++rule`]()s, the output of which is
351+Parser modifier: surround with pair of `++rule`s, the output of which is
350discarded.
352discarded.
351
353
352Accepts
354Accepts
@@ -365,15 +367,19 @@ Source
365------
367------
366
368
367 ++ ifix
369 ++ ifix
368− |* [fel=[p=_rule q=_rule] hof=_rule]
370+ |* {fel/{rule rule} hof/rule}
371+ ~! +<
372+ ~! +<:-.fel
373+ ~! +<:+.fel
369− ;~(pfix p.fel ;~(sfix hof q.fel))
374+ ;~(pfix -.fel ;~(sfix hof +.fel))
375+ ::
370
376
371Examples
377Examples
372--------
378--------
373
379
374− ~zod/try=> (scan "-40-" (ifix [hep hep] dem))
380+ > (scan "-40-" (ifix [hep hep] dem))
375 q=40
381 q=40
376− ~zod/try=> (scan "4my4" (ifix [dit dit] (star alf)))
382+ > (scan "4my4" (ifix [dit dit] (star alf)))
377 "my"
383 "my"
378
384
379
385
@@ -388,24 +394,24 @@ Match and consume a cord.
388Accepts
394Accepts
389-------
395-------
390
396
391−`daf` is a [`@t`]().
397+`daf` is a `@t`.
392
398
393Produces
399Produces
394--------
400--------
395
401
396−An [`++edge`]().
402+An `++edge`.
397
403
398Source
404Source
399------
405------
400
406
401 ++ jest :: match a cord
407 ++ jest :: match a cord
402− |= daf=@t
408+ |= daf/@t
403− |= tub=nail
409+ |= tub/nail
404 =+ fad=daf
410 =+ fad=daf
405− |- ^- (like ,@t)
411+ |- ^- (like @t)
406− ?: =(0 daf)
412+ ?: =(`@`0 daf)
407 [p=p.tub q=[~ u=[p=fad q=tub]]]
413 [p=p.tub q=[~ u=[p=fad q=tub]]]
408− ?: |(?=(~ q.tub) !=((end 3 1 daf) i.q.tub))
414+ ?: |(?=($~ q.tub) !=((end 3 1 daf) i.q.tub))
409 (fail tub)
415 (fail tub)
410 $(p.tub (lust i.q.tub p.tub), q.tub t.q.tub, daf (rsh 3 1 daf))
416 $(p.tub (lust i.q.tub p.tub), q.tub t.q.tub, daf (rsh 3 1 daf))
411 ::
417 ::
@@ -413,17 +419,17 @@ Source
413Examples
419Examples
414--------
420--------
415
421
416− ~zod/try=> ((jest 'abc') [[1 1] "abc"])
422+ > ((jest 'abc') [[1 1] "abc"])
417 [p=[p=1 q=4] q=[~ [p='abc' q=[p=[p=1 q=4] q=""]]]]
423 [p=[p=1 q=4] q=[~ [p='abc' q=[p=[p=1 q=4] q=""]]]]
418− ~zod/try=> (scan "abc" (jest 'abc'))
424+ > (scan "abc" (jest 'abc'))
419 'abc'
425 'abc'
420− ~zod/try=> (scan "abc" (jest 'acb'))
426+ > (scan "abc" (jest 'acb'))
421 ! {1 2}
427 ! {1 2}
422 ! 'syntax-error'
428 ! 'syntax-error'
423 ! exit
429 ! exit
424− ~zod/try=> ((jest 'john doe') [[1 1] "john smith"])
430+ > ((jest 'john doe') [[1 1] "john smith"])
425 [p=[p=1 q=6] q=~]
431 [p=[p=1 q=6] q=~]
426− ~zod/try=> ((jest 'john doe') [[1 1] "john doe"])
432+ > ((jest 'john doe') [[1 1] "john doe"])
427 [p=[p=1 q=9] q=[~ [p='john doe' q=[p=[p=1 q=9] q=""]]]]
433 [p=[p=1 q=9] q=[~ [p='john doe' q=[p=[p=1 q=9] q=""]]]]
428
434
429
435
@@ -438,21 +444,21 @@ Match and consume a single character.
438Accepts
444Accepts
439-------
445-------
440
446
441−`daf` is a [`++char`]()
447+`daf` is a `++char`
442
448
443Produces
449Produces
444--------
450--------
445
451
446−A [`++rule`]().
452+A `++rule`.
447
453
448Source
454Source
449------
455------
450
456
451 ++ just :: XX redundant, jest
457 ++ just :: XX redundant, jest
452 ~/ %just :: match a char
458 ~/ %just :: match a char
453− |= daf=char
459+ |= daf/char
454 ~/ %fun
460 ~/ %fun
455− |= tub=nail
461+ |= tub/nail
456 ^- (like char)
462 ^- (like char)
457 ?~ q.tub
463 ?~ q.tub
458 (fail tub)
464 (fail tub)
@@ -465,15 +471,15 @@ Source
465Examples
471Examples
466--------
472--------
467
473
468− ~zod/try=> ((just 'a') [[1 1] "abc"])
474+ > ((just 'a') [[1 1] "abc"])
469 [p=[p=1 q=2] q=[~ [p=~~a q=[p=[p=1 q=2] q="bc"]]]]
475 [p=[p=1 q=2] q=[~ [p=~~a q=[p=[p=1 q=2] q="bc"]]]]
470− ~zod/try=> (scan "abc" (just 'a'))
476+ > (scan "abc" (just 'a'))
471 ! {1 2}
477 ! {1 2}
472 ! 'syntax-error'
478 ! 'syntax-error'
473 ! exit
479 ! exit
474− ~zod/try=> (scan "a" (just 'a'))
480+ > (scan "a" (just 'a'))
475 ~~a
481 ~~a
476− ~zod/try=> (scan "%" (just '%'))
482+ > (scan "%" (just '%'))
477 ~~~25.
483 ~~~25.
478
484
479
485
@@ -491,30 +497,30 @@ Accepts
491
497
492`gar` is a noun.
498`gar` is a noun.
493
499
494−`sef` is a [gate]() that accepts a [`++rule`]()
500+`sef` is a gate that accepts a `++rule`
495
501
496Produces
502Produces
497--------
503--------
498
504
499−A [`++rule`]().
505+A `++rule`.
500
506
501Source
507Source
502------
508------
503
509
504 ++ knee :: callbacks
510 ++ knee :: callbacks
505− |* [gar=* sef=_|.(rule)]
511+ |* {gar/* sef/_|.(*rule)}
506− |= tub=nail
512+ |= tub/nail
507− ^- (like ,_gar)
513+ ^- (like _gar)
508 ((sef) tub)
514 ((sef) tub)
509 ::
515 ::
510
516
511Examples
517Examples
512--------
518--------
513
519
514− ~zod/try=> |-(;~(plug prn ;~(pose $ (easy ~))))
520+ > |-(;~(plug prn ;~(pose $ (easy ~))))
515 ! rest-loop
521 ! rest-loop
516 ! exit
522 ! exit
517− ~zod/try=> |-(;~(plug prn ;~(pose (knee *tape |.(^$)) (easy ~))))
523+ > |-(;~(plug prn ;~(pose (knee *tape |.(^$)) (easy ~))))
518 < 1.obo
524 < 1.obo
519 [ c=c=tub=[p=[p=@ud q=@ud] q=""]
525 [ c=c=tub=[p=[p=@ud q=@ud] q=""]
520 b
526 b
@@ -529,7 +535,7 @@ Examples
529 ... 450 lines omitted ...
535 ... 450 lines omitted ...
530 ]
536 ]
531 >
537 >
532− ~zod/try=> (scan "abcd" |-(;~(plug prn ;~(pose (knee *tape |.(^$)) (easy ~)))))
538+ > (scan "abcd" |-(;~(plug prn ;~(pose (knee *tape |.(^$)) (easy ~)))))
533 [~~a "bcd"]
539 [~~a "bcd"]
534
540
535
541
@@ -545,25 +551,25 @@ characters.
545Accepts
551Accepts
546-------
552-------
547
553
548−`bud` is a list of [`++char`]()
554+`bud` is a list of `++char`
549
555
550Produces
556Produces
551--------
557--------
552
558
553−A [`++rule`]().
559+A `++rule`.
554
560
555Source
561Source
556------
562------
557
563
558 ++ mask :: match char in set
564 ++ mask :: match char in set
559 ~/ %mask
565 ~/ %mask
560− |= bud=(list char)
566+ |= bud/(list char)
561 ~/ %fun
567 ~/ %fun
562− |= tub=nail
568+ |= tub/nail
563 ^- (like char)
569 ^- (like char)
564 ?~ q.tub
570 ?~ q.tub
565 (fail tub)
571 (fail tub)
566− ?. (lien bud |=(a=char =(i.q.tub a)))
572+ ?. (lien bud |=(a/char =(i.q.tub a)))
567 (fail tub)
573 (fail tub)
568 (next tub)
574 (next tub)
569 ::
575 ::
@@ -571,13 +577,13 @@ Source
571Examples
577Examples
572--------
578--------
573
579
574− ~zod/try=> (scan "a" (mask "cba"))
580+ > (scan "a" (mask "cba"))
575 ~~a
581 ~~a
576− ~zod/try=> ((mask "abc") [[1 1] "abc"])
582+ > ((mask "abc") [[1 1] "abc"])
577 [p=[p=1 q=2] q=[~ [p=~~a q=[p=[p=1 q=2] q="bc"]]]]
583 [p=[p=1 q=2] q=[~ [p=~~a q=[p=[p=1 q=2] q="bc"]]]]
578− ~zod/try=> ((mask "abc") [[1 1] "bbc"])
584+ > ((mask "abc") [[1 1] "bbc"])
579 [p=[p=1 q=2] q=[~ [p=~~b q=[p=[p=1 q=2] q="bc"]]]]
585 [p=[p=1 q=2] q=[~ [p=~~b q=[p=[p=1 q=2] q="bc"]]]]
580− ~zod/try=> ((mask "abc") [[1 1] "dbc"])
586+ > ((mask "abc") [[1 1] "dbc"])
581 [p=[p=1 q=1] q=~]
587 [p=[p=1 q=1] q=~]
582
588
583
589
@@ -587,7 +593,7 @@ Examples
587
593
588Parse list with delimiter
594Parse list with delimiter
589
595
590−Parser modifier: Parse a list of matches using a delimiter [`++rule`]().
596+Parser modifier: Parse a list of matches using a delimiter `++rule`.
591
597
592Accepts
598Accepts
593-------
599-------
@@ -605,17 +611,18 @@ Source
605------
611------
606
612
607 ++ more
613 ++ more
608− |* [bus=_rule fel=_rule]
614+ |* {bus/rule fel/rule}
609 ;~(pose (most bus fel) (easy ~))
615 ;~(pose (most bus fel) (easy ~))
616+ ::
610
617
611Examples
618Examples
612--------
619--------
613
620
614− ~zod/try=> (scan "" (more ace dem))
621+ > (scan "" (more ace dem))
615 ~
622 ~
616− ~zod/try=> (scan "40 20" (more ace dem))
623+ > (scan "40 20" (more ace dem))
617 [q=40 ~[q=20]]
624 [q=40 ~[q=20]]
618− ~zod/try=> (scan "40 20 60 1 5" (more ace dem))
625+ > (scan "40 20 60 1 5" (more ace dem))
619 [q=40 ~[q=20 q=60 q=1 q=5]]
626 [q=40 ~[q=20 q=60 q=1 q=5]]
620
627
621
628
@@ -625,7 +632,7 @@ Examples
625
632
626Parse list of at least one match
633Parse list of at least one match
627
634
628−Parser modifier: parse a [`++list`]() of at least one match using a delimiter [`++rule`]().
635+Parser modifier: parse a `++list` of at least one match using a delimiter `++rule`.
629
636
630Accepts
637Accepts
631-------
638-------
@@ -643,17 +650,18 @@ Source
643------
650------
644
651
645 ++ most
652 ++ most
646− |* [bus=_rule fel=_rule]
653+ |* {bus/rule fel/rule}
647 ;~(plug fel (star ;~(pfix bus fel)))
654 ;~(plug fel (star ;~(pfix bus fel)))
655+ ::
648
656
649Examples
657Examples
650--------
658--------
651
659
652− ~zod/try=> (scan "40 20" (most ace dem))
660+ > (scan "40 20" (most ace dem))
653 [q=40 ~[q=20]]
661 [q=40 ~[q=20]]
654− ~zod/try=> (scan "40 20 60 1 5" (most ace dem))
662+ > (scan "40 20 60 1 5" (most ace dem))
655 [q=40 ~[q=20 q=60 q=1 q=5]]
663 [q=40 ~[q=20 q=60 q=1 q=5]]
656− ~zod/try=> (scan "" (most ace dem))
664+ > (scan "" (most ace dem))
657 ! {1 1}
665 ! {1 1}
658 ! exit
666 ! exit
659
667
@@ -669,18 +677,18 @@ Consume any character, producing it as a result.
669Accepts
677Accepts
670-------
678-------
671
679
672−`tub` is a [`++nail`]()
680+`tub` is a `++nail`
673
681
674Produces
682Produces
675--------
683--------
676
684
677−An [`++edge`]().
685+An `++edge`.
678
686
679Source
687Source
680------
688------
681
689
682 ++ next :: consume a char
690 ++ next :: consume a char
683− |= tub=nail
691+ |= tub/nail
684 ^- (like char)
692 ^- (like char)
685 ?~ q.tub
693 ?~ q.tub
686 (fail tub)
694 (fail tub)
@@ -691,9 +699,9 @@ Source
691Examples
699Examples
692--------
700--------
693
701
694− ~zod/try=> (next [[1 1] "ebc"])
702+ > (next [[1 1] "ebc"])
695 [p=[p=1 q=2] q=[~ [p=~~e q=[p=[p=1 q=2] q="bc"]]]]
703 [p=[p=1 q=2] q=[~ [p=~~e q=[p=[p=1 q=2] q="bc"]]]]
696− ~zod/try=> (next [[1 1] "john jumps jones"])
704+ > (next [[1 1] "john jumps jones"])
697 [p=[p=1 q=2] q=[~ [p=~~j q=[p=[p=1 q=2] q="ohn jumps jones"]]]]
705 [p=[p=1 q=2] q=[~ [p=~~j q=[p=[p=1 q=2] q="ohn jumps jones"]]]]
698
706
699
707
@@ -704,12 +712,12 @@ Examples
704
712
705List of at least one match.
713List of at least one match.
706
714
707−Parser modifier: parse [`++list`]() of at least one match.
715+Parser modifier: parse `++list` of at least one match.
708
716
709Accepts
717Accepts
710-------
718-------
711
719
712−`fel` is a [`++rule`]().
720+`fel` is a `++rule`.
713
721
714Produces
722Produces
715--------
723--------
@@ -719,18 +727,19 @@ A `++rule`.
719Source
727Source
720------
728------
721
729
722− ++ plus |*(fel=_rule ;~(plug fel (star fel)))
730+ ++ plus |*(fel/rule ;~(plug fel (star fel)))
731+
723
732
724Examples
733Examples
725--------
734--------
726
735
727− ~zod/try=> (scan ">>>>" (cook lent (plus gar)))
736+ > (scan ">>>>" (cook lent (plus gar)))
728 4
737 4
729− ~zod/try=> (scan "- - " (plus ;~(pose ace hep)))
738+ > (scan "- - " (plus ;~(pose ace hep)))
730 [~~- " - "]
739 [~~- " - "]
731− ~zod/try=> `tape`(scan "- - " (plus ;~(pose ace hep)))
740+ > `tape`(scan "- - " (plus ;~(pose ace hep)))
732 "- - "
741 "- - "
733− ~zod/try=> `(pole ,@t)`(scan "- - " (plus ;~(pose ace hep)))
742+ > `(pole ,@t)`(scan "- - " (plus ;~(pose ace hep)))
734 ['-' [' ' [' ' ['-' [' ' ~]]]]]
743 ['-' [' ' [' ' ['-' [' ' ~]]]]]
735
744
736
745
@@ -740,25 +749,24 @@ Examples
740
749
741Conditional `++cook`
750Conditional `++cook`
742
751
743−Conditional [`++cook`](). Slams the result through a gate that produces
752+Conditional `++cook`. Slams the result through a gate that produces
744a unit; if that unit is empty, fail.
753a unit; if that unit is empty, fail.
745
754
746Accepts
755Accepts
747-------
756-------
748
757
749−`tub` is a [`++nail`](/doc/hoon/library/1#++nail)
758+`tub` is a `++nail`.
750−
751Produces
759Produces
752--------
760--------
753
761
754−A [`++rule`]().
762+A `++rule`.
755
763
756Source
764Source
757------
765------
758
766
759 ++ sear :: conditional cook
767 ++ sear :: conditional cook
760− |* [pyq=_|=(* *(unit)) sef=_rule]
768+ |* {pyq/$-(* (unit)) sef/rule}
761− |= tub=nail
769+ |= tub/nail
762 =+ vex=(sef tub)
770 =+ vex=(sef tub)
763 ?~ q.vex
771 ?~ q.vex
764 vex
772 vex
@@ -768,12 +776,13 @@ Source
768 [p=p.vex q=[~ u=[p=u.gey q=q.u.q.vex]]]
776 [p=p.vex q=[~ u=[p=u.gey q=q.u.q.vex]]]
769 ::
777 ::
770
778
779+
771Examples
780Examples
772--------
781--------
773
782
774− ~zod/try=> ((sear |=(a=* ?@(a (some a) ~)) (just `a`)) [[1 1] "abc"])
783+ > ((sear |=(a/* ?@(a (some a) ~)) (just `a`)) [[1 1] "abc"])
775 [p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]]
784 [p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]]
776− ~zod/try=> ((sear |=(* ~) (just 'a')) [[1 1] "abc"])
785+ > ((sear |=(* ~) (just 'a')) [[1 1] "abc"])
777 [p=[p=1 q=2] q=~]
786 [p=[p=1 q=2] q=~]
778
787
779
788
@@ -783,7 +792,7 @@ Examples
783
792
784Char in range
793Char in range
785
794
786−Match characters ([`++char`]()) within a range.
795+Match characters (`++char`) within a range.
787
796
788Accepts
797Accepts
789-------
798-------
@@ -795,16 +804,16 @@ Accepts
795Produces
804Produces
796--------
805--------
797
806
798−A [`++rule`]().
807+A `++rule`.
799
808
800Source
809Source
801------
810------
802
811
803 ++ shim :: match char in range
812 ++ shim :: match char in range
804 ~/ %shim
813 ~/ %shim
805− |= [les=@ mos=@]
814+ |= {les/@ mos/@}
806 ~/ %fun
815 ~/ %fun
807− |= tub=nail
816+ |= tub/nail
808 ^- (like char)
817 ^- (like char)
809 ?~ q.tub
818 ?~ q.tub
810 (fail tub)
819 (fail tub)
@@ -816,11 +825,11 @@ Source
816Examples
825Examples
817--------
826--------
818
827
819− ~zod/try=> ((shim 'a' 'z') [[1 1] "abc"])
828+ > ((shim 'a' 'z') [[1 1] "abc"])
820 [p=[p=1 q=2] q=[~ [p=~~a q=[p=[p=1 q=2] q="bc"]]]]
829 [p=[p=1 q=2] q=[~ [p=~~a q=[p=[p=1 q=2] q="bc"]]]]
821− ~zod/try=> ((shim 'a' 'Z') [[1 1] "abc"])
830+ > ((shim 'a' 'Z') [[1 1] "abc"])
822 [p=[p=1 q=1] q=~]
831 [p=[p=1 q=1] q=~]
823− ~zod/try=> ((shim 'a' 'Z') [[1 1] "Abc"])
832+ > ((shim 'a' 'Z') [[1 1] "Abc"])
824 [p=[p=1 q=2] q=[~ [p=~~~41. q=[p=[p=1 q=2] q="bc"]]]]
833 [p=[p=1 q=2] q=[~ [p=~~~41. q=[p=[p=1 q=2] q="bc"]]]]
825
834
826
835
@@ -830,13 +839,13 @@ Examples
830
839
831Use gate to parse delimited list
840Use gate to parse delimited list
832
841
833−Parser modifier: By composing with a [gate](), parse a delimited [`++list`]() of
842+Parser modifier: By composing with a gate, parse a delimited `++list` of
834matches.
843matches.
835
844
836Accepts
845Accepts
837-------
846-------
838
847
839−`bus` is a [`++rule`]().
848+`bus` is a `++rule`.
840
849
841`fel` is a `++rule`.
850`fel` is a `++rule`.
842
851
@@ -849,16 +858,18 @@ Source
849------
858------
850
859
851 ++ slug
860 ++ slug
852− |* raq=_|*([a=* b=*] [a b])
861+ |* raq/_|*({a/* b/*} [a b])
853− |* [bus=_rule fel=_rule]
862+ |* {bus/rule fel/rule}
854 ;~((comp raq) fel (stir +<+.raq raq ;~(pfix bus fel)))
863 ;~((comp raq) fel (stir +<+.raq raq ;~(pfix bus fel)))
864+ ::
865+
855
866
856Examples
867Examples
857--------
868--------
858
869
859− ~zod/try=> (scan "20+5+110" ((slug add) lus dem))
870+ > (scan "20+5+110" ((slug add) lus dem))
860 135
871 135
861− ~zod/try=> `@t`(scan "a b c" ((slug |=(a=[@ @t] (cat 3 a))) ace alp))
872+ > `@t`(scan "a b c" ((slug |=(a/[@ @t] (cat 3 a))) ace alp))
862 'abc'
873 'abc'
863
874
864
875
@@ -880,16 +891,16 @@ Accepts
880Produces
891Produces
881--------
892--------
882
893
883−A [`++rule`]().
894+A `++rule`.
884
895
885Source
896Source
886------
897------
887
898
888 ++ stag :: add a label
899 ++ stag :: add a label
889 ~/ %stag
900 ~/ %stag
890− |* [gob=* sef=_rule]
901+ |* {gob/* sef/rule}
891 ~/ %fun
902 ~/ %fun
892− |= tub=nail
903+ |= tub/nail
893 =+ vex=(sef tub)
904 =+ vex=(sef tub)
894 ?~ q.vex
905 ?~ q.vex
895 vex
906 vex
@@ -899,11 +910,11 @@ Source
899Examples
910Examples
900--------
911--------
901
912
902− ~zod/try=> ((stag %foo (just 'a')) [[1 1] "abc"])
913+ > ((stag %foo (just 'a')) [[1 1] "abc"])
903 [p=[p=1 q=2] q=[~ u=[p=[%foo ~~a] q=[p=[p=1 q=2] q="bc"]]]]
914 [p=[p=1 q=2] q=[~ u=[p=[%foo ~~a] q=[p=[p=1 q=2] q="bc"]]]]
904− ~zod/try=> ((stag "xyz" (jest 'abc')) [[1 1] "abc"])
915+ > ((stag "xyz" (jest 'abc')) [[1 1] "abc"])
905 [p=[p=1 q=4] q=[~ u=[p=["xyz" 'abc'] q=[p=[p=1 q=4] q=""]]]]
916 [p=[p=1 q=4] q=[~ u=[p=["xyz" 'abc'] q=[p=[p=1 q=4] q=""]]]]
906− ~zod/try=> ((stag 10.000 (shim 0 100)) [[1 1] "abc"])
917+ > ((stag 10.000 (shim 0 100)) [[1 1] "abc"])
907 [p=[p=1 q=2] q=[~ u=[p=[10.000 ~~a] q=[p=[p=1 q=2] q="bc"]]]]
918 [p=[p=1 q=2] q=[~ u=[p=[10.000 ~~a] q=[p=[p=1 q=2] q="bc"]]]]
908
919
909
920
@@ -913,36 +924,36 @@ Examples
913
924
914List of matches
925List of matches
915
926
916−Parser modifier: parse [`++list`]() of matches.
927+Parser modifier: parse `++list` of matches.
917
928
918Accepts
929Accepts
919-------
930-------
920
931
921−`fel` is a [`++rule`]().
932+`fel` is a `++rule`.
922
933
923Produces
934Produces
924--------
935--------
925
936
926 ++ star :: 0 or more times
937 ++ star :: 0 or more times
927− |* fel=_rule
938+ |* fel/rule
928− (stir `(list ,_(wonk *fel))`~ |*([a=* b=*] [a b]) fel)
939+ (stir `(list _(wonk *fel))`~ |*({a/* b/*} [a b]) fel)
929
940
930Examples
941Examples
931--------
942--------
932
943
933− ~zod/try=> (scan "aaaaa" (just 'a'))
944+ > (scan "aaaaa" (just 'a'))
934 ! {1 2}
945 ! {1 2}
935 ! 'syntax-error'
946 ! 'syntax-error'
936 ! exit
947 ! exit
937− ~zod/try=> (scan "aaaaa" (star (just 'a')))
948+ > (scan "aaaaa" (star (just 'a')))
938 "aaaaa"
949 "aaaaa"
939− ~zod/try=> (scan "abcdef" (star (just 'a')))
950+ > (scan "abcdef" (star (just 'a')))
940 ! {1 2}
951 ! {1 2}
941 ! 'syntax-error'
952 ! 'syntax-error'
942 ! exit
953 ! exit
943− ~zod/try=> (scan "abcabc" (star (jest 'abc')))
954+ > (scan "abcabc" (star (jest 'abc')))
944 <|abc abc|>
955 <|abc abc|>
945− ~zod/try=> (scan "john smith" (star (shim 0 200)))
956+ > (scan "john smith" (star (shim 0 200)))
946 "john smith"
957 "john smith"
947
958
948
959
@@ -968,7 +979,7 @@ Source
968------
979------
969
980
970 ++ stet
981 ++ stet
971− |* leh=(list ,[?(@ [@ @]) _rule])
982+ |* leh/(list {?(@ {@ @}) rule})
972 |-
983 |-
973 ?~ leh
984 ?~ leh
974 ~
985 ~
@@ -978,7 +989,7 @@ Source
978Examples
989Examples
979--------
990--------
980
991
981− ~zod/try=> (stet (limo [[5 (just 'a')] [1 (jest 'abc')] [[1 1] (shim 0 200)]
992+ > (stet (limo [[5 (just 'a')] [1 (jest 'abc')] [[1 1] (shim 0 200)]
982 [[1 10] (cold %foo (just 'a'))]~]))
993 [[1 10] (cold %foo (just 'a'))]~]))
983 ~[
994 ~[
984 [p=5 q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
995 [p=5 q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
@@ -986,12 +997,12 @@ Examples
986 [p=[1 1] q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
997 [p=[1 1] q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
987 [p=[1 10] q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
998 [p=[1 10] q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
988 ]
999 ]
989− ~zod/try=> [[[1 1] (just 'a')] [[2 1] (shim 0 200)] ~]
1000+ > [[[1 1] (just 'a')] [[2 1] (shim 0 200)] ~]
990 [ [[1 1] <1.tnv [tub=[p=[p=@ud q=@ud] q=""] <1.ktu [daf=@tD <414.fvk 101.jzo 1.ypj %164>]>]>]
1001 [ [[1 1] <1.tnv [tub=[p=[p=@ud q=@ud] q=""] <1.ktu [daf=@tD <414.fvk 101.jzo 1.ypj %164>]>]>]
991 [[2 1] <1.fvg [tub=[p=[p=@ud q=@ud] q=""] <1.khu [[les=@ mos=@] <414.fvk 101.jzo 1.ypj %164>]>]>]
1002 [[2 1] <1.fvg [tub=[p=[p=@ud q=@ud] q=""] <1.khu [[les=@ mos=@] <414.fvk 101.jzo 1.ypj %164>]>]>]
992 ~
1003 ~
993 ]
1004 ]
994− ~zod/try=> (stet (limo [[[1 1] (just 'a')] [[2 1] (shim 0 200)] ~]))
1005+ > (stet (limo [[[1 1] (just 'a')] [[2 1] (shim 0 200)] ~]))
995 ~[
1006 ~[
996 [p=[1 1] q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
1007 [p=[1 1] q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
997 [p=[2 1] q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
1008 [p=[2 1] q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
@@ -1006,14 +1017,14 @@ Switch by first
1006
1017
1007 ++ stew :: switch by first char
1018 ++ stew :: switch by first char
1008 ~/ %stew
1019 ~/ %stew
1009− |* leh=(list ,[p=?(@ [@ @]) q=_rule]) :: char/range keys
1020+ |* leh/(list {p/?(@ {@ @}) q/rule}) :: char+range keys
1010 =+ ^= wor :: range complete lth
1021 =+ ^= wor :: range complete lth
1011− |= [ort=?(@ [@ @]) wan=?(@ [@ @])]
1022+ |= {ort/?(@ {@ @}) wan/?(@ {@ @})}
1012 ?@ ort
1023 ?@ ort
1013 ?@(wan (lth ort wan) (lth ort -.wan))
1024 ?@(wan (lth ort wan) (lth ort -.wan))
1014 ?@(wan (lth +.ort wan) (lth +.ort -.wan))
1025 ?@(wan (lth +.ort wan) (lth +.ort -.wan))
1015 =+ ^= hel :: build parser map
1026 =+ ^= hel :: build parser map
1016− =+ hel=`(tree $_(?>(?=(^ leh) i.leh)))`~
1027+ =+ hel=`(tree _?>(?=(^ leh) i.leh))`~
1017 |- ^+ hel
1028 |- ^+ hel
1018 ?~ leh
1029 ?~ leh
1019 ~
1030 ~
@@ -1033,7 +1044,7 @@ Switch by first
1033 [n.yal l.yal nuc]
1044 [n.yal l.yal nuc]
1034 [n.nuc [n.yal l.yal l.nuc] r.nuc]
1045 [n.nuc [n.yal l.yal l.nuc] r.nuc]
1035 ~% %fun ..^$ ~
1046 ~% %fun ..^$ ~
1036− |= tub=nail
1047+ |= tub/nail
1037 ?~ q.tub
1048 ?~ q.tub
1038 (fail tub)
1049 (fail tub)
1039 |-
1050 |-
@@ -1049,8 +1060,10 @@ Switch by first
1049 $(hel r.hel)
1060 $(hel r.hel)
1050 ::
1061 ::
1051
1062
1063+
1064+
1052−Parser generator. From an associative [`++list`]() of characters or character
1065+Parser generator. From an associative `++list` of characters or character
1053−ranges to [`++rule`]()s, construct a [`++map`](), and parse [`++tape`]()s only
1066+ranges to `++rule`s, construct a `++map`, and parse `++tape`s only
1054with `++rules` associated with a range that the `++tape`'s first character falls in.
1067with `++rules` associated with a range that the `++tape`'s first character falls in.
1055
1068
1056
1069
@@ -1060,7 +1073,7 @@ with `++rules` associated with a range that the `++tape`'s first character falls
1060
1073
1061Parse repeatedly
1074Parse repeatedly
1062
1075
1063−Parse with [`++rule`]() as many times as possible, and fold over results with a
1076+Parse with `++rule` as many times as possible, and fold over results with a
1064binary gate.
1077binary gate.
1065
1078
1066Accepts
1079Accepts
@@ -1080,26 +1093,33 @@ A rule.
1080Source
1093Source
1081------
1094------
1082
1095
1083−++ stir :: parse repeatedly
1096+ ++ stun :: parse several times
1084− ~/ %stir
1097+ |* {lig/{@ @} fel/rule}
1085− |* [rud=* raq=_|*([a=* b=*] [a b]) fel=_rule]
1086− ~/ %fun
1087− |= tub=nail
1098+ |= tub/nail
1088− ^- (like ,_rud)
1099+ ^- (like (list _(wonk (fel))))
1100+ ?: =(0 +.lig)
1101+ [p.tub [~ ~ tub]]
1089 =+ vex=(fel tub)
1102 =+ vex=(fel tub)
1090 ?~ q.vex
1103 ?~ q.vex
1104+ ?: =(0 -.lig)
1091− [p.vex [~ rud tub]]
1105+ [p.vex [~ ~ tub]]
1106+ vex
1107+ =+ ^= wag %= $
1108+ -.lig ?:(=(0 -.lig) 0 (dec -.lig))
1109+ +.lig ?:(=(0 +.lig) 0 (dec +.lig))
1092− =+ wag=$(tub q.u.q.vex)
1110+ tub q.u.q.vex
1111+ ==
1093− ?> ?=(^ q.wag)
1112+ ?~ q.wag
1113+ wag
1094− [(last p.vex p.wag) [~ (raq p.u.q.vex p.u.q.wag) q.u.q.wag]]
1114+ [p.wag [~ [p.u.q.vex p.u.q.wag] q.u.q.wag]]
1095− ::
1115+
1096
1116
1097Examples
1117Examples
1098--------
1118--------
1099
1119
1100− ~zod/try=> (scan "abc" (stir *@ add prn))
1120+ > (scan "abc" (stir *@ add prn))
1101 294
1121 294
1102− ~zod/try=> (roll "abc" add)
1122+ > (roll "abc" add)
1103 b=294
1123 b=294
1104
1124
1105
1125
@@ -1116,30 +1136,30 @@ Accepts
1116
1136
1117`[les=@ mos=@]` is a cell of atoms indicating the bounds.
1137`[les=@ mos=@]` is a cell of atoms indicating the bounds.
1118
1138
1119−`fel` is a [`++rule`]().
1139+`fel` is a `++rule`.
1120
1140
1121Produces
1141Produces
1122--------
1142--------
1123
1143
1124−A [`++rule`]().
1144+A `++rule`.
1125
1145
1126Source
1146Source
1127------
1147------
1128
1148
1129 ++ stun :: parse several times
1149 ++ stun :: parse several times
1130− |* [[les=@ mos=@] fel=_rule]
1150+ |* {lig/{@ @} fel/rule}
1131− |= tub=nail
1151+ |= tub/nail
1132− ^- (like (list ,_(wonk (fel))))
1152+ ^- (like (list _(wonk (fel))))
1133− ?: =(0 mos)
1153+ ?: =(0 +.lig)
1134 [p.tub [~ ~ tub]]
1154 [p.tub [~ ~ tub]]
1135 =+ vex=(fel tub)
1155 =+ vex=(fel tub)
1136 ?~ q.vex
1156 ?~ q.vex
1137− ?: =(0 les)
1157+ ?: =(0 -.lig)
1138 [p.vex [~ ~ tub]]
1158 [p.vex [~ ~ tub]]
1139 vex
1159 vex
1140 =+ ^= wag %= $
1160 =+ ^= wag %= $
1141− les ?:(=(0 les) 0 (dec les))
1161+ -.lig ?:(=(0 -.lig) 0 (dec -.lig))
1142− mos ?:(=(0 mos) 0 (dec mos))
1162+ +.lig ?:(=(0 +.lig) 0 (dec +.lig))
1143 tub q.u.q.vex
1163 tub q.u.q.vex
1144 ==
1164 ==
1145 ?~ q.wag
1165 ?~ q.wag
@@ -1149,11 +1169,11 @@ Source
1149Examples
1169Examples
1150--------
1170--------
1151
1171
1152− ~zod/try=> ((stun [5 10] prn) [1 1] "aquickbrownfoxran")
1172+ > ((stun [5 10] prn) [1 1] "aquickbrownfoxran")
1153 [p=[p=1 q=11] q=[~ [p="aquickbrow" q=[p=[p=1 q=11] q="nfoxran"]]]]
1173 [p=[p=1 q=11] q=[~ [p="aquickbrow" q=[p=[p=1 q=11] q="nfoxran"]]]]
1154− ~zod/try=> ((stun [5 10] prn) [1 1] "aquickbro")
1174+ > ((stun [5 10] prn) [1 1] "aquickbro")
1155 [p=[p=1 q=10] q=[~ [p="aquickbro" q=[p=[p=1 q=10] q=""]]]]
1175 [p=[p=1 q=10] q=[~ [p="aquickbro" q=[p=[p=1 q=10] q=""]]]]
1156− ~zod/try=> ((stun [5 10] prn) [1 1] "aqui")
1176+ > ((stun [5 10] prn) [1 1] "aqui")
1157 [p=[p=1 q=5] q=~]
1177 [p=[p=1 q=5] q=~]
1158
1178
1159***
1179***
docs/system/hoon/library/4g.md+29−26
@@ -3,7 +3,7 @@
3
3
4Parse or crash
4Parse or crash
5
5
6−Parse a cord with a given [`++rule`]() and crash if the [`++cord`]() isn't entirely
6+Parse a cord with a given `++rule` and crash if the `++cord` isn't entirely
7parsed.
7parsed.
8
8
9Accepts
9Accepts
@@ -21,20 +21,21 @@ The value of the parse result, or crash.
21Source
21Source
22------
22------
23
23
24− ++ rash |*([naf=@ sab=_rule] (scan (trip naf) sab)) ::
24+ ++ rash |*({naf/@ sab/rule} (scan (trip naf) sab)) ::
25+
25
26
26Examples
27Examples
27--------
28--------
28
29
29− ~zod/try=> (rash 'I was the world in which I walked, and what I saw' (star (shim 0 200)))
30+ > (rash 'I was the world in which I walked, and what I saw' (star (shim 0 200)))
30 "I was the world in which I walked, and what I saw"
31 "I was the world in which I walked, and what I saw"
31− ~zod/try=> (rash 'abc' (just 'a'))
32+ > (rash 'abc' (just 'a'))
32 ! {1 2}
33 ! {1 2}
33 ! 'syntax-error'
34 ! 'syntax-error'
34 ! exit
35 ! exit
35− ~zod/try=> (rash 'abc' (jest 'abc'))
36+ > (rash 'abc' (jest 'abc'))
36 'abc'
37 'abc'
37− `~zod/try=> (rash 'abc' (jest 'ab'))
38+ `> (rash 'abc' (jest 'ab'))
38 ! {1 3}
39 ! {1 3}
39 ! 'syntax-error'
40 ! 'syntax-error'
40 ! exit
41 ! exit
@@ -52,9 +53,9 @@ entirely parsed.
52Accepts
53Accepts
53-------
54-------
54
55
55−`naf` is an [atom]().
56+`naf` is an atom.
56
57
57−`sab` is a [rule]().
58+`sab` is a rule.
58
59
59Produces
60Produces
60--------
61--------
@@ -64,20 +65,21 @@ The value of the parse result, or null.
64Source
65Source
65------
66------
66
67
67− ++ rush |*([naf=@ sab=_rule] (rust (trip naf) sab))
68+ ++ rush |*({naf/@ sab/rule} (rust (trip naf) sab))
69+
68
70
69Examples
71Examples
70--------
72--------
71
73
72− ~zod/try=> (rush 'I was the world in which I walked, and what I saw' (star (shim 0 200)))
74+ > (rush 'I was the world in which I walked, and what I saw' (star (shim 0 200)))
73 [~ "I was the world in which I walked, and what I saw"]
75 [~ "I was the world in which I walked, and what I saw"]
74− ~zod/try=> (rush 'abc' (just 'a'))
76+ > (rush 'abc' (just 'a'))
75 ~
77 ~
76− ~zod/try=> (rush 'abc' (jest 'abc'))
78+ > (rush 'abc' (jest 'abc'))
77 [~ 'abc']
79 [~ 'abc']
78− ~zod/try=> (rush 'abc' (jest 'ac'))
80+ > (rush 'abc' (jest 'ac'))
79 ~
81 ~
80− ~zod/try=> (rush 'abc' (jest 'ab'))
82+ > (rush 'abc' (jest 'ab'))
81 ~
83 ~
82
84
83
85
@@ -87,7 +89,7 @@ Examples
87
89
88Parse tape or null
90Parse tape or null
89
91
90−Parse a [`++tape`]() with a given [`++rule`]() and produce null if the `++tape` isn't
92+Parse a `++tape` with a given `++rule` and produce null if the `++tape` isn't
91entirely parsed.
93entirely parsed.
92
94
93Accepts
95Accepts
@@ -105,18 +107,19 @@ A `(unit ,@t)`
105Source
107Source
106------
108------
107
109
108− ++ rust |* [los=tape sab=_rule]
110+ ++ rust |* {los/tape sab/rule}
109 =+ vex=((full sab) [[1 1] los])
111 =+ vex=((full sab) [[1 1] los])
110 ?~(q.vex ~ [~ u=p.u.q.vex])
112 ?~(q.vex ~ [~ u=p.u.q.vex])
111
113
114+
112Examples
115Examples
113--------
116--------
114
117
115− ~zod/try=> (rust "I was the world in which I walked, and what I saw" (star (shim 0 200)))
118+ > (rust "I was the world in which I walked, and what I saw" (star (shim 0 200)))
116 [~ "I was the world in which I walked, and what I saw"]
119 [~ "I was the world in which I walked, and what I saw"]
117− ~zod/try=> (rust "Or heard or felt came not but from myself;" (star (shim 0 200)))
120+ > (rust "Or heard or felt came not but from myself;" (star (shim 0 200)))
118 [~ "Or heard or felt came not but from myself;"]
121 [~ "Or heard or felt came not but from myself;"]
119− ~zod/try=> (rust "And there I found myself more truly and more strange." (jest 'And there I'))
122+ > (rust "And there I found myself more truly and more strange." (jest 'And there I'))
120 ~
123 ~
121
124
122
125
@@ -126,15 +129,15 @@ Examples
126
129
127Parse tape or crash
130Parse tape or crash
128
131
129−Parse a [`++tape`]() with a given [`++rule`]() and crash if the `++tape` isn't entirely
132+Parse a `++tape` with a given `++rule` and crash if the `++tape` isn't entirely
130parsed.
133parsed.
131
134
132Accepts
135Accepts
133-------
136-------
134
137
135−`los` is a [tape]().
138+`los` is a tape.
136
139
137−`sab` is a [rule]().
140+`sab` is a rule.
138
141
139Produces
142Produces
140--------
143--------
@@ -144,7 +147,7 @@ Either a `++tape` or a crash.
144Source
147Source
145------
148------
146
149
147− ++ scan |* [los=tape sab=_rule]
150+ ++ scan |* {los/tape sab/rule}
148 =+ vex=((full sab) [[1 1] los])
151 =+ vex=((full sab) [[1 1] los])
149 ?~ q.vex
152 ?~ q.vex
150 ~_ (show [%m '{%d %d}'] p.p.vex q.p.vex ~)
153 ~_ (show [%m '{%d %d}'] p.p.vex q.p.vex ~)
@@ -154,11 +157,11 @@ Source
154Examples
157Examples
155--------
158--------
156
159
157− ~zod/try=> (scan "I was the world in which I walked, and what I saw" (star (shim 0 200)))
160+ > (scan "I was the world in which I walked, and what I saw" (star (shim 0 200)))
158 "I was the world in which I walked, and what I saw"
161 "I was the world in which I walked, and what I saw"
159− ~zod/try=> (scan "Or heard or felt came not but from myself;" (star (shim 0 200)))
162+ > (scan "Or heard or felt came not but from myself;" (star (shim 0 200)))
160 "Or heard or felt came not but from myself;"
163 "Or heard or felt came not but from myself;"
161− ~zod/try=> (scan "And there I found myself more truly and more strange." (jest 'And there I'))
164+ > (scan "And there I found myself more truly and more strange." (jest 'And there I'))
162 ! {1 12}
165 ! {1 12}
163 ! 'syntax-error'
166 ! 'syntax-error'
164 ! exit
167 ! exit
docs/system/hoon/library/4h.md+135−135
@@ -13,13 +13,13 @@ Source
13Examples
13Examples
14--------
14--------
15
15
16− ~zod/try=> (scan " " ace)
16+ > (scan " " ace)
17 ~~.
17 ~~.
18− ~zod/try=> `cord`(scan " " ace)
18+ > `cord`(scan " " ace)
19 ' '
19 ' '
20− ~zod/try=> (ace [[1 1] " "])
20+ > (ace [[1 1] " "])
21 [p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q=""]]]]
21 [p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q=""]]]]
22− ~zod/try=> (ace [[1 1] " abc "])
22+ > (ace [[1 1] " abc "])
23 [p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q="abc "]]]]
23 [p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q="abc "]]]]
24
24
25
25
@@ -39,13 +39,13 @@ Source
39Examples
39Examples
40--------
40--------
41
41
42− ~zod/try=> (scan "|" bar)
42+ > (scan "|" bar)
43 ~~~7c.
43 ~~~7c.
44− ~zod/try=> `cord`(scan "|" bar)
44+ > `cord`(scan "|" bar)
45 '|'
45 '|'
46− ~zod/try=> (bar [[1 1] "|"])
46+ > (bar [[1 1] "|"])
47 [p=[p=1 q=2] q=[~ [p=~~~7c. q=[p=[p=1 q=2] q=""]]]]
47 [p=[p=1 q=2] q=[~ [p=~~~7c. q=[p=[p=1 q=2] q=""]]]]
48− ~zod/try=> (bar [[1 1] "|="])
48+ > (bar [[1 1] "|="])
49 [p=[p=1 q=2] q=[~ [p=~~~7c. q=[p=[p=1 q=2] q="="]]]]
49 [p=[p=1 q=2] q=[~ [p=~~~7c. q=[p=[p=1 q=2] q="="]]]]
50
50
51
51
@@ -67,15 +67,15 @@ Source
67Examples
67Examples
68--------
68--------
69
69
70− ~zod/try=> (scan "\\" bas)
70+ > (scan "\\" bas)
71 ~~~5c.
71 ~~~5c.
72− ~zod/try=> `cord`(scan "\\" bas)
72+ > `cord`(scan "\\" bas)
73 '\'
73 '\'
74− ~zod/try=> (bas [[1 1] "\"])
74+ > (bas [[1 1] "\"])
75 ~ <syntax error at [1 18]>
75 ~ <syntax error at [1 18]>
76− ~zod/try=> (bas [[1 1] "\\"])
76+ > (bas [[1 1] "\\"])
77 [p=[p=1 q=2] q=[~ [p=~~~5c. q=[p=[p=1 q=2] q=""]]]]
77 [p=[p=1 q=2] q=[~ [p=~~~5c. q=[p=[p=1 q=2] q=""]]]]
78− ~zod/try=> (bas [[1 1] "\""])
78+ > (bas [[1 1] "\""])
79 [p=[p=1 q=1] q=~]
79 [p=[p=1 q=1] q=~]
80
80
81
81
@@ -95,13 +95,13 @@ Source
95Examples
95Examples
96--------
96--------
97
97
98− ~zod/try=> (scan "$" buc)
98+ > (scan "$" buc)
99 ~~~24.
99 ~~~24.
100− ~zod/try=> `cord`(scan "$" buc)
100+ > `cord`(scan "$" buc)
101 '$'
101 '$'
102− ~zod/try=> (buc [[1 1] "$"])
102+ > (buc [[1 1] "$"])
103 [p=[p=1 q=2] q=[~ [p=~~~24. q=[p=[p=1 q=2] q=""]]]]
103 [p=[p=1 q=2] q=[~ [p=~~~24. q=[p=[p=1 q=2] q=""]]]]
104− ~zod/try=> (buc [[1 1] "$%"])
104+ > (buc [[1 1] "$%"])
105 [p=[p=1 q=2] q=[~ [p=~~~24. q=[p=[p=1 q=2] q="%"]]]]
105 [p=[p=1 q=2] q=[~ [p=~~~24. q=[p=[p=1 q=2] q="%"]]]]
106
106
107
107
@@ -121,13 +121,13 @@ Source
121Examples
121Examples
122--------
122--------
123
123
124− ~zod/try=> (scan "_" cab)
124+ > (scan "_" cab)
125 ~~~5f.
125 ~~~5f.
126− ~zod/try=> `cord`(scan "_" cab)
126+ > `cord`(scan "_" cab)
127 '_'
127 '_'
128− ~zod/try=> (cab [[1 1] "_"])
128+ > (cab [[1 1] "_"])
129 [p=[p=1 q=2] q=[~ [p=~~~5f. q=[p=[p=1 q=2] q=""]]]]
129 [p=[p=1 q=2] q=[~ [p=~~~5f. q=[p=[p=1 q=2] q=""]]]]
130− ~zod/try=> (cab [[1 1] "|_"])
130+ > (cab [[1 1] "|_"])
131 [p=[p=1 q=1] q=~]
131 [p=[p=1 q=1] q=~]
132
132
133
133
@@ -147,13 +147,13 @@ Source
147Examples
147Examples
148--------
148--------
149
149
150− ~zod/try=> (scan "%" cen)
150+ > (scan "%" cen)
151 ~~~25.
151 ~~~25.
152− ~zod/try=> `cord`(scan "%" cen)
152+ > `cord`(scan "%" cen)
153 '%'
153 '%'
154− ~zod/try=> (cen [[1 1] "%"])
154+ > (cen [[1 1] "%"])
155 [p=[p=1 q=2] q=[~ [p=~~~25. q=[p=[p=1 q=2] q=""]]]]
155 [p=[p=1 q=2] q=[~ [p=~~~25. q=[p=[p=1 q=2] q=""]]]]
156− ~zod/try=> (cen [[1 1] "%^"])
156+ > (cen [[1 1] "%^"])
157 [p=[p=1 q=2] q=[~ [p=~~~25. q=[p=[p=1 q=2] q="^"]]]]
157 [p=[p=1 q=2] q=[~ [p=~~~25. q=[p=[p=1 q=2] q="^"]]]]
158
158
159
159
@@ -173,13 +173,13 @@ Source
173Examples
173Examples
174--------
174--------
175
175
176− ~zod/try=> (scan ":" col)
176+ > (scan ":" col)
177 ~~~3a.
177 ~~~3a.
178− ~zod/try=> `cord`(scan ":" col)
178+ > `cord`(scan ":" col)
179 ':'
179 ':'
180− ~zod/try=> (col [[1 1] ":"])
180+ > (col [[1 1] ":"])
181 [p=[p=1 q=2] q=[~ [p=~~~3a. q=[p=[p=1 q=2] q=""]]]]
181 [p=[p=1 q=2] q=[~ [p=~~~3a. q=[p=[p=1 q=2] q=""]]]]
182− ~zod/try=> (col [[1 1] ":-"])
182+ > (col [[1 1] ":-"])
183 [p=[p=1 q=2] q=[~ [p=~~~3a. q=[p=[p=1 q=2] q="-"]]]]
183 [p=[p=1 q=2] q=[~ [p=~~~3a. q=[p=[p=1 q=2] q="-"]]]]
184
184
185
185
@@ -199,13 +199,13 @@ Source
199Examples
199Examples
200--------
200--------
201
201
202− ~zod/try=> (scan "," com)
202+ > (scan "," com)
203 ~~~2c.
203 ~~~2c.
204− ~zod/try=> `cord`(scan "," com)
204+ > `cord`(scan "," com)
205 ','
205 ','
206− ~zod/try=> (com [[1 1] ","])
206+ > (com [[1 1] ","])
207 [p=[p=1 q=2] q=[~ [p=~~~2c. q=[p=[p=1 q=2] q=""]]]]
207 [p=[p=1 q=2] q=[~ [p=~~~2c. q=[p=[p=1 q=2] q=""]]]]
208− ~zod/try=> (com [[1 1] "not com"])
208+ > (com [[1 1] "not com"])
209 [p=[p=1 q=1] q=~]
209 [p=[p=1 q=1] q=~]
210
210
211
211
@@ -225,15 +225,15 @@ Source
225Examples
225Examples
226--------
226--------
227
227
228− ~zod/try=> (scan "\"" doq)
228+ > (scan "\"" doq)
229 ~~~22.
229 ~~~22.
230− ~zod/try=> `cord`(scan "\"" doq)
230+ > `cord`(scan "\"" doq)
231 '"'
231 '"'
232− ~zod/try=> (doq [[1 1] "\""])
232+ > (doq [[1 1] "\""])
233 [p=[p=1 q=2] q=[~ [p=~~~22. q=[p=[p=1 q=2] q=""]]]]
233 [p=[p=1 q=2] q=[~ [p=~~~22. q=[p=[p=1 q=2] q=""]]]]
234− ~zod/try=> (doq [[1 1] "not successfully parsed"])
234+ > (doq [[1 1] "not successfully parsed"])
235 [p=[p=1 q=1] q=~]
235 [p=[p=1 q=1] q=~]
236− ~zod/try=> (scan "see?" doq)
236+ > (scan "see?" doq)
237 ! {1 1}
237 ! {1 1}
238 ! 'syntax-error'
238 ! 'syntax-error'
239 ! exit
239 ! exit
@@ -255,13 +255,13 @@ Source
255Examples
255Examples
256--------
256--------
257
257
258− ~zod/try=> (scan "." dot)
258+ > (scan "." dot)
259 ~~~.
259 ~~~.
260− ~zod/try=> `cord`(scan "." dot)
260+ > `cord`(scan "." dot)
261 '.'
261 '.'
262− ~zod/try=> (dot [[1 1] "."])
262+ > (dot [[1 1] "."])
263 [p=[p=1 q=2] q=[~ [p=~~~. q=[p=[p=1 q=2] q=""]]]]
263 [p=[p=1 q=2] q=[~ [p=~~~. q=[p=[p=1 q=2] q=""]]]]
264− ~zod/try=> (dot [[1 1] ".^"])
264+ > (dot [[1 1] ".^"])
265 [p=[p=1 q=2] q=[~ [p=~~~. q=[p=[p=1 q=2] q="^"]]]]
265 [p=[p=1 q=2] q=[~ [p=~~~. q=[p=[p=1 q=2] q="^"]]]]
266
266
267
267
@@ -281,13 +281,13 @@ Source
281Examples
281Examples
282--------
282--------
283
283
284− ~zod/try=> (scan "/" fas)
284+ > (scan "/" fas)
285 ~~~2f.
285 ~~~2f.
286− ~zod/try=> `cord`(scan "/" fas)
286+ > `cord`(scan "/" fas)
287 '/'
287 '/'
288− ~zod/try=> (fas [[1 1] "/"])
288+ > (fas [[1 1] "/"])
289 [p=[p=1 q=2] q=[~ [p=~~~2f. q=[p=[p=1 q=2] q=""]]]]
289 [p=[p=1 q=2] q=[~ [p=~~~2f. q=[p=[p=1 q=2] q=""]]]]
290− ~zod/try=> (fas [[1 1] "|/"])
290+ > (fas [[1 1] "|/"])
291 [p=[p=1 q=1] q=~]
291 [p=[p=1 q=1] q=~]
292
292
293
293
@@ -307,15 +307,15 @@ Source
307Examples
307Examples
308--------
308--------
309
309
310− ~zod/try=> (scan "<" gal)
310+ > (scan "<" gal)
311 ~~~3c.
311 ~~~3c.
312− ~zod/try=> `cord`(scan "<" gal)
312+ > `cord`(scan "<" gal)
313 '<'
313 '<'
314− ~zod/try=> (gal [[1 1] "<"])
314+ > (gal [[1 1] "<"])
315 [p=[p=1 q=2] q=[~ [p=~~~3c. q=[p=[p=1 q=2] q=""]]]]
315 [p=[p=1 q=2] q=[~ [p=~~~3c. q=[p=[p=1 q=2] q=""]]]]
316− ~zod/try=> (gal [[1 1] "<+"])
316+ > (gal [[1 1] "<+"])
317 [p=[p=1 q=2] q=[~ [p=~~~3c. q=[p=[p=1 q=2] q="+"]]]]
317 [p=[p=1 q=2] q=[~ [p=~~~3c. q=[p=[p=1 q=2] q="+"]]]]
318− ~zod/try=> (gal [[1 1] "+<"])
318+ > (gal [[1 1] "+<"])
319 [p=[p=1 q=1] q=~]
319 [p=[p=1 q=1] q=~]
320
320
321
321
@@ -335,13 +335,13 @@ Source
335Examples
335Examples
336--------
336--------
337
337
338− ~zod/try=> (scan ">" gar)
338+ > (scan ">" gar)
339 ~~~3e.
339 ~~~3e.
340− ~zod/try=> `cord`(scan ">" gar)
340+ > `cord`(scan ">" gar)
341 '>'
341 '>'
342− ~zod/try=> (gar [[1 1] ">"])
342+ > (gar [[1 1] ">"])
343 [p=[p=1 q=2] q=[~ [p=~~~3e. q=[p=[p=1 q=2] q=""]]]]
343 [p=[p=1 q=2] q=[~ [p=~~~3e. q=[p=[p=1 q=2] q=""]]]]
344− ~zod/try=> (gar [[1 1] "=>"])
344+ > (gar [[1 1] "=>"])
345 [p=[p=1 q=1] q=~]
345 [p=[p=1 q=1] q=~]
346
346
347
347
@@ -361,13 +361,13 @@ Source
361Examples
361Examples
362--------
362--------
363
363
364− ~zod/try=> (scan "#" hax)
364+ > (scan "#" hax)
365 ~~~23.
365 ~~~23.
366− ~zod/try=> `cord`(scan "#" hax)
366+ > `cord`(scan "#" hax)
367 '#'
367 '#'
368− ~zod/try=> (hax [[1 1] "#"])
368+ > (hax [[1 1] "#"])
369 [p=[p=1 q=2] q=[~ [p=~~~23. q=[p=[p=1 q=2] q=""]]]]
369 [p=[p=1 q=2] q=[~ [p=~~~23. q=[p=[p=1 q=2] q=""]]]]
370− ~zod/try=> (hax [[1 1] "#!"])
370+ > (hax [[1 1] "#!"])
371 [p=[p=1 q=2] q=[~ [p=~~~23. q=[p=[p=1 q=2] q="!"]]]]
371 [p=[p=1 q=2] q=[~ [p=~~~23. q=[p=[p=1 q=2] q="!"]]]]
372
372
373
373
@@ -387,13 +387,13 @@ Source
387Examples
387Examples
388--------
388--------
389
389
390− ~zod/try=> (scan "-" hep)
390+ > (scan "-" hep)
391 ~~-
391 ~~-
392− ~zod/try=> `cord`(scan "-" hep)
392+ > `cord`(scan "-" hep)
393 '-'
393 '-'
394− ~zod/try=> (hep [[1 1] "-"])
394+ > (hep [[1 1] "-"])
395 [p=[p=1 q=2] q=[~ [p=~~- q=[p=[p=1 q=2] q=""]]]]
395 [p=[p=1 q=2] q=[~ [p=~~- q=[p=[p=1 q=2] q=""]]]]
396− ~zod/try=> (hep [[1 1] ":-"])
396+ > (hep [[1 1] ":-"])
397 [p=[p=1 q=1] q=~]
397 [p=[p=1 q=1] q=~]
398
398
399
399
@@ -415,13 +415,13 @@ Source
415Examples
415Examples
416--------
416--------
417
417
418− ~zod/try=> (scan "\{" kel)
418+ > (scan "\{" kel)
419 ~~~7b.
419 ~~~7b.
420− ~zod/try=> `cord`(scan "\{" kel)
420+ > `cord`(scan "\{" kel)
421 '{'
421 '{'
422− ~zod/try=> (kel [[1 1] "\{"])
422+ > (kel [[1 1] "\{"])
423 [p=[p=1 q=2] q=[~ [p=~~~7b. q=[p=[p=1 q=2] q=""]]]]
423 [p=[p=1 q=2] q=[~ [p=~~~7b. q=[p=[p=1 q=2] q=""]]]]
424− ~zod/try=> (kel [[1 1] " \{"])
424+ > (kel [[1 1] " \{"])
425 [p=[p=1 q=1] q=~]
425 [p=[p=1 q=1] q=~]
426
426
427
427
@@ -443,13 +443,13 @@ Source
443Examples
443Examples
444--------
444--------
445
445
446− ~zod/try=> (scan "}" ker)
446+ > (scan "}" ker)
447 ~~~7d.
447 ~~~7d.
448− ~zod/try=> `cord`(scan "}" ker)
448+ > `cord`(scan "}" ker)
449 '}'
449 '}'
450− ~zod/try=> (ker [[1 1] "}"])
450+ > (ker [[1 1] "}"])
451 [p=[p=1 q=2] q=[~ [p=~~~7d. q=[p=[p=1 q=2] q=""]]]]
451 [p=[p=1 q=2] q=[~ [p=~~~7d. q=[p=[p=1 q=2] q=""]]]]
452− ~zod/try=> (ker [[1 1] "\{}"])
452+ > (ker [[1 1] "\{}"])
453 [p=[p=1 q=1] q=~]
453 [p=[p=1 q=1] q=~]
454
454
455
455
@@ -469,13 +469,13 @@ Source
469Examples
469Examples
470--------
470--------
471
471
472− ~zod/try=> (scan "^" ket)
472+ > (scan "^" ket)
473 ~~~5e.
473 ~~~5e.
474− ~zod/try=> `cord`(scan "^" ket)
474+ > `cord`(scan "^" ket)
475 '^'
475 '^'
476− ~zod/try=> (ket [[1 1] "^"])
476+ > (ket [[1 1] "^"])
477 [p=[p=1 q=2] q=[~ [p=~~~5e. q=[p=[p=1 q=2] q=""]]]]
477 [p=[p=1 q=2] q=[~ [p=~~~5e. q=[p=[p=1 q=2] q=""]]]]
478− ~zod/try=> (ket [[1 1] ".^"])
478+ > (ket [[1 1] ".^"])
479 [p=[p=1 q=1] q=~]
479 [p=[p=1 q=1] q=~]
480
480
481
481
@@ -494,13 +494,13 @@ Source
494Examples
494Examples
495--------
495--------
496
496
497− ~zod/try=> (scan "+" lus)
497+ > (scan "+" lus)
498 ~~~2b.
498 ~~~2b.
499− ~zod/try=> `cord`(scan "+" lus)
499+ > `cord`(scan "+" lus)
500 '+'
500 '+'
501− ~zod/try=> (lus [[1 1] "+"])
501+ > (lus [[1 1] "+"])
502 [p=[p=1 q=2] q=[~ [p=~~~2b. q=[p=[p=1 q=2] q=""]]]]
502 [p=[p=1 q=2] q=[~ [p=~~~2b. q=[p=[p=1 q=2] q=""]]]]
503− ~zod/try=> (lus [[1 1] ".+"])
503+ > (lus [[1 1] ".+"])
504 [p=[p=1 q=1] q=~]
504 [p=[p=1 q=1] q=~]
505
505
506
506
@@ -520,13 +520,13 @@ Source
520Examples
520Examples
521--------
521--------
522
522
523− ~zod/try=> (scan "&" pam)
523+ > (scan "&" pam)
524 ~~~26.
524 ~~~26.
525− ~zod/try=> `cord`(scan "&" pam)
525+ > `cord`(scan "&" pam)
526 '&'
526 '&'
527− ~zod/try=> (pam [[1 1] "&"])
527+ > (pam [[1 1] "&"])
528 [p=[p=1 q=2] q=[~ [p=~~~26. q=[p=[p=1 q=2] q=""]]]]
528 [p=[p=1 q=2] q=[~ [p=~~~26. q=[p=[p=1 q=2] q=""]]]]
529− ~zod/try=> (pam [[1 1] "?&"])
529+ > (pam [[1 1] "?&"])
530 [p=[p=1 q=1] q=~]
530 [p=[p=1 q=1] q=~]
531
531
532
532
@@ -546,13 +546,13 @@ Source
546Examples
546Examples
547--------
547--------
548
548
549− ~zod/try=> (scan "@" pat)
549+ > (scan "@" pat)
550 ~~~4.
550 ~~~4.
551− ~zod/try=> `cord`(scan "@" pat)
551+ > `cord`(scan "@" pat)
552 '@'
552 '@'
553− ~zod/try=> (pat [[1 1] "@"])
553+ > (pat [[1 1] "@"])
554 [p=[p=1 q=2] q=[~ [p=~~~4. q=[p=[p=1 q=2] q=""]]]]
554 [p=[p=1 q=2] q=[~ [p=~~~4. q=[p=[p=1 q=2] q=""]]]]
555− ~zod/try=> (pat [[1 1] "?@"])
555+ > (pat [[1 1] "?@"])
556 [p=[p=1 q=1] q=~]
556 [p=[p=1 q=1] q=~]
557
557
558
558
@@ -572,13 +572,13 @@ Source
572Examples
572Examples
573--------
573--------
574
574
575− ~zod/try=> (scan "(" pel)
575+ > (scan "(" pel)
576 ~~~28.
576 ~~~28.
577− ~zod/try=> `cord`(scan "(" pel)
577+ > `cord`(scan "(" pel)
578 '('
578 '('
579− ~zod/try=> (pel [[1 1] "("])
579+ > (pel [[1 1] "("])
580 [p=[p=1 q=2] q=[~ [p=~~~28. q=[p=[p=1 q=2] q=""]]]]
580 [p=[p=1 q=2] q=[~ [p=~~~28. q=[p=[p=1 q=2] q=""]]]]
581− ~zod/try=> (pel [[1 1] ";("])
581+ > (pel [[1 1] ";("])
582 [p=[p=1 q=1] q=~]
582 [p=[p=1 q=1] q=~]
583
583
584
584
@@ -598,13 +598,13 @@ Source
598Examples
598Examples
599--------
599--------
600
600
601− ~zod/try=> (scan ")" per)
601+ > (scan ")" per)
602 ~~~29.
602 ~~~29.
603− ~zod/try=> `cord`(scan ")" per)
603+ > `cord`(scan ")" per)
604 ')'
604 ')'
605− ~zod/try=> (per [[1 1] ")"])
605+ > (per [[1 1] ")"])
606 [p=[p=1 q=2] q=[~ [p=~~~29. q=[p=[p=1 q=2] q=""]]]]
606 [p=[p=1 q=2] q=[~ [p=~~~29. q=[p=[p=1 q=2] q=""]]]]
607− ~zod/try=> (per [[1 1] " )"])
607+ > (per [[1 1] " )"])
608 [p=[p=1 q=1] q=~]
608 [p=[p=1 q=1] q=~]
609
609
610
610
@@ -624,13 +624,13 @@ Source
624Examples
624Examples
625--------
625--------
626
626
627− ~zod/try=> (scan "[" sel)
627+ > (scan "[" sel)
628 ~~~5b.
628 ~~~5b.
629− ~zod/try=> `cord`(scan "[" sel)
629+ > `cord`(scan "[" sel)
630 '['
630 '['
631− ~zod/try=> (sel [[1 1] "["])
631+ > (sel [[1 1] "["])
632 [p=[p=1 q=2] q=[~ [p=~~~5b. q=[p=[p=1 q=2] q=""]]]]
632 [p=[p=1 q=2] q=[~ [p=~~~5b. q=[p=[p=1 q=2] q=""]]]]
633− ~zod/try=> (sel [[1 1] "-["])
633+ > (sel [[1 1] "-["])
634 [p=[p=1 q=1] q=~]
634 [p=[p=1 q=1] q=~]
635
635
636
636
@@ -650,13 +650,13 @@ Source
650Examples
650Examples
651--------
651--------
652
652
653− ~zod/try=> (scan ";" sem)
653+ > (scan ";" sem)
654 ~~~3b.
654 ~~~3b.
655− ~zod/try=> `cord`(scan ";" sem)
655+ > `cord`(scan ";" sem)
656 ';'
656 ';'
657− ~zod/try=> (sem [[1 1] ";"])
657+ > (sem [[1 1] ";"])
658 [p=[p=1 q=2] q=[~ [p=~~~3b. q=[p=[p=1 q=2] q=""]]]]
658 [p=[p=1 q=2] q=[~ [p=~~~3b. q=[p=[p=1 q=2] q=""]]]]
659− ~zod/try=> (sem [[1 1] " ;"])
659+ > (sem [[1 1] " ;"])
660 [p=[p=1 q=1] q=~]
660 [p=[p=1 q=1] q=~]
661
661
662
662
@@ -676,13 +676,13 @@ Source
676Examples
676Examples
677--------
677--------
678
678
679− ~zod/try=> (scan "]" ser)
679+ > (scan "]" ser)
680 ~~~5d.
680 ~~~5d.
681− ~zod/try=> `cord`(scan "]" ser)
681+ > `cord`(scan "]" ser)
682 ']'
682 ']'
683− ~zod/try=> (ser [[1 1] "]"])
683+ > (ser [[1 1] "]"])
684 [p=[p=1 q=2] q=[~ [p=~~~5d. q=[p=[p=1 q=2] q=""]]]]
684 [p=[p=1 q=2] q=[~ [p=~~~5d. q=[p=[p=1 q=2] q=""]]]]
685− ~zod/try=> (ser [[1 1] "[ ]"])
685+ > (ser [[1 1] "[ ]"])
686 [p=[p=1 q=1] q=~]
686 [p=[p=1 q=1] q=~]
687
687
688
688
@@ -702,13 +702,13 @@ Source
702Examples
702Examples
703--------
703--------
704
704
705− ~zod/try=> (scan "~" sig)
705+ > (scan "~" sig)
706 ~~~~
706 ~~~~
707− ~zod/try=> `cord`(scan "~" sig)
707+ > `cord`(scan "~" sig)
708 '~'
708 '~'
709− ~zod/try=> (sig [[1 1] "~"])
709+ > (sig [[1 1] "~"])
710 [p=[p=1 q=2] q=[~ [p=~~~~ q=[p=[p=1 q=2] q=""]]]]
710 [p=[p=1 q=2] q=[~ [p=~~~~ q=[p=[p=1 q=2] q=""]]]]
711− ~zod/try=> (sig [[1 1] "?~"])
711+ > (sig [[1 1] "?~"])
712 [p=[p=1 q=1] q=~]
712 [p=[p=1 q=1] q=~]
713
713
714
714
@@ -729,13 +729,13 @@ Source
729Examples
729Examples
730--------
730--------
731
731
732− ~zod/try=> (scan "'" soq)
732+ > (scan "'" soq)
733 ~~~27.
733 ~~~27.
734− ~zod/try=> `cord`(scan "'" soq)
734+ > `cord`(scan "'" soq)
735 '''
735 '''
736− ~zod/try=> (soq [[1 1] "'"])
736+ > (soq [[1 1] "'"])
737 [p=[p=1 q=2] q=[~ [p=~~~27. q=[p=[p=1 q=2] q=""]]]]
737 [p=[p=1 q=2] q=[~ [p=~~~27. q=[p=[p=1 q=2] q=""]]]]
738− ~zod/try=> (soq [[1 1] ">'"])
738+ > (soq [[1 1] ">'"])
739 [p=[p=1 q=1] q=~]
739 [p=[p=1 q=1] q=~]
740
740
741
741
@@ -755,13 +755,13 @@ Source
755Examples
755Examples
756--------
756--------
757
757
758− ~zod/try=> (scan "*" tar)
758+ > (scan "*" tar)
759 ~~~2a.
759 ~~~2a.
760− ~zod/try=> `cord`(scan "*" tar)
760+ > `cord`(scan "*" tar)
761 '*'
761 '*'
762− ~zod/try=> (tar [[1 1] "*"])
762+ > (tar [[1 1] "*"])
763 [p=[p=1 q=2] q=[~ [p=~~~2a. q=[p=[p=1 q=2] q=""]]]]
763 [p=[p=1 q=2] q=[~ [p=~~~2a. q=[p=[p=1 q=2] q=""]]]]
764− ~zod/try=> (tar [[1 1] ".*"])
764+ > (tar [[1 1] ".*"])
765 [p=[p=1 q=1] q=~]
765 [p=[p=1 q=1] q=~]
766
766
767
767
@@ -782,13 +782,13 @@ Source
782Examples
782Examples
783--------
783--------
784
784
785− ~zod/try=> (scan "`" tec)
785+ > (scan "`" tec)
786 ~~~6.
786 ~~~6.
787− ~zod/try=> `cord`(scan "`" tec)
787+ > `cord`(scan "`" tec)
788 '`'
788 '`'
789− ~zod/try=> (tec [[1 1] "`"])
789+ > (tec [[1 1] "`"])
790 [p=[p=1 q=2] q=[~ [p=~~~6. q=[p=[p=1 q=2] q=""]]]]
790 [p=[p=1 q=2] q=[~ [p=~~~6. q=[p=[p=1 q=2] q=""]]]]
791− ~zod/try=> (tec [[1 1] " `"])
791+ > (tec [[1 1] " `"])
792 [p=[p=1 q=1] q=~]
792 [p=[p=1 q=1] q=~]
793
793
794
794
@@ -808,13 +808,13 @@ Source
808Examples
808Examples
809--------
809--------
810
810
811− ~zod/try=> (scan "=" tis)
811+ > (scan "=" tis)
812 ~~~3d.
812 ~~~3d.
813− ~zod/try=> `cord`(scan "=" tis)
813+ > `cord`(scan "=" tis)
814 '='
814 '='
815− ~zod/try=> (tis [[1 1] "="])
815+ > (tis [[1 1] "="])
816 [p=[p=1 q=2] q=[~ [p=~~~3d. q=[p=[p=1 q=2] q=""]]]]
816 [p=[p=1 q=2] q=[~ [p=~~~3d. q=[p=[p=1 q=2] q=""]]]]
817− ~zod/try=> (tis [[1 1] "|="])
817+ > (tis [[1 1] "|="])
818 [p=[p=1 q=1] q=~]
818 [p=[p=1 q=1] q=~]
819
819
820
820
@@ -834,13 +834,13 @@ Source
834Examples
834Examples
835--------
835--------
836
836
837− ~zod/try=> (scan "?" wut)
837+ > (scan "?" wut)
838 ~~~3f.
838 ~~~3f.
839− ~zod/try=> `cord`(scan "?" wut)
839+ > `cord`(scan "?" wut)
840 '?'
840 '?'
841− ~zod/try=> (wut [[1 1] "?"])
841+ > (wut [[1 1] "?"])
842 [p=[p=1 q=2] q=[~ [p=~~~3f. q=[p=[p=1 q=2] q=""]]]]
842 [p=[p=1 q=2] q=[~ [p=~~~3f. q=[p=[p=1 q=2] q=""]]]]
843− ~zod/try=> (wut [[1 1] ".?"])
843+ > (wut [[1 1] ".?"])
844 [p=[p=1 q=1] q=~]
844 [p=[p=1 q=1] q=~]
845
845
846
846
@@ -860,13 +860,13 @@ Source
860Examples
860Examples
861--------
861--------
862
862
863− ~zod/try=> (scan "!" zap)
863+ > (scan "!" zap)
864 ~~~21.
864 ~~~21.
865− ~zod/try=> `cord`(scan "!" zap)
865+ > `cord`(scan "!" zap)
866 '!'
866 '!'
867− ~zod/try=> (zap [[1 1] "!"])
867+ > (zap [[1 1] "!"])
868 [p=[p=1 q=2] q=[~ [p=~~~21. q=[p=[p=1 q=2] q=""]]]]
868 [p=[p=1 q=2] q=[~ [p=~~~21. q=[p=[p=1 q=2] q=""]]]]
869− ~zod/try=> (zap [[1 1] "?!"])
869+ > (zap [[1 1] "?!"])
870 [p=[p=1 q=1] q=~]
870 [p=[p=1 q=1] q=~]
871
871
872
872
docs/system/hoon/library/4j.md+193−192
@@ -14,7 +14,7 @@ Source
14Examples
14Examples
15--------
15--------
16
16
17− ~zod/try=> ab
17+ > ab
18 <36.ecc 414.gly 100.xkc 1.ypj %164>
18 <36.ecc 414.gly 100.xkc 1.ypj %164>
19
19
20------------------------------------------------------------------------
20------------------------------------------------------------------------
@@ -23,7 +23,7 @@ Examples
23
23
24Parse hex pair
24Parse hex pair
25
25
26−Parsing [`++rule`](). Parses a pair of base-16 digits. Used in escapes.
26+Parsing `++rule`. Parses a pair of base-16 digits. Used in escapes.
27
27
28Accepts
28Accepts
29-------
29-------
@@ -43,11 +43,11 @@ Source
43Examples
43Examples
44--------
44--------
45
45
46− ~zod/try=> (scan "07" bix:ab)
46+ > (scan "07" bix:ab)
47 q=7
47 q=7
48− ~zod/try=> (scan "51" bix:ab)
48+ > (scan "51" bix:ab)
49 q=81
49 q=81
50− ~zod/try=> (scan "a3" bix:ab)
50+ > (scan "a3" bix:ab)
51 q=163
51 q=163
52
52
53------------------------------------------------------------------------
53------------------------------------------------------------------------
@@ -56,7 +56,7 @@ Examples
56
56
57Parse phonetic pair
57Parse phonetic pair
58
58
59−Parsing [`++rule`](). Parses an atom of [odor]() [`@pE`](), a phrase of two bytes
59+Parsing `++rule`. Parses an atom of odor `@pE`, a phrase of two bytes
60encoded phonetically.
60encoded phonetically.
61
61
62Accepts
62Accepts
@@ -77,9 +77,9 @@ Source
77Examples
77Examples
78--------
78--------
79
79
80− ~zod/try=> (scan "doznec" hif:ab)
80+ > (scan "doznec" hif:ab)
81 q=256
81 q=256
82− ~zod/try=> (scan "pittyp" hif:ab)
82+ > (scan "pittyp" hif:ab)
83 q=48.626
83 q=48.626
84
84
85------------------------------------------------------------------------
85------------------------------------------------------------------------
@@ -88,7 +88,7 @@ Examples
88
88
89Parse two phonetic pairs
89Parse two phonetic pairs
90
90
91−Parsing [`++rule`](). Parses and unscrambles an atom of odor [@pF](), a phrase
91+Parsing `++rule`. Parses and unscrambles an atom of odor @pF, a phrase
92of two two-byte pairs that are encoded (and scrambled) phonetically.
92of two two-byte pairs that are encoded (and scrambled) phonetically.
93
93
94Accepts
94Accepts
@@ -105,17 +105,17 @@ Source
105------
105------
106
106
107 ++ huf %+ cook
107 ++ huf %+ cook
108− |=([a=@ b=@] (wred:un ~(zug mu ~(zag mu [a b]))))
108+ |=([a/@ b/@] (wred:un ~(zug mu ~(zag mu [a b]))))
109 ;~(plug hif ;~(pfix hep hif))
109 ;~(plug hif ;~(pfix hep hif))
110
110
111Examples
111Examples
112--------
112--------
113
113
114− ~zod/try=> (scan "pittyp-pittyp" huf:ab)
114+ > (scan "pittyp-pittyp" huf:ab)
115 328.203.557
115 328.203.557
116− ~zod/try=> (scan "tasfyn-partyv" huf:ab)
116+ > (scan "tasfyn-partyv" huf:ab)
117 65.792
117 65.792
118− ~zod/try=> `@ux`(scan "tasfyn-partyv" huf:ab)
118+ > `@ux`(scan "tasfyn-partyv" huf:ab)
119 0x1.0100
119 0x1.0100
120
120
121------------------------------------------------------------------------
121------------------------------------------------------------------------
@@ -124,13 +124,13 @@ Examples
124
124
125Parse 8 phonetic bytes
125Parse 8 phonetic bytes
126
126
127−Parsing [`++rule`](). Parses an atom of odor [@pG](), a phrase of eight of
127+Parsing `++rule`. Parses an atom of odor @pG, a phrase of eight of
128phonetic bytes.
128phonetic bytes.
129
129
130Accepts
130Accepts
131-------
131-------
132
132
133−An atom of odor [`@pG`]()
133+An atom of odor `@pG`
134
134
135Produces
135Produces
136--------
136--------
@@ -145,9 +145,9 @@ Source
145Examples
145Examples
146--------
146--------
147
147
148− ~zod/try=> (scan "sondel-forsut-tillyn-nillyt" hyf:ab)
148+ > (scan "sondel-forsut-tillyn-nillyt" hyf:ab)
149 q=365.637.097.828.335.095
149 q=365.637.097.828.335.095
150− ~zod/try=> `@u`~sondel-forsut-tillyn-nillyt
150+ > `@u`~sondel-forsut-tillyn-nillyt
151 365.637.097.828.335.095
151 365.637.097.828.335.095
152
152
153------------------------------------------------------------------------
153------------------------------------------------------------------------
@@ -156,12 +156,12 @@ Examples
156
156
157Parse \<= 5 base-32
157Parse \<= 5 base-32
158
158
159−Parsing [`++rule`](). Parses up to five base-32 digits without a leading zero.
159+Parsing `++rule`. Parses up to five base-32 digits without a leading zero.
160
160
161Accepts
161Accepts
162-------
162-------
163
163
164−Up to five [@uv]() (base 64) digits.
164+Up to five @uv (base 64) digits.
165
165
166Produces
166Produces
167--------
167--------
@@ -176,14 +176,14 @@ Source
176Examples
176Examples
177--------
177--------
178
178
179− ~zod/try=> (scan "a" pev:ab)
179+ > (scan "a" pev:ab)
180 q=10
180 q=10
181− ~zod/try=> (scan "290j" pev:ab)
181+ > (scan "290j" pev:ab)
182 q=74.771
182 q=74.771
183− ~zod/try=> (scan "123456" pev:ab)
183+ > (scan "123456" pev:ab)
184 ! {1 6}
184 ! {1 6}
185 ! exit
185 ! exit
186− ~zod/try=> (scan "090j" pev:ab)
186+ > (scan "090j" pev:ab)
187 ~ <syntax error at [1 11]>
187 ~ <syntax error at [1 11]>
188
188
189------------------------------------------------------------------------
189------------------------------------------------------------------------
@@ -192,12 +192,12 @@ Examples
192
192
193Parse \<= 5 base-64
193Parse \<= 5 base-64
194
194
195−Parsing [`++rule`](). Parses up to five base-64 digits without a leading zero.
195+Parsing `++rule`. Parses up to five base-64 digits without a leading zero.
196
196
197Accepts
197Accepts
198-------
198-------
199
199
200−Up to five [@uw]() (base 64) digits.
200+Up to five @uw (base 64) digits.
201
201
202Produces
202Produces
203--------
203--------
@@ -212,16 +212,16 @@ Source
212Examples
212Examples
213--------
213--------
214
214
215− ~zod/try=> (scan "Q" pew:ab)
215+ > (scan "Q" pew:ab)
216 q=52
216 q=52
217− ~zod/try=> (scan "aQ~9" pew:ab)
217+ > (scan "aQ~9" pew:ab)
218 q=2.838.473
218 q=2.838.473
219− ~zod/try=> `@`0waQ~9
219+ > `@`0waQ~9
220 2.838.473
220 2.838.473
221− ~zod/try=> (scan "123456" pew:ab)
221+ > (scan "123456" pew:ab)
222 ! {1 6}
222 ! {1 6}
223 ! exit
223 ! exit
224− ~zod/try=> (scan "012345" pew:ab)
224+ > (scan "012345" pew:ab)
225 ! {1 1}
225 ! {1 1}
226 ! exit
226 ! exit
227
227
@@ -231,7 +231,7 @@ Examples
231
231
232Parse 5 base-32
232Parse 5 base-32
233
233
234−Parsing [`++rule`](). Parses exactly five base-32 digits.
234+Parsing `++rule`. Parses exactly five base-32 digits.
235
235
236Accepts
236Accepts
237-------
237-------
@@ -247,9 +247,9 @@ Source
247Examples
247Examples
248--------
248--------
249
249
250− ~zod/try=> (scan "10b3l" piv:ab)
250+ > (scan "10b3l" piv:ab)
251 q=1.059.957
251 q=1.059.957
252− ~zod/try=> (scan "1" piv:ab)
252+ > (scan "1" piv:ab)
253 ! {1 2}
253 ! {1 2}
254 ! exit
254 ! exit
255
255
@@ -259,7 +259,7 @@ Examples
259
259
260Parse 5 base-64
260Parse 5 base-64
261
261
262−Parsing [`++rule`](). Parses exactly five base-64 digits.
262+Parsing `++rule`. Parses exactly five base-64 digits.
263
263
264Accepts
264Accepts
265-------
265-------
@@ -267,8 +267,6 @@ Accepts
267Produces
267Produces
268--------
268--------
269
269
270−My name henry let's see how fast I can type.
271−
272Source
270Source
273------
271------
274
272
@@ -277,9 +275,9 @@ Source
277Examples
275Examples
278--------
276--------
279
277
280− ~zod/try=> (scan "2C-pZ" piw:ab)
278+ > (scan "2C-pZ" piw:ab)
281 q=43.771.517
279 q=43.771.517
282− ~zod/try=> (scan "2" piv:ab)
280+ > (scan "2" piv:ab)
283 ! {1 2}
281 ! {1 2}
284 ! exit
282 ! exit
285
283
@@ -289,7 +287,7 @@ Examples
289
287
290Parse \<= 4 binary
288Parse \<= 4 binary
291
289
292−Parsing [`++rule`](). Parses a binary number of up to 4 digits in length without
290+Parsing `++rule`. Parses a binary number of up to 4 digits in length without
293a leading zero.
291a leading zero.
294
292
295Accepts
293Accepts
@@ -306,16 +304,16 @@ Source
306Examples
304Examples
307--------
305--------
308
306
309− ~zod/try=> (scan "1" qeb:ab)
307+ > (scan "1" qeb:ab)
310 q=1
308 q=1
311− ~zod/try=> (scan "101" qeb:ab)
309+ > (scan "101" qeb:ab)
312 q=5
310 q=5
313− ~zod/try=> (scan "1111" qeb:ab)
311+ > (scan "1111" qeb:ab)
314 q=15
312 q=15
315− ~zod/try=> (scan "11111" qeb:ab)
313+ > (scan "11111" qeb:ab)
316 ! {1 5}
314 ! {1 5}
317 ! exit
315 ! exit
318− ~zod/try=> (scan "01" qeb:ab)
316+ > (scan "01" qeb:ab)
319 ! {1 1}
317 ! {1 1}
320 ! exit
318 ! exit
321
319
@@ -325,7 +323,7 @@ Examples
325
323
326Parse \<= 4 hex
324Parse \<= 4 hex
327
325
328−Parsing [`++rule`](). Parses a hexadecimal number of up to 4 digits in length
326+Parsing `++rule`. Parses a hexadecimal number of up to 4 digits in length
329without a leading zero.
327without a leading zero.
330
328
331Accepts
329Accepts
@@ -342,14 +340,14 @@ Source
342Examples
340Examples
343--------
341--------
344
342
345− ~zod/try=> (scan "ca" qex:ab)
343+ > (scan "ca" qex:ab)
346 q=202
344 q=202
347− ~zod/try=> (scan "18ac" qex:ab)
345+ > (scan "18ac" qex:ab)
348 q=6.316
346 q=6.316
349− ~zod/try=> (scan "18acc" qex:ab)
347+ > (scan "18acc" qex:ab)
350 ! {1 5}
348 ! {1 5}
351 ! exit
349 ! exit
352− ~zod/try=> (scan "08ac" qex:ab)
350+ > (scan "08ac" qex:ab)
353 ! {1 1}
351 ! {1 1}
354 ! exit
352 ! exit
355
353
@@ -359,7 +357,7 @@ Examples
359
357
360Parse 4 binary
358Parse 4 binary
361
359
362−Parsing [`++rule`](). Parses exactly four binary digits.
360+Parsing `++rule`. Parses exactly four binary digits.
363
361
364Accepts
362Accepts
365-------
363-------
@@ -375,11 +373,11 @@ Source
375Examples
373Examples
376--------
374--------
377
375
378− ~zod/try=> (scan "0001" qib:ab)
376+ > (scan "0001" qib:ab)
379 q=1
377 q=1
380− ~zod/try=> (scan "0100" qib:ab)
378+ > (scan "0100" qib:ab)
381 q=4
379 q=4
382− ~zod/try=> (scan "110" qib:ab)
380+ > (scan "110" qib:ab)
383 ! {1 4}
381 ! {1 4}
384 ! exit
382 ! exit
385
383
@@ -389,7 +387,7 @@ Examples
389
387
390Parse 4 hex
388Parse 4 hex
391
389
392−Parsing [`++rule`](). Parses exactly four hexadecimal digits.
390+Parsing `++rule`. Parses exactly four hexadecimal digits.
393
391
394Accepts
392Accepts
395-------
393-------
@@ -405,11 +403,11 @@ Source
405Examples
403Examples
406--------
404--------
407
405
408− ~zod/try=> (scan "0100" qix:ab)
406+ > (scan "0100" qix:ab)
409 q=256
407 q=256
410− ~zod/try=> (scan "10ff" qix:ab)
408+ > (scan "10ff" qix:ab)
411 q=4.351
409 q=4.351
412− ~zod/try=> (scan "0" qix:ab)
410+ > (scan "0" qix:ab)
413 ! {1 2}
411 ! {1 2}
414 ! exit
412 ! exit
415
413
@@ -419,7 +417,7 @@ Examples
419
417
420Parse 1
418Parse 1
421
419
422−Parsing [`++rule`](). Parses the number 1.
420+Parsing `++rule`. Parses the number 1.
423
421
424Accepts
422Accepts
425-------
423-------
@@ -435,12 +433,12 @@ Source
435Examples
433Examples
436--------
434--------
437
435
438− ~zod/try=> (scan "1" seb:ab)
436+ > (scan "1" seb:ab)
439 1
437 1
440− ~zod/try=> (scan "0" seb:ab)
438+ > (scan "0" seb:ab)
441 ! ~zod/try/~2014.10.23..22.34.21..bfdd/:<[1 1].[1 18]>
439 ! ~zod/try/~2014.10.23..22.34.21..bfdd/:<[1 1].[1 18]>
442 ! {1 1}
440 ! {1 1}
443− ~zod/try=> (scan "2" seb:ab)
441+ > (scan "2" seb:ab)
444 ! ~zod/try/~2014.10.23..22.34.29..d399/:<[1 1].[1 18]>
442 ! ~zod/try/~2014.10.23..22.34.29..d399/:<[1 1].[1 18]>
445 ! {1 1}
443 ! {1 1}
446
444
@@ -450,7 +448,7 @@ Examples
450
448
451Parse decimal
449Parse decimal
452
450
453−Parsing [`++rule`](). Parses a nonzero decimal digit.
451+Parsing `++rule`. Parses a nonzero decimal digit.
454
452
455Accepts
453Accepts
456-------
454-------
@@ -461,14 +459,14 @@ Produces
461Source
459Source
462------
460------
463
461
464− ++ sed (cook |=(a=@ (sub a '0')) (shim '1' '9'))
462+ ++ sed (cook |=(a/@ (sub a '0')) (shim '1' '9'))
465
463
466Examples
464Examples
467--------
465--------
468
466
469− ~zod/try=> (scan "5" sed:ab)
467+ > (scan "5" sed:ab)
470 5
468 5
471− ~zod/try=> (scan "0" sed:ab)
469+ > (scan "0" sed:ab)
472 ! {1 1}
470 ! {1 1}
473 ! exit
471 ! exit
474
472
@@ -478,7 +476,7 @@ Examples
478
476
479Parse base-32
477Parse base-32
480
478
481−Parsing [`++rule`](). Parses a nonzero base-32 digit
479+Parsing `++rule`. Parses a nonzero base-32 digit
482
480
483Accepts
481Accepts
484-------
482-------
@@ -494,7 +492,7 @@ Source
494Examples
492Examples
495--------
493--------
496
494
497− ~zod/try=> (scan "c" sev:ab)
495+ > (scan "c" sev:ab)
498 12
496 12
499 ~zod/socialnet=> (scan "0" sev:ab)
497 ~zod/socialnet=> (scan "0" sev:ab)
500 ! {1 1}
498 ! {1 1}
@@ -506,7 +504,7 @@ Examples
506
504
507Parse base-64
505Parse base-64
508
506
509−Parsing [`++rule`](). Parses a nonzero base-64 digit
507+Parsing `++rule`. Parses a nonzero base-64 digit
510
508
511Accepts
509Accepts
512-------
510-------
@@ -522,9 +520,9 @@ Source
522Examples
520Examples
523--------
521--------
524
522
525− ~zod/try=> (scan "M" sew:ab)
523+ > (scan "M" sew:ab)
526 48
524 48
527− ~zod/try=> (scan "0" sew:ab)
525+ > (scan "0" sew:ab)
528 ! {1 1}
526 ! {1 1}
529 ! exit
527 ! exit
530
528
@@ -534,7 +532,7 @@ Examples
534
532
535Parse hex
533Parse hex
536
534
537−Parsing [`++rule`](). Parses a nonzero hexadecimal digit.
535+Parsing `++rule`. Parses a nonzero hexadecimal digit.
538
536
539Accepts
537Accepts
540-------
538-------
@@ -550,9 +548,9 @@ Source
550Examples
548Examples
551--------
549--------
552
550
553− ~zod/try=> (scan "e" sex:ab)
551+ > (scan "e" sex:ab)
554 14
552 14
555− ~zod/try=> (scan "0" sex:ab)
553+ > (scan "0" sex:ab)
556 ! {1 1}
554 ! {1 1}
557 ! exit
555 ! exit
558
556
@@ -562,7 +560,7 @@ Examples
562
560
563Parse binary
561Parse binary
564
562
565−Parsing [`++rule`](). Parses a binary digit.
563+Parsing `++rule`. Parses a binary digit.
566
564
567Accepts
565Accepts
568-------
566-------
@@ -573,12 +571,12 @@ Produces
573Source
571Source
574------
572------
575
573
576− ++ sib (cook |=(a=@ (sub a '0')) (shim '0' '1'))
574+ ++ sib (cook |=(a/@ (sub a '0')) (shim '0' '1'))
577
575
578Examples
576Examples
579--------
577--------
580
578
581− ~zod/try=> (scan "1" sib:ab)
579+ > (scan "1" sib:ab)
582 1
580 1
583 ~zod/socialnet=> (scan "0" sib:ab)
581 ~zod/socialnet=> (scan "0" sib:ab)
584 0
582 0
@@ -589,7 +587,7 @@ Examples
589
587
590Parse decimal
588Parse decimal
591
589
592−Parsing [`++rule`](). Parses a decimal digit.
590+Parsing `++rule`. Parses a decimal digit.
593
591
594Accepts
592Accepts
595-------
593-------
@@ -600,12 +598,12 @@ Produces
600Source
598Source
601------
599------
602
600
603− ++ sid (cook |=(a=@ (sub a '0')) (shim '0' '9'))
601+ ++ sid (cook |=(a/@ (sub a '0')) (shim '0' '9'))
604
602
605Examples
603Examples
606--------
604--------
607
605
608− ~zod/try=> (scan "5" sid:ab)
606+ > (scan "5" sid:ab)
609 5
607 5
610
608
611------------------------------------------------------------------------
609------------------------------------------------------------------------
@@ -614,7 +612,7 @@ Examples
614
612
615Parse base-32
613Parse base-32
616
614
617−Parsing [`++rule`](). Parses a base-32 digit.
615+Parsing `++rule`. Parses a base-32 digit.
618
616
619Accepts
617Accepts
620-------
618-------
@@ -630,7 +628,7 @@ Source
630Examples
628Examples
631--------
629--------
632
630
633− ~zod/try=> (scan "c" siv:ab)
631+ > (scan "c" siv:ab)
634 12
632 12
635
633
636------------------------------------------------------------------------
634------------------------------------------------------------------------
@@ -639,7 +637,7 @@ Examples
639
637
640Parse base-64
638Parse base-64
641
639
642−Parsing [`++rule`](). Parses a base-64 digit.
640+Parsing `++rule`. Parses a base-64 digit.
643
641
644Accepts
642Accepts
645-------
643-------
@@ -655,7 +653,7 @@ Source
655Examples
653Examples
656--------
654--------
657
655
658− ~zod/try=> (scan "M" siw:ab)
656+ > (scan "M" siw:ab)
659 48
657 48
660
658
661------------------------------------------------------------------------
659------------------------------------------------------------------------
@@ -664,7 +662,7 @@ Examples
664
662
665Parse hex
663Parse hex
666
664
667−Parsing [`++rule`](). Parses a hexadecimal digit.
665+Parsing `++rule`. Parses a hexadecimal digit.
668
666
669Accepts
667Accepts
670-------
668-------
@@ -680,7 +678,7 @@ Source
680Examples
678Examples
681--------
679--------
682
680
683− ~zod/try=> (scan "e" six:ab)
681+ > (scan "e" six:ab)
684 14
682 14
685
683
686------------------------------------------------------------------------
684------------------------------------------------------------------------
@@ -689,7 +687,7 @@ Examples
689
687
690Parse base-32
688Parse base-32
691
689
692−Parsing [`++rule`](). Parses a base-32 letter.
690+Parsing `++rule`. Parses a base-32 letter.
693
691
694Accepts
692Accepts
695-------
693-------
@@ -700,12 +698,12 @@ Produces
700Source
698Source
701------
699------
702
700
703− ++ sov (cook |=(a=@ (sub a 87)) (shim 'a' 'v'))
701+ ++ sov (cook |=(a/@ (sub a 87)) (shim 'a' 'v'))
704
702
705Examples
703Examples
706--------
704--------
707
705
708− ~zod/try=> (scan "c" sov:ab)
706+ > (scan "c" sov:ab)
709 12
707 12
710
708
711------------------------------------------------------------------------
709------------------------------------------------------------------------
@@ -714,7 +712,7 @@ Examples
714
712
715Parse base-64
713Parse base-64
716
714
717−Parsing [`++rule`](). Parses a base-64 letter/symbol.
715+Parsing `++rule`. Parses a base-64 letter/symbol.
718
716
719Accepts
717Accepts
720-------
718-------
@@ -726,8 +724,8 @@ Source
726------
724------
727
725
728 ++ sow ;~ pose
726 ++ sow ;~ pose
729− (cook |=(a=@ (sub a 87)) (shim 'a' 'z'))
727+ (cook |=(a/@ (sub a 87)) (shim 'a' 'z'))
730− (cook |=(a=@ (sub a 29)) (shim 'A' 'Z'))
728+ (cook |=(a/@ (sub a 29)) (shim 'A' 'Z'))
731 (cold 62 (just '-'))
729 (cold 62 (just '-'))
732 (cold 63 (just '~'))
730 (cold 63 (just '~'))
733 ==
731 ==
@@ -735,7 +733,7 @@ Source
735Examples
733Examples
736--------
734--------
737
735
738− ~zod/try=> (scan "M" sow:ab)
736+ > (scan "M" sow:ab)
739 48
737 48
740
738
741------------------------------------------------------------------------
739------------------------------------------------------------------------
@@ -744,7 +742,7 @@ Examples
744
742
745Parse hex letter
743Parse hex letter
746
744
747−Parsing [`++rule`](). Parses a hexadecimal letter.
745+Parsing `++rule`. Parses a hexadecimal letter.
748
746
749Accepts
747Accepts
750-------
748-------
@@ -755,12 +753,12 @@ Produces
755Source
753Source
756------
754------
757
755
758− ++ sox (cook |=(a=@ (sub a 87)) (shim 'a' 'f'))
756+ ++ sox (cook |=(a/@ (sub a 87)) (shim 'a' 'f'))
759
757
760Examples
758Examples
761--------
759--------
762
760
763− ~zod/try=> (scan "e" sox:ab)
761+ > (scan "e" sox:ab)
764 14
762 14
765
763
766------------------------------------------------------------------------
764------------------------------------------------------------------------
@@ -769,7 +767,7 @@ Examples
769
767
770Parse \<= 3 decimal
768Parse \<= 3 decimal
771
769
772−Parsing [`++rule`](). Parses a decimal number of up to 3 digits without a
770+Parsing `++rule`. Parses a decimal number of up to 3 digits without a
773leading zero.
771leading zero.
774
772
775Accepts
773Accepts
@@ -786,13 +784,13 @@ Source
786Examples
784Examples
787--------
785--------
788
786
789− ~zod/try=> (scan "21" ted:ab)
787+ > (scan "21" ted:ab)
790 q=21
788 q=21
791− ~zod/try=> (scan "214" ted:ab)
789+ > (scan "214" ted:ab)
792 q=214
790 q=214
793− ~zod/try=> (scan "2140" ted:ab)
791+ > (scan "2140" ted:ab)
794 {1 4}
792 {1 4}
795− ~zod/try=> (scan "0" ted:ab)
793+ > (scan "0" ted:ab)
796 ! {1 1}
794 ! {1 1}
797 ! exit
795 ! exit
798
796
@@ -802,7 +800,7 @@ Examples
802
800
803Leading phonetic byte
801Leading phonetic byte
804
802
805−Parsing [`++rule`](). Parses the leading phonetic byte, which represents a
803+Parsing `++rule`. Parses the leading phonetic byte, which represents a
806syllable.
804syllable.
807
805
808Accepts
806Accepts
@@ -814,14 +812,14 @@ Produces
814Source
812Source
815------
813------
816
814
817− ++ tip (sear |=(a=@ (ins:po a)) til)
815+ ++ tip (sear |=(a/@ (ins:po a)) til)
818
816
819Examples
817Examples
820--------
818--------
821
819
822− ~zod/try=> (scan "doz" tip:ab)
820+ > (scan "doz" tip:ab)
823 0
821 0
824− ~zod/try=> (scan "pit" tip:ab)
822+ > (scan "pit" tip:ab)
825 242
823 242
826
824
827------------------------------------------------------------------------
825------------------------------------------------------------------------
@@ -830,7 +828,7 @@ Examples
830
828
831Trailing phonetic syllable
829Trailing phonetic syllable
832
830
833−Parsing [`++rule`](). Parses the trailing phonetic byte, which represents a
831+Parsing `++rule`. Parses the trailing phonetic byte, which represents a
834syllable.
832syllable.
835
833
836Accepts
834Accepts
@@ -842,14 +840,14 @@ Produces
842Source
840Source
843------
841------
844
842
845− ++ tiq (sear |=(a=@ (ind:po a)) til)
843+ ++ tiq (sear |=(a/@ (ind:po a)) til)
846
844
847Examples
845Examples
848--------
846--------
849
847
850− ~zod/try=> (scan "zod" tiq:ab)
848+ > (scan "zod" tiq:ab)
851 0
849 0
852− ~zod/try=> (scan "nec" tiq:ab)
850+ > (scan "nec" tiq:ab)
853 1
851 1
854
852
855------------------------------------------------------------------------
853------------------------------------------------------------------------
@@ -858,7 +856,7 @@ Examples
858
856
859Parse 3 decimal digits
857Parse 3 decimal digits
860
858
861−Parsing [`++rule`](). Parses exactly three decimal digits.
859+Parsing `++rule`. Parses exactly three decimal digits.
862
860
863Accepts
861Accepts
864-------
862-------
@@ -874,9 +872,9 @@ Source
874Examples
872Examples
875--------
873--------
876
874
877− ~zod/try=> (scan "013" tid:ab)
875+ > (scan "013" tid:ab)
878 q=13
876 q=13
879− ~zod/try=> (scan "01" tid:ab)
877+ > (scan "01" tid:ab)
880 ! {1 3}
878 ! {1 3}
881 ! exit
879 ! exit
882
880
@@ -886,7 +884,7 @@ Examples
886
884
887Parse 3 lowercase
885Parse 3 lowercase
888
886
889−Parsing [`++rule`](). Parses exactly three lowercase letters.
887+Parsing `++rule`. Parses exactly three lowercase letters.
890
888
891Accepts
889Accepts
892-------
890-------
@@ -902,11 +900,11 @@ Source
902Examples
900Examples
903--------
901--------
904
902
905− ~zod/try=> (scan "mer" til:ab)
903+ > (scan "mer" til:ab)
906 q=7.497.069
904 q=7.497.069
907− ~zod/try=> `@t`(scan "mer" til:ab)
905+ > `@t`(scan "mer" til:ab)
908 'mer'
906 'mer'
909− ~zod/try=> (scan "me" til:ab)
907+ > (scan "me" til:ab)
910 ! {1 3}
908 ! {1 3}
911 ! exit
909 ! exit
912
910
@@ -916,7 +914,7 @@ Examples
916
914
917Parse span characters
915Parse span characters
918
916
919−Parsing rule. Parses characters from an atom of the span odor [`@ta`]().
917+Parsing rule. Parses characters from an atom of the span odor `@ta`.
920
918
921Accepts
919Accepts
922-------
920-------
@@ -928,15 +926,15 @@ Source
928------
926------
929
927
930 ++ urs %+ cook
928 ++ urs %+ cook
931− |=(a=tape (rap 3 ^-((list ,@) a)))
929+ |=(a/tape (rap 3 ^-((list @) a)))
932 (star ;~(pose nud low hep dot sig cab))
930 (star ;~(pose nud low hep dot sig cab))
933
931
934Examples
932Examples
935--------
933--------
936
934
937− ~zod/try=> `@ta`(scan "asa-lom_tak" urs:ab)
935+ > `@ta`(scan "asa-lom_tak" urs:ab)
938 ~.asa-lom_tak
936 ~.asa-lom_tak
939− ~zod/try=> `@t`(scan "asa-lom_tak" urs:ab)
937+ > `@t`(scan "asa-lom_tak" urs:ab)
940 'asa-lom_tak'
938 'asa-lom_tak'
941
939
942------------------------------------------------------------------------
940------------------------------------------------------------------------
@@ -945,7 +943,7 @@ Examples
945
943
946Parse non-`_` span
944Parse non-`_` span
947
945
948−Parsing rule. Parses all characters of the span odor [`@ta`]() except
946+Parsing rule. Parses all characters of the span odor `@ta` except
949for cab, `_`.
947for cab, `_`.
950
948
951Accepts
949Accepts
@@ -958,13 +956,13 @@ Source
958------
956------
959
957
960 ++ urt %+ cook
958 ++ urt %+ cook
961− |=(a=tape (rap 3 ^-((list ,@) a)))
959+ |=(a/tape (rap 3 ^-((list @) a)))
962 (star ;~(pose nud low hep dot sig))
960 (star ;~(pose nud low hep dot sig))
963
961
964Examples
962Examples
965--------
963--------
966
964
967− ~zod/try=> `@t`(scan "asa-lom.t0k" urt:ab)
965+ > `@t`(scan "asa-lom.t0k" urt:ab)
968 'asa-lom.t0k'
966 'asa-lom.t0k'
969
967
970------------------------------------------------------------------------
968------------------------------------------------------------------------
@@ -990,9 +988,9 @@ Source
990Examples
988Examples
991--------
989--------
992
990
993− ~zod/try=> (scan "\\0a" voy:ab)
991+ > (scan "\\0a" voy:ab)
994 q=10
992 q=10
995− ~zod/try=> (scan "\\'" voy:ab)
993+ > (scan "\\'" voy:ab)
996 q=39
994 q=39
997
995
998------------------------------------------------------------------------
996------------------------------------------------------------------------
@@ -1018,7 +1016,7 @@ Source
1018Examples
1016Examples
1019--------
1017--------
1020
1018
1021− ~zod/try=> ag
1019+ > ag
1022 <14.vpu 414.mof 100.xkc 1.ypj %164>
1020 <14.vpu 414.mof 100.xkc 1.ypj %164>
1023
1021
1024------------------------------------------------------------------------
1022------------------------------------------------------------------------
@@ -1035,17 +1033,18 @@ Accepts
1035Produces
1033Produces
1036--------
1034--------
1037
1035
1038−`fel` is a [`rule`]().
1036+`fel` is a `rule`.
1039
1037
1040Source
1038Source
1041------
1039------
1042
1040
1043− ++ ape |*(fel=_rule ;~(pose (cold 0 (just '0')) fel))
1041+ ++ ape |*(fel/rule ;~(pose (cold 0 (just '0')) fel))
1042+
1044
1043
1045Examples
1044Examples
1046--------
1045--------
1047
1046
1048− ~zod/try=> (scan "202" (star (ape:ag (cold 2 (just '2')))))
1047+ > (scan "202" (star (ape:ag (cold 2 (just '2')))))
1049 ~[2 0 2]
1048 ~[2 0 2]
1050
1049
1051------------------------------------------------------------------------
1050------------------------------------------------------------------------
@@ -1070,7 +1069,7 @@ Source
1070Examples
1069Examples
1071--------
1070--------
1072
1071
1073− ~zod/try=> (scan "10.0110" bay:ag)
1072+ > (scan "10.0110" bay:ag)
1074 q=38
1073 q=38
1075
1074
1076------------------------------------------------------------------------
1075------------------------------------------------------------------------
@@ -1079,7 +1078,7 @@ Examples
1079
1078
1080Parse IPv6
1079Parse IPv6
1081
1080
1082−Parsing rule. Parses a [`@is`](), an IPv6 address.
1081+Parsing rule. Parses a `@is`, an IPv6 address.
1083
1082
1084Accepts
1083Accepts
1085-------
1084-------
@@ -1096,9 +1095,9 @@ Source
1096Examples
1095Examples
1097--------
1096--------
1098
1097
1099− ~zod/try=> (scan "0.0.ea.3e6c.0.0.0.0" bip:ag)
1098+ > (scan "0.0.ea.3e6c.0.0.0.0" bip:ag)
1100 q=283.183.420.760.121.105.516.068.864
1099 q=283.183.420.760.121.105.516.068.864
1101− ~zod/try=> `@is`(scan "0.0.ea.3e6c.0.0.0.0" bip:ag)
1100+ > `@is`(scan "0.0.ea.3e6c.0.0.0.0" bip:ag)
1102 .0.0.ea.3e6c.0.0.0.0
1101 .0.0.ea.3e6c.0.0.0.0
1103
1102
1104------------------------------------------------------------------------
1103------------------------------------------------------------------------
@@ -1120,12 +1119,13 @@ Source
1120
1119
1121 ++ dem (ape (bass 1.000 ;~(plug ted:ab (star ;~(pfix dog tid:ab)))))
1120 ++ dem (ape (bass 1.000 ;~(plug ted:ab (star ;~(pfix dog tid:ab)))))
1122
1121
1122+
1123Examples
1123Examples
1124--------
1124--------
1125
1125
1126− ~zod/try=> (scan "52" dem:ag)
1126+ > (scan "52" dem:ag)
1127 q=52
1127 q=52
1128− ~zod/try=> (scan "13.507" dem:ag)
1128+ > (scan "13.507" dem:ag)
1129 q=13.507
1129 q=13.507
1130
1130
1131------------------------------------------------------------------------
1131------------------------------------------------------------------------
@@ -1150,9 +1150,9 @@ Source
1150Examples
1150Examples
1151--------
1151--------
1152
1152
1153− ~zod/try=> (scan "52" dim:ag)
1153+ > (scan "52" dim:ag)
1154 q=52
1154 q=52
1155− ~zod/try=> (scan "013507" dim:ag)
1155+ > (scan "013507" dim:ag)
1156 ! {1 2}
1156 ! {1 2}
1157 ! exit
1157 ! exit
1158
1158
@@ -1178,11 +1178,11 @@ Source
1178Examples
1178Examples
1179--------
1179--------
1180
1180
1181− ~zod/try=> (scan "52" dum:ag)
1181+ > (scan "52" dum:ag)
1182 q=52
1182 q=52
1183− ~zod/try=> (scan "0000052" dum:ag)
1183+ > (scan "0000052" dum:ag)
1184 q=52
1184 q=52
1185− ~zod/try=> (scan "13507" dim:ag)
1185+ > (scan "13507" dim:ag)
1186 q=13.507
1186 q=13.507
1187
1187
1188------------------------------------------------------------------------
1188------------------------------------------------------------------------
@@ -1191,7 +1191,7 @@ Examples
1191
1191
1192Parse phonetic base
1192Parse phonetic base
1193
1193
1194−Parsing rule. Parses an atom of odor [`@p`](), the phonetic base.
1194+Parsing rule. Parses an atom of odor `@p`, the phonetic base.
1195
1195
1196Accepts
1196Accepts
1197-------
1197-------
@@ -1212,19 +1212,19 @@ Source
1212Examples
1212Examples
1213--------
1213--------
1214
1214
1215− ~zod/try=> (scan "zod" fed:ag)
1215+ > (scan "zod" fed:ag)
1216 0
1216 0
1217− ~zod/try=> (scan "nec" fed:ag)
1217+ > (scan "nec" fed:ag)
1218 1
1218 1
1219− ~zod/try=> (scan "sondel" fed:ag)
1219+ > (scan "sondel" fed:ag)
1220 9.636
1220 9.636
1221− ~zod/try=> ~tillyn-nillyt
1221+ > ~tillyn-nillyt
1222 ~tillyn-nillyt
1222 ~tillyn-nillyt
1223− ~zod/try=> (scan "tillyn-nillyt" fed:ag)
1223+ > (scan "tillyn-nillyt" fed:ag)
1224 3.569.565.175
1224 3.569.565.175
1225− ~zod/try=> (scan "tillyn-nillyt-tasfyn-partyv" fed:ag)
1225+ > (scan "tillyn-nillyt-tasfyn-partyv" fed:ag)
1226 15.331.165.687.565.582.592
1226 15.331.165.687.565.582.592
1227− ~zod/try=> (scan "tillyn-nillyt-tasfyn-partyv--novweb-talrud-talmud-sonfyr" fed:ag)
1227+ > (scan "tillyn-nillyt-tasfyn-partyv--novweb-talrud-talmud-sonfyr" fed:ag)
1228 282.810.089.790.159.633.869.501.053.313.363.681.181
1228 282.810.089.790.159.633.869.501.053.313.363.681.181
1229
1229
1230------------------------------------------------------------------------
1230------------------------------------------------------------------------
@@ -1249,13 +1249,13 @@ Source
1249Examples
1249Examples
1250--------
1250--------
1251
1251
1252− ~zod/try=> (scan "4" hex:ag)
1252+ > (scan "4" hex:ag)
1253 q=4
1253 q=4
1254− ~zod/try=> (scan "1a" hex:ag)
1254+ > (scan "1a" hex:ag)
1255 q=26
1255 q=26
1256− ~zod/try=> (scan "3.ac8d" hex:ag)
1256+ > (scan "3.ac8d" hex:ag)
1257 q=240.781
1257 q=240.781
1258− ~zod/try=> `@ux`(scan "3.ac8d" hex:ag)
1258+ > `@ux`(scan "3.ac8d" hex:ag)
1259 0x3.ac8d
1259 0x3.ac8d
1260
1260
1261------------------------------------------------------------------------
1261------------------------------------------------------------------------
@@ -1281,11 +1281,11 @@ Source
1281Examples
1281Examples
1282--------
1282--------
1283
1283
1284− ~zod/try=> (scan "127.0.0.1" lip:ag)
1284+ > (scan "127.0.0.1" lip:ag)
1285 q=2.130.706.433
1285 q=2.130.706.433
1286− ~zod/try=> `@if`(scan "127.0.0.1" lip:ag)
1286+ > `@if`(scan "127.0.0.1" lip:ag)
1287 .127.0.0.1
1287 .127.0.0.1
1288− ~zod/try=> `@if`(scan "8.8.8.8" lip:ag)
1288+ > `@if`(scan "8.8.8.8" lip:ag)
1289 .8.8.8.8
1289 .8.8.8.8
1290
1290
1291------------------------------------------------------------------------
1291------------------------------------------------------------------------
@@ -1310,7 +1310,7 @@ Source
1310Examples
1310Examples
1311--------
1311--------
1312
1312
1313− ~zod/try=> (scan "e2.ol4pm" viz:ag)
1313+ > (scan "e2.ol4pm" viz:ag)
1314 q=15.125.353.270
1314 q=15.125.353.270
1315
1315
1316------------------------------------------------------------------------
1316------------------------------------------------------------------------
@@ -1335,7 +1335,7 @@ Source
1335Examples
1335Examples
1336--------
1336--------
1337
1337
1338− ~zod/try=> (scan "e2ol4pm" vum:ag)
1338+ > (scan "e2ol4pm" vum:ag)
1339 q=15.125.353.270
1339 q=15.125.353.270
1340
1340
1341------------------------------------------------------------------------
1341------------------------------------------------------------------------
@@ -1362,7 +1362,7 @@ Source
1362Examples
1362Examples
1363--------
1363--------
1364
1364
1365− ~zod/try=> (scan "e2O.l4Xpm" wiz:ag)
1365+ > (scan "e2O.l4Xpm" wiz:ag)
1366 q=61.764.130.813.526
1366 q=61.764.130.813.526
1367
1367
1368***
1368***
@@ -1370,7 +1370,7 @@ Examples
1370
1370
1371Core used to scramble 16-bit atoms
1371Core used to scramble 16-bit atoms
1372
1372
1373−A [door]() that contains arms that are used to scramble two atoms, `top`
1373+A door that contains arms that are used to scramble two atoms, `top`
1374and `bot`. Used especially in the phonetic base to disguise the
1374and `bot`. Used especially in the phonetic base to disguise the
1375relationship between a destroyer and its cruiser.
1375relationship between a destroyer and its cruiser.
1376
1376
@@ -1380,20 +1380,20 @@ Accepts
1380Produces
1380Produces
1381--------
1381--------
1382
1382
1383−`bot` is an [atom]().
1383+`bot` is an atom.
1384
1384
1385−`top` is an [atom]().
1385+`top` is an atom.
1386
1386
1387Source
1387Source
1388------
1388------
1389
1389
1390 ++ mu
1390 ++ mu
1391− |_ [top=@ bot=@]
1391+ |_ [top/@ bot/@]
1392
1392
1393Examples
1393Examples
1394--------
1394--------
1395
1395
1396− ~zod/try=> ~(. mu 0x20e5 0x5901)
1396+ > ~(. mu 0x20e5 0x5901)
1397 <3.sjm [[@ux @ux] <414.hhh 100.xkc 1.ypj %164>]>
1397 <3.sjm [[@ux @ux] <414.hhh 100.xkc 1.ypj %164>]>
1398
1398
1399------------------------------------------------------------------------
1399------------------------------------------------------------------------
@@ -1412,19 +1412,20 @@ Accepts
1412Produces
1412Produces
1413--------
1413--------
1414
1414
1415−`bot` is an [atom]().
1415+`bot` is an atom.
1416
1416
1417−`top` is an [atom]().
1417+`top` is an atom.
1418
1418
1419Source
1419Source
1420------
1420------
1421
1421
1422 ++ zag [p=(end 4 1 (add top bot)) q=bot]
1422 ++ zag [p=(end 4 1 (add top bot)) q=bot]
1423
1423
1424+
1424Examples
1425Examples
1425--------
1426--------
1426
1427
1427− ~zod/try=> `[@ux @ux]`~(zag mu 0x20e0 0x201)
1428+ > `[@ux @ux]`~(zag mu 0x20e0 0x201)
1428 [0x22e1 0x201]
1429 [0x22e1 0x201]
1429
1430
1430------------------------------------------------------------------------
1431------------------------------------------------------------------------
@@ -1433,7 +1434,7 @@ Examples
1433
1434
1434Subtract bottom from top
1435Subtract bottom from top
1435
1436
1436−The inverse of [`++zag`](). Produces the cell of `top` and `bot` with
1437+The inverse of `++zag`. Produces the cell of `top` and `bot` with
1437`top` unscrambled. The unscrambled `top` is the sum of the sample `top`
1438`top` unscrambled. The unscrambled `top` is the sum of the sample `top`
1438and the 16-bit complement of `bot`. Used to unscramble the name of the
1439and the 16-bit complement of `bot`. Used to unscramble the name of the
1439destroyer.
1440destroyer.
@@ -1444,9 +1445,9 @@ Accepts
1444Produces
1445Produces
1445--------
1446--------
1446
1447
1447−`bot` is an [atom]().
1448+`bot` is an atom.
1448
1449
1449−`top` is an [atom]().
1450+`top` is an atom.
1450
1451
1451Source
1452Source
1452------
1453------
@@ -1456,7 +1457,7 @@ Source
1456Examples
1457Examples
1457--------
1458--------
1458
1459
1459− ~zod/try=> `[@ux @ux]`~(zig mu 0x2f46 0x1042)
1460+ > `[@ux @ux]`~(zig mu 0x2f46 0x1042)
1460 [0x1f04 0x1042]
1461 [0x1f04 0x1042]
1461
1462
1462------------------------------------------------------------------------
1463------------------------------------------------------------------------
@@ -1474,9 +1475,9 @@ Accepts
1474Produces
1475Produces
1475--------
1476--------
1476
1477
1477−`bot` is an [atom]().
1478+`bot` is an atom.
1478
1479
1479−`top` is an [atom]().
1480+`top` is an atom.
1480
1481
1481Source
1482Source
1482------
1483------
@@ -1486,7 +1487,7 @@ Source
1486Examples
1487Examples
1487--------
1488--------
1488
1489
1489− ~zod/try=> `@ux`~(zug mu 0x10e1 0xfa)
1490+ > `@ux`~(zug mu 0x10e1 0xfa)
1490 0x10e1.00fa
1491 0x10e1.00fa
1491
1492
1492
1493
@@ -1496,7 +1497,7 @@ Examples
1496
1497
1497Digit rendering engine
1498Digit rendering engine
1498
1499
1499−A [door]() containing arms that render digits at bases 10, 16, 32, and
1500+A door containing arms that render digits at bases 10, 16, 32, and
150064.
150164.
1501
1502
1502Accepts
1503Accepts
@@ -1505,18 +1506,18 @@ Accepts
1505Produces
1506Produces
1506--------
1507--------
1507
1508
1508−`tig` is an [`atom`]().
1509+`tig` is an `atom`.
1509
1510
1510Source
1511Source
1511------
1512------
1512
1513
1513 ++ ne
1514 ++ ne
1514− |_ tig=@
1515+ |_ tig/@
1515
1516
1516Examples
1517Examples
1517--------
1518--------
1518
1519
1519− ~zod/try=> ~(. ne 20)
1520+ > ~(. ne 20)
1520 <4.gut [@ud <414.hhh 100.xkc 1.ypj %164>]>
1521 <4.gut [@ud <414.hhh 100.xkc 1.ypj %164>]>
1521
1522
1522------------------------------------------------------------------------
1523------------------------------------------------------------------------
@@ -1533,7 +1534,7 @@ Accepts
1533Produces
1534Produces
1534--------
1535--------
1535
1536
1536−`tig` is an [`atom`]().
1537+`tig` is an `atom`.
1537
1538
1538Source
1539Source
1539------
1540------
@@ -1543,7 +1544,7 @@ Source
1543Examples
1544Examples
1544--------
1545--------
1545
1546
1546− ~zod/try=> `@t`~(d ne 7)
1547+ > `@t`~(d ne 7)
1547 '7'
1548 '7'
1548
1549
1549------------------------------------------------------------------------
1550------------------------------------------------------------------------
@@ -1560,7 +1561,7 @@ Accepts
1560Produces
1561Produces
1561--------
1562--------
1562
1563
1563−`tig` is an [`atom`]().
1564+`tig` is an `atom`.
1564
1565
1565Source
1566Source
1566------
1567------
@@ -1570,9 +1571,9 @@ Source
1570Examples
1571Examples
1571--------
1572--------
1572
1573
1573− ~zod/try=> `@t`~(x ne 7)
1574+ > `@t`~(x ne 7)
1574 '7'
1575 '7'
1575− ~zod/try=> `@t`~(x ne 14)
1576+ > `@t`~(x ne 14)
1576 'e'
1577 'e'
1577
1578
1578------------------------------------------------------------------------
1579------------------------------------------------------------------------
@@ -1597,11 +1598,11 @@ Source
1597Examples
1598Examples
1598--------
1599--------
1599
1600
1600− ~zod/try=> `@t`~(v ne 7)
1601+ > `@t`~(v ne 7)
1601 '7'
1602 '7'
1602− ~zod/try=> `@t`~(v ne 14)
1603+ > `@t`~(v ne 14)
1603 'e'
1604 'e'
1604− ~zod/try=> `@t`~(v ne 25)
1605+ > `@t`~(v ne 25)
1605 'p'
1606 'p'
1606
1607
1607------------------------------------------------------------------------
1608------------------------------------------------------------------------
@@ -1618,7 +1619,7 @@ Accepts
1618Produces
1619Produces
1619--------
1620--------
1620
1621
1621−`tig` is an [`atom`]().
1622+`tig` is an `atom`.
1622
1623
1623Source
1624Source
1624------
1625------
@@ -1630,19 +1631,19 @@ Source
1630Examples
1631Examples
1631--------
1632--------
1632
1633
1633− ~zod/try=> `@t`~(w ne 7)
1634+ > `@t`~(w ne 7)
1634 '7'
1635 '7'
1635− ~zod/try=> `@t`~(w ne 14)
1636+ > `@t`~(w ne 14)
1636 'e'
1637 'e'
1637− ~zod/try=> `@t`~(w ne 25)
1638+ > `@t`~(w ne 25)
1638 'p'
1639 'p'
1639− ~zod/try=> `@t`~(w ne 52)
1640+ > `@t`~(w ne 52)
1640 'Q'
1641 'Q'
1641− ~zod/try=> `@t`~(w ne 61)
1642+ > `@t`~(w ne 61)
1642 'Z'
1643 'Z'
1643− ~zod/try=> `@t`~(w ne 63)
1644+ > `@t`~(w ne 63)
1644 '~'
1645 '~'
1645− ~zod/try=> `@t`~(w ne 62)
1646+ > `@t`~(w ne 62)
1646 '-'
1647 '-'
1647
1648
1648
1649
docs/system/hoon/library/4k.md+383−457
@@ -1,4 +1,267 @@
1# 4k: atom printing
1# 4k: atom printing
2+### `++co`
3+
4+Literal rendering engine
5+
6+A door that contains arms that operate on the sample coin `lot`.
7+
8+Accepts
9+-------
10+
11+Produces
12+--------
13+
14+`lot` is a `++coin`.
15+
16+Source
17+------
18+
19+ ++ co !.
20+ ~% %co ..co ~
21+ =< |_ lot/coin
22+
23+
24+Examples
25+--------
26+
27+ > < 3.nta
28+ { lot/{$many {$~ $ta @t} {$~ $ud @ud} $~}
29+ <10.cfg 4.jjn {rep/"" <402.arm 110.jyx 1.ztu $151>}>
30+ }
31+ >
32+
33+------------------------------------------------------------------------
34+
35+### `++rear`
36+
37+Prepend & render as tape
38+
39+Renders a coin `lot` as a tape prepended to the sample tape `rom`.
40+
41+Accepts
42+-------
43+
44+Produces
45+--------
46+
47+`rom` is a `pe`
48+
49+`lot` is a `++coin`.
50+
51+Source
52+------
53+
54+ ++ rear |=(rom/tape =>(.(rex rom) rend))
55+
56+Examples
57+--------
58+
59+ > (~(rear co %$ %ux 200) "--ha")
60+ "0xc8--ha"
61+
62+------------------------------------------------------------------------
63+
64+### `++rent`
65+
66+Render as span
67+
68+Renders a coin `lot` as a span.
69+
70+Accepts
71+-------
72+
73+Produces
74+--------
75+
76+`lot` is a `++coin`.
77+
78+Source
79+------
80+
81+ ++ rent `@ta`(rap 3 rend)
82+
83+Examples
84+--------
85+
86+ > ~(rent co %$ %ux 200)
87+ ~.0xc8
88+ > `@t`~(rent co %$ %ux 200)
89+ '0xc8'
90+
91+------------------------------------------------------------------------
92+
93+### `++rend`
94+
95+Render as tape
96+
97+Renders a coin `lot` as a tape.
98+
99+Accepts
100+-------
101+
102+Produces
103+--------
104+
105+`lot` is a `++coin`.
106+
107+Source
108+------
109+
110+ ++ rend
111+ ^- tape
112+ ?: ?=($blob -.lot)
113+ ['~' '0' ((v-co 1) (jam p.lot))]
114+ ?: ?=($many -.lot)
115+ :- '.'
116+ |- ^- tape
117+ ?~ p.lot
118+ ['_' '_' rep]
119+ ['_' (weld (trip (wack rent(lot i.p.lot))) $(p.lot t.p.lot))]
120+ =+ [yed=(end 3 1 p.p.lot) hay=(cut 3 [1 1] p.p.lot)]
121+ |- ^- tape
122+ ?+ yed (z-co q.p.lot)
123+ $c ['~' '-' (weld (rip 3 (wood (tuft q.p.lot))) rep)]
124+ $d
125+ ?+ hay (z-co q.p.lot)
126+ $a
127+ =+ yod=(yore q.p.lot)
128+ => ^+(. .(rep ?~(f.t.yod rep ['.' (s-co f.t.yod)])))
129+ => ^+ .
130+ %= .
131+ rep
132+ ?: &(=(~ f.t.yod) =(0 h.t.yod) =(0 m.t.yod) =(0 s.t.yod))
133+ rep
134+ => .(rep ['.' (y-co s.t.yod)])
135+ => .(rep ['.' (y-co m.t.yod)])
136+ ['.' '.' (y-co h.t.yod)]
137+ ==
138+ => .(rep ['.' (a-co d.t.yod)])
139+ => .(rep ['.' (a-co m.yod)])
140+ => .(rep ?:(a.yod rep ['-' rep]))
141+ ['~' (a-co y.yod)]
142+ ::
143+ $r
144+ =+ yug=(yell q.p.lot)
145+ => ^+(. .(rep ?~(f.yug rep ['.' (s-co f.yug)])))
146+ :- '~'
147+ ?: &(=(0 d.yug) =(0 m.yug) =(0 h.yug) =(0 s.yug))
148+ ['s' '0' rep]
149+ => ^+(. ?:(=(0 s.yug) . .(rep ['.' 's' (a-co s.yug)])))
150+ => ^+(. ?:(=(0 m.yug) . .(rep ['.' 'm' (a-co m.yug)])))
151+ => ^+(. ?:(=(0 h.yug) . .(rep ['.' 'h' (a-co h.yug)])))
152+ => ^+(. ?:(=(0 d.yug) . .(rep ['.' 'd' (a-co d.yug)])))
153+ +.rep
154+ ==
155+ ::
156+ $f
157+ ?: =(& q.p.lot)
158+ ['.' 'y' rep]
159+ ?:(=(| q.p.lot) ['.' 'n' rep] (z-co q.p.lot))
160+ ::
161+ $n ['~' rep]
162+ $i
163+ ?+ hay (z-co q.p.lot)
164+ $f ((ro-co [3 10 4] |=(a/@ ~(d ne a))) q.p.lot)
165+ $s ((ro-co [4 16 8] |=(a/@ ~(x ne a))) q.p.lot)
166+ ==
167+ ::
168+ $p
169+ =+ dyx=(met 3 q.p.lot)
170+ :- '~'
171+ ?: (lte dyx 1)
172+ (weld (trip (tod:po q.p.lot)) rep)
173+ ?: =(2 dyx)
174+ ;: weld
175+ (trip (tos:po (end 3 1 q.p.lot)))
176+ (trip (tod:po (rsh 3 1 q.p.lot)))
177+ rep
178+ ==
179+ =+ [dyz=(met 5 q.p.lot) fin=| dub=&]
180+ |- ^- tape
181+ ?: =(0 dyz)
182+ rep
183+ %= $
184+ fin &
185+ dub !dub
186+ dyz (dec dyz)
187+ q.p.lot (rsh 5 1 q.p.lot)
188+ rep
189+ =+ syb=(wren:un (end 5 1 q.p.lot))
190+ =+ cog=~(zig mu [(rsh 4 1 syb) (end 4 1 syb)])
191+ ;: weld
192+ (trip (tos:po (end 3 1 p.cog)))
193+ (trip (tod:po (rsh 3 1 p.cog)))
194+ `tape`['-' ~]
195+ (trip (tos:po (end 3 1 q.cog)))
196+ (trip (tod:po (rsh 3 1 q.cog)))
197+ `tape`?.(fin ~ ['-' ?.(dub ~ ['-' ~])])
198+ rep
199+ ==
200+ ==
201+ ::
202+ $r
203+ ?+ hay (z-co q.p.lot)
204+ $d ['.' '~' (r-co (rlyd q.p.lot))]
205+ $h ['.' '~' '~' (r-co (rlyh q.p.lot))]
206+ $q ['.' '~' '~' '~' (r-co (rlyq q.p.lot))]
207+ $s ['.' (r-co (rlys q.p.lot))]
208+ ==
209+ ::
210+ $u
211+ ?: ?=($c hay)
212+ %+ welp ['0' 'c' (reap (pad:fa q.p.lot) '1')]
213+ (c-co (enc:fa q.p.lot))
214+ =- (weld p.gam ?:(=(0 q.p.lot) `tape`['0' ~] q.gam))
215+ ^= gam ^- {p/tape q/tape}
216+ ?+ hay [~ ((ox-co [10 3] |=(a/@ ~(d ne a))) q.p.lot)]
217+ $b [['0' 'b' ~] ((ox-co [2 4] |=(a/@ ~(d ne a))) q.p.lot)]
218+ $i [['0' 'i' ~] ((d-co 1) q.p.lot)]
219+ $x [['0' 'x' ~] ((ox-co [16 4] |=(a/@ ~(x ne a))) q.p.lot)]
220+ $v [['0' 'v' ~] ((ox-co [32 5] |=(a/@ ~(x ne a))) q.p.lot)]
221+ $w [['0' 'w' ~] ((ox-co [64 5] |=(a/@ ~(w ne a))) q.p.lot)]
222+ ==
223+ ::
224+ $s
225+ %+ weld
226+ ?:((syn:si q.p.lot) "--" "-")
227+ $(yed 'u', q.p.lot (abs:si q.p.lot))
228+ ::
229+ $t
230+ ?: =('a' hay)
231+ ?: =('s' (cut 3 [2 1] p.p.lot))
232+ (weld (rip 3 q.p.lot) rep)
233+ ['~' '.' (weld (rip 3 q.p.lot) rep)]
234+ ['~' '~' (weld (rip 3 (wood q.p.lot)) rep)]
235+ ==
236+ --
237+
238+Examples
239+--------
240+
241+ > ~(rend co ~ %ux 200)
242+ "0xc8"
243+ > ~(rend co %many ~[[%$ ux+200] [%$ p+40]])
244+ "._0xc8_~~tem__"
245+ > ~(rend co ~ %p 32.819)
246+ "~pillyt"
247+ > ~(rend co ~ %ux 18)
248+ "0x12"
249+ > ~(rend co [~ p=[p=%if q=0x7f00.0001]])
250+ ".127.0.0.1"
251+ > `@ux`.127.0.0.1
252+ 2.130.706.433
253+ > ~(rend co %many ~[[~ %ud 20] [~ %uw 133] [~ %tas 'sam']])
254+ "._20_0w25_sam__"
255+ > ~(rend co %blob [1 1])
256+ "~0ph"
257+ > ~0ph
258+ [1 1]
259+ > `@uv`(jam [1 1])
260+ 0vph
261+
262+
263+
264+***
2### `++alf`
265### `++alf`
3
266
4Alphabetic characters
267Alphabetic characters
@@ -13,11 +276,11 @@ Source
13Examples
276Examples
14--------
277--------
15
278
16− ~zod/try=> (scan "a" alf)
279+ > (scan "a" alf)
17 ~~a
280 ~~a
18− ~zod/try=> (scan "A" alf)
281+ > (scan "A" alf)
19 ~~~41.
282 ~~~41.
20− ~zod/try=> (scan "AaBbCc" (star alf))
283+ > (scan "AaBbCc" (star alf))
21 "AaBbCc"
284 "AaBbCc"
22
285
23
286
@@ -37,11 +300,11 @@ Source
37Examples
300Examples
38--------
301--------
39
302
40− ~zod/try=> (scan "0" aln)
303+ > (scan "0" aln)
41 ~~0
304 ~~0
42− ~zod/try=> (scan "alf42" (star aln))
305+ > (scan "alf42" (star aln))
43 "alf42"
306 "alf42"
44− ~zod/try=> (scan "0123456789abcdef" (star aln))
307+ > (scan "0123456789abcdef" (star aln))
45 "0123456789abcdef"
308 "0123456789abcdef"
46
309
47
310
@@ -61,11 +324,11 @@ Source
61Examples
324Examples
62--------
325--------
63
326
64− ~zod/try=> (scan "7" alp)
327+ > (scan "7" alp)
65 ~~7
328 ~~7
66− ~zod/try=> (scan "s" alp)
329+ > (scan "s" alp)
67 ~~s
330 ~~s
68− ~zod/try=> (scan "123abc-" (star alp))
331+ > (scan "123abc-" (star alp))
69 "123abc-"
332 "123abc-"
70
333
71
334
@@ -86,9 +349,9 @@ Source
86Examples
349Examples
87--------
350--------
88
351
89− ~zod/try=> (scan "-" bet)
352+ > (scan "-" bet)
90 2
353 2
91− ~zod/try=> (scan "+" bet)
354+ > (scan "+" bet)
92 3
355 3
93
356
94
357
@@ -108,13 +371,13 @@ Source
108Examples
371Examples
109--------
372--------
110
373
111− ~zod/try=> (scan "0000" bin)
374+ > (scan "0000" bin)
112 0
375 0
113− ~zod/try=> (scan "0001" bin)
376+ > (scan "0001" bin)
114 1
377 1
115− ~zod/try=> (scan "0010" bin)
378+ > (scan "0010" bin)
116 2
379 2
117− ~zod/try=> (scan "100000001111" bin)
380+ > (scan "100000001111" bin)
118 2.063
381 2.063
119
382
120
383
@@ -134,15 +397,15 @@ Source
134Examples
397Examples
135--------
398--------
136
399
137− ~zod/try=> (scan "0" but)
400+ > (scan "0" but)
138 0
401 0
139− ~zod/try=> (scan "1" but)
402+ > (scan "1" but)
140 1
403 1
141− ~zod/try=> (scan "01" but)
404+ > (scan "01" but)
142 ! {1 2}
405 ! {1 2}
143 ! 'syntax-error'
406 ! 'syntax-error'
144 ! exit
407 ! exit
145− ~zod/try=> (scan "01" (star but))
408+ > (scan "01" (star but))
146 ~[0 1]
409 ~[0 1]
147
410
148
411
@@ -162,15 +425,15 @@ Source
162Examples
425Examples
163--------
426--------
164
427
165− ~zod/try=> (scan "1" cit)
428+ > (scan "1" cit)
166 1
429 1
167− ~zod/try=> (scan "7" cit)
430+ > (scan "7" cit)
168 7
431 7
169− ~zod/try=> (scan "8" cit)
432+ > (scan "8" cit)
170 ! {1 1}
433 ! {1 1}
171 ! 'syntax-error'
434 ! 'syntax-error'
172 ! exit
435 ! exit
173− ~zod/try=> (scan "60" (star cit))
436+ > (scan "60" (star cit))
174 ~[6 0]
437 ~[6 0]
175
438
176
439
@@ -190,13 +453,13 @@ Source
190Examples
453Examples
191--------
454--------
192
455
193− ~zod/try=> (scan "7" dem)
456+ > (scan "7" dem)
194 7
457 7
195− ~zod/try=> (scan "42" dem)
458+ > (scan "42" dem)
196 42
459 42
197− ~zod/try=> (scan "150000000" dem)
460+ > (scan "150000000" dem)
198 150.000.000
461 150.000.000
199− ~zod/try=> (scan "12456" dem)
462+ > (scan "12456" dem)
200 12.456
463 12.456
201
464
202
465
@@ -216,11 +479,11 @@ Source
216Examples
479Examples
217--------
480--------
218
481
219− ~zod/try=> (scan "7" dit)
482+ > (scan "7" dit)
220 7
483 7
221− ~zod/try=> (scan "42" (star dit))
484+ > (scan "42" (star dit))
222 ~[4 2]
485 ~[4 2]
223− ~zod/try=> (scan "26000" (star dit))
486+ > (scan "26000" (star dit))
224 ~[2 6 0 0 0]
487 ~[2 6 0 0 0]
225
488
226
489
@@ -240,10 +503,10 @@ Source
240Examples
503Examples
241--------
504--------
242
505
243− /~zod/try=> 1.234.
506+ /> 1.234.
244 703
507 703
245 1.234.703
508 1.234.703
246− ~zod/try=> (scan "a. " ;~(pfix alf dog))
509+ > (scan "a. " ;~(pfix alf dog))
247 [~~~. ~]
510 [~~~. ~]
248
511
249
512
@@ -263,14 +526,14 @@ Source
263Examples
526Examples
264--------
527--------
265
528
266− /~zod/try=> ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
529+ /> ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
267 ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
530 ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
268− /~zod/try=> ~nopfel-botduc-nilnev-dolfyn--
531+ /> ~nopfel-botduc-nilnev-dolfyn--
269 haspub-natlun-lodmur-holtyd
532 haspub-natlun-lodmur-holtyd
270 ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
533 ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
271− ~zod/try=> (scan "--" doh)
534+ > (scan "--" doh)
272 [[~~- ~~-] ~]
535 [[~~- ~~-] ~]
273− ~zod/try=> (scan "-- " doh)
536+ > (scan "-- " doh)
274 [[~~- ~~-] ~]
537 [[~~- ~~-] ~]
275
538
276
539
@@ -290,9 +553,9 @@ Source
290Examples
553Examples
291--------
554--------
292
555
293− ~zod/try=> (scan "--" dun)
556+ > (scan "--" dun)
294 ~
557 ~
295− ~zod/try=> (dun [[1 1] "--"])
558+ > (dun [[1 1] "--"])
296 [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=""]]]]
559 [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=""]]]]
297
560
298
561
@@ -313,9 +576,9 @@ Source
313Examples
576Examples
314--------
577--------
315
578
316− ~zod/try=> (scan "==" duz)
579+ > (scan "==" duz)
317 ~
580 ~
318− ~zod/try=> (duz [[1 1] "== |=..."])
581+ > (duz [[1 1] "== |=..."])
319 [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=" |=..."]]]]
582 [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=" |=..."]]]]
320
583
321
584
@@ -336,19 +599,19 @@ Source
336Examples
599Examples
337--------
600--------
338
601
339− /~zod/try=> ^- * :: show spaces
602+ /> ^- * :: show spaces
340 """
603 """
341 -
604 -
342 -
605 -
343 -
606 -
344 """
607 """
345 [32 32 32 45 10 32 45 10 32 32 45 0]
608 [32 32 32 45 10 32 45 10 32 32 45 0]
346− /~zod/try=> ^- *
609+ /> ^- *
347 """
610 """
348
611
349 """
612 """
350 [32 32 32 10 32 10 32 32 0]
613 [32 32 32 10 32 10 32 32 0]
351− /~zod/try=> ^- (list ,@)
614+ /> ^- (list ,@)
352 %- scan :_ (star gah)
615 %- scan :_ (star gah)
353 """
616 """
354
617
@@ -434,9 +697,9 @@ Examples
434--------
697--------
435characters bas and fas.
698characters bas and fas.
436
699
437− ~zod/try=> (scan "\\/" gon)
700+ > (scan "\\/" gon)
438 [~~~5c. ~ ~~~2f.]
701 [~~~5c. ~ ~~~2f.]
439− ~zod/try=> (gon [[1 1] "\\/"])
702+ > (gon [[1 1] "\\/"])
440 [p=[p=1 q=3] q=[~ u=[p=[~~~5c. ~ ~~~2f.] q=[p=[p=1 q=3] q=""]]]]
703 [p=[p=1 q=3] q=[~ u=[p=[~~~5c. ~ ~~~2f.] q=[p=[p=1 q=3] q=""]]]]
441
704
442
705
@@ -456,9 +719,9 @@ Source
456Examples
719Examples
457--------
720--------
458
721
459− ~zod/try=> (scan "<" gul)
722+ > (scan "<" gul)
460 2
723 2
461− ~zod/try=> (scan ">" gul)
724+ > (scan ">" gul)
462 3
725 3
463
726
464
727
@@ -478,19 +741,19 @@ Source
478Examples
741Examples
479--------
742--------
480
743
481− ~zod/try=> (scan "a" hex)
744+ > (scan "a" hex)
482 10
745 10
483− ~zod/try=> (scan "A" hex)
746+ > (scan "A" hex)
484 10
747 10
485− ~zod/try=> (scan "2A" hex)
748+ > (scan "2A" hex)
486 42
749 42
487− ~zod/try=> (scan "1ee7" hex)
750+ > (scan "1ee7" hex)
488 7.911
751 7.911
489− ~zod/try=> (scan "1EE7" hex)
752+ > (scan "1EE7" hex)
490 7.911
753 7.911
491− ~zod/try=> (scan "1EE7F7" hex)
754+ > (scan "1EE7F7" hex)
492 2.025.463
755 2.025.463
493− ~zod/try=> `@ux`(scan "1EE7F7" hex)
756+ > `@ux`(scan "1EE7F7" hex)
494 0x1e.e7f7
757 0x1e.e7f7
495
758
496
759
@@ -509,13 +772,13 @@ Source
509Examples
772Examples
510--------
773--------
511
774
512− ~zod/try=> (scan "G" hig)
775+ > (scan "G" hig)
513 ~~~47.
776 ~~~47.
514− ~zod/try=> `cord`(scan "G" hig)
777+ > `cord`(scan "G" hig)
515 'G'
778 'G'
516− ~zod/try=> (scan "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (star hig))
779+ > (scan "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (star hig))
517 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
780 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
518− ~zod/try=> (hig [[1 1] "G"])
781+ > (hig [[1 1] "G"])
519 [p=[p=1 q=2] q=[~ [p=~~~47. q=[p=[p=1 q=2] q=""]]]]
782 [p=[p=1 q=2] q=[~ [p=~~~47. q=[p=[p=1 q=2] q=""]]]]
520
783
521
784
@@ -539,13 +802,13 @@ Source
539Examples
802Examples
540--------
803--------
541
804
542− ~zod/try=> (scan "a" hit)
805+ > (scan "a" hit)
543 10
806 10
544− ~zod/try=> (scan "A" hit)
807+ > (scan "A" hit)
545 10
808 10
546− ~zod/try=> (hit [[1 1] "a"])
809+ > (hit [[1 1] "a"])
547 [p=[p=1 q=2] q=[~ [p=10 q=[p=[p=1 q=2] q=""]]]]
810 [p=[p=1 q=2] q=[~ [p=10 q=[p=[p=1 q=2] q=""]]]]
548− ~zod/try=> (scan "2A" (star hit))
811+ > (scan "2A" (star hit))
549 ~[2 10]
812 ~[2 10]
550
813
551
814
@@ -554,13 +817,13 @@ Examples
554
817
555Indentation block
818Indentation block
556
819
557−Apply [`++rule`]() to indented block starting at current column number, omitting
820+Apply `++rule` to indented block starting at current column number, omitting
558the leading whitespace.
821the leading whitespace.
559
822
560Accepts
823Accepts
561-------
824-------
562
825
563−`sef` is a [`++rule`]()
826+`sef` is a `++rule`
564
827
565Produces
828Produces
566--------
829--------
@@ -570,7 +833,7 @@ A `++rule`.
570Source
833Source
571------
834------
572
835
573− ++ iny |* sef=_rule :: indentation block
836+ ++ inde |* sef/rule :: indentation block
574 |= nail ^+ (sef)
837 |= nail ^+ (sef)
575 =+ [har tap]=[p q]:+<
838 =+ [har tap]=[p q]:+<
576 =+ lev=(fil 3 (dec q.har) ' ')
839 =+ lev=(fil 3 (dec q.har) ' ')
@@ -593,17 +856,17 @@ Source
593Examples
856Examples
594--------
857--------
595
858
596− ~zod/try=> (scan "abc" (iny (star ;~(pose prn (just `@`10)))))
859+ > (scan "abc" (iny (star ;~(pose prn (just `@`10)))))
597 "abc"
860 "abc"
598− ~zod/try=> (scan "abc" (star ;~(pose prn (just `@`10))))
861+ > (scan "abc" (star ;~(pose prn (just `@`10))))
599 "abc"
862 "abc"
600− ~zod/try=> (scan " abc\0ade" ;~(pfix ace ace (star ;~(pose prn (just `@`10)))))
863+ > (scan " abc\0ade" ;~(pfix ace ace (star ;~(pose prn (just `@`10)))))
601 "abc
864 "abc
602 de"
865 de"
603− ~zod/try=> (scan " abc\0ade" ;~(pfix ace ace (iny (star ;~(pose prn (just `@`10))))))
866+ > (scan " abc\0ade" ;~(pfix ace ace (iny (star ;~(pose prn (just `@`10))))))
604 ! {1 6}
867 ! {1 6}
605 ! exit
868 ! exit
606− ~zod/try=> (scan " abc\0a de" ;~(pfix ace ace (iny (star ;~(pose prn (just `@`10))))))
869+ > (scan " abc\0a de" ;~(pfix ace ace (iny (star ;~(pose prn (just `@`10))))))
607 "abc
870 "abc
608 de"
871 de"
609
872
@@ -624,13 +887,13 @@ Source
624Examples
887Examples
625--------
888--------
626
889
627− ~zod/try=> (scan "g" low)
890+ > (scan "g" low)
628 ~~g
891 ~~g
629− ~zod/try=> `cord`(scan "g" low)
892+ > `cord`(scan "g" low)
630 'g'
893 'g'
631− ~zod/try=> (scan "abcdefghijklmnopqrstuvwxyz" (star low))
894+ > (scan "abcdefghijklmnopqrstuvwxyz" (star low))
632 "abcdefghijklmnopqrstuvwxyz"
895 "abcdefghijklmnopqrstuvwxyz"
633− ~zod/try=> (low [[1 1] "g"])
896+ > (low [[1 1] "g"])
634 [p=[p=1 q=2] q=[~ [p=~~g q=[p=[p=1 q=2] q=""]]]]
897 [p=[p=1 q=2] q=[~ [p=~~g q=[p=[p=1 q=2] q=""]]]]
635
898
636
899
@@ -646,17 +909,17 @@ Source
646------
909------
647
910
648 ++ mes %+ cook :: hexbyte
911 ++ mes %+ cook :: hexbyte
649− |=([a=@ b=@] (add (mul 16 a) b))
912+ |=({a/@ b/@} (add (mul 16 a) b))
650 ;~(plug hit hit)
913 ;~(plug hit hit)
651
914
652Examples
915Examples
653--------
916--------
654
917
655− ~zod/try=> (scan "2A" mes)
918+ > (scan "2A" mes)
656 42
919 42
657− ~zod/try=> (mes [[1 1] "2A"])
920+ > (mes [[1 1] "2A"])
658 [p=[p=1 q=3] q=[~ u=[p=42 q=[p=[p=1 q=3] q=""]]]]
921 [p=[p=1 q=3] q=[~ u=[p=42 q=[p=[p=1 q=3] q=""]]]]
659− ~zod/try=> (scan "42" mes)
922+ > (scan "42" mes)
660 66
923 66
661
924
662
925
@@ -676,9 +939,9 @@ Source
676Examples
939Examples
677--------
940--------
678
941
679− ~zod/try=> (scan "as_me" nix)
942+ > (scan "as_me" nix)
680 q=435.626.668.897
943 q=435.626.668.897
681− ~zod/try=> `@t`(scan "as_me" nix)
944+ > `@t`(scan "as_me" nix)
682 'as_me'
945 'as_me'
683
946
684
947
@@ -699,13 +962,13 @@ Source
699Examples
962Examples
700--------
963--------
701
964
702− ~zod/try=> (scan "0" nud)
965+ > (scan "0" nud)
703 ~~0
966 ~~0
704− ~zod/try=> (scan "7" nud)
967+ > (scan "7" nud)
705 ~~7
968 ~~7
706− ~zod/try=> (nud [[1 1] "1"])
969+ > (nud [[1 1] "1"])
707 [p=[p=1 q=2] q=[~ [p=~~1 q=[p=[p=1 q=2] q=""]]]]
970 [p=[p=1 q=2] q=[~ [p=~~1 q=[p=[p=1 q=2] q=""]]]]
708− ~zod/try=> (scan "0123456789" (star nud))
971+ > (scan "0123456789" (star nud))
709 "0123456789"
972 "0123456789"
710
973
711
974
@@ -724,11 +987,11 @@ Source
724Examples
987Examples
725--------
988--------
726
989
727− ~zod/try=> (scan "h" prn)
990+ > (scan "h" prn)
728 ~~h
991 ~~h
729− ~zod/try=> (scan "!" prn)
992+ > (scan "!" prn)
730 ~~~21.
993 ~~~21.
731− ~zod/try=> (scan "\01" prn)
994+ > (scan "\01" prn)
732 ! {1 1}
995 ! {1 1}
733 ! exit
996 ! exit
734
997
@@ -752,21 +1015,21 @@ Source
752Examples
1015Examples
753--------
1016--------
754
1017
755− ~zod/try=> (scan "%" qit)
1018+ > (scan "%" qit)
756 37
1019 37
757− ~zod/try=> `@t`(scan "%" qit)
1020+ > `@t`(scan "%" qit)
758 '%'
1021 '%'
759− ~zod/try=> (scan "0" qit)
1022+ > (scan "0" qit)
760 48
1023 48
761− ~zod/try=> (scan "E" qit)
1024+ > (scan "E" qit)
762 69
1025 69
763− ~zod/try=> (scan "a" qit)
1026+ > (scan "a" qit)
764 97
1027 97
765− ~zod/try=> (scan "\\0a" qit)
1028+ > (scan "\\0a" qit)
766 10
1029 10
767− ~zod/try=> `@ux`(scan "\\0a" qit)
1030+ > `@ux`(scan "\\0a" qit)
768 0xa
1031 0xa
769− ~zod/try=> (scan "cord" (star qit))
1032+ > (scan "cord" (star qit))
770 ~[99 111 114 100]
1033 ~[99 111 114 100]
771
1034
772
1035
@@ -789,21 +1052,21 @@ Source
789Examples
1052Examples
790--------
1053--------
791
1054
792− ~zod/try=> (scan "%" qit)
1055+ > (scan "%" qit)
793 37
1056 37
794− ~zod/try=> `@t`(scan "%" qit)
1057+ > `@t`(scan "%" qit)
795 '%'
1058 '%'
796− ~zod/try=> (scan "0" qit)
1059+ > (scan "0" qit)
797 48
1060 48
798− ~zod/try=> (scan "E" qit)
1061+ > (scan "E" qit)
799 69
1062 69
800− ~zod/try=> (scan "a" qit)
1063+ > (scan "a" qit)
801 97
1064 97
802− ~zod/try=> (scan "\\0a" qit)
1065+ > (scan "\\0a" qit)
803 10
1066 10
804− ~zod/try=> `@ux`(scan "\\0a" qit)
1067+ > `@ux`(scan "\\0a" qit)
805 0xa
1068 0xa
806− ~zod/try=> (scan "cord" (star qit))
1069+ > (scan "cord" (star qit))
807 ~[99 111 114 100]
1070 ~[99 111 114 100]
808
1071
809
1072
@@ -836,13 +1099,13 @@ Source
836Examples
1099Examples
837--------
1100--------
838
1101
839− ~zod/try=> (scan "'cord'" qut)
1102+ > (scan "'cord'" qut)
840 q=1.685.221.219
1103 q=1.685.221.219
841− ~zod/try=> 'cord'
1104+ > 'cord'
842 'cord'
1105 'cord'
843− ~zod/try=> `@ud`'cord'
1106+ > `@ud`'cord'
844 1.685.221.219
1107 1.685.221.219
845− /~zod/try=> '''
1108+ /> '''
846 Heredoc isn't prohibited from containing quotes
1109 Heredoc isn't prohibited from containing quotes
847 '''
1110 '''
848 'Heredoc isn't prohibited from containing quotes'
1111 'Heredoc isn't prohibited from containing quotes'
@@ -864,9 +1127,9 @@ Source
864Examples
1127Examples
865--------
1128--------
866
1129
867− ~zod/try=> (scan "'''" soz)
1130+ > (scan "'''" soz)
868 [~~~27. ~~~27. ~~~27.]
1131 [~~~27. ~~~27. ~~~27.]
869− ~zod/try=> (rash '"""' soz)
1132+ > (rash '"""' soz)
870 ! {1 1}
1133 ! {1 1}
871 ! exit
1134 ! exit
872
1135
@@ -891,11 +1154,11 @@ Source
891Examples
1154Examples
892--------
1155--------
893
1156
894− ~zod/try=> (scan "sam-2" sym)
1157+ > (scan "sam-2" sym)
895 215.510.507.891
1158 215.510.507.891
896− ~zod/try=> `@t`(scan "sam-2" sym)
1159+ > `@t`(scan "sam-2" sym)
897 'sam-2'
1160 'sam-2'
898− ~zod/try=> (scan "sym" sym)
1161+ > (scan "sym" sym)
899 7.174.515
1162 7.174.515
900
1163
901
1164
@@ -910,10 +1173,10 @@ Axis syntax parser
910Source
1173Source
911------
1174------
912
1175
913− ++ ven ;~ (comp |=([a=@ b=@] (peg a b))) :: +>- axis syntax
1176+ ++ ven ;~ (comp |=({a/@ b/@} (peg a b))) :: +>- axis syntax
914 bet
1177 bet
915 =+ hom=`?`|
1178 =+ hom=`?`|
916− |= tub=nail
1179+ |= tub/nail
917 ^- (like axis)
1180 ^- (like axis)
918 =+ vex=?:(hom (bet tub) (gul tub))
1181 =+ vex=?:(hom (bet tub) (gul tub))
919 ?~ q.vex
1182 ?~ q.vex
@@ -949,9 +1212,9 @@ Source
949
1212
950 ++ vit :: base64 digit
1213 ++ vit :: base64 digit
951 ;~ pose
1214 ;~ pose
952− (cook |=(a=@ (sub a 65)) (shim 'A' 'Z'))
1215+ (cook |=(a/@ (sub a 65)) (shim 'A' 'Z'))
953− (cook |=(a=@ (sub a 71)) (shim 'a' 'z'))
1216+ (cook |=(a/@ (sub a 71)) (shim 'a' 'z'))
954− (cook |=(a=@ (add a 4)) (shim '0' '9'))
1217+ (cook |=(a/@ (add a 4)) (shim '0' '9'))
955 (cold 62 (just '-'))
1218 (cold 62 (just '-'))
956 (cold 63 (just '+'))
1219 (cold 63 (just '+'))
957 ==
1220 ==
@@ -977,7 +1240,7 @@ Comments to null
977Source
1240Source
978------
1241------
979
1242
980− ++ vul %- cold :- ~ :: comments
1243+ ++ vul %+ cold ~ :: comments
981 ;~ plug col col
1244 ;~ plug col col
982 (star prn)
1245 (star prn)
983 (just `@`10)
1246 (just `@`10)
@@ -989,349 +1252,12 @@ with a newline character.
989Examples
1252Examples
990--------
1253--------
991
1254
992− ~zod/try=> (scan "::this is a comment \0a" vul)
1255+ > (scan "::this is a comment \0a" vul)
993 ~
1256 ~
994− ~zod/try=> (scan "::this is a comment " vul)
1257+ > (scan "::this is a comment " vul)
995 ! {1 21}
1258 ! {1 21}
996 ! exit
1259 ! exit
997
1260
998
1261
999
1262
1000−***
1001−### `++co`
1002−
1003−Literal rendering engine
1004−
1005−A [door]() that contains arms that operate on the sample coin `lot`.
1006−
1007−Accepts
1008−-------
1009−
1010−Produces
1011−--------
1012−
1013−`lot` is a [`++coin`]().
1014−
1015−Source
1016−------
1017−
1018− ++ co
1019− =< |_ lot=coin
1020−
1021−Examples
1022−--------
1023−
1024− ~zod/try=> ~(. co many/~[`ta/'mo' `ud/5])
1025− < 3.dhd
1026− [ [ %many
1027− [%~ %ta @t]
1028− [%~ %ud @ud]
1029− %~
1030− ]
1031− <10.utz 3.zid [rex="" <414.hmb 100.xkc 1.ypj %164>]>
1032− ]
1033− >
1034−
1035−------------------------------------------------------------------------
1036−
1037−### `++rear`
1038−
1039−Prepend & render as tape
1040−
1041−Renders a coin `lot` as a [tape]() prepended to the sample tape `rom`.
1042−
1043−Accepts
1044−-------
1045−
1046−Produces
1047−--------
1048−
1049−`rom` is a [`pe`]()
1050−
1051−`lot` is a [`++coin`]().
1052−
1053−Source
1054−------
1055−
1056− ++ rear |=(rom=tape =>(.(rex rom) rend))
1057−
1058−Examples
1059−--------
1060−
1061− ~zod/try=> (~(rear co %$ %ux 200) "--ha")
1062− "0xc8--ha"
1063−
1064−------------------------------------------------------------------------
1065−
1066−### `++rent`
1067−
1068−Render as span
1069−
1070−Renders a coin `lot` as a span.
1071−
1072−Accepts
1073−-------
1074−
1075−Produces
1076−--------
1077−
1078−`lot` is a [`++coin`]().
1079−
1080−Source
1081−------
1082−
1083− ++ rent `@ta`(rap 3 rend)
1084−
1085−Examples
1086−--------
1087−
1088− ~zod/try=> ~(rent co %$ %ux 200)
1089− ~.0xc8
1090− ~zod/try=> `@t`~(rent co %$ %ux 200)
1091− '0xc8'
1092−
1093−------------------------------------------------------------------------
1094−
1095−### `++rend`
1096−
1097−Render as tape
1098−
1099−Renders a coin `lot` as a tape.
1100−
1101−Accepts
1102−-------
1103−
1104−Produces
1105−--------
1106−
1107−`lot` is a [`++coin`]().
1108−
1109−Source
1110−------
1111−
1112− ++ rend
1113− ^- tape
1114− ?: ?=(%blob -.lot)
1115− ['~' '0' ((v-co 1) (jam p.lot))]
1116− ?: ?=(%many -.lot)
1117− :- '.'
1118− |- ^- tape
1119− ?~ p.lot
1120− ['_' '_' rex]
1121− ['_' (weld (trip (wack rent(lot i.p.lot))) $(p.lot t.p.lot))]
1122− =+ [yed=(end 3 1 p.p.lot) hay=(cut 3 [1 1] p.p.lot)]
1123− |- ^- tape
1124− ?+ yed (z-co q.p.lot)
1125− %c ['~' '-' (weld (rip 3 (wood (tuft q.p.lot))) rex)]
1126− %d
1127− ?+ hay (z-co q.p.lot)
1128− %a
1129− =+ yod=(yore q.p.lot)
1130− => ^+(. .(rex ?~(f.t.yod rex ['.' (s-co f.t.yod)])))
1131− => ^+ .
1132− %= .
1133− rex
1134− ?: &(=(~ f.t.yod) =(0 h.t.yod) =(0 m.t.yod) =(0 s.t.yod))
1135− rex
1136− => .(rex ['.' (y-co s.t.yod)])
1137− => .(rex ['.' (y-co m.t.yod)])
1138− ['.' '.' (y-co h.t.yod)]
1139− ==
1140− => .(rex ['.' (a-co d.t.yod)])
1141− => .(rex ['.' (a-co m.yod)])
1142− => .(rex ?:(a.yod rex ['-' rex]))
1143− ['~' (a-co y.yod)]
1144− ::
1145− %r
1146− =+ yug=(yell q.p.lot)
1147− => ^+(. .(rex ?~(f.yug rex ['.' (s-co f.yug)])))
1148− :- '~'
1149− ?: &(=(0 d.yug) =(0 m.yug) =(0 h.yug) =(0 s.yug))
1150− ['.' 's' '0' rex]
1151− => ^+(. ?:(=(0 s.yug) . .(rex ['.' 's' (a-co s.yug)])))
1152− => ^+(. ?:(=(0 m.yug) . .(rex ['.' 'm' (a-co m.yug)])))
1153− => ^+(. ?:(=(0 h.yug) . .(rex ['.' 'h' (a-co h.yug)])))
1154− => ^+(. ?:(=(0 d.yug) . .(rex ['.' 'd' (a-co d.yug)])))
1155− +.rex
1156− ==
1157− ::
1158− %f
1159− ?: =(& q.p.lot)
1160− ['.' 'y' rex]
1161− ?:(=(| q.p.lot) ['.' 'n' rex] (z-co q.p.lot))
1162− ::
1163− %n ['~' rex]
1164− %i
1165− ?+ hay (z-co q.p.lot)
1166− %f ((ro-co [3 10 4] |=(a=@ ~(d ne a))) q.p.lot)
1167− %s ((ro-co [4 16 8] |=(a=@ ~(x ne a))) q.p.lot)
1168− ==
1169− ::
1170− %p
1171− =+ dyx=(met 3 q.p.lot)
1172− :- '~'
1173− ?: (lte dyx 1)
1174− (weld (trip (tod:po q.p.lot)) rex)
1175− ?: =(2 dyx)
1176− ;: weld
1177− (trip (tos:po (end 3 1 q.p.lot)))
1178− (trip (tod:po (rsh 3 1 q.p.lot)))
1179− rex
1180− ==
1181− =+ [dyz=(met 5 q.p.lot) fin=|]
1182− |- ^- tape
1183− ?: =(0 dyz)
1184− rex
1185− %= $
1186− fin &
1187− dyz (dec dyz)
1188− q.p.lot (rsh 5 1 q.p.lot)
1189− rex
1190− =+ syb=(wren:un (end 5 1 q.p.lot))
1191− =+ cog=~(zig mu [(rsh 4 1 syb) (end 4 1 syb)])
1192− ;: weld
1193− (trip (tos:po (end 3 1 p.cog)))
1194− (trip (tod:po (rsh 3 1 p.cog)))
1195− `tape`['-' ~]
1196− (trip (tos:po (end 3 1 q.cog)))
1197− (trip (tod:po (rsh 3 1 q.cog)))
1198− `tape`?:(fin ['-' ?:(=(1 (end 0 1 dyz)) ~ ['-' ~])] ~)
1199− rex
1200− ==
1201− ==
1202− ::
1203− %r
1204− ?+ hay (z-co q.p.lot)
1205− %d
1206− =+ r=(rlyd q.p.lot)
1207− ?~ e.r
1208− ['.' '~' (r-co r)]
1209− ['.' '~' u.e.r]
1210− %h ['.' '~' '~' (r-co (rlyh q.p.lot))]
1211− %q ['.' '~' '~' '~' (r-co (rlyq q.p.lot))]
1212− %s ['.' (r-co (rlys q.p.lot))]
1213− ==
1214− ::
1215− %u
1216− =- (weld p.gam ?:(=(0 q.p.lot) `tape`['0' ~] q.gam))
1217− ^= gam ^- [p=tape q=tape]
1218− ?+ hay [~ ((ox-co [10 3] |=(a=@ ~(d ne a))) q.p.lot)]
1219− %b [['0' 'b' ~] ((ox-co [2 4] |=(a=@ ~(d ne a))) q.p.lot)]
1220− %i [['0' 'i' ~] ((d-co 1) q.p.lot)]
1221− %x [['0' 'x' ~] ((ox-co [16 4] |=(a=@ ~(x ne a))) q.p.lot)]
1222− %v [['0' 'v' ~] ((ox-co [32 5] |=(a=@ ~(x ne a))) q.p.lot)]
1223− %w [['0' 'w' ~] ((ox-co [64 5] |=(a=@ ~(w ne a))) q.p.lot)]
1224− ==
1225− ::
1226− %s
1227− %+ weld
1228− ?:((syn:si q.p.lot) "--" "-")
1229− $(yed 'u', q.p.lot (abs:si q.p.lot))
1230− ::
1231− %t
1232− ?: =('a' hay)
1233− ?: =('s' (cut 3 [2 1] p.p.lot))
1234−
1235− (weld (rip 3 q.p.lot) rex)
1236− ['~' '.' (weld (rip 3 q.p.lot) rex)]
1237− ['~' '~' (weld (rip 3 (wood q.p.lot)) rex)]
1238− ==
1239− --
1240− =+ rex=*tape
1241− =< |%
1242− ++ a-co |=(dat=@ ((d-co 1) dat))
1243− ++ d-co |=(min=@ (em-co [10 min] |=([? b=@ c=tape] [~(d ne b) c])))
1244− ++ r-co
1245− |= [syn=? nub=@ der=@ ign=(unit tape) ne=?]
1246− => .(rex ['.' (t-co ((d-co 1) der) ne)])
1247− => .(rex ((d-co 1) nub))
1248− ?:(syn rex ['-' rex])
1249− ++ t-co |= [a=tape n=?] ^- tape
1250− ?: n a
1251− ?~ a ~|(%empty-frac !!) t.a
1252− ::
1253− ++ s-co
1254− |= esc=(list ,@) ^- tape
1255− ~| [%so-co esc]
1256− ?~ esc
1257− rex
1258− :- '.'
1259− =>(.(rex $(esc t.esc)) ((x-co 4) i.esc))
1260−
1261− ::
1262− ++ v-co |=(min=@ (em-co [32 min] |=([? b=@ c=tape] [~(v ne b) c])))
1263− ++ w-co |=(min=@ (em-co [64 min] |=([? b=@ c=tape] [~(w ne b) c])))
1264− ++ x-co |=(min=@ (em-co [16 min] |=([? b=@ c=tape] [~(x ne b) c])))
1265− ++ y-co |=(dat=@ ((d-co 2) dat))
1266− ++ z-co |=(dat=@ `tape`['0' 'x' ((x-co 1) dat)])
1267− --
1268− ~% %co +> ~
1269− |%
1270− ++ em-co
1271− ~/ %emco
1272− |= [[bas=@ min=@] [par=$+([? @ tape] tape)]]
1273− |= hol=@
1274− ^- tape
1275− ?: &(=(0 hol) =(0 min))
1276− rex
1277− =+ [rad=(mod hol bas) dar=(div hol bas)]
1278− %= $
1279− min ?:(=(0 min) 0 (dec min))
1280− hol dar
1281− rex (par =(0 dar) rad rex)
1282− ==
1283− ::
1284− ++ ox-co
1285− ~/ %oxco
1286− |= [[bas=@ gop=@] dug=$+(@ @)]
1287− %+ em-co
1288− [|-(?:(=(0 gop) 1 (mul bas $(gop (dec gop))))) 0]
1289− |= [top=? seg=@ res=tape]
1290− %+ weld
1291− ?:(top ~ `tape`['.' ~])
1292− %. seg
1293− %+ em-co(rex res)
1294− [bas ?:(top 0 gop)]
1295− |=([? b=@ c=tape] [(dug b) c])
1296− ::
1297− ++ ro-co
1298− ~/ %roco
1299− |= [[buz=@ bas=@ dop=@] dug=$+(@ @)]
1300− |= hol=@
1301− ^- tape
1302− ?: =(0 dop)
1303− rex
1304− => .(rex $(dop (dec dop)))
1305− :- '.'
1306− %- (em-co [bas 1] |=([? b=@ c=tape] [(dug b) c]))
1307− [(cut buz [(dec dop) 1] hol)]
1308− --
1309− ::
1310−
1311−Examples
1312−--------
1313−
1314− ~zod/try=> ~(rend co ~ %ux 200)
1315− "0xc8"
1316− ~zod/try=> ~(rend co %many ~[[%$ ux/200] [%$ p/40]])
1317− "._0xc8_~~tem__"
1318− ~zod/try=> ~(rend co ~ %p 32.819)
1319− "~pillyt"
1320− ~zod/try=> ~(rend co ~ %ux 18)
1321− "0x12"
1322− ~zod/try=> ~(rend co [~ p=[p=%if q=0x7f00.0001]])
1323− ".127.0.0.1"
1324− ~zod/try=> `@ux`.127.0.0.1
1325− 2.130.706.433
1326− ~zod/try=> ~(rend co %many ~[[~ %ud 20] [~ %uw 133] [~ %tas 'sam']])
1327− "._20_0w25_sam__"
1328− ~zod/try=> ~(rend co %blob [1 1])
1329− "~0ph"
1330− ~zod/try=> ~0ph
1331− [1 1]
1332− ~zod/try=> `@uv`(jam [1 1])
1333− 0vph
1334−
1335−
1336−
1337***
1263***
docs/system/hoon/library/4l.md+235−116
@@ -3,7 +3,7 @@
3
3
4Coin parser engine
4Coin parser engine
5
5
6−Core containing arms that parse [`++coin`]s.
6+Core containing arms that parse `++coin`.
7
7
8Accepts
8Accepts
9-------
9-------
@@ -20,7 +20,7 @@ Source
20Examples
20Examples
21--------
21--------
22
22
23− ~zod/try=> so
23+ > so
24 <10.mkn 414.hhh 100.xkc 1.ypj %164>
24 <10.mkn 414.hhh 100.xkc 1.ypj %164>
25
25
26------------------------------------------------------------------------
26------------------------------------------------------------------------
@@ -30,7 +30,7 @@ Examples
30Parse odor-atom pair
30Parse odor-atom pair
31
31
32Parsing rule. Parses an unsigned integer of any permitted base,
32Parsing rule. Parses an unsigned integer of any permitted base,
33−producing a [`++dime`]().
33+producing a `++dime`.
34
34
35Accepts
35Accepts
36-------
36-------
@@ -58,9 +58,9 @@ Source
58Examples
58Examples
59--------
59--------
60
60
61− ~zod/try=> (scan "25" bisk:so)
61+ > (scan "25" bisk:so)
62 [%ud q=25]
62 [%ud q=25]
63− ~zod/try=> (scan "0x12.6401" bisk:so)
63+ > (scan "0x12.6401" bisk:so)
64 [%ux q=1.205.249]
64 [%ux q=1.205.249]
65
65
66------------------------------------------------------------------------
66------------------------------------------------------------------------
@@ -70,8 +70,8 @@ Examples
70Parse `@da`, `@dr`, `@p`, `@t`
70Parse `@da`, `@dr`, `@p`, `@t`
71
71
72Parsing rule. Parses any atom of any of the following odors after a
72Parsing rule. Parses any atom of any of the following odors after a
73−leading sig, `~` into a [`++dime`](): [`@da`](), [`@dr`](), [`@p`](),
73+leading sig, `~` into a `++dime`: `@da`, `@dr`, `@p`,
74−and [`@t`](), producing a [`++dime`]().
74+and `@t`, producing a `++dime`.
75
75
76Accepts
76Accepts
77-------
77-------
@@ -83,12 +83,13 @@ Source
83------
83------
84
84
85 ++ crub
85 ++ crub
86+ ~+
86 ;~ pose
87 ;~ pose
87 %+ cook
88 %+ cook
88− |=(det=date `dime`[%da (year det)])
89+ |=(det/date `dime`[%da (year det)])
89 ;~ plug
90 ;~ plug
90 %+ cook
91 %+ cook
91− |=([a=@ b=?] [b a])
92+ |=({a/@ b/?} [b a])
92 ;~(plug dim:ag ;~(pose (cold | hep) (easy &)))
93 ;~(plug dim:ag ;~(pose (cold | hep) (easy &)))
93 ;~(pfix dot dim:ag) :: month
94 ;~(pfix dot dim:ag) :: month
94 ;~(pfix dot dim:ag) :: day
95 ;~(pfix dot dim:ag) :: day
@@ -107,16 +108,16 @@ Source
107 ==
108 ==
108 ::
109 ::
109 %+ cook
110 %+ cook
110− |= [a=(list ,[p=?(%d %h %m %s) q=@]) b=(list ,@)]
111+ |= {a/(list {p/?($d $h $m $s) q/@}) b/(list @)}
111 =+ rop=`tarp`[0 0 0 0 b]
112 =+ rop=`tarp`[0 0 0 0 b]
112 |- ^- dime
113 |- ^- dime
113 ?~ a
114 ?~ a
114 [%dr (yule rop)]
115 [%dr (yule rop)]
115 ?- p.i.a
116 ?- p.i.a
116− %d $(a t.a, d.rop (add q.i.a d.rop))
117+ $d $(a t.a, d.rop (add q.i.a d.rop))
117− %h $(a t.a, h.rop (add q.i.a h.rop))
118+ $h $(a t.a, h.rop (add q.i.a h.rop))
118− %m $(a t.a, m.rop (add q.i.a m.rop))
119+ $m $(a t.a, m.rop (add q.i.a m.rop))
119− %s $(a t.a, s.rop (add q.i.a s.rop))
120+ $s $(a t.a, s.rop (add q.i.a s.rop))
120 ==
121 ==
121 ;~ plug
122 ;~ plug
122 %+ most
123 %+ most
@@ -132,24 +133,126 @@ Source
132 ::
133 ::
133 (stag %p fed:ag)
134 (stag %p fed:ag)
134 ;~(pfix dot (stag %ta urs:ab))
135 ;~(pfix dot (stag %ta urs:ab))
135− ;~(pfix sig (stag %t (cook woad urs:ab)))
136+ ;~(pfix sig (stag %t urx:ab))
136− ;~(pfix hep (stag %c (cook turf (cook woad urs:ab))))
137+ ;~(pfix hep (stag %c (cook turf urx:ab)))
137 ==
138 ==
139+ ++ nuck
140+ ~/ %nuck |= a/nail %. a
141+ %+ knee *coin |. ~+
142+ %- stew
143+ ^. stet ^. limo
144+ :~ :- ['a' 'z'] (cook |=(a/@ta [%$ %tas a]) sym)
145+ :- ['0' '9'] (stag %$ bisk)
146+ :- '-' (stag %$ tash)
147+ :- '.' ;~(pfix dot perd)
148+ :- '~' ;~(pfix sig ;~(pose twid (easy [%$ %n 0])))
149+ ==
150+ ++ nusk
151+ ~+
152+ :(sear |=(a/@ta (rush a nuck)) wick urt:ab)
153+ ++ perd
154+ ~+
155+ ;~ pose
156+ (stag %$ zust)
157+ (stag %many (ifix [cab ;~(plug cab cab)] (more cab nusk)))
158+ ==
159+ ++ royl
160+ ~+
161+ =+ ^= moo
162+ |= a/tape
163+ :- (lent a)
164+ (scan a (bass 10 (plus sid:ab)))
165+ =+ ^= voy
166+ %+ cook royl-cell
167+ ;~ pose
168+ ;~ plug
169+ (easy %d)
170+ ;~ pose (cold | hep) (easy &) ==
171+ ;~ plug dim:ag
172+ ;~ pose
173+ ;~(pfix dot (cook moo (plus (shim '0' '9'))))
174+ (easy [0 0])
175+ ==
176+ ;~ pose
177+ ;~ pfix
178+ (just 'e')
179+ ;~(plug ;~(pose (cold | hep) (easy &)) dim:ag)
180+ ==
181+ (easy [& 0])
182+ ==
183+ ==
184+ ==
185+ ;~ plug
186+ (easy %i)
187+ ;~ sfix
188+ ;~ pose (cold | hep) (easy &) ==
189+ (jest 'inf')
190+ ==
191+ ==
192+ ;~ plug
193+ (easy %n)
194+ (cold ~ (jest 'nan'))
195+ ==
196+ ==
197+ ;~ pose
198+ (stag %rh (cook rylh ;~(pfix ;~(plug sig sig) voy)))
199+ (stag %rq (cook rylq ;~(pfix ;~(plug sig sig sig) voy)))
200+ (stag %rd (cook ryld ;~(pfix sig voy)))
201+ (stag %rs (cook ryls voy))
202+ ==
203+ ::
204+ ++ royl-cell
205+ |= rn
206+ ^- dn
207+ ?. ?=({$d *} +<) +<
208+ =+ ^= h
209+ (dif:si (new:si f.b i.b) (sun:si d.b))
210+ [%d a h (add (mul c.b (pow 10 d.b)) e.b)]
211+ ::
212+ ++ tash
213+ ~+
214+ =+ ^= neg
215+ |= {syn/? mol/dime} ^- dime
216+ ?> =('u' (end 3 1 p.mol))
217+ [(cat 3 's' (rsh 3 1 p.mol)) (new:si syn q.mol)]
218+ ;~ pfix hep
219+ ;~ pose
220+ (cook |=(a/dime (neg | a)) bisk)
221+ ;~(pfix hep (cook |=(a/dime (neg & a)) bisk))
222+ ==
223+ ==
224+ ::
225+ ++ twid
226+ ~+
227+ ;~ pose
228+ (cook |=(a/@ [%blob (cue a)]) ;~(pfix (just '0') vum:ag))
229+ (stag %$ crub)
230+ ==
231+ ::
232+ ++ zust
233+ ~+
234+ ;~ pose
235+ (stag %is bip:ag)
236+ (stag %if lip:ag)
237+ (stag %f ;~(pose (cold & (just 'y')) (cold | (just 'n'))))
238+ royl
239+ ==
240+ --
138
241
139Examples
242Examples
140--------
243--------
141
244
142− ~zod/try=> (scan "1926.5.12" crub:so)
245+ > (scan "1926.5.12" crub:so)
143 [p=~.da q=170.141.184.449.747.016.871.285.095.307.149.312.000]
246 [p=~.da q=170.141.184.449.747.016.871.285.095.307.149.312.000]
144− ~zod/try=> (,[%da @da] (scan "1926.5.12" crub:so))
247+ > ([%da @da] (scan "1926.5.12" crub:so))
145 [%da ~1926.5.12]
248 [%da ~1926.5.12]
146− ~zod/try=> (scan "s10" crub:so)
249+ > (scan "s10" crub:so)
147 [p=~.dr q=184.467.440.737.095.516.160]
250 [p=~.dr q=184.467.440.737.095.516.160]
148− ~zod/try=> (,[%dr @dr] (scan "s10" crub:so))
251+ > ([%dr @dr] (scan "s10" crub:so))
149 [%dr ~s10]
252 [%dr ~s10]
150− ~zod/try=> (scan "doznec" crub:so)
253+ > (scan "doznec" crub:so)
151 [%p 256]
254 [%p 256]
152− ~zod/try=> (scan ".mas" crub:so)
255+ > (scan ".mas" crub:so)
153 [%ta 7.561.581]
256 [%ta 7.561.581]
154
257
155------------------------------------------------------------------------
258------------------------------------------------------------------------
@@ -159,7 +262,7 @@ Examples
159Top-level coin parser
262Top-level coin parser
160
263
161Parsing rule. Switches on the first character and applies the
264Parsing rule. Switches on the first character and applies the
162−corresponding [`++coin`]() parser.
265+corresponding `++coin` parser.
163
266
164Accepts
267Accepts
165-------
268-------
@@ -170,40 +273,43 @@ Produces
170Source
273Source
171------
274------
172
275
173− ++ nuck
276+ ++ nuck
277+ ~/ %nuck |= a/nail %. a
174− %+ knee *coin |. ~+
278+ %+ knee *coin |. ~+
175− %- stew
279+ %- stew
176− ^. stet ^. limo
280+ ^. stet ^. limo
177− :~ :- ['a' 'z'] (cook |=(a=@ta [~ %tas a]) sym)
281+ :~ :- ['a' 'z'] (cook |=(a/@ta [%$ %tas a]) sym)
178− :- ['0' '9'] (stag ~ bisk)
282+ :- ['0' '9'] (stag %$ bisk)
179− :- '-' (stag ~ tash)
283+ :- '-' (stag %$ tash)
180− :- '.' ;~(pfix dot perd)
284+ :- '.' ;~(pfix dot perd)
181− :- '~' ;~(pfix sig ;~(pose twid (easy [~ %n 0])))
285+ :- '~' ;~(pfix sig ;~(pose twid (easy [%$ %n 0])))
182− ==
286+ ==
287+
288+
183
289
184Examples
290Examples
185--------
291--------
186
292
187− ~zod/try=> (scan "~pillyt" nuck:so)
293+ > (scan "~pillyt" nuck:so)
188 [% p=[p=~.p q=32.819]]
294 [% p=[p=~.p q=32.819]]
189− ~zod/try=> (scan "0x12" nuck:so)
295+ > (scan "0x12" nuck:so)
190 [% p=[p=~.ux q=18]]
296 [% p=[p=~.ux q=18]]
191− ~zod/try=> (scan ".127.0.0.1" nuck:so)
297+ > (scan ".127.0.0.1" nuck:so)
192 [% p=[p=~.if q=2.130.706.433]]
298 [% p=[p=~.if q=2.130.706.433]]
193− ~zod/try=> `@ud`.127.0.0.1
299+ > `@ud`.127.0.0.1
194 2.130.706.433
300 2.130.706.433
195− ~zod/try=> (scan "._20_0w25_sam__" nuck:so)
301+ > (scan "._20_0w25_sam__" nuck:so)
196 [ %many
302 [ %many
197 p
303 p
198 ~[[% p=[p=~.ud q=20]] [% p=[p=~.uw q=133]] [% p=[p=~.tas q=7.168.371]]]
304 ~[[% p=[p=~.ud q=20]] [% p=[p=~.uw q=133]] [% p=[p=~.tas q=7.168.371]]]
199 ]
305 ]
200− ~zod/try=> `@`%sam
306+ > `@`%sam
201 7.168.371
307 7.168.371
202− ~zod/try=> (scan "~0ph" nuck:so)
308+ > (scan "~0ph" nuck:so)
203 [%blob p=[1 1]]
309 [%blob p=[1 1]]
204− ~zod/try=> ~0ph
310+ > ~0ph
205 [1 1]
311 [1 1]
206− ~zod/try=> `@uv`(jam [1 1])
312+ > `@uv`(jam [1 1])
207 0vph
313 0vph
208
314
209------------------------------------------------------------------------
315------------------------------------------------------------------------
@@ -225,18 +331,18 @@ Source
225------
331------
226
332
227 ++ nusk
333 ++ nusk
228− (sear |=(a=@ta (rush (wick a) nuck)) urt:ab)
334+ (sear |=(a/@ta (rush (wick a) nuck)) urt:ab)
229
335
230Examples
336Examples
231--------
337--------
232
338
233− ~zod/try=> ~.asd_a
339+ > ~.asd_a
234 ~.asd_a
340 ~.asd_a
235− ~zod/try=> ._1_~~.asd~-a__
341+ > ._1_~~.asd~-a__
236 [1 ~.asd_a]
342 [1 ~.asd_a]
237− ~zod/try=> (scan "~~.asd~-a" nusk:so)
343+ > (scan "~~.asd~-a" nusk:so)
238 [% p=[p=~.ta q=418.212.246.369]]
344 [% p=[p=~.ta q=418.212.246.369]]
239− ~zod/try=> (,[~ %ta @ta] (scan "~~.asd~-a" nusk:so))
345+ > ([~ %ta @ta] (scan "~~.asd~-a" nusk:so))
240 [~ %ta ~.asd_a]
346 [~ %ta ~.asd_a]
241
347
242------------------------------------------------------------------------
348------------------------------------------------------------------------
@@ -266,13 +372,13 @@ Source
266Examples
372Examples
267--------
373--------
268
374
269− ~zod/try=> (scan "y" perd:so)
375+ > (scan "y" perd:so)
270 [~ [%f %.y]]
376 [~ [%f %.y]]
271− ~zod/try=> (scan "n" perd:so)
377+ > (scan "n" perd:so)
272 [~ [%f %.n]]
378 [~ [%f %.n]]
273− ~zod/try=> |
379+ > |
274 %.n
380 %.n
275− ~zod/try=> (scan "_20_x__" perd:so)
381+ > (scan "_20_x__" perd:so)
276 [%many [[% p=[p=~.ud q=20]] ~[[% p=[p=~.tas q=120]]]]]
382 [%many [[% p=[p=~.ud q=20]] ~[[% p=[p=~.tas q=120]]]]]
277
383
278------------------------------------------------------------------------
384------------------------------------------------------------------------
@@ -281,7 +387,7 @@ Examples
281
387
282Parse dime float
388Parse dime float
283
389
284−Parsing rule. Parses a number into a [`++dime`]() float.
390+Parsing rule. Parses a number into a `++dime` float.
285
391
286Accepts
392Accepts
287-------
393-------
@@ -292,35 +398,58 @@ Produces
292Source
398Source
293------
399------
294
400
295− ++ royl
401+ ++ royl
296− =+ ^= zer
402+ ~+
297− (cook lent (star (just '0')))
403+ =+ ^= moo
404+ |= a/tape
405+ :- (lent a)
406+ (scan a (bass 10 (plus sid:ab)))
298− =+ ^= voy
407+ =+ ^= voy
299− %+ cook royl-cell
408+ %+ cook royl-cell
300− ;~ plug
409+ ;~ pose
410+ ;~ plug
411+ (easy %d)
301− ;~(pose (cold | hep) (easy &))
412+ ;~ pose (cold | hep) (easy &) ==
302− ;~(plug dim:ag ;~(pose ;~(pfix dot ;~(plug zer dim:ag)) (easy [0 0])))
413+ ;~ plug dim:ag
414+ ;~ pose
415+ ;~(pfix dot (cook moo (plus (shim '0' '9'))))
416+ (easy [0 0])
417+ ==
303− ;~ pose
418+ ;~ pose
304− ;~ pfix
419+ ;~ pfix
305− (just 'e')
420+ (just 'e')
306− (cook some ;~(plug ;~(pose (cold | hep) (easy &)) dim:ag))
421+ ;~(plug ;~(pose (cold | hep) (easy &)) dim:ag)
307− ==
308− (easy ~)
309 ==
422 ==
423+ (easy [& 0])
310 ==
424 ==
425+ ==
426+ ==
427+ ;~ plug
428+ (easy %i)
429+ ;~ sfix
311− ;~ pose
430+ ;~ pose (cold | hep) (easy &) ==
312− (stag %rh (cook rylh ;~(pfix ;~(plug sig sig) voy)))
431+ (jest 'inf')
313− (stag %rq (cook rylq ;~(pfix ;~(plug sig sig sig) voy)))
432+ ==
314− (stag %rd (cook ryld ;~(pfix sig voy)))
433+ ==
315− (stag %rs (cook ryls voy)
434+ ;~ plug
435+ (easy %n)
436+ (cold ~ (jest 'nan'))
316 ==
437 ==
438+ ==
439+ ;~ pose
440+ (stag %rh (cook rylh ;~(pfix ;~(plug sig sig) voy)))
441+ (stag %rq (cook rylq ;~(pfix ;~(plug sig sig sig) voy)))
442+ (stag %rd (cook ryld ;~(pfix sig voy)))
443+ (stag %rs (cook ryls voy))
444+ ==
445+ ::
317
446
318Examples
447Examples
319--------
448--------
320
449
321− ~zod/try=> (scan "~3.14" royl:so)
450+ > (scan "~3.14" royl:so)
322 [%rd .~3.13999999999999]
451 [%rd .~3.13999999999999]
323− ~zod/try=> .~3.14
452+ > .~3.14
324 .~3.13999999999999
453 .~3.13999999999999
325
454
326------------------------------------------------------------------------
455------------------------------------------------------------------------
@@ -331,6 +460,15 @@ XX still not fully functional
331
460
332Intermediate parsed float convereter
461Intermediate parsed float convereter
333
462
463+ ++ royl-cell
464+ |= rn
465+ ^- dn
466+ ?. ?=({$d *} +<) +<
467+ =+ ^= h
468+ (dif:si (new:si f.b i.b) (sun:si d.b))
469+ [%d a h (add (mul c.b (pow 10 d.b)) e.b)]
470+ ::
471+
334------------------------------------------------------------------------
472------------------------------------------------------------------------
335
473
336### `++tash`
474### `++tash`
@@ -340,57 +478,38 @@ Parse signed dime
340Accepts
478Accepts
341-------
479-------
342
480
343−Accepts
344−-------
345−
346Produces
481Produces
347--------
482--------
348
483
349−Produces
350−--------
351−
352−Parsing rule. Parses a signed number into a [`++dime`]().
484+Parsing rule. Parses a signed number into a `++dime`.
353−
354−Source
355−------
356−
357− ++ royl-cell
358− |= [a=? b=[c=@ d=@ e=@] f=(unit ,[h=? i=@])]
359− ^- [? @ @ @ (unit ,@s)]
360− ?~ f
361− [a c.b d.b e.b ~]
362− ?: h.u.f
363− [a c.b d.b e.b [~ (mul i.u.f 2)]]
364− [a c.b d.b e.b [~ (dec (mul i.u.f 2))]]
365−
366−Examples
367−--------
368
485
369Source
486Source
370------
487------
371
488
372 ++ tash
489 ++ tash
490+ ~+
373 =+ ^= neg
491 =+ ^= neg
374− |= [syn=? mol=dime] ^- dime
492+ |= {syn/? mol/dime} ^- dime
375 ?> =('u' (end 3 1 p.mol))
493 ?> =('u' (end 3 1 p.mol))
376 [(cat 3 's' (rsh 3 1 p.mol)) (new:si syn q.mol)]
494 [(cat 3 's' (rsh 3 1 p.mol)) (new:si syn q.mol)]
377 ;~ pfix hep
495 ;~ pfix hep
378 ;~ pose
496 ;~ pose
379− (cook |=(a=dime (neg | a)) bisk)
497+ (cook |=(a/dime (neg | a)) bisk)
380− ;~(pfix hep (cook |=(a=dime (neg & a)) bisk))
498+ ;~(pfix hep (cook |=(a/dime (neg & a)) bisk))
381 ==
499 ==
382 ==
500 ==
501+ ::
383
502
384Examples
503Examples
385--------
504--------
386
505
387− ~zod/try=> (scan "-20" tash:so)
506+ > (scan "-20" tash:so)
388 [p=~.sd q=39]
507 [p=~.sd q=39]
389− ~zod/try=> (,[%sd @sd] (scan "-20" tash:so))
508+ > (,[%sd @sd] (scan "-20" tash:so))
390 [%sd -20]
509 [%sd -20]
391− ~zod/try=> (,[%sd @sd] (scan "--20" tash:so))
510+ > (,[%sd @sd] (scan "--20" tash:so))
392 [%sd --20]
511 [%sd --20]
393− ~zod/try=> (,[%sx @sx] (scan "--0x2e" tash:so))
512+ > (,[%sx @sx] (scan "--0x2e" tash:so))
394 [%sx --0x2e]
513 [%sx --0x2e]
395
514
396------------------------------------------------------------------------
515------------------------------------------------------------------------
@@ -412,7 +531,7 @@ Source
412
531
413 ++ twid
532 ++ twid
414 ;~ pose
533 ;~ pose
415− (cook |=(a=@ [%blob (cue a)]) ;~(pfix (just '0') vum:ag))
534+ (cook |=(a/@ [%blob (cue a)]) ;~(pfix (just '0') vum:ag))
416 (stag ~ crub)
535 (stag ~ crub)
417 ==
536 ==
418 ::
537 ::
@@ -420,15 +539,15 @@ Source
420Examples
539Examples
421--------
540--------
422
541
423− ~zod/try=> (scan "zod" twid:so)
542+ > (scan "zod" twid:so)
424 [~ [%p 0]]
543 [~ [%p 0]]
425− ~zod/try=> (scan ".sam" twid:so)
544+ > (scan ".sam" twid:so)
426 [~ [%ta 7.168.371]]
545 [~ [%ta 7.168.371]]
427− ~zod/try=> `@ud`~.sam
546+ > `@ud`~.sam
428 7.168.371
547 7.168.371
429− ~zod/try=> `@t`~.sam
548+ > `@t`~.sam
430 'sam'
549 'sam'
431− ~zod/try=> (scan "0ph" twid:so)
550+ > (scan "0ph" twid:so)
432 [%blob [1 1]]
551 [%blob [1 1]]
433
552
434------------------------------------------------------------------------
553------------------------------------------------------------------------
@@ -437,8 +556,8 @@ Examples
437
556
438Parse prefixed dimes from `@if`, `@f`, `@rd`
557Parse prefixed dimes from `@if`, `@f`, `@rd`
439
558
440−Parsing rule. Parses an atom of either [`@if`]() (IP address), [`@f`]()
559+Parsing rule. Parses an atom of either `@if` (IP address), `@f`
441−(loobean), or [`rf`]()(floating point) into a [`++dime`]().
560+(loobean), or `rf`(floating point) into a `++dime`.
442
561
443Accepts
562Accepts
444-------
563-------
@@ -461,17 +580,17 @@ Source
461Examples
580Examples
462--------
581--------
463
582
464− ~zod/try=> (scan "127.0.0.1" zust:so)
583+ > (scan "127.0.0.1" zust:so)
465 [%if q=2.130.706.433]
584 [%if q=2.130.706.433]
466− ~zod/try=> (scan "af.0.0.0.0.e7a5.30d2.7" zust:so)
585+ > (scan "af.0.0.0.0.e7a5.30d2.7" zust:so)
467 [%is q=908.651.950.243.594.834.993.091.554.288.205.831]
586 [%is q=908.651.950.243.594.834.993.091.554.288.205.831]
468− ~zod/try=> (,[%is @is] (scan "af.0.0.0.0.e7a5.30d2.7" zust:so))
587+ > (,[%is @is] (scan "af.0.0.0.0.e7a5.30d2.7" zust:so))
469 [%is .af.0.0.0.0.e7a5.30d2.7]
588 [%is .af.0.0.0.0.e7a5.30d2.7]
470− ~zod/try=> (,[%is @ux] (scan "af.0.0.0.0.e7a5.30d2.7" zust:so))
589+ > (,[%is @ux] (scan "af.0.0.0.0.e7a5.30d2.7" zust:so))
471 [%is 0xaf.0000.0000.0000.0000.e7a5.30d2.0007]
590 [%is 0xaf.0000.0000.0000.0000.e7a5.30d2.0007]
472− ~zod/try=> (scan "y" zust:so)
591+ > (scan "y" zust:so)
473 [%f %.y]
592 [%f %.y]
474− ~zod/try=> (scan "12.09" zust:so)
593+ > (scan "12.09" zust:so)
475 [%rd .~12.00999999999999]
594 [%rd .~12.00999999999999]
476
595
477
596
docs/system/hoon/library/4m.md+104−98
@@ -11,31 +11,31 @@ Accepts
11Produces
11Produces
12--------
12--------
13
13
14−`mol` is a [`++dime`]().
14+`mol` is a `++dime`.
15
15
16Source
16Source
17------
17------
18
18
19− ++ scot |=(mol=dime ~(rent co %$ mol))
19+ ++ scot |=(mol/dime ~(rent co %$ mol))
20
20
21Examples
21Examples
22--------
22--------
23
23
24− ~zod/try=> (scot %p ~pillyt)
24+ > (scot %p ~pillyt)
25 ~.~pillyt
25 ~.~pillyt
26− ~zod/try=> `@t`(scot %p ~pillyt)
26+ > `@t`(scot %p ~pillyt)
27 '~pillyt'
27 '~pillyt'
28− ~zod/try=> (scot %ux 0x12)
28+ > (scot %ux 0x12)
29 ~.0x12
29 ~.0x12
30− ~zod/try=> `@t`(scot %ux 0x12)
30+ > `@t`(scot %ux 0x12)
31 '0x12'
31 '0x12'
32− ~zod/try=> (scot %if .127.0.0.1)
32+ > (scot %if .127.0.0.1)
33 ~..127.0.0.1
33 ~..127.0.0.1
34− ~zod/try=> `@t`(scot %if .127.0.0.1)
34+ > `@t`(scot %if .127.0.0.1)
35 '.127.0.0.1'
35 '.127.0.0.1'
36− ~zod/try=> (scot %ta ~.asd_a)
36+ > (scot %ta ~.asd_a)
37 ~.~.asd_a
37 ~.~.asd_a
38− ~zod/try=> `@t`(scot %ta ~.asd_a)
38+ > `@t`(scot %ta ~.asd_a)
39 '~.asd_a'
39 '~.asd_a'
40
40
41
41
@@ -53,23 +53,23 @@ Accepts
53Produces
53Produces
54--------
54--------
55
55
56−`mol` is a [`++dime`]().
56+`mol` is a `++dime`.
57
57
58Source
58Source
59------
59------
60
60
61− ++ scow |=(mol=dime ~(rend co %$ mol))
61+ ++ scow |=(mol/dime ~(rend co %$ mol))
62
62
63Examples
63Examples
64--------
64--------
65
65
66− ~zod/try=> (scow %p ~pillyt)
66+ > (scow %p ~pillyt)
67 "~pillyt"
67 "~pillyt"
68− ~zod/try=> (scow %ux 0x12)
68+ > (scow %ux 0x12)
69 "0x12"
69 "0x12"
70− ~zod/try=> (scow %if .127.0.0.1)
70+ > (scow %if .127.0.0.1)
71 ".127.0.0.1"
71 ".127.0.0.1"
72− ~zod/try=> (scow %ta ~.asd_a)
72+ > (scow %ta ~.asd_a)
73 "~.asd_a"
73 "~.asd_a"
74
74
75
75
@@ -79,7 +79,7 @@ Examples
79
79
80Curried slaw
80Curried slaw
81
81
82−Produces a [`gate`]() that parses a [`term`]() `txt` to an atom of the
82+Produces a `gate` that parses a `term` `txt` to an atom of the
83odor specified by `mod`.
83odor specified by `mod`.
84
84
85Accepts
85Accepts
@@ -88,25 +88,25 @@ Accepts
88Produces
88Produces
89--------
89--------
90
90
91−`mod` is a term, an atom of odor [`@tas`]().
91+`mod` is a term, an atom of odor `@tas`.
92
92
93−`txt` is a span, an atom of odor [`@ta`]().
93+`txt` is a span, an atom of odor `@ta`.
94
94
95Source
95Source
96------
96------
97
97
98− ++ slat |=(mod=@tas |=(txt=@ta (slaw mod txt)))
98+ ++ slat |=(mod/@tas |=(txt/@ta (slaw mod txt)))
99
99
100Examples
100Examples
101--------
101--------
102
102
103− ~zod/try=> `(unit ,@p)`((slat %p) '~pillyt')
103+ > `(unit @p)`((slat %p) '~pillyt')
104 [~ ~pillyt]
104 [~ ~pillyt]
105− ~zod/try=> `(unit ,@ux)`((slat %ux) '0x12')
105+ > `(unit @ux)`((slat %ux) '0x12')
106 [~ 0x12]
106 [~ 0x12]
107− ~zod/try=> `(unit ,@if)`((slat %if) '.127.0.0.1')
107+ > `(unit @if)`((slat %if) '.127.0.0.1')
108 [~ .127.0.0.1]
108 [~ .127.0.0.1]
109− ~zod/try=> `(unit ,@ta)`((slat %ta) '~.asd_a')
109+ > `(unit @ta)`((slat %ta) '~.asd_a')
110 [~ ~.asd_a
110 [~ ~.asd_a
111
111
112
112
@@ -125,33 +125,33 @@ Accepts
125Produces
125Produces
126--------
126--------
127
127
128−`mod` is a term, an atom of odor [`@tas`]().
128+`mod` is a term, an atom of odor `@tas`.
129
129
130−`txt` is a span, an atom of odor [`@ta`]().
130+`txt` is a span, an atom of odor `@ta`.
131
131
132Source
132Source
133------
133------
134
134
135− ++ slav |=([mod=@tas txt=@ta] (need (slaw mod txt)))
135+ ++ slav |=([mod/@tas txt/@ta] (need (slaw mod txt)))
136
136
137Examples
137Examples
138--------
138--------
139
139
140− ~zod/try=> `@p`(slav %p '~pillyt')
140+ > `@p`(slav %p '~pillyt')
141 ~pillyt
141 ~pillyt
142− ~zod/try=> `@p`(slav %p '~pillam')
142+ > `@p`(slav %p '~pillam')
143 ! exit
143 ! exit
144− ~zod/try=> `@ux`(slav %ux '0x12')
144+ > `@ux`(slav %ux '0x12')
145 0x12
145 0x12
146− ~zod/try=> `@ux`(slav %ux '0b10')
146+ > `@ux`(slav %ux '0b10')
147 ! exit
147 ! exit
148− ~zod/try=> `@if`(slav %if '.127.0.0.1')
148+ > `@if`(slav %if '.127.0.0.1')
149 .127.0.0.1
149 .127.0.0.1
150− ~zod/try=> `@if`(slav %if '.fe80.0.0.202')
150+ > `@if`(slav %if '.fe80.0.0.202')
151 ! exit
151 ! exit
152− ~zod/try=> `@ta`(slav %ta '~.asd_a')
152+ > `@ta`(slav %ta '~.asd_a')
153 ~.asd_a
153 ~.asd_a
154− ~zod/try=> `@ta`(slav %ta '~~asd-a')
154+ > `@ta`(slav %ta '~~asd-a')
155 ! exit
155 ! exit
156
156
157
157
@@ -169,38 +169,39 @@ Accepts
169Produces
169Produces
170--------
170--------
171
171
172−`mod` is a term, an atom of odor [`@tas`]().
172+`mod` is a term, an atom of odor `@tas`.
173
173
174−`txt` is a span, an atom of odor [`@ta`]().
174+`txt` is a span, an atom of odor `@ta`.
175
175
176Source
176Source
177------
177------
178
178
179 ++ slaw
179 ++ slaw
180+ ~/ %slaw
180− |= [mod=@tas txt=@ta]
181+ |= {mod/@tas txt/@ta}
181− ^- (unit ,@)
182+ ^- (unit @)
182 =+ con=(slay txt)
183 =+ con=(slay txt)
183− ?.(&(?=([~ %$ @ @] con) =(p.p.u.con mod)) ~ [~ q.p.u.con])
184+ ?.(&(?=({$~ $$ @ @} con) =(p.p.u.con mod)) ~ [~ q.p.u.con])
184− ::
185+
185
186
186Examples
187Examples
187--------
188--------
188
189
189− ~zod/try=> `(unit ,@p)`(slaw %p '~pillyt')
190+ > `(unit @p)`(slaw %p '~pillyt')
190 [~ ~pillyt]
191 [~ ~pillyt]
191− ~zod/try=> `(unit ,@p)`(slaw %p '~pillam')
192+ > `(unit @p)`(slaw %p '~pillam')
192 ~
193 ~
193− ~zod/try=> `(unit ,@ux)`(slaw %ux '0x12')
194+ > `(unit @ux)`(slaw %ux '0x12')
194 [~ 0x12]
195 [~ 0x12]
195− ~zod/try=> `(unit ,@ux)`(slaw %ux '0b10')
196+ > `(unit @ux)`(slaw %ux '0b10')
196 ~
197 ~
197− ~zod/try=> `(unit ,@if)`(slaw %if '.127.0.0.1')
198+ > `(unit @if)`(slaw %if '.127.0.0.1')
198 [~ .127.0.0.1]
199 [~ .127.0.0.1]
199− ~zod/try=> `(unit ,@if)`(slaw %if '.fe80.0.0.202')
200+ > `(unit @if)`(slaw %if '.fe80.0.0.202')
200 ~
201 ~
201− ~zod/try=> `(unit ,@ta)`(slaw %ta '~.asd_a')
202+ > `(unit @ta)`(slaw %ta '~.asd_a')
202 [~ ~.asd_a]
203 [~ ~.asd_a]
203− ~zod/try=> `(unit ,@ta)`(slaw %ta '~~asd-a')
204+ > `(unit @ta)`(slaw %ta '~~asd-a')
204 ~
205 ~
205
206
206
207
@@ -210,7 +211,7 @@ Examples
210
211
211Parse span to coin
212Parse span to coin
212
213
213−Parses a span `txt` to the unit of a [`++coin`]().
214+Parses a span `txt` to the unit of a `++coin`.
214
215
215Accepts
216Accepts
216-------
217-------
@@ -218,45 +219,49 @@ Accepts
218Produces
219Produces
219--------
220--------
220
221
221−`txt` is a [`@ta`]().
222+`txt` is a `@ta`.
222
223
223Source
224Source
224------
225------
225
226
226− ++ slay
227+ ++ slay
227− |= txt=@ta ^- (unit coin)
228+ |= txt/@ta ^- (unit coin)
229+ =+ ^= vex
230+ ?: (gth 0x7fff.ffff txt) :: XX petty cache
228− =+ vex=((full nuck:so) [[1 1] (trip txt)])
231+ ~+ ((full nuck:so) [[1 1] (trip txt)])
232+ ((full nuck:so) [[1 1] (trip txt)])
229− ?~ q.vex
233+ ?~ q.vex
230− ~
234+ ~
231− [~ p.u.q.vex]
235+ [~ p.u.q.vex]
232− ::
236+ ::
237+
233
238
234Examples
239Examples
235--------
240--------
236
241
237− ~zod/try=> (slay '~pillyt')
242+ > (slay '~pillyt')
238 [~ [% p=[p=~.p q=32.819]]]
243 [~ [% p=[p=~.p q=32.819]]]
239− ~zod/try=> (slay '0x12')
244+ > (slay '0x12')
240 [~ [% p=[p=~.ux q=18]]]
245 [~ [% p=[p=~.ux q=18]]]
241− ~zod/try=> (slay '.127.0.0.1')
246+ > (slay '.127.0.0.1')
242 [~ [% p=[p=~.if q=2.130.706.433]]]
247 [~ [% p=[p=~.if q=2.130.706.433]]]
243− ~zod/try=> `@ud`.127.0.0.1
248+ > `@ud`.127.0.0.1
244 2.130.706.433
249 2.130.706.433
245− ~zod/try=> (slay '._20_0w25_sam__')
250+ > (slay '._20_0w25_sam__')
246 [ ~
251 [ ~
247 [ %many
252 [ %many
248 p=~[[% p=[p=~.ud q=20]] [% p=[p=~.uw q=133]] [% p=[p=~.tas q=7.168.371]]]
253 p=~[[% p=[p=~.ud q=20]] [% p=[p=~.uw q=133]] [% p=[p=~.tas q=7.168.371]]]
249 ]
254 ]
250 ]
255 ]
251− ~zod/try=> `@`%sam
256+ > `@`%sam
252 7.168.371
257 7.168.371
253− ~zod/try=> (slay '~0ph')
258+ > (slay '~0ph')
254 [~ [%blob p=[1 1]]]
259 [~ [%blob p=[1 1]]]
255− ~zod/try=> 0ph
260+ > 0ph
256 ~ <syntax error at [1 2]>
261 ~ <syntax error at [1 2]>
257− ~zod/try=> ~0ph
262+ > ~0ph
258 [1 1]
263 [1 1]
259− ~zod/try=> `@uv`(jam [1 1])
264+ > `@uv`(jam [1 1])
260 0vph
265 0vph
261
266
262
267
@@ -266,7 +271,7 @@ Examples
266
271
267Render path as tank
272Render path as tank
268
273
269−Renders the path `bon` as a [`tank`](), which is used for
274+Renders the path `bon` as a `tank`, which is used for
270pretty-printing.
275pretty-printing.
271
276
272Accepts
277Accepts
@@ -275,21 +280,21 @@ Accepts
275Produces
280Produces
276--------
281--------
277
282
278−`bon` is a [`++path`]().
283+`bon` is a `++path`.
279
284
280Source
285Source
281------
286------
282
287
283− ++ smyt
288+ ++ smyt :: pretty print path
284− |= bon=path ^- tank
289+ |= bon/path ^- tank
285− :+ %rose [['/' ~] ['/' ~] ['/' ~]]
290+ :+ %rose [['/' ~] ['/' ~] ~]
286− |- ^- (list tank)
287− (turn bon |=(a=@ [%leaf (rip 3 a)]))
291+ (turn bon |=(a/@ [%leaf (trip a)]))
292+ ::
288
293
289Examples
294Examples
290--------
295--------
291
296
292− ~zod/try=> (smyt %)
297+ > (smyt %)
293 [ %rose
298 [ %rose
294 p=[p="/" q="/" r="/"]
299 p=[p="/" q="/" r="/"]
295 q
300 q
@@ -298,7 +303,7 @@ Examples
298 [%leaf p="~2014.10.28..18.36.58..a280"]
303 [%leaf p="~2014.10.28..18.36.58..a280"]
299 ]
304 ]
300 ]
305 ]
301− ~zod/try=> (smyt /as/les/top)
306+ > (smyt /as/les/top)
302 [ %rose
307 [ %rose
303 p=[p="/" q="/" r="/"]
308 p=[p="/" q="/" r="/"]
304 q=~[[%leaf p="as"] [%leaf p="les"] [%leaf p="top"]]
309 q=~[[%leaf p="as"] [%leaf p="les"] [%leaf p="top"]]
@@ -319,21 +324,21 @@ Accepts
319Produces
324Produces
320--------
325--------
321
326
322−`pax` is a [`path`]().
327+`pax` is a `path`.
323
328
324Source
329Source
325------
330------
326
331
327− ++ spat |=(pax=path (crip (spud pax))) :: path to cord
332+ ++ spat |=(pax/path (crip (spud pax))) :: path to cord
328
333
329Examples
334Examples
330--------
335--------
331
336
332− ~zod/try=> (spat %)
337+ > (spat %)
333 '~zod/try/~2014.10.28..18.40.20..4287'
338 '~zod/try/~2014.10.28..18.40.20..4287'
334− ~zod/try=> (spat %/bin)
339+ > (spat %/bin)
335 '~zod/try/~2014.10.28..18.41.12..3bcd/bin'
340 '~zod/try/~2014.10.28..18.41.12..3bcd/bin'
336− ~zod/try=> (spat /as/les/top)
341+ > (spat /as/les/top)
337 '/as/les/top'
342 '/as/les/top'
338
343
339
344
@@ -343,7 +348,7 @@ Examples
343
348
344Render path as tape
349Render path as tape
345
350
346−Renders a path `pax` as [tape]().
351+Renders a path `pax` as tape.
347
352
348Accepts
353Accepts
349-------
354-------
@@ -351,21 +356,21 @@ Accepts
351Produces
356Produces
352--------
357--------
353
358
354−`pax` is a [`path`]().
359+`pax` is a `path`.
355
360
356Source
361Source
357------
362------
358
363
359− ++ spud |=(pax=path ~(ram re (smyt pax))) :: path to tape
364+ ++ spud |=(pax/path ~(ram re (smyt pax))) :: path to tape
360
365
361Examples
366Examples
362--------
367--------
363
368
364− ~zod/try=> (spud %)
369+ > (spud %)
365 "~zod/try/~2014.10.28..18.40.46..e951"
370 "~zod/try/~2014.10.28..18.40.46..e951"
366− ~zod/try=> (spud %/bin)
371+ > (spud %/bin)
367 "~zod/try/~2014.10.28..18.41.05..16f2/bin"
372 "~zod/try/~2014.10.28..18.41.05..16f2/bin"
368− ~zod/try=> (spud /as/les/top)
373+ > (spud /as/les/top)
369 "/as/les/top"
374 "/as/les/top"
370
375
371
376
@@ -375,7 +380,7 @@ Examples
375
380
376Parse span to path
381Parse span to path
377
382
378−Parsing rule. Parses a span `zep` to a static [`++path`](/doc/hoon/library/1#++path).
383+Parsing rule. Parses a span `zep` to a static `++path`.
379
384
380Accepts
385Accepts
381-------
386-------
@@ -386,24 +391,25 @@ Produces
386Source
391Source
387------
392------
388
393
389− ++ stab :: parse span to path
394+ ++ stab :: parse cord to path
390− |= zep=@ta ^- path
391− (rash zep ;~(pfix fas ;~(sfix (more fas urs:ab) fas)))
395+ =+ fel=;~(pfix fas (more fas urs:ab))
396+ |=(zep/@t `path`(rash zep fel))
397+
392
398
393Examples
399Examples
394--------
400--------
395
401
396− ~zod/try=> (stab '/as/lek/tor')
402+ > (stab '/as/lek/tor')
397 /as/lek/tor
403 /as/lek/tor
398− ~zod/try=> `(pole ,@ta)`(stab '/as/lek/tor')
404+ > `(pole ,@ta)`(stab '/as/lek/tor')
399 [~.as [~.lek [~.tor ~]]]
405 [~.as [~.lek [~.tor ~]]]
400− ~zod/try=> (stab '~zod/arvo/~2014.10.28..18.48.41..335f/zuse')
406+ > (stab '~zod/arvo/~2014.10.28..18.48.41..335f/zuse')
401 ~zod/arvo/~2014.10.28..18.48.41..335f/zuse
407 ~zod/arvo/~2014.10.28..18.48.41..335f/zuse
402− ~zod/try=> `(pole ,@ta)`(stab '~zod/arvo/~2014.10.28..18.48.41..335f/zuse')
408+ > `(pole ,@ta)`(stab '~zod/arvo/~2014.10.28..18.48.41..335f/zuse')
403 [~.~zod [~.arvo [~.~2014.10.28..18.48.41..335f [~.zuse ~]]]]
409 [~.~zod [~.arvo [~.~2014.10.28..18.48.41..335f [~.zuse ~]]]]
404− ~zod/try=> (stab '/a/~pillyt/pals/1')
410+ > (stab '/a/~pillyt/pals/1')
405 /a/~pillyt/pals/1
411 /a/~pillyt/pals/1
406− ~zod/try=> `(pole ,@ta)`(stab '/a/~pillyt/pals/1')
412+ > `(pole ,@ta)`(stab '/a/~pillyt/pals/1')
407 [~.a [~.~pillyt [~.pals [~.1 ~]]]]
413 [~.a [~.~pillyt [~.pals [~.1 ~]]]]
408
414
409
415
docs/system/hoon/library/4n.md+133−150
@@ -3,14 +3,14 @@
3
3
4Nock subject to unit
4Nock subject to unit
5
5
6−Accepts a nock subject-formula cell and wraps it into a [`++unit`]().
6+Accepts a nock subject-formula cell and wraps it into a `++unit`.
7`fol` is pure nock, meaning that nock `11` operations result in a block,
7`fol` is pure nock, meaning that nock `11` operations result in a block,
8producing a `~`.
8producing a `~`.
9
9
10Accepts
10Accepts
11-------
11-------
12
12
13−`sub` is a subject [noun]().
13+`sub` is a subject noun.
14
14
15`fol` is a formula noun, which is generally a `++nock`.
15`fol` is a formula noun, which is generally a `++nock`.
16
16
@@ -23,24 +23,25 @@ Source
23------
23------
24
24
25 ++ mack
25 ++ mack
26− |= [sub=* fol=*]
26+ |= {sub/* fol/*}
27 ^- (unit)
27 ^- (unit)
28− =+ ton=(mink [sub fol] |=(* ~))
28+ =+ ton=(mink [sub fol] |=({* *} ~))
29− ?.(?=([0 *] ton) ~ [~ p.ton])
29+ ?.(?=({$0 *} ton) ~ [~ p.ton])
30 ::
30 ::
31
31
32+
32Examples
33Examples
33--------
34--------
34
35
35− ~zod/try=> (mack [[1 2 3] [0 1]])
36+ > (mack [[1 2 3] [0 1]])
36 [~ [1 2 3]]
37 [~ [1 2 3]]
37− ~zod/try=> (mack [41 4 0 1])
38+ > (mack [41 4 0 1])
38 [~ 42]
39 [~ 42]
39− ~zod/try=> (mack [4 0 4])
40+ > (mack [4 0 4])
40 ~
41 ~
41− ~zod/try=> (mack [[[0 2] [1 3]] 4 4 4 4 0 5])
42+ > (mack [[[0 2] [1 3]] 4 4 4 4 0 5])
42 [~ 6]
43 [~ 6]
43− ~zod/try=> ;;((unit ,@tas) (mack [[1 %yes %no] 6 [0 2] [0 6] 0 7]))
44+ > ;;((unit @tas) (mack [[1 %yes %no] 6 [0 2] [0 6] 0 7]))
44 [~ %no]
45 [~ %no]
45
46
46
47
@@ -50,19 +51,19 @@ Examples
50
51
51Mock interpreter
52Mock interpreter
52
53
53−Bottom-level [mock]() (virtual nock) interpreter. Produces a
54+Bottom-level mock (virtual nock) interpreter. Produces a
54−[`++tone`](), a nock computation result. If nock 11 is invoked, `sky`
55+`++tone`, a nock computation result. If nock 11 is invoked, `sky`
55−computes on the subject and produces a [`++unit`]() result. An empty
56+computes on the subject and produces a `++unit` result. An empty
56result becomes a `%1` `++tone`, indicating a block.
57result becomes a `%1` `++tone`, indicating a block.
57
58
58Accepts
59Accepts
59-------
60-------
60
61
61−`sub` is the subject as a [noun]().
62+`sub` is the subject as a noun.
62
63
63`fol` is the formula as a noun.
64`fol` is the formula as a noun.
64
65
65−`sky` is an [`%iron`]() gate invoked with [nock operator 11]().
66+`sky` is an `%iron` gate invoked with nock operator 11.
66
67
67Produces
68Produces
68--------
69--------
@@ -74,98 +75,100 @@ Source
74
75
75 ++ mink
76 ++ mink
76 ~/ %mink
77 ~/ %mink
77− |= [[sub=* fol=*] sky=$+(* (unit))]
78+ |= {{sub/* fol/*} gul/$-({* *} (unit (unit)))}
78− =+ tax=*(list ,[@ta *])
79+ =+ tax=*(list {@ta *})
79 |- ^- tone
80 |- ^- tone
80 ?@ fol
81 ?@ fol
81 [%2 tax]
82 [%2 tax]
82 ?: ?=(^ -.fol)
83 ?: ?=(^ -.fol)
83 =+ hed=$(fol -.fol)
84 =+ hed=$(fol -.fol)
84− ?: ?=(%2 -.hed)
85+ ?: ?=($2 -.hed)
85 hed
86 hed
86 =+ tal=$(fol +.fol)
87 =+ tal=$(fol +.fol)
87 ?- -.tal
88 ?- -.tal
88− %0 ?-(-.hed %0 [%0 p.hed p.tal], %1 hed)
89+ $0 ?-(-.hed $0 [%0 p.hed p.tal], $1 hed)
89− %1 ?-(-.hed %0 tal, %1 [%1 (weld p.hed p.tal)])
90+ $1 ?-(-.hed $0 tal, $1 [%1 (weld p.hed p.tal)])
90− %2 tal
91+ $2 tal
91 ==
92 ==
92 ?+ fol
93 ?+ fol
93 [%2 tax]
94 [%2 tax]
94 ::
95 ::
95− [0 b=@]
96+ {$0 b/@}
96 ?: =(0 b.fol) [%2 tax]
97 ?: =(0 b.fol) [%2 tax]
97 ?: =(1 b.fol) [%0 sub]
98 ?: =(1 b.fol) [%0 sub]
98 ?: ?=(@ sub) [%2 tax]
99 ?: ?=(@ sub) [%2 tax]
99 =+ [now=(cap b.fol) lat=(mas b.fol)]
100 =+ [now=(cap b.fol) lat=(mas b.fol)]
100 $(b.fol lat, sub ?:(=(2 now) -.sub +.sub))
101 $(b.fol lat, sub ?:(=(2 now) -.sub +.sub))
101 ::
102 ::
102− [1 b=*]
103+ {$1 b/*}
103 [%0 b.fol]
104 [%0 b.fol]
104 ::
105 ::
105− [2 b=[^ *]]
106+ {$2 b/{^ *}}
106 =+ ben=$(fol b.fol)
107 =+ ben=$(fol b.fol)
107− ?. ?=(%0 -.ben) ben
108+ ?. ?=($0 -.ben) ben
108 ?>(?=(^ p.ben) $(sub -.p.ben, fol +.p.ben))
109 ?>(?=(^ p.ben) $(sub -.p.ben, fol +.p.ben))
109 ::?>(?=(^ p.ben) $([sub fol] p.ben)
110 ::?>(?=(^ p.ben) $([sub fol] p.ben)
110 ::
111 ::
111− [3 b=*]
112+ {$3 b/*}
112 =+ ben=$(fol b.fol)
113 =+ ben=$(fol b.fol)
113− ?. ?=(%0 -.ben) ben
114+ ?. ?=($0 -.ben) ben
114 [%0 .?(p.ben)]
115 [%0 .?(p.ben)]
115 ::
116 ::
116− [4 b=*]
117+ {$4 b/*}
117 =+ ben=$(fol b.fol)
118 =+ ben=$(fol b.fol)
118− ?. ?=(%0 -.ben) ben
119+ ?. ?=($0 -.ben) ben
119 ?. ?=(@ p.ben) [%2 tax]
120 ?. ?=(@ p.ben) [%2 tax]
120 [%0 .+(p.ben)]
121 [%0 .+(p.ben)]
121 ::
122 ::
122− [5 b=*]
123+ {$5 b/*}
123 =+ ben=$(fol b.fol)
124 =+ ben=$(fol b.fol)
124− ?. ?=(%0 -.ben) ben
125+ ?. ?=($0 -.ben) ben
125 ?. ?=(^ p.ben) [%2 tax]
126 ?. ?=(^ p.ben) [%2 tax]
126 [%0 =(-.p.ben +.p.ben)]
127 [%0 =(-.p.ben +.p.ben)]
127 ::
128 ::
128− [6 b=* c=* d=*]
129+ {$6 b/* c/* d/*}
129 $(fol =>(fol [2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]))
130 $(fol =>(fol [2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]))
130 ::
131 ::
131− [7 b=* c=*] $(fol =>(fol [2 b 1 c]))
132+ {$7 b/* c/*} $(fol =>(fol [2 b 1 c]))
132− [8 b=* c=*] $(fol =>(fol [7 [[0 1] b] c]))
133+ {$8 b/* c/*} $(fol =>(fol [7 [[0 1] b] c]))
133− [9 b=* c=*] $(fol =>(fol [7 c 0 b]))
134+ {$9 b/* c/*} $(fol =>(fol [7 c 0 b]))
134− [10 @ c=*] $(fol c.fol)
135+ {$10 @ c/*} $(fol c.fol)
135− [10 [b=* c=*] d=*]
136+ {$10 {b/* c/*} d/*}
136 =+ ben=$(fol c.fol)
137 =+ ben=$(fol c.fol)
137− ?. ?=(%0 -.ben) ben
138+ ?. ?=($0 -.ben) ben
138− ?: ?=(?(%hunk %lose %mean %spot) b.fol)
139+ ?: ?=(?($hunk $hand $lose $mean $spot) b.fol)
139 $(fol d.fol, tax [[b.fol p.ben] tax])
140 $(fol d.fol, tax [[b.fol p.ben] tax])
140 $(fol d.fol)
141 $(fol d.fol)
141 ::
142 ::
142− [11 b=*]
143+ {$11 b/* c/*}
144+ =+ ref=$(fol b.fol)
143− =+ ben=$(fol b.fol)
145+ =+ ben=$(fol c.fol)
146+ ?. ?=($0 -.ref) ref
144− ?. ?=(%0 -.ben) ben
147+ ?. ?=($0 -.ben) ben
145− =+ val=(sky p.ben)
148+ =+ val=(gul p.ref p.ben)
146− ?~(val [%1 p.ben ~] [%0 u.val])
149+ ?~(val [%1 p.ben ~] ?~(u.val [%2 [[%hunk (mush p.ben)] tax]] [%0 u.u.val]))
147− ::
148 ==
150 ==
149 ::
151 ::
150
152
153+
151Examples
154Examples
152--------
155--------
153
156
154− ~zod/try=> (mink [20 [4 0 1]] ,~)
157+ > (mink [20 [4 0 1]] $~)
155 [%0 p=21]
158 [%0 p=21]
156− ~zod/try=> (mink [[90 5 3] [0 3]] ,~)
159+ > (mink [[90 5 3] [0 3]] $~)
157 [%0 p=[5 3]]
160 [%0 p=[5 3]]
158− ~zod/try=> (mink 20^[4 0 1] ,~)
161+ > (mink 20^[4 0 1] $~)
159 [%0 p=21]
162 [%0 p=21]
160− ~zod/try=> (mink [90 5 3]^[0 3] ,~)
163+ > (mink [90 5 3]^[0 3] $~)
161 [%0 p=[5 3]]
164 [%0 p=[5 3]]
162− ~zod/try=> (mink [0]^[11 1 20] ,~)
165+ > (mink [0]^[11 1 20] $~)
163 [%1 p=~[20]]
166 [%1 p=~[20]]
164− ~zod/try=> (mink [0]^[11 1 20] |=(a=* `[40 a]))
167+ > (mink [0]^[11 1 20] |=(a=* `[40 a]))
165 [%0 p=[40 20]]
168 [%0 p=[40 20]]
166− ~zod/try=> (mink [5]^[0 2] ,~)
169+ > (mink [5]^[0 2] $~)
167 [%2 p=~]
170 [%2 p=~]
168− ~zod/try=> (mink [5]^[10 yelp/[0 1] 0 0] ,~)
171+ > (mink [5]^[10 yelp/[0 1] 0 0] $~)
169 [%2 p=~[[~.yelp 5]]]
172 [%2 p=~[[~.yelp 5]]]
170
173
171
174
@@ -174,19 +177,19 @@ Examples
174
177
175Compute formula on subject with hint
178Compute formula on subject with hint
176
179
177−Produces a [`++toon`](), which is either a sucessful, blocked, or
180+Produces a `++toon`, which is either a sucessful, blocked, or
178crashed result. If nock 11 is invoked, `sky` computes on the subject and
181crashed result. If nock 11 is invoked, `sky` computes on the subject and
179−produces a [`++unit`]() result. An empty result becomes a `%1` `++tune`,
182+produces a `++unit` result. An empty result becomes a `%1` `++tune`,
180indicating a block.
183indicating a block.
181
184
182Accepts
185Accepts
183-------
186-------
184
187
185−`sub` is the subject as a [noun]().
188+`sub` is the subject as a noun.
186
189
187`fol` is the formula as a noun.
190`fol` is the formula as a noun.
188
191
189−`sky` is an [%iron]() gate invoked with [nock operator 11]().
192+`sky` is an %iron gate invoked with nock operator 11.
190
193
191Produces
194Produces
192--------
195--------
@@ -197,26 +200,27 @@ Source
197------
200------
198
201
199 ++ mock
202 ++ mock
200− |= [[sub=* fol=*] sky=$+(* (unit))]
203+ |= {{sub/* fol/*} gul/$-({* *} (unit (unit)))}
201− (mook (mink [sub fol] sky))
204+ (mook (mink [sub fol] gul))
202 ::
205 ::
203
206
207+
204Examples
208Examples
205--------
209--------
206
210
207− ~zod/try=> (mock [5 4 0 1] ,~)
211+ > (mock [5 4 0 1] ,~)
208 [%0 p=6]
212 [%0 p=6]
209− ~zod/try=> (mock [~ 11 1 0] |=(* `999))
213+ > (mock [~ 11 1 0] |=(* `999))
210 [%0 p=999]
214 [%0 p=999]
211− ~zod/try=> (mock [~ 0 1.337] ,~)
215+ > (mock [~ 0 1.337] ,~)
212 [%2 p=~]
216 [%2 p=~]
213− ~zod/try=> (mock [~ 11 1 1.337] ,~)
217+ > (mock [~ 11 1 1.337] ,~)
214 [%1 p=~[1.337]]
218 [%1 p=~[1.337]]
215− ~zod/try=> (mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[+<]))
219+ > (mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[+<]))
216 [%0 p=14]
220 [%0 p=14]
217− ~zod/try=> (mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[<+<>]))
221+ > (mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[<+<>]))
218 [%0 p=[49 52 0]]
222 [%0 p=[49 52 0]]
219− ~zod/try=> ;;(tape +:(mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[<+<>])))
223+ > ;;(tape +:(mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[<+<>])))
220 "14"
224 "14"
221
225
222
226
@@ -226,17 +230,17 @@ Examples
226
230
227Slam gate with sample
231Slam gate with sample
228
232
229−Produces a [`++toon`]() computation result from slamming `gat` with
233+Produces a `++toon` computation result from slamming `gat` with
230`sam`, using `sky` to compute or block on nock 11 when applicable.
234`sam`, using `sky` to compute or block on nock 11 when applicable.
231
235
232Accepts
236Accepts
233-------
237-------
234
238
235−`gat` is a [noun]() that is generally a [`gate`]().
239+`gat` is a noun that is generally a `gate`.
236
240
237−`sam` is a [`sample`]() noun.
241+`sam` is a `sample` noun.
238
242
239−`sky` is an [%iron]() gate invoked with [nock operator 11]().
243+`sky` is an %iron gate invoked with nock operator 11.
240
244
241Produces
245Produces
242--------
246--------
@@ -247,33 +251,33 @@ Source
247------
251------
248
252
249 ++ mong
253 ++ mong
250− |= [[gat=* sam=*] sky=$+(* (unit))]
254+ |= {{gat/* sam/*} gul/$-({* *} (unit (unit)))}
251 ^- toon
255 ^- toon
252 ?. &(?=(^ gat) ?=(^ +.gat))
256 ?. &(?=(^ gat) ?=(^ +.gat))
253 [%2 ~]
257 [%2 ~]
254− (mock [[-.gat [sam +>.gat]] -.gat] sky)
258+ (mock [[-.gat [sam +>.gat]] -.gat] gul)
255 ::
259 ::
256
260
257Examples
261Examples
258--------
262--------
259
263
260− ~zod/try=> (mong [|=(@ 20) ~] ,~)
264+ > (mong [|=(@ 20) ~] ,~)
261 [%0 p=20]
265 [%0 p=20]
262− ~zod/try=> (mong [|=(@ !!) ~] ,~)
266+ > (mong [|=(@ !!) ~] ,~)
263 [%2 p=~]
267 [%2 p=~]
264− ~zod/try=> (mong [|=(a=@ (add 20 a)) ~] ,~)
268+ > (mong [|=(a/@ (add 20 a)) ~] ,~)
265 [%0 p=20]
269 [%0 p=20]
266− ~zod/try=> (mong [|=(a=[@ @] (add 20 -.a)) ~] ,~)
270+ > (mong [|=(a/[@ @] (add 20 -.a)) ~] ,~)
267 [%2 p=~]
271 [%2 p=~]
268− ~zod/try=> (mong [|=(a=[@ @] (add 20 -.a)) [4 6]] ,~)
272+ > (mong [|=(a/[@ @] (add 20 -.a)) [4 6]] ,~)
269 [%0 p=24]
273 [%0 p=24]
270− ~zod/try=> (mong [|=(a=@ .^(a)) ~] ,~)
274+ > (mong [|=(a/@ .^(a)) ~] ,~)
271 [%1 p=~[0]]
275 [%1 p=~[0]]
272− ~zod/try=> (mong [|=(a=@ .^(a)) ~] ,[~ %42])
276+ > (mong [|=(a/@ .^(a)) ~] ,[~ %42])
273 [%0 p=42]
277 [%0 p=42]
274− ~zod/try=> (mong [|=(a=@ .^(a)) ~] |=(a=* [~ a 6]))
278+ > (mong [|=(a/@ .^(a)) ~] |=(a/* [~ a 6]))
275 [%0 p=[0 6]]
279 [%0 p=[0 6]]
276− ~zod/try=> (mong [|=(a=@ .^(a)) 8] |=(a=* [~ a 6]))
280+ > (mong [|=(a/@ .^(a)) 8] |=(a/* [~ a 6]))
277 [%0 p=[8 6]]
281 [%0 p=[8 6]]
278
282
279
283
@@ -283,81 +287,70 @@ Examples
283
287
284Intelligently render crash annotation
288Intelligently render crash annotation
285
289
286−Converts a `%2` `++tone` nock stack trace to a list of [`++tank`]().
290+Converts a `%2` `++tone` nock stack trace to a list of `++tank`.
287−Each may be a tank, cord, [`++spot`](), or trapped tank.
291+Each may be a tank, cord, `++spot`, or trapped tank.
288
292
289Accepts
293Accepts
290-------
294-------
291
295
292−`ton` is a [`++tone`]().
296+`ton` is a `++tone`.
293
297
294Produces
298Produces
295--------
299--------
296
300
297−A [`++toon`]().
301+A `++toon`.
298
302
299Source
303Source
300------
304------
301
305
302 ++ mook
306 ++ mook
303− |= ton=tone
307+ |= ton/tone
304 ^- toon
308 ^- toon
305− ?. ?=([2 *] ton) ton
309+ ?. ?=({$2 *} ton) ton
306 :- %2
310 :- %2
311+ :: =. p.ton (moop p.ton)
307 =+ yel=(lent p.ton)
312 =+ yel=(lent p.ton)
308 =. p.ton
313 =. p.ton
309 ?. (gth yel 256) p.ton
314 ?. (gth yel 256) p.ton
310 %+ weld
315 %+ weld
311 (scag 128 p.ton)
316 (scag 128 p.ton)
312− ^- (list ,[@ta *])
317+ ^- (list {@ta *})
313 :_ (slag (sub yel 128) p.ton)
318 :_ (slag (sub yel 128) p.ton)
314 :- %lose
319 :- %lose
315 %+ rap 3
320 %+ rap 3
316− ;: weld
317− "[skipped "
318− ~(rend co %$ %ud (sub yel 256))
321+ "[skipped {(scow %ud (sub yel 256))} frames]"
319− " frames]"
320− ==
321 |- ^- (list tank)
322 |- ^- (list tank)
322 ?~ p.ton ~
323 ?~ p.ton ~
323− =+ rex=$(p.ton t.p.ton)
324+ =+ rep=$(p.ton t.p.ton)
324− ?+ -.i.p.ton rex
325+ ?+ -.i.p.ton rep
325− %hunk [(tank +.i.p.ton) rex]
326+ $hunk [(tank +.i.p.ton) rep]
326− %lose [[%leaf (rip 3 (,@ +.i.p.ton))] rex]
327+ $lose [[%leaf (rip 3 (@ +.i.p.ton))] rep]
328+ $hand [[%leaf (scow %p (mug +.i.p.ton))] rep]
327− %mean :_ rex
329+ $mean :_ rep
328− ?@ +.i.p.ton [%leaf (rip 3 (,@ +.i.p.ton))]
330+ ?@ +.i.p.ton [%leaf (rip 3 (@ +.i.p.ton))]
329 =+ mac=(mack +.i.p.ton +<.i.p.ton)
331 =+ mac=(mack +.i.p.ton +<.i.p.ton)
330 ?~(mac [%leaf "####"] (tank u.mac))
332 ?~(mac [%leaf "####"] (tank u.mac))
331− %spot :_ rex
333+ $spot :_ rep
332 =+ sot=(spot +.i.p.ton)
334 =+ sot=(spot +.i.p.ton)
333− :- %leaf
335+ :+ %rose [":" ~ ~]
334− ;: weld
335− ~(ram re (smyt p.sot))
336+ :~ (smyt p.sot)
336− ":<["
337− ~(rend co ~ %ud p.p.q.sot)
337+ => [ud=|=(a/@u (scow %ud a)) q.sot]
338− " "
338+ leaf+"<[{(ud p.p)} {(ud q.p)}].[{(ud p.q)} {(ud q.q)}]>"
339− ~(rend co ~ %ud q.p.q.sot)
340− "].["
341− ~(rend co ~ %ud p.q.q.sot)
342− " "
343− ~(rend co ~ %ud q.q.q.sot)
344− "]>"
345− ==
346− ==
339+ == ==
347 ::
340 ::
348
341
349Examples
342Examples
350--------
343--------
351
344
352− ~zod/try=> (mook [%0 5 4 5 1])
345+ > (mook [%0 5 4 5 1])
353 [%0 p=[5 4 5 1]]
346 [%0 p=[5 4 5 1]]
354− ~zod/try=> (mook [%2 ~[[%hunk %rose ["<" "," ">"] ~[[%leaf "err"]]]]])
347+ > (mook [%2 ~[[%hunk %rose ["<" "," ">"] ~[[%leaf "err"]]]]])
355 [%2 p=~[[%rose p=[p="<" q="," r=">"] q=[i=[%leaf p="err"] t=~]]]]
348 [%2 p=~[[%rose p=[p="<" q="," r=">"] q=[i=[%leaf p="err"] t=~]]]]
356− ~zod/try=> (mook [%2 ~[[%malformed %elem] [%lose 'do print']]])
349+ > (mook [%2 ~[[%malformed %elem] [%lose 'do print']]])
357 [%2 p=~[[%leaf p="do print"]]]
350 [%2 p=~[[%leaf p="do print"]]]
358− ~zod/try=> (mook [%2 ~[[%mean |.(>(add 5 6)<)]]])
351+ > (mook [%2 ~[[%mean |.(>(add 5 6)<)]]])
359 [%2 p=~[[%leaf p="11"]]]
352 [%2 p=~[[%leaf p="11"]]]
360− ~zod/try=> (mook [%2 ~[[%spot /b/repl [1 1]^[1 2]] [%mean |.(!!)]]])
353+ > (mook [%2 ~[[%spot /b/repl [1 1]^[1 2]] [%mean |.(!!)]]])
361 [%2 p=~[[%leaf p="/b/repl/:<[1 1].[1 2]>"] [%leaf p="####"]]]
354 [%2 p=~[[%leaf p="/b/repl/:<[1 1].[1 2]>"] [%leaf p="####"]]]
362
355
363
356
@@ -367,13 +360,13 @@ Examples
367
360
368Typed virtual
361Typed virtual
369
362
370−Kicks a [`++trap`](), producing its results or any errors that occur along
363+Kicks a `++trap`, producing its results or any errors that occur along
371the way. Used to lazily compute stack traces.
364the way. Used to lazily compute stack traces.
372
365
373Accepts
366Accepts
374-------
367-------
375
368
376−`taq` is a [`++trap`](), generally producing a list of [`++tank`]()s.
369+`taq` is a `++trap`, generally producing a list of `++tank`s.
377
370
378Produces
371Produces
379--------
372--------
@@ -385,22 +378,23 @@ Source
385
378
386 ++ mule :: typed virtual
379 ++ mule :: typed virtual
387 ~/ %mule
380 ~/ %mule
388− |* taq=_|.(_*)
381+ |* taq/_|.(**)
389 =+ mud=(mute taq)
382 =+ mud=(mute taq)
390 ?- -.mud
383 ?- -.mud
391− & [%& p=$:taq]
384+ $& [%& p=$:taq] :: XX transition
392− | [%| p=p.mud]
385+ $| [%| p=p.mud]
393 ==
386 ==
394 ::
387 ::
395
388
389+
396Examples
390Examples
397--------
391--------
398
392
399− ~zod/try=> (mule |.(leaf/"hello"))
393+ > (mule |.(leaf/"hello"))
400 [%.y p=[%leaf "hello"]]
394 [%.y p=[%leaf "hello"]]
401− ~zod/try=> (mule |.(!!))
395+ > (mule |.(!!))
402 [%.n p=~]
396 [%.n p=~]
403− ~zod/try=> (mule |.(.^(a//=pals/1)))
397+ > (mule |.(.^(a//=pals/1)))
404 [ %.n
398 [ %.n
405 p
399 p
406 ~[
400 ~[
@@ -422,50 +416,39 @@ Examples
422Untyped virtual
416Untyped virtual
423
417
424Kicks a `++trap`, producing its result as a noun or the tanks of any
418Kicks a `++trap`, producing its result as a noun or the tanks of any
425−error that occurs. Similar to [`++mule`](), but preserves no type
419+error that occurs. Similar to `++mule`, but preserves no type
426information.
420information.
427
421
428Accepts
422Accepts
429-------
423-------
430
424
431−`taq` is a [`++trap`](/doc/hoon/library/1#++trap).
425+`taq` is a `++trap`.
432−
433Produces
426Produces
434--------
427--------
435
428
436−Either a noun or a [`++list`]() of [`++tank`]().
429+Either a noun or a `++list` of `++tank`.
437
430
438Source
431Source
439------
432------
440
433
441 ++ mute :: untyped virtual
434 ++ mute :: untyped virtual
442− |= taq=_^?(|.(_*))
435+ |= taq/_^?(|.(**))
443− ^- (each ,* (list tank))
436+ ^- (each * (list tank))
444− =+ ton=(mock [taq 9 2 0 1] |=(* ~))
437+ =+ ton=(mock [taq 9 2 0 1] |=({* *} ~))
445 ?- -.ton
438 ?- -.ton
446− %0 [%& p.ton]
439+ $0 [%& p.ton]
447− %1 [%| (turn p.ton |=(a=* (smyt (path a))))]
440+ $1 [%| (turn p.ton |=(a/* (smyt (path a))))]
448− %2 [%| p.ton]
441+ $2 [%| p.ton]
449 ==
442 ==
450
443
444+
451Examples
445Examples
452--------
446--------
453
447
454− ~zod/try=> (mute |.(leaf/"hello"))
448+ > (mute |.(leaf/"hello"))
455 [%.y p=[1.717.658.988 104 101 108 108 111 0]]
449 [%.y p=[1.717.658.988 104 101 108 108 111 0]]
456− ~zod/try=> (mute |.(!!))
450+ > (mute |.(!!))
457 [%.n p=~]
451 [%.n p=~]
458− ~zod/try=> (mute |.(.^(a//=pals/1)))
459− [ %.n
460− p
461− ~[
462− [ %rose
463− p=[p="/" q="/" r="/"]
464− q=[i=[%leaf p="a"] t=[i=[%leaf p="~zod"] t=[i=[%leaf p="pals"] t=[i=[%leaf p="1"] t=~]]]]
465− ]
466− ]
467− ]
468−
469
452
470
453
471***
454***
docs/system/hoon/library/4o.md+60−60
@@ -11,7 +11,7 @@ Source
11Examples
11Examples
12--------
12--------
13
13
14− ~zod/try=> *abel
14+ > *abel
15 %void
15 %void
16
16
17
17
@@ -35,7 +35,7 @@ Examples
35
35
36See also: [`++base`](), [aura reference]()
36See also: [`++base`](), [aura reference]()
37
37
38− ~zod/try=> `aura`%ux
38+ > `aura`%ux
39 ~.ux
39 ~.ux
40
40
41
41
@@ -57,13 +57,13 @@ Source
57Examples
57Examples
58--------
58--------
59
59
60− ~zod/try=> *axis
60+ > *axis
61 0
61 0
62
62
63− ~zod/try=> :: 0 is not actually a valid axis
63+ > :: 0 is not actually a valid axis
64− ~zod/try=> [[4 5] 6 7]
64+ > [[4 5] 6 7]
65 [[4 5] 6 7]
65 [[4 5] 6 7]
66− ~zod/try=> `axis`0b110
66+ > `axis`0b110
67 6
67 6
68
68
69
69
@@ -84,15 +84,15 @@ Source
84Examples
84Examples
85--------
85--------
86
86
87− ~zod/try=> *base
87+ > *base
88 %null
88 %null
89
89
90− ~zod/try=> (ream '=|(^ !!)')
90+ > (ream '=|(^ !!)')
91 [%tsbr p=[%axil p=%cell] q=[%zpzp ~]]
91 [%tsbr p=[%axil p=%cell] q=[%zpzp ~]]
92− ~zod/try=> :: p.p is a ++base
92+ > :: p.p is a ++base
93− ~zod/try=> (ream '=|(@t !!)')
93+ > (ream '=|(@t !!)')
94 [%tsbr p=[%axil p=[%atom p=~.t]] q=[%zpzp ~]]
94 [%tsbr p=[%axil p=[%atom p=~.t]] q=[%zpzp ~]]
95− ~zod/try=> (ream '=|(? !!)')
95+ > (ream '=|(? !!)')
96 [%tsbr p=[%axil p=%bean] q=[%zpzp ~]]
96 [%tsbr p=[%axil p=%bean] q=[%zpzp ~]]
97
97
98
98
@@ -111,12 +111,12 @@ Source
111Examples
111Examples
112--------
112--------
113
113
114− ~zod/try=> *bean
114+ > *bean
115 %.y
115 %.y
116
116
117− ~zod/try=> `bean`&
117+ > `bean`&
118 %.y
118 %.y
119− ~zod/try=> `bean`|
119+ > `bean`|
120 %.n
120 %.n
121
121
122
122
@@ -136,9 +136,9 @@ Source
136Examples
136Examples
137--------
137--------
138
138
139− ~zod/try=> `beer`'as'
139+ > `beer`'as'
140 29.537
140 29.537
141− ~zod/try=> `beer`[~ (ream 'lan')]
141+ > `beer`[~ (ream 'lan')]
142 [~ p=[%cnzz p=~[%lan]]]
142 [~ p=[%cnzz p=~[%lan]]]
143
143
144
144
@@ -185,10 +185,10 @@ Examples
185
185
186XX there's a ++chum in zuse that's politely causing this not to work
186XX there's a ++chum in zuse that's politely causing this not to work
187
187
188− ~zod/try=> `chum`'hi'
188+ > `chum`'hi'
189 lef=%hi
189 lef=%hi
190
190
191− ~zod/try=> (ream '~/(%lob.314 !!)')
191+ > (ream '~/(%lob.314 !!)')
192 [%sgfs p=[std=%lob kel=314] q=[%zpzp ~]]
192 [%sgfs p=[std=%lob kel=314] q=[%zpzp ~]]
193
193
194
194
@@ -232,16 +232,16 @@ Examples
232
232
233See also: [`++ap`](), [`++ut`]()
233See also: [`++ap`](), [`++ut`]()
234
234
235− ~zod/try=> *foot
235+ > *foot
236 [%yew p={}]
236 [%yew p={}]
237
237
238− ~zod/try=> (ream '|% ++ $ foo --')
238+ > (ream '|% ++ $ foo --')
239 [%brcn p={[p=%$ q=[%ash p=[%cnzz p=~[%foo]]]]}]
239 [%brcn p={[p=%$ q=[%ash p=[%cnzz p=~[%foo]]]]}]
240− ~zod/try=> +<+:(ream '|% ++ $ foo --')
240+ > +<+:(ream '|% ++ $ foo --')
241 t=~[%ash %cnzz %foo]
241 t=~[%ash %cnzz %foo]
242− ~zod/try=> (foot +<+:(ream '|% ++ $ foo --'))
242+ > (foot +<+:(ream '|% ++ $ foo --'))
243 [%ash p=[%cnzz p=~[%foo]]]
243 [%ash p=[%cnzz p=~[%foo]]]
244− ~zod/try=> (foot +<+:(ream '|% +- $ foo --'))
244+ > (foot +<+:(ream '|% +- $ foo --'))
245 [%elm p=[%cnzz p=~[%foo]]]
245 [%elm p=[%cnzz p=~[%foo]]]
246
246
247***
247***
@@ -255,11 +255,11 @@ Reference into subject by name/axis
255
255
256See also: section 2fC-2fD
256See also: section 2fC-2fD
257
257
258− ~zod/try=> (ream '^^$')
258+ > (ream '^^$')
259 [%cnzz p=~[[%.n p=2 q=%$]]]
259 [%cnzz p=~[[%.n p=2 q=%$]]]
260− ~zod/try=> (limb &2:(ream '^^$'))
260+ > (limb &2:(ream '^^$'))
261 [%.n p=2 q=%$]
261 [%.n p=2 q=%$]
262− ~zod/try=> (limb &2:(ream '^^^$'))
262+ > (limb &2:(ream '^^^$'))
263 [%.n p=3 q=%$]
263 [%.n p=3 q=%$]
264
264
265
265
@@ -278,7 +278,7 @@ Source
278Examples
278Examples
279--------
279--------
280
280
281− ~zod/try=> (ream '$%([1 a] [%2 b])')
281+ > (ream '$%([1 a] [%2 b])')
282 [ %bccm
282 [ %bccm
283 p
283 p
284 [ %kelp
284 [ %kelp
@@ -288,9 +288,9 @@ Examples
288 ]
288 ]
289 ]
289 ]
290 ]
290 ]
291− ~zod/try=> &3:(ream '$%([1 a] [%2 b])')
291+ > &3:(ream '$%([1 a] [%2 b])')
292 p=[p=[%leaf p=%ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
292 p=[p=[%leaf p=%ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
293− ~zod/try=> (line &3:(ream '$%([1 a] [%2 b])'))
293+ > (line &3:(ream '$%([1 a] [%2 b])'))
294 [p=[%leaf p=~.ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
294 [p=[%leaf p=~.ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
295
295
296
296
@@ -329,9 +329,9 @@ Source
329Examples
329Examples
330--------
330--------
331
331
332− ~zod/try=> !=([+(.) 20 -<])
332+ > !=([+(.) 20 -<])
333 [[4 0 1] [1 20] 0 4]
333 [[4 0 1] [1 20] 0 4]
334− ~zod/try=> (nock !=([+(.) 20]))
334+ > (nock !=([+(.) 20]))
335 [p=[%4 p=[%0 p=1]] q=[%1 p=20]]
335 [p=[%4 p=[%0 p=1]] q=[%1 p=20]]
336
336
337
337
@@ -343,7 +343,7 @@ Examples
343
343
344Used nowhere XX
344Used nowhere XX
345
345
346− ~zod/try=> `noun`~[1 2 3]
346+ > `noun`~[1 2 3]
347 [1 2 3 0]
347 [1 2 3 0]
348
348
349
349
@@ -355,7 +355,7 @@ Used nowhere XX
355
355
356Used nowhere XX
356Used nowhere XX
357
357
358− ~zod/try=> :type; *null
358+ > :type; *null
359 ~
359 ~
360 %~
360 %~
361
361
@@ -381,7 +381,7 @@ Source
381Examples
381Examples
382--------
382--------
383
383
384− ~zod/try=> *port
384+ > *port
385 [p=0 q=[%.y p=%void]]
385 [p=0 q=[%.y p=%void]]
386
386
387
387
@@ -402,18 +402,18 @@ Source
402 ++ span ,@ta :: text-atom (ASCII)
402 ++ span ,@ta :: text-atom (ASCII)
403Examples
403Examples
404--------
404--------
405− ~zod/try=> *span
405+ > *span
406 ~.
406 ~.
407
407
408− ~zod/try=> `@t`~.foo
408+ > `@t`~.foo
409 'foo'
409 'foo'
410− ~zod/try=> `@t`~.foo.bar
410+ > `@t`~.foo.bar
411 'foo.bar'
411 'foo.bar'
412− ~zod/try=> `@t`~.foo~~bar
412+ > `@t`~.foo~~bar
413 'foo~bar'
413 'foo~bar'
414− ~zod/try=> `@t`~.foo~-bar
414+ > `@t`~.foo~-bar
415 'foo_bar'
415 'foo_bar'
416− ~zod/try=> `@t`~.foo-bar
416+ > `@t`~.foo-bar
417 'foo-bar'
417 'foo-bar'
418
418
419
419
@@ -433,7 +433,7 @@ Examples
433
433
434A `++wing` or `++twig`.
434A `++wing` or `++twig`.
435
435
436− ~zod/try=> (ream '=+ a=4 ?-(a @ ~)')
436+ > (ream '=+ a=4 ?-(a @ ~)')
437 [ %tsls
437 [ %tsls
438 p=[%ktts p=p=%a q=[%dtzy p=%ud q=4]]
438 p=[%ktts p=p=%a q=[%dtzy p=%ud q=4]]
439 q
439 q
@@ -442,7 +442,7 @@ A `++wing` or `++twig`.
442 q=~[[p=[%axil p=[%atom p=~.]] q=[%bczp p=%null]]]
442 q=~[[p=[%axil p=[%atom p=~.]] q=[%bczp p=%null]]]
443 ]
443 ]
444 ]
444 ]
445− ~zod/try=> (ream '=+ a=4 ?-(4 @ ~)')
445+ > (ream '=+ a=4 ?-(4 @ ~)')
446 [ %tsls
446 [ %tsls
447 p=[%ktts p=p=%a q=[%dtzy p=%ud q=4]]
447 p=[%ktts p=p=%a q=[%dtzy p=%ud q=4]]
448 q
448 q
@@ -474,21 +474,21 @@ Source
474Examples
474Examples
475--------
475--------
476
476
477− ~zod/try=> a=1
477+ > a=1
478 a=1
478 a=1
479− ~zod/try=> (ream 'a=1')
479+ > (ream 'a=1')
480 [%ktts p=p=%a q=[%dtzy p=%ud q=1]]
480 [%ktts p=p=%a q=[%dtzy p=%ud q=1]]
481− ~zod/try=> [a b]=[1 2 3]
481+ > [a b]=[1 2 3]
482 [a=1 b=[2 3]]
482 [a=1 b=[2 3]]
483− ~zod/try=> (ream '[a b]=[1 2 3]')
483+ > (ream '[a b]=[1 2 3]')
484 [ %ktts
484 [ %ktts
485 p=[%2 p=p=%a q=p=%b]
485 p=[%2 p=p=%a q=p=%b]
486 q=[%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
486 q=[%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
487 ]
487 ]
488
488
489− ~zod/try=> [a ~]=[1 2 3]
489+ > [a ~]=[1 2 3]
490 [a=1 2 3]
490 [a=1 2 3]
491− ~zod/try=> (ream '[a ~]=[1 2 3]')
491+ > (ream '[a ~]=[1 2 3]')
492 [ %ktts
492 [ %ktts
493 p=[%2 p=p=%a q=[%0 ~]]
493 p=[%2 p=p=%a q=[%0 ~]]
494 q=[%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
494 q=[%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
@@ -511,17 +511,17 @@ Source
511Examples
511Examples
512--------
512--------
513
513
514− ~zod/try=> (mink [[20 21] 0 3] ,~)
514+ > (mink [[20 21] 0 3] ,~)
515 [%0 p=21]
515 [%0 p=21]
516
516
517− ~zod/try=> (mink [[0] !=(.^(cy//=main/1))] ,~)
517+ > (mink [[0] !=(.^(cy//=main/1))] ,~)
518 [%1 p=~[[31.075 1.685.027.454 1.852.399.981 49 0]]]
518 [%1 p=~[[31.075 1.685.027.454 1.852.399.981 49 0]]]
519− ~zod/try=> (path [31.075 1.685.027.454 1.852.399.981 49 0])
519+ > (path [31.075 1.685.027.454 1.852.399.981 49 0])
520 /cy/~zod/main/1
520 /cy/~zod/main/1
521
521
522− ~zod/try=> (mink [[1 2] !=(~|(%hi +(.)))] ,~)
522+ > (mink [[1 2] !=(~|(%hi +(.)))] ,~)
523 [%2 p=~[[~.yelp 26.984]]]
523 [%2 p=~[[~.yelp 26.984]]]
524− ~zod/try=> (mink [[1 2] !=(!:(+(.)))] ,~)
524+ > (mink [[1 2] !=(!:(+(.)))] ,~)
525 [ %2
525 [ %2
526 p
526 p
527 ~[
527 ~[
@@ -586,9 +586,9 @@ Source
586Examples
586Examples
587--------
587--------
588
588
589− ~zod/try=> (ream '[1 2 3]')
589+ > (ream '[1 2 3]')
590 [%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
590 [%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
591− ~zod/try=> (tusk +:(ream '[1 2 3]'))
591+ > (tusk +:(ream '[1 2 3]'))
592 ~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]
592 ~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]
593
593
594
594
@@ -622,9 +622,9 @@ Source
622Examples
622Examples
623--------
623--------
624
624
625− ~zod/try=> (scan "/==as=" porc:vast)
625+ > (scan "/==as=" porc:vast)
626 [0 ~[~ ~ [~ [%dtzy p=%tas q=29.537]] ~]]
626 [0 ~[~ ~ [~ [%dtzy p=%tas q=29.537]] ~]]
627− ~zod/try=> `tyke`+:(scan "/==as=" porc:vast)
627+ > `tyke`+:(scan "/==as=" porc:vast)
628 ~[~ ~ [~ [%dtzy p=%tas q=29.537]] ~]
628 ~[~ ~ [~ [%dtzy p=%tas q=29.537]] ~]
629
629
630
630
@@ -679,7 +679,7 @@ Examples
679--------
679--------
680See `%arvo` doc
680See `%arvo` doc
681
681
682− ~zod/try=> `vase`!>(~)
682+ > `vase`!>(~)
683 [p=[%cube p=0 q=[%atom p=%n]] q=0]
683 [p=[%cube p=0 q=[%atom p=%n]] q=0]
684
684
685
685
@@ -713,9 +713,9 @@ term alone is the trivial case of a `++wing`.
713
713
714See also: `++twig`
714See also: `++twig`
715
715
716− ~zod/try=> (ream 'a.+.c')
716+ > (ream 'a.+.c')
717 [%cnzz p=~[%a [%.y p=3] %c]]
717 [%cnzz p=~[%a [%.y p=3] %c]]
718− ~zod/try=> (wing +:(ream 'a.+.c'))
718+ > (wing +:(ream 'a.+.c'))
719 ~[%a [%.y p=3] %c]
719 ~[%a [%.y p=3] %c]
720
720
721
721
docs/system/hoon/library/5f.md+24−25
@@ -4,24 +4,24 @@
4XML name
4XML name
5
5
6An XML name (tag name or attribute name) with an optional namespace. Parsed by
6An XML name (tag name or attribute name) with an optional namespace. Parsed by
7−[`++name`]() within [`++poxa`](), rendered by [`++name`]() within `++poxo`.
7+`++name` within `++poxa`, rendered by `++name` within `++poxo`.
8
8
9Source
9Source
10------
10------
11
11
12− ++ mane $|(@tas [@tas @tas]) :: XML name/space
12+ ++ mane $@(@tas [@tas @tas]) :: XML name/space
13
13
14Examples
14Examples
15--------
15--------
16
16
17−See also: [`++sail`]()
17+See also: `++sail`
18
18
19− ~zod/try=> *mane
19+ > *mane
20 %$
20 %$
21
21
22− ~zod/try=> `mane`n.g:`manx`;div:namespace;
22+ > `mane`n.g:`manx`;div:namespace;
23 %div
23 %div
24− ~zod/try=> `mane`n.g:`manx`;div_namespace;
24+ > `mane`n.g:`manx`;div_namespace;
25 [%div %namespace]
25 [%div %namespace]
26
26
27
27
@@ -31,17 +31,17 @@ See also: [`++sail`]()
31
31
32XML node.
32XML node.
33
33
34−Parsed by [`++apex`]() within [`++poxa`](), rendered by [`++poxo`]().
34+Parsed by `++apex` within `++poxa`, rendered by `++poxo`.
35
35
36Source
36Source
37------
37------
38
38
39− ++ manx ,[g=marx c=marl] :: XML node
39+ ++ manx {g/marx c/marl} :: XML node
40
40
41Examples
41Examples
42--------
42--------
43
43
44−See also: [`++sail`]() doc
44+See also: `++sail` doc
45
45
46
46
47
47
@@ -68,12 +68,13 @@ Examples
68
68
69XML CDATA
69XML CDATA
70
70
71−Implicitly produced by [`++chrd`]() within [`++poxa`]()
71+Implicitly produced by `++chrd` within `++poxa`
72
72
73Source
73Source
74------
74------
75
75
76− ++ mars ,[t=[n=%$ a=[i=[n=%$ v=tape] t=~]] c=~] :: XML cdata
76+ ++ mars {t/{n/$$ a/{i/{n/$$ v/tape} t/$~}} c/$~} :: XML cdata
77+
77
78
78Examples
79Examples
79--------
80--------
@@ -85,15 +86,15 @@ Examples
85
86
86List of XML attributes
87List of XML attributes
87
88
88−Each `++mart` is a list of pairs of [`++mane`]() and
89+Each `++mart` is a list of pairs of `++mane` and
89−[`++tape`]().
90+`++tape`.
90
91
91−Parsed by [`++attr`]() within [`++poxa`](), rendered by `++attr` within [`++poxo`]()
92+Parsed by `++attr` within `++poxa`, rendered by `++attr` within `++poxo`
92
93
93Source
94Source
94------
95------
95
96
96− ++ mart (list ,[n=mane v=tape]) :: XML attributes
97+ ++ mart (list {n/mane v/tape}) :: XML attributes
97
98
98Examples
99Examples
99--------
100--------
@@ -106,12 +107,12 @@ Examples
106XML tag
107XML tag
107
108
108A `++marx` is a pair of a tag name, `++mane` and a list of attributes,
109A `++marx` is a pair of a tag name, `++mane` and a list of attributes,
109−`++mart`. Parsed by [`++head`]() `++poxa`, rendered within `++poxo`.
110+`++mart`. Parsed by `++head` `++poxa`, rendered within `++poxo`.
110
111
111Source
112Source
112------
113------
113
114
114− ++ marx ,[n=mane a=mart] :: XML tag
115+ ++ marx {n/mane a/mart} :: XML tag
115
116
116Examples
117Examples
117--------
118--------
@@ -128,7 +129,7 @@ Used primarily in crypto.
128Source
129Source
129------
130------
130
131
131− ++ pass ,@ :: public key
132+ ++ pass @ :: public key
132
133
133
134
134
135
@@ -142,7 +143,7 @@ Used primarily in crypto.
142Source
143Source
143------
144------
144
145
145− ++ ring ,@ :: private key
146+ ++ ring @ :: private key
146
147
147
148
148
149
@@ -156,17 +157,15 @@ The `@da` odor designates an absolute date atom.
156Source
157Source
157------
158------
158
159
159− ++ time ,@da :: galactic time
160+ ++ time @da :: galactic time
160
161
161Examples
162Examples
162--------
163--------
163
164
164−See also: [`++date`](), [odor reference]()
165+See also: `++date`, odor reference
166+
165
167
166− ~zod/try=> `time`-<-
167− ~2014.9.25..20.01.47..eeac
168− ~zod/try=> :: the time is always in your context at -<-
169− ~zod/try=> `time`~2014.1.1
168+ > `time`~2014.1.1
170 ~2014.1.1
169 ~2014.1.1
171
170
172
171
docs/system/hoon/runes/bc/shoe.md → docs/system/hoon/runes/bc/bccb.mdrenamed+3−3
@@ -1,8 +1,8 @@
1−# `:shoe`, `$_`, "buccab", `{$shoe p/twig}`
1+# `:shoe, $_, "buccab", {$shoe p/twig}`
2
2
3−The product: a mold whose product is always `p`.
3+Type as a single example.
4
4
5−Usage: define a type as a single example.
5+Product: a mold whose product is always `p`.
6
6
7Regular form: *1-fixed*.
7Regular form: *1-fixed*.
8
8
docs/system/hoon/runes/bc/bank.md → docs/system/hoon/runes/bc/bccl.mdrenamed+3−3
@@ -1,8 +1,8 @@
1−# `:bank`, `$:`, "buccol", `{$bank p/(list moss)}`
1+# `:bank, $:, "buccol", {$bank p/(list moss)}`
2
2
3−The product: a mold which applies the tuple `p` to its sample.
3+Tuple of molds
4
4
5−Usage: define a record type.
5+Product: a mold which applies the tuple `p` to its sample.
6
6
7Regular form: *running*.
7Regular form: *running*.
8
8
docs/system/hoon/runes/bc/book.md → docs/system/hoon/runes/bc/bccn.mdrenamed+4−4
@@ -1,11 +1,11 @@
1−# `:book`, `$%`, "buctis", `{$book p/(list moss)}`
1+# `:book, $%, "buctis", {$book p/(list moss)}`
2
2
3+Tagged union
4+
3−The product: a mold producing the tagged union of the molds in
5+Product: a mold producing the tagged union of the molds in
4`p`, all of which must be of the form `:bank(stem bulb)`, where
6`p`, all of which must be of the form `:bank(stem bulb)`, where
5`stem` is an atomic mold.
7`stem` is an atomic mold.
6
8
7−Usage: define a type which is a tagged union.
8−
9Regular form: *running*.
9Regular form: *running*.
10
10
11Examples:
11Examples:
docs/system/hoon/runes/bc/bchp.mdnew file+15
@@ -0,0 +1,15 @@
1+# `:lamb, $-, "buchep", {$lamb p/moss q/moss}`
2+
3+Function type.
4+
5+Product: a mold producing a gate accepting
6+
7+Regular form: *2-fixed*.
8+
9+Example:
10+```
11+~zod:dojo> =a :lamb($foo $bar)
12+
13+~zod:dojo> ($:a %foo)
14+%bar
15+```
docs/system/hoon/runes/bc/bush.md → docs/system/hoon/runes/bc/bcpm.mdrenamed+4−5
@@ -1,10 +1,9 @@
1−# `:bush`, `$&`, "bucpam", `{$bush p/moss q/moss}`
1+# `:bush, $&, "bucpam", {$bush p/moss q/moss}`
2
2
3−The product: a mold which applies `p` if the head of its sample
3+Union of two cells: one w/cellular head & other w/atomic head.
4−is a cell, `q` if the head of its sample is a cell.
5
4
6−Usage: add a default pair behavior (like "autocons" in Nock
5+Product: a mold which applies `p` if the head of its sample
7−formulas) to a tagged union type.
6+is a cell, `q` if the head of its sample is a cell.
8
7
9Regular form: *2-fixed*.
8Regular form: *2-fixed*.
10
9
docs/system/hoon/runes/bc/claw.md → docs/system/hoon/runes/bc/bcpt.mdrenamed+4−4
@@ -1,9 +1,9 @@
1−# `:claw`, `$@`, "bucpat", `{$claw p/moss q/moss}`
1+# `:claw, $@, "bucpat", {$claw p/moss q/moss}`
2
2
3−The product: a mold which applies `p` if its sample is an atom,
3+Type: either an atom or a cell.
4−`q` if its sample is a cell.
5
4
6−Usage: define a type which is either an atom or a cell.
5+Product: a mold which applies `p` if its sample is an atom,
6+`q` if its sample is a cell.
7
7
8Regular form: *2-fixed*.
8Regular form: *2-fixed*.
9
9
docs/system/hoon/runes/bc/bcts.mdnew file+21
@@ -0,0 +1,21 @@
1+# `:coat, $=, "buctis", {$coat p/@tas q/moss}`
2+
3+Add variable name
4+
5+Product: a mold which puts the label `p` on the mold `q`.
6+
7+Regular form: *2-fixed*.
8+
9+Irregular form:
10+```
11+a/b :coat(a b)
12+```
13+
14+Examples:
15+
16+```
17+~zod:dojo> =a :coat(p $foo)
18+
19+~zod:dojo> (a %bar)
20+p=%foo
21+```
docs/system/hoon/runes/bc/bcwt.mdnew file+23
@@ -0,0 +1,23 @@
1+# `:pick, $?, "bucwut", {$? p/(list moss)}`
2+
3+Generalized type union.
4+
5+Product: a mold which tries each of the alternatives in `p`.
6+
7+Note: Use `:pick` only if none of `:book` (`$%`), `:claw` (`$@`) or `:bush` (`$&`) applies.
8+
9+Regular form: *running*.
10+
11+Example:
12+```
13+~zod:dojo> =a :pick($foo $bar $baz)
14+
15+~zod:dojo> (a %baz)
16+%baz
17+
18+~zod:dojo> (a [37 45])
19+%foo
20+
21+~zod:dojo> $:a
22+$foo
23+```
docs/system/hoon/runes/bc/coat.mddeleted−21
@@ -1,21 +0,0 @@
1−# `:coat`, `$=`, "buctis", `{$coat p/@tas q/moss}
2−
3−The product: a mold which puts the label `p` on the mold `q`.
4−
5−Usage: name a typed attribute or variable.
6−
7−Regular form: *2-fixed*.
8−
9−Irregular form:
10−```
11−a/b :coat(a b)
12−```
13−
14−Examples:
15−
16−```
17−~zod:dojo> =a :coat(p $foo)
18−
19−~zod:dojo> (a %bar)
20−p=%foo
21−```
docs/system/hoon/runes/bc/lamb.mddeleted−15
@@ -1,15 +0,0 @@
1−# `:lamb`, `$-`, "buchep", `{$lamb p/moss q/moss}`
2−
3−The product: a mold producing a gate accepting
4−
5−Usage: define a function type.
6−
7−Regular form: *2-fixed*.
8−
9−Example:
10−```
11−~zod:dojo> =a :lamb($foo $bar)
12−
13−~zod:dojo> ($:a %foo)
14−%bar
15−```
docs/system/hoon/runes/bc/pick.mddeleted−29
@@ -1,29 +0,0 @@
1−# `:pick`, `$?`, "bucwut", `{$? p/(list moss)}`
2−
3−The product: a mold which tries each of the alternatives in `p`.
4−
5−Usage: a generalized type union. Use `:pick` only if none of
6−`:book` (`$%`), `:claw` (`$@`) or `:bush` (`$&`) applies.
7−
8−Regular form: *running*.
9−
10−Irregular form:
11−
12−```
13−?(a b c) $?(a b c)
14−```
15−
16−Example:
17−
18−```
19−~zod:dojo> =a :pick($foo $bar $baz)
20−
21−~zod:dojo> (a %baz)
22−%baz
23−
24−~zod:dojo> (a [37 45])
25−%foo
26−
27−~zod:dojo> $:a
28−$foo
29−```
docs/system/hoon/runes/br/brcb.md+14−31
@@ -2,40 +2,23 @@
2sort: 7
2sort: 7
3---
3---
4
4
5−`|_ barcab`
5+# `:door`, `|_`, "buccab", `{$door p/moss q/(map term twig)}`
6−===========
7
6
8Door: core with sample (input values).
7Door: core with sample (input values).
9
8
10−Similar to [`|%`](), but also takes input data (aka [sample]())
9+Produces: a core whose sample is `p` and arms are `q`.
11−available within the entire core. Cores of this type are called doors.
12−Moreover, `|_` only accepts [dry or `%elm`]() arms--in other words,
13−type checking on these arms is performed on the input before computation.
14−
15−Produces
16−--------
17−
18−Twig: `[%brcb p=twig q=(map term foot)]`
19
10
20−Accepts
11+Regular form: *1-fixed*, then *battery*
21−-------
22
12
23−`p` is a a [mold](). `q` is a [`++map`]() with [`++term`]() keys and
13+Similar to `|%`, but also takes input data (aka sample)
24−[`++foot`]() values.
14+available within the entire core. Cores of this type are called doors.
25−
15+Moreover, `|_` only accepts dry or `%elm` arms--in other words,
26−Tall form
16+type checking on these arms is performed on the input before computation.
27−---------
28−
29− |_ p
30− ++ p.n.q
31− q.n.q
32− --
33
17
34−Examples
18+Examples:
35−--------
36
19
37 /~zod/try=> =mol
20 /~zod/try=> =mol
38− |_ a=@ud
21+ |_ a/@ud
39 ++ succ +(a)
22 ++ succ +(a)
40 ++ prev (dec a)
23 ++ prev (dec a)
41 --
24 --
@@ -44,14 +27,14 @@ Examples
44 /~zod/try=> ~(succ mol ~(succ mol ~(prev mol 5)))
27 /~zod/try=> ~(succ mol ~(succ mol ~(prev mol 5)))
45 6
28 6
46
29
47−In this example we create a door `mol` that operates on a [`@ud`](),
30+In this example we create a door `mol` that operates on a `@ud`,
48`a`. We add two arms to our door, `++succ` and `++prev`, and invoke them
31`a`. We add two arms to our door, `++succ` and `++prev`, and invoke them
49−with the irregular form of [`%~`](). Doors are commonly invoked with
32+with the irregular form of `%~`. Doors are commonly invoked with
50`%~`, irregular form `~(arm door sample)`, which replaces the door's
33`%~`, irregular form `~(arm door sample)`, which replaces the door's
51sample and calls the specified arm.
34sample and calls the specified arm.
52
35
53 /~zod/try=> =kom
36 /~zod/try=> =kom
54− |_ a=(list)
37+ |_ a/(list)
55 ++ hed -.a
38 ++ hed -.a
56 ++ tal +.a
39 ++ tal +.a
57 --
40 --
@@ -73,7 +56,7 @@ sample and calls the specified arm.
73
56
74Here we're demonstrating the difference between `|_` and `|/`. We create
57Here we're demonstrating the difference between `|_` and `|/`. We create
75a nearly identical door using both runes, each with an arm that produces
58a nearly identical door using both runes, each with an arm that produces
76−the tail of the sample `a`. You can see that [wet]() functions use the
59+the tail of the sample `a`. You can see that wet functions use the
77sample as a mold to produce well-typed output.
60sample as a mold to produce well-typed output.
78
61
79 ++ ne
62 ++ ne
@@ -99,5 +82,5 @@ arms who all take the same sample.
99
82
100Here we put `++ne` to work a bit. Our first call renders 12 in base 16.
83Here we put `++ne` to work a bit. Our first call renders 12 in base 16.
101Since `99` is within the ASCII character range, we can cast it to a
84Since `99` is within the ASCII character range, we can cast it to a
102−[`@t`]() and get `'c'`. Conveniently, casting `12` to a [`@ux`]()
85+`@t` and get `'c'`. Conveniently, casting `12` to a `@ux`
103results in `0xc`.
86results in `0xc`.
docs/system/hoon/runes/br/brcn.md+19−58
@@ -2,42 +2,20 @@
2sort: 1
2sort: 1
3---
3---
4
4
5−`|% barcen`
5+# `:core, |%, "buccab", {$shoe p/twig}`
6−===========
7
6
8Generic core.
7Generic core.
9
8
10−Constructs a generic core with n named expressions, closed with `--`. Cores are
9+Produces: a core with `p`, an associative array with `++term` keys and `++foot` values.
11−similar to an object with named properties (aka [arms]()) that can contain either functions or data. Accepts both [dry or `%elm`]() and [wet or `%ash`]() arms.
12
10
13−Produces
11+Regular form: *Battery*
14−--------
15
12
16−Twig: `[%brcn p=(map term foot)]`
13+Example:
17−
18−Accepts
19−-------
20−
21−`p` is a [`++map`]() with [`++term`]() keys and [`++foot`]() values, which
22−are called arms.
23−
24−Tall form
25−---------
26−
27− |%
28− ++ p.n.q
29− q.n.q
30− +- p.n.l.q
31− q.n.l.q
32− --
33−
34−Examples
35−--------
36
14
37 /~zod/try=>
15 /~zod/try=>
38 =a |%
16 =a |%
39 ++ n 100
17 ++ n 100
40− ++ g |= b=@
18+ ++ g |= b/@
41 (add b n)
19 (add b n)
42 --
20 --
43 new var %a
21 new var %a
@@ -54,7 +32,7 @@ function. `g` adds our constant `n` to whatever is passed to it.
54 ++ r 100
32 ++ r 100
55 ++ s 4
33 ++ s 4
56 --
34 --
57− ++ g |= b=@
35+ ++ g |= b/@
58 (div (add b r:l) s:l)
36 (div (add b r:l) s:l)
59 --
37 --
60 changed %a
38 changed %a
@@ -67,36 +45,19 @@ and make our function `g` a bit more complicated. `g` now computes the
67sum of its argument and the arm `r` inside `l`, and divides that by `s`
45sum of its argument and the arm `r` inside `l`, and divides that by `s`
68inside `l`.
46inside `l`.
69
47
70− ++ yo
71− |% ++ cet 36.524 :: (add 24 (mul 100 365))
72− ++ day 86.400 :: (mul 24 hor)
73− ++ era 146.097 :: (add 1 (mul 4 cet))
74− ++ hor 3.600 :: (mul 60 mit)
75− ++ jes 106.751.991.084.417 :: (mul 730.692.561 era)
76− ++ mit 60
77− ++ moh `(list ,@ud)`[31 28 31 30 31 30 31 31 30 31 30 31 ~]
78− ++ moy `(list ,@ud)`[31 29 31 30 31 30 31 31 30 31 30 31 ~]
79− ++ qad 126.144.001 :: (add 1 (mul 4 yer))
80− ++ yer 31.536.000 :: (mul 365 day)
81− --
82−
83−[`++yo`](), found in `hoon.hoon`, uses `|%` to create a core whose arms
84−contain constant data for calculating time. As the following examples
85−shows, `|%` is also used to encapsulate arms that perform calculations.
86−
87 ++ si :: signed integer
48 ++ si :: signed integer
88 |%
49 |%
89− ++ abs |=(a=@s (add (end 0 1 a) (rsh 0 1 a)))
50+ ++ abs |=(a/@s (add (end 0 1 a) (rsh 0 1 a)))
90− ++ dif |=([a=@s b=@s] (sum a (new !(syn b) (abs b))))
51+ ++ dif |=([a/@s b/@s] (sum a (new !(syn b) (abs b))))
91− ++ dul |=([a=@s b=@] =+(c=(old a) ?:(-.c (mod +.c b) (sub b +.c))))
52+ ++ dul |=([a/@s b/@] =+(c=(old a) ?:(-.c (mod +.c b) (sub b +.c))))
92− ++ fra |= [a=@s b=@s]
53+ ++ fra |= [a/@s b/@s]
93 (new =(0 (mix (syn a) (syn b))) (div (abs a) (abs b)))
54 (new =(0 (mix (syn a) (syn b))) (div (abs a) (abs b)))
94− ++ new |=([a=? b=@] `@s`?:(a (mul 2 b) ?:(=(0 b) 0 +((mul 2 (dec b))))))
55+ ++ new |=([a/? b/@] `@s`?:(a (mul 2 b) ?:(=(0 b) 0 +((mul 2 (dec b))))))
95− ++ old |=(a=@s [(syn a) (abs a)])
56+ ++ old |=(a/@s [(syn a) (abs a)])
96− ++ pro |= [a=@s b=@s]
57+ ++ pro |= [a/@s b/@s]
97 (new =(0 (mix (syn a) (syn b))) (mul (abs a) (abs b)))
58 (new =(0 (mix (syn a) (syn b))) (mul (abs a) (abs b)))
98− ++ rem |=([a=@s b=@s] (dif a (pro b (fra a b))))
59+ ++ rem |=([a/@s b/@s] (dif a (pro b (fra a b))))
99− ++ sum |= [a=@s b=@s]
60+ ++ sum |= [a/@s b/@s]
100 ~| %si-sum
61 ~| %si-sum
101 =+ [c=(old a) d=(old b)]
62 =+ [c=(old a) d=(old b)]
102 ?: -.c
63 ?: -.c
@@ -110,10 +71,10 @@ shows, `|%` is also used to encapsulate arms that perform calculations.
110 (new | (sub +.c +.d))
71 (new | (sub +.c +.d))
111 (new & (sub +.d +.c))
72 (new & (sub +.d +.c))
112 (new | (add +.c +.d))
73 (new | (add +.c +.d))
113− ++ sun |=(a=@u (mul 2 a))
74+ ++ sun |=(a/@u (mul 2 a))
114− ++ syn |=(a=@s =(0 (end 0 1 a)))
75+ ++ syn |=(a/@s =(0 (end 0 1 a)))
115 --
76 --
116
77
117−[`++si`](), found in `hoon.hoon`, uses `|%` to create a core whose arms
78+`++si`, found in `hoon.hoon`, uses `|%` to create a core whose arms
118−contain functions used to calculate with signed integers, [`@s`](). In this
79+contain functions used to calculate with signed integers, `@s`. In this
119case our core is made up entirely of functions.
80case our core is made up entirely of functions.
docs/system/hoon/runes/br/brdt.md+6−25
@@ -2,34 +2,15 @@
2sort: 3
2sort: 3
3---
3---
4
4
5−`|. bardot`
5+# `:trap. |., "bardot", {$trap p/twig}`
6−===========
7
6
8−Trap: `|=` with no argument & not called automatically.
7+Trap: `|=` with no argument; expression not evaluated automatically.
9
8
10−Similar to `|=` except that it takes no arguments and is not automatically
9+Produces: a core with a single arm `$` that it takes no arguments and is not automatically
11called (you must activate it with the irregular wideform of `%-`, which is
10called (you must activate it with the irregular wideform of `%-`, which is
12−`()`. More specifically, its single arm [$]() (the empty name) is not automatically called when the [core]() is constructed. The core produced is both [dry] and [`%gold`](). Used to prevent thunk. XX
11+`()`).
13
12
14−Produces
13+Regular form: *1-fixed*
15−--------
16−
17−Twig: `[%brdt p=twig]`
18−
19−Accepts
20−-------
21−
22−`p` is a [`++twig`]().
23−
24−Tall form
25−---------
26−
27− |. p
28−
29−Wide form
30−---------
31−
32− |.(p)
33
14
34Examples
15Examples
35--------
16--------
@@ -68,7 +49,7 @@ Examples
68
49
69This is a simple example. We assign a shell variable `a` to be a trap
50This is a simple example. We assign a shell variable `a` to be a trap
70that simply produces the atom `42`. Printing `a` prints the core and its
51that simply produces the atom `42`. Printing `a` prints the core and its
71−context. Calling `a` using `(`, the irregular form of [`%-`](), produces
52+context. Calling `a` using `(`, the irregular form of `%-`, produces
72its value. As does pulling the arm `$` from inside it using `$:a`.
53its value. As does pulling the arm `$` from inside it using `$:a`.
73
54
74 /~zod/try=>
55 /~zod/try=>
docs/system/hoon/runes/br/brfs.mddeleted−93
@@ -1,93 +0,0 @@
1−---
2−sort: 8
3−---
4−
5−`|/ barfas`
6−===========
7−
8−`|_` with well typed output.
9−
10−Similar to `|_` except that it takes and produces well-typed output. XX
11−
12−`|/` is a synthetic rune that produces a [`%gold`]() [door]() with
13−[sample]() `[%bctr p]` and list of [wet or %ash]() [arm]()s `q`. The list of arms must be
14−closed with a `--`.
15−
16−Produces
17−--------
18−
19−Twig: `[%brfs p=mold q=(map term foot)]`
20−
21−Accepts
22−-------
23−
24−`p` is a [mold](). `q` is a [`++map`]() with [`++term`]() keys and
25−[`++foot`]() values.
26−
27−Tall form
28−---------
29−
30− |/ p
31− +- p.n.q
32− q.n.q
33− --
34−
35−Examples
36−--------
37−
38− /~zod/try=> =fas |/
39− a=@
40− +- two (mul a 2)
41− +- for (div a 2)
42− --
43− new var %fas
44− /~zod/try=> ~(two fas 2)
45− 4
46− /~zod/try=> ~(for fas ~(for fas ~(two fas 12)))
47− 6
48−
49−In this simple example we're creating a door with two arms. One arm
50−divides our sample by two, the other divides by two.
51−
52− /~zod/try=> =kom
53− |_ a=(list)
54− ++ hed -.a
55− ++ tal +.a
56− --
57− new var %kom
58− /~zod/try=> =kot
59− |/ a=(list)
60− +- hed -.a
61− +- tal +.a
62− --
63− new var %kot
64− /~zod/try=> ~(tal kom "abc")
65− t=~[98 99]
66− /~zod/try=> ~(tal kot "abc")
67− t="bc"
68− /~zod/try=> ~(tal kot [1 2 3 ~])
69− [2 3 ~]
70− /~zod/try=> ~(tal kom [1 2 3 ~])
71− t=~[2 3]
72−
73−Here we're demonstrating the difference between `|_` and `|/`. We create
74−a nearly identical door using both runes, each with an arm that produces
75−the tail of the sample, `a`. You can see that our wet gates use the
76−[sample]() as a mold to produce well-typed output.
77−
78− ++ by :: map engine
79− ~/ %by
80− |/ a=(map)
81− ::
82− +- all
83− ~/ %all
84− |* b=$+(* ?)
85− |- ^- ?
86− ?@ a
87− &
88− ?&((b q.n.a) $(a l.a) $(a r.a))
89−
90−All of the container engines in `hoon.hoon` use `|/` to set up the mold
91−for their operations. In `++by`, the map engine, `|/` creates a door
92−that takes a map that is passed to its arms. See more about using `++by`
93−in the [library]().
docs/system/hoon/runes/br/brhp.md+5−25
@@ -2,35 +2,15 @@
2sort: 4
2sort: 4
3---
3---
4
4
5−`|- barhep`
5+# `:loop, |-, "barfas", {$trap p/twig}`
6−===========
7
6
8Trap: automatically called function with no arguments.
7Trap: automatically called function with no arguments.
9
8
10−A function with no arguments that's automatically called when constructed. More specifically, it produces a [dry]() [%gold]() [core]() whose single [arm]() [$]() (the empty name) is automatically called when the core is constructed. Similar to creating and calling an anonymous function and is quite commonly used for loops or recursion.
9+Produces: a core whose single arm $ (the empty name) is automatically called when the core is constructed. Similar to creating and calling an anonymous function and is quite commonly used for loops or recursion.
11
10
12−Produces
11+Regular form: *1-fixed*
13−--------
14
12
15−[`++twig`]: `[%brhp p=twig]`
13+Examples:
16−
17−Accepts
18−-------
19−
20−`p` is a twig
21−
22−Tall form
23−---------
24−
25− |- p
26−
27−Wide form
28−---------
29−
30− |-(p)
31−
32−Examples
33−--------
34
14
35 /~zod/try=> |-(42)
15 /~zod/try=> |-(42)
36 42
16 42
@@ -51,7 +31,7 @@ producing a nested tuple.
51
31
52 ++ dec :: decrement
32 ++ dec :: decrement
53 ~/ %dec
33 ~/ %dec
54− |= a=@
34+ |= a/@
55 ~| %decrement-underflow
35 ~| %decrement-underflow
56 ?< =(0 a)
36 ?< =(0 a)
57 =+ b=0
37 =+ b=0
docs/system/hoon/runes/br/brkt.md+12−32
@@ -2,36 +2,16 @@
2sort: 6
2sort: 6
3---
3---
4
4
5−`|^ barket`
5+# `:cork`, `|^`, "barket", `{$cork p/twig q/(map term foot)}`
6−===========
7
6
8−Same as `|-` except that it can contain internal arms.
7+Same as `|-` (expression evaluated automatically) except that it can contain internal arms.
9
8
10−`|^` is a synthetic rune that produces and then calls a [`%gold`]()
11−[book]() with sample `p` as a [`%$(p)`](), and a list of [arm]()s `q`.
9+Produces a `%gold` (XX elaborate on what gold, book mean?) book with sample `p` as a `%$(p)`, and a list of arms `q`.
12`q` must be closed with a `--`.
10`q` must be closed with a `--`.
13
11
14−Produces
12+Regular form: *1-fixed*
15−--------
16
13
17−Twig: `[%brkt p=twig q=(map term foot)]`
18−
19−Accepts
20−-------
21−
22−`p` is a [++twig](). `q` is a [`map`]() with [`++term`]() keys and
23−[`++foot`]() values, which are called arms.
24−
25−Tall form
26−---------
27−
28− |^ p
29− ++ p.n.q
30− q.n.q
31− --
32−
33−Examples
14+Examples:
34−--------
35
15
36 /~zod/try=> =+ a=21
16 /~zod/try=> =+ a=21
37 |^ [square double]
17 |^ [square double]
@@ -46,15 +26,15 @@ commonly used inside another gate or core.
46
26
47 ++ mum :: mug with murmur3
27 ++ mum :: mug with murmur3
48 ~/ %mum
28 ~/ %mum
49− |= a=*
29+ |= a/*
50 |^ (trim ?@(a a (mix $(a -.a) (mix 0x7fff.ffff $(a +.a)))))
30 |^ (trim ?@(a a (mix $(a -.a) (mix 0x7fff.ffff $(a +.a)))))
51 ++ spec :: standard murmur3
31 ++ spec :: standard murmur3
52− |= [syd=@ key=@]
32+ |= [syd/@ key/@]
53 ?> (lte (met 5 syd) 1)
33 ?> (lte (met 5 syd) 1)
54 =+ ^= row
34 =+ ^= row
55− |= [a=@ b=@]
35+ |= [a/@ b/@]
56 (con (end 5 1 (lsh 0 a b)) (rsh 0 (sub 32 a) b))
36 (con (end 5 1 (lsh 0 a b)) (rsh 0 (sub 32 a) b))
57− =+ mow=|=([a=@ b=@] (end 5 1 (mul a b)))
37+ =+ mow=|=([a/@ b/@] (end 5 1 (mul a b)))
58 =+ len=(met 5 key)
38 =+ len=(met 5 key)
59 =- =. goc (mix goc len)
39 =- =. goc (mix goc len)
60 =. goc (mix goc (rsh 4 1 goc))
40 =. goc (mix goc (rsh 4 1 goc))
@@ -63,7 +43,7 @@ commonly used inside another gate or core.
63 =. goc (mow goc 0xc2b2.ae35)
43 =. goc (mow goc 0xc2b2.ae35)
64 (mix goc (rsh 4 1 goc))
44 (mix goc (rsh 4 1 goc))
65 ^= goc
45 ^= goc
66− =+ [inx=0 goc=syd]
46+ =+ [inx/0 goc/syd]
67 |- ^- @
47 |- ^- @
68 ?: =(inx len) goc
48 ?: =(inx len) goc
69 =+ kop=(cut 5 [inx 1] key)
49 =+ kop=(cut 5 [inx 1] key)
@@ -76,7 +56,7 @@ commonly used inside another gate or core.
76 $(inx +(inx))
56 $(inx +(inx))
77 ::
57 ::
78 ++ trim :: 31-bit nonzero
58 ++ trim :: 31-bit nonzero
79− |= key=@
59+ |= key/@
80 =+ syd=0xcafe.babe
60 =+ syd=0xcafe.babe
81 |- ^- @
61 |- ^- @
82 =+ haz=(spec syd key)
62 =+ haz=(spec syd key)
@@ -85,5 +65,5 @@ commonly used inside another gate or core.
85 --
65 --
86 ::
66 ::
87
67
88−[`++mum`]() is a hashing gate, which uses two helper arms to compute
68+`++mum` is a hashing gate, which uses two helper arms to compute
89its results. The `|^` at the top performs the computation.
69its results. The `|^` at the top performs the computation.
docs/system/hoon/runes/br/brls.md+10−31
@@ -7,47 +7,26 @@ sort: 9
7
7
8Function with unreadable sample.
8Function with unreadable sample.
9
9
10−`|+` is a synthetic rune that produces a [dry]() [`%iron`]() function
10+Produces:a dry `%iron` gate with argument (aka sample) `$*(p)` and arms
11+`q`. Similar to `|=`, but differs in that its input (sample) cannot be
11−with argument (aka [sample]()) [`$*(p)`]() and [arm]()s `q`. `|+` is similar to `|=`, but differs in that its input (sample) cannot be read and thus cannot interfere with the type system.
12+read and thus cannot interfere with the type system.
12
13
13−Produces
14+Examples:
14−--------
15
15
16−Twig: `[%brls p=mold q=twig]`
17−
18−Accepts
19−-------
20−
21−`p` is a [mold](). `q` is a [`++twig`]().
22−
23−Tall form
24−---------
25−
26− |+ p
27− q
28−
29−Wide form
30−---------
31−
32− |+(p q)
33−
34−Examples
35−--------
36−
37− ~zod/try=> +<:|+(a=@ a)
16+ ~zod/try=> +<:|+(a/@ a)
38 ! -axis.6
17 ! -axis.6
39 ! peek-park
18 ! peek-park
40 ! exit
19 ! exit
41− ~zod/try=> +<:|=(a=@ a)
20+ ~zod/try=> +<:|=(a/@ a)
42 a=0
21 a=0
43
22
44−Here we're trying to read the sample, using the [head]() of the [tail]() of two different kinds of functions. With `|+` you can see we cause an error, whereas with `|=` our default sample is `a=0`.
23+Here we're trying to read the sample, using the head of the tail of two different kinds of functions. With `|+` you can see we cause an error, whereas with `|=` our default sample is `a=0`.
45
24
46− ~zod/try=> %.(20 |+(a=@ a))
25+ ~zod/try=> %.(20 |+(a/@ a))
47 20
26 20
48− ~zod/try=> %.(20 |=(a=@ a))
27+ ~zod/try=> %.(20 |=(a/@ a))
49 20
28 20
50− ~zod/try=> %.(20 |+(a=@ (add a 12)))
29+ ~zod/try=> %.(20 |+(a/@ (add a 12)))
51 32
30 32
52
31
53Kicking a `|+` gate, however, is the same as `|=`.
32Kicking a `|+` gate, however, is the same as `|=`.
docs/system/hoon/runes/br/brtr.md+10−32
@@ -2,42 +2,20 @@
2sort: 10
2sort: 10
3---
3---
4
4
5−`|* bartar`
5+# `:gill`, `|*`, "bartar", `{$gill p/twig q/twig}`
6−===========
7
6
8−Wet function.
7+Function with arguments; type checking at call time
9
8
10−Similar to `|=` except that it does type checking at
9+Produces: a gate with argument `p` and body `q`. Type checking happens at
11−call time, and that the product type is checked to be the same as
10+call time.
12−the input type (in other words it's [wet]()), rather than the input ([sample]()) [mold]().
13
11
14−Produces
12+Regular form: *1-fixed*, followed by Battery
15−--------
16
13
17−Twig: `[%brtr p=mold q=twig]`
14+Examples:
18
15
19−Accepts
20−-------
21−
22−`p` is a mold. `q` is a [++twig]().
23−
24−Tall form
25−---------
26−
27− |* p
28− q
29−
30−Wide form
31−---------
32−
33− |*(p q)
34−
35−Examples
36−--------
37−
38− ~zod/try=> %.('c' |*(a=@ a))
16+ ~zod/try=> %.('c' |*(a/@ a))
39 'c'
17 'c'
40− ~zod/try=> %.('c' |=(a=@ a))
18+ ~zod/try=> %.('c' |=(a/@ a))
41 99
19 99
42
20
43This is a concise way of understanding the difference between `|*` and
21This is a concise way of understanding the difference between `|*` and
@@ -48,7 +26,7 @@ input sample type.
48
26
49 ++ flop :: reverse
27 ++ flop :: reverse
50 ~/ %flop
28 ~/ %flop
51− |* a=(list)
29+ |* a/(list)
52 => .(a (homo a))
30 => .(a (homo a))
53 ^+ a
31 ^+ a
54 =+ b=`_a`~
32 =+ b=`_a`~
@@ -57,6 +35,6 @@ input sample type.
57 b
35 b
58 $(a t.a, b [i.a b])
36 $(a t.a, b [i.a b])
59
37
60−In [`++flop`](), `|*` is used so the type information within the passed
38+In `++flop`, `|*` is used so the type information within the passed
61in list is maintained. Without a `|*`, any cords would be cast to nouns
39in list is maintained. Without a `|*`, any cords would be cast to nouns
62as in our previous example.
40as in our previous example.
docs/system/hoon/runes/br/brts.md+6−35
@@ -2,45 +2,16 @@
2sort: 2
2sort: 2
3---
3---
4
4
5−`|= bartis`
5+# `:gate`, `|=`, "bartis", `{$gate p/twig q/twig}`
6−===========
7
6
8Function with argument(s).
7Function with argument(s).
9
8
10−`|=`, is a synthetic rune that produces a [dry]() [`%gold`]() gate with
11−sample [`$*(p)`](), arm `q`. A gate is a core with one arm, [`$`](), the
9+Produces: a dry `%gold` gate with sample `$*(p)`, arm `q`. A gate is a core with one arm, `$`, the
12−empty name. `|=` checks its input sample against its [mold](), `p`.
10+empty name.
13−
14−`|=` is similar to a function that takes a defined input and produces
15−the result of some computation. `|=` differs from `|*` in that its
16−typechecking occurs at compile-time to ensure that all inputs match its
17−sample mold.
18−
19−Produces
20−--------
21−
22−Twig: `[%brts p=mold q=twig]`
23−
24−Accepts
25−-------
26−
27−`p` is a mold. `q` is a twig.
28−
29−Tall form
30−---------
31−
32− |= p
33− q
34−
35−Wide form
36−---------
37−
38− |=(p q)
39
11
40Examples
12Examples
41−--------
42
13
43− ~zod/try=> =inc |=(a=@ +(a))
14+ ~zod/try=> =inc |=(a/@ +(a))
44 ~zod/try=> (inc 20)
15 ~zod/try=> (inc 20)
45 21
16 21
46
17
@@ -50,13 +21,13 @@ arguments.
50
21
51 ++ add :: add
22 ++ add :: add
52 ~/ %add
23 ~/ %add
53− |= [a=@ b=@]
24+ |= [a/@ b=@]
54 ^- @
25 ^- @
55 ?: =(0 a)
26 ?: =(0 a)
56 b
27 b
57 $(a (dec a), b +(b))
28 $(a (dec a), b +(b))
58
29
59−In [++add](), from `hoon.hoon`, `|=` creates a gate whose sample takes
30+In ++add, from `hoon.hoon`, `|=` creates a gate whose sample takes
60two atoms labeled `a` and `b`, and whose arm evaluates an expression
31two atoms labeled `a` and `b`, and whose arm evaluates an expression
61that produces the sum of the atoms by decrementing `a` until it is `0`
32that produces the sum of the atoms by decrementing `a` until it is `0`
62and incrementing `b` at each step. Here, `$` is used for recursion,
33and incrementing `b` at each step. Here, `$` is used for recursion,
docs/system/hoon/runes/br/brwt.md+23−45
@@ -2,51 +2,29 @@
2sort: 5
2sort: 5
3---
3---
4
4
5−`|? barwut`
5+# `:tray`, `|?`, "barwut", `{$tray p/twig}`
6−===========
7
6
8`|-` with hidden context.
7`|-` with hidden context.
9
8
10−Similar to `|-` except for that the [sample]() and
9+Produces: a lead trap with expression `p` whose context is hidden to avoid type conflicts.
11−[context]() of the core being passed is hidden in order to avoid
10+
12−type conflicts with a core that has a different [sample]() and
13−context. In urbit language, `|?` produces a [dry]() [%lead]() trap.
14−
15−Produces
16−--------
17−
18−Twig: `[%brwt q=twig]`
19−
20−Accepts
21−-------
22−
23−`p` is a [++twig]().
24−
25−Tall form
26−---------
27−
28− |? p
29−
30−Wide form
31−---------
32−
33− |?(p)
34−
35−Examples
11+Examples:
36−--------
12+
37−
38− ~zod/try=> |?(20)
13+ > |?(20)
39− < 1?lld
14+ < 1?aoy
40− [[[@da @ta] [@p @ta] *''] @n <250.yum 41.int 414.hhh 100.xkc 1.ypj %164>]
15+ { {a/^#3.?({i/@ud t/#3} ^#2.?({i/@ud t/#2} it(@ud))) our/@p now/@da eny/@uvI}
41− >
16+ $~
17+ <282.ucw 42.juj 402.arm 110.jyx 1.ztu $151>
18+ }
42− ~zod/try=> +:|?(20)
19+ > ~zod/try=> +:|?(20)
43− ! -axis.3
44− ! peek-park
45− ! exit
46− ~zod/try=> +:|.(20)
20+ > +:|.(20)
47− [ [[~2014.10.22..19.39.41..0440 ~.~2014.10.22..19.39.41..0440] [~zod ~.~zod] <||>]
21+ [ [ a=[i=1 t=[i=2 t=[i=3 t=~]]]
22+ our=~sivtyv-barnel
23+ now=~2016.3.29..04.14.18..9a26
24+ eny=0v16.dkepv.qm6er.7v2mh.kcdva.oisv9.th4dl.era7v.pj315.fd6la.76d34
25+ ]
48− ~
26+ ~
49− <250.yum 41.int 414.hhh 100.xkc 1.ypj %164>
27+ <282.ucw 42.juj 402.arm 110.jyx 1.ztu $151>
50− ]
28+ ]
51−
29+
52−A lead core's payload cannot be read or written.
30+As demonstrated above, a lead core's payload cannot be read or written.
docs/system/hoon/runes/cl/clcb.md+5−26
@@ -1,33 +1,12 @@
1−`:_ colcab`
1+# `:scon`, `:_`, "colcab", `{$scon p/twig q/twig}`
2−===========
3
2
4Inverted tuple of `p` `q`.
3Inverted tuple of `p` `q`.
5
4
6−Exists for code readability and organization. See the [backstep]() convention.
5+Produces: a cell of `[q p]`. Exists for code readability and organization. See the backstep convention.
7
6
8−Produces
7+Regular form: *2-fixed*
9−--------
10
8
11−Twig: `[%clcb p=twig q=twig]`
12−
13−Accepts
14−-------
15−
16−`p` is a [++twig](). `q` is a twig.
17−
18−Tall form
19−---------
20−
21− :_ p
22− q
23−
24−Wide form
25−---------
26−
27− :_(p q)
28−
29−Examples
9+Examples:
30−--------
31
10
32 ~zod/try=> :_(1 2)
11 ~zod/try=> :_(1 2)
33 [2 1]
12 [2 1]
@@ -38,7 +17,7 @@ reverse order.
38 ~zod/try=> `tape`:_(~ 'a')
17 ~zod/try=> `tape`:_(~ 'a')
39 "a"
18 "a"
40
19
41−Since a [`++tape`]() is a null-terminated list of characters, casting
20+Since a `++tape` is a null-terminated list of characters, casting
42the result of `:_(~ 'a')` to a `tape` produces `"a"`.
21the result of `:_(~ 'a')` to a `tape` produces `"a"`.
43
22
44 /~zod/try=>
23 /~zod/try=>
docs/system/hoon/runes/cl/clfs.md+2−23
@@ -1,33 +1,12 @@
1`:/ colfas`
1`:/ colfas`
2===========
2===========
3
3
4−String to XML XX.
4+String to XML XX
5
5
6`:/`, `colfas`, is a synthetic rune that produces `[%$ [%$ p ~] ~]`,
6`:/`, `colfas`, is a synthetic rune that produces `[%$ [%$ p ~] ~]`,
7i.e., `[0 [0 p 0] 0]`.
7i.e., `[0 [0 p 0] 0]`.
8
8
9−Produces
10−--------
11−
12−Twig: `[%clfs p=twig]`
13−
14−Accepts
15−-------
16−
17−`p` is a [`++twig`]()
18−
19−Tall form
20−---------
21−
22− :/ p
23−
24−Wide form
25−---------
26−
27− :/(p)
28−
29−Examples
9+Examples:
30−--------
31
10
32 ~zod/try=> :/(20)
11 ~zod/try=> :/(20)
33 [[%~. [%~. 20] ~] ~]
12 [[%~. [%~. 20] ~] ~]
docs/system/hoon/runes/cl/clhp.md+15−29
@@ -1,36 +1,22 @@
1−`:- colhep`
1+# `:cons`, `:-`, "colhep", `{$cons p/twig q/twig}`
2−===========
3
2
4Tuple of two.
3Tuple of two.
5
4
6−Produces
5+Produces: a cell of `p` and `q`.
7−--------
8
6
9−Twig: `[%clhp p=twig q=twig]`
7+Regular form: *2-fixed*
10
8
11−Accepts
9+Irregular forms:
12−-------
13
10
14−`p` is a [++twig](). `q` is a twig.
11+```
12+[a b] :-(a b)
13+1^2^3 [1 2 3]
14+a+1 [%a 1]
15+`1 [~ 1]
16+[1 2]~ [[1 2] ~]
17+```
15
18
16−Tall form
17−---------
18−
19− :- p
20− q
21−
22−Wide form
23−---------
24−
25− :-(p q)
26−
27−Irregular form
28−--------------
29−
30− [p q]
31−
32−Examples
19+Examples:
33−--------
34
20
35 ~zod/try=> :-(1 2)
21 ~zod/try=> :-(1 2)
36 [1 2]
22 [1 2]
@@ -66,7 +52,7 @@ Some obscure `:-` irregular forms
66 ~zod/main=/app> a/'twig'
52 ~zod/main=/app> a/'twig'
67 [%a 'twig']
53 [%a 'twig']
68
54
69−Like `^`, but first item must be a [`++term`](), and is [cube]()d. Used to construct [`path`]()s and [frond]().
55+Like `^`, but first item must be a `++term`, and is cubed. Used to construct `path`s and frond.
70
56
71### Prefix `` ` ``, postfix `~`
57### Prefix `` ` ``, postfix `~`
72
58
@@ -75,5 +61,5 @@ Like `^`, but first item must be a [`++term`](), and is [cube]()d. Used to const
75 ~zod/main=/app> [42 30]~
61 ~zod/main=/app> [42 30]~
76 [[42 30] ~]
62 [[42 30] ~]
77
63
78−Complimenting each other, these construct pairs with `~` in the [head]() and
64+Complimenting each other, these construct pairs with `~` in the head and
79−[`tail`]() respectively. Multiple postfix `~` do not work for unknown reasons.
65+`tail` respectively. Multiple postfix `~` do not work for unknown reasons.
docs/system/hoon/runes/cl/clkt.md+3−36
@@ -1,45 +1,12 @@
1−`:^ colket`
1+# `:conq`, `:^`, "colket", `{$conq p/twig q/twig r/twig s/twig}`
2−===========
3
2
4Tuple of four.
3Tuple of four.
5
4
6−Produces
5+Produces: the tuple of `[p q r s]`.
7−--------
8
6
9−Twig: `[%clkt p=twig q=twig r=twig s=twig]`
7+Regular form: *4-fixed*
10−
11−Accepts
12−-------
13−
14−`p` is a [++twig](). `q` is a twig. `r` is a twig. `s` is a
15−twig.
16−
17−Tall form
18−---------
19−
20−Kingside:
21−
22− :^ p
23− q
24− r
25− s
26−
27−Queenside:
28−
29− :^ p q
30− r
31− s
32−
33− :^ p q r
34− s
35−
36−Wide form
37−---------
38−
39− :^(p q r s)
40
8
41Examples
9Examples
42−--------
43
10
44 /~zod/try=> :^(1 2 3 4)
11 /~zod/try=> :^(1 2 3 4)
45 [1 2 3 4]
12 [1 2 3 4]
docs/system/hoon/runes/cl/clls.md+5−29
@@ -1,39 +1,15 @@
1−`:+ collus`
1+# `:cont`, `:+`, "collus", `{$cont p/twig q/twig r/twig}`
2===========
2===========
3
3
4Tuple of 3.
4Tuple of 3.
5
5
6−Produces
6+Produces: the tuple of `p`, `q`, and `r`.
7−--------
8
7
9−Twig: `[%clls p=twig q=twig r=twig]`
8+Regular form:
10
9
11−Accepts
10+*3-fixed*
12−-------
13
11
14−`p` is a [++twig](). `q` is a twig. `r` is a twig.
15−
16−Tall form
17−---------
18−
19−Kingside:
20−
21− :+ p
22− q
23− r
24−
25−Queenside:
26−
27− :+ p q
28− r
29−
30−Wide form
31−---------
32−
33− :+(p q r)
34−
35−Examples
12+Examples:
36−--------
37
13
38 /~zod/try=> :+ 1
14 /~zod/try=> :+ 1
39 2
15 2
docs/system/hoon/runes/cl/clsg.md+5−32
@@ -1,40 +1,13 @@
1−`:~ colsig`
1+# `:conl`, `:~`, "colsig", `{$conl p/(list twig)}`
2===========
2===========
3
3
4Null-terminated tuple of n elements.
4Null-terminated tuple of n elements.
5
5
6−Closed with `==`.
6+Produces: tuple of input elements. Closed with `==` in tall form.
7
7
8−Produces
8+Regular form: *running*
9−--------
10
9
11−Twig: `[%clsg p=tusk]`
10+Examples:
12−
13−Accepts
14−-------
15−
16−`p` is a [`++tusk`](), a list of [`++twig`]()s.
17−
18−Tall form
19−---------
20−
21− :~ i.p
22− i.t.p
23− i.t.t.p
24− ==
25−
26−Wide form
27−---------
28−
29− :~(i.p i.t.p i.t.t.p)
30−
31−Irregular form
32−--------------
33−
34− ~[i.p i.t.p i.t.t.p]
35−
36−Examples
37−--------
38
11
39 /~zod/try=> :~(5 3 4 2 1)
12 /~zod/try=> :~(5 3 4 2 1)
40 [5 3 4 2 1 ~]
13 [5 3 4 2 1 ~]
@@ -61,7 +34,7 @@ This is the most straightforward case of `:~`, producing a tuple in wide, irregu
61 ~[1 2 4 3 5]
34 ~[1 2 4 3 5]
62
35
63In this example we use `%-` to pass the results of our previous example
36In this example we use `%-` to pass the results of our previous example
64−to [`++limo`](), which creates a [`++list`](), and [`++flop`](), which
37+to `++limo`, which creates a `++list`, and `++flop`, which
65reverses its order. This example shows how `:~` is commonly useful.
38reverses its order. This example shows how `:~` is commonly useful.
66Null-terminated tuples are easily converted to lists, which are
39Null-terminated tuples are easily converted to lists, which are
67frequently encountered in hoon.
40frequently encountered in hoon.
docs/system/hoon/runes/cl/cltr.md+3−30
@@ -1,37 +1,10 @@
1−`:* coltar`
1+# `:conp`, `:*`, "coltar", {$conp p/(list twig)}
2−===========
3
2
4Tuple of n elements.
3Tuple of n elements.
5
4
6−Closed with `==`.
5+Produces: tuple of input elements. Closed with `==`.
7
6
8−Produces
7+Regular form: *running*
9−--------
10−
11−Twig: `[%cltr p=tusk]`
12−
13−Accepts
14−-------
15−
16−`p` is a [`++tusk`](), a list of [++twig]()s.
17−
18−Tall form
19−---------
20−
21− :~ i.p
22− i.t.p
23− i.t.t.p
24− ==
25−
26−Wide form
27−---------
28−
29− :*(i.p i.t.p i.t.t.p)
30−
31−Irregular form
32−--------------
33−
34− [i.p i.t.p i.t.t.p]
35
8
36Examples
9Examples
37--------
10--------
docs/system/hoon/runes/dt/dtkt.md+7−46
@@ -1,51 +1,12 @@
1−`.^ dotket`
1+# `:wish`, `.^`, "dotket", `{$wish p/twig q/twig}`
2−===========
3
2
4−Nock 11.
3+Nock 11--grab a file from namespace.
5
4
6−Generates nock operator `11`, which--in virtual userspace
5+Generates: nock operator `11`, which--in virtual userspace
7−nock, [`++mock`]()--loads a file from the global namespace, [%clay]().
6+nock, `++mock`--loads a file from the global namespace, %clay.
8
7
8+Regular form: *2-fixed*
9
9
10−Produces
10+Examples:
11−--------
12
11
13−Twig: `[%dtkt p=twig]`
12+XX Something wasn't working for me and didn't want to waste time.
14−
15−Accepts
16−-------
17−
18−`p` is a [`++twig`]().
19−
20−Tall form
21−---------
22−
23− .^ p
24−
25−Wide form
26−---------
27−
28− .^(p)
29−
30−Examples
31−--------
32−
33− ~zod/try=> .^(a//=name=/~zod)
34− 587.481.414.525.965.665.129.596
35− ~zod/try=> (,@t .^(a//=name=/~zod))
36− '|Tianming|'
37−
38−First we use `.^` to load the contents of `a//=name=/~zod` as a noun.
39−Subsequently using `,@t` to cast to a cord, we can see that the contents
40−are `'|Tianming|'`.
41−
42− ~zod/try=> :into %/test 'hello'
43− + /~zod/try/2/test
44− ~zod/try=> .^(cx/%/test)
45− 478.560.413.032
46− ~zod/try=> (,@t .^(cx/%/test))
47− 'hello'
48−
49−This is similar to the previous example, but uses our simple `:into`
50−program to write a cord to a file. Then we follow the above method to
51−confirm its contents.
docs/system/hoon/runes/dt/dtls.md+5−27
@@ -1,38 +1,16 @@
1−`.+ dotlus`
1+# `:bump`, `.+` "dotlus" `{$bump p/twig}`
2−===========
3
2
4Increments an atom.
3Increments an atom.
5
4
6−`.+` is a natural rune that generates nock operator `4`, which
5+Generates: nock operator `4`, which increments atom `p`.
7−increments an operand that's an atom.
8
6
9−Accepts
7+Regular form: *1-fixed*
10−--------
11
8
12−Twig: `[%dtls p=twig]`
9+Irregular form:
13
10
14−Sample
11+`+(6) .+(6)`
15−------
16−
17−`p` is a [`++twig`]()
18−
19−Tall form
20−---------
21−
22− .+ p
23−
24−Wide form
25−---------
26−
27− .+(p)
28−
29−Irregular form
30−--------------
31−
32− +(p)
33
12
34Examples
13Examples
35−--------
36
14
37 ~zod/try=> +(6)
15 ~zod/try=> +(6)
38 7
16 7
docs/system/hoon/runes/dt/dttr.md+4−31
@@ -1,38 +1,11 @@
1−`.* dottar`
1+# `:bump`, `{$bump p/twig}`
2−===========
3
2
4Compute nock.
3Compute nock.
5
4
6−Computes nock expressions. Runs nock formula `q` on
5+Computes: nock expressions. Runs nock formula `q` on
7nock subject `p`.
6nock subject `p`.
8
7
9−`.*` is a natural rune that calculates the nock of subject `p` and
8+Examples:
10−formula `q`. `.*` makes it possible to compute nock formulas in user
11−space.
12−
13−Produces
14−--------
15−
16−Twig: `[%dttr p=twig q=twig]`
17−
18−Accepts
19−-------
20−
21−`p` is a [twig](). `q` is a [twig]().
22−
23−Tall form
24−---------
25−
26− .* p
27− q
28−
29−Wide form
30−---------
31−
32− .*(p q)
33−
34−Examples
35−--------
36
9
37 ~zod/try=> .*([20 30] [0 2])
10 ~zod/try=> .*([20 30] [0 2])
38 20
11 20
@@ -47,4 +20,4 @@ Examples
47 ~zod/try=> .*(~ [5 1^5 [4 1^3]])
20 ~zod/try=> .*(~ [5 1^5 [4 1^3]])
48 1
21 1
49
22
50−See the [nock tutorial]() for further discussion of Nock.
23+See the nock tutorial for further discussion of Nock.
docs/system/hoon/runes/dt/dtts.md+6−32
@@ -1,38 +1,12 @@
1−`.= dottis`
1+# `:same`, `.=`, "dottis", `{$same p/twig q/twig}`
2−===========
3
2
4Test equality.
3Test equality.
5
4
6−Nock operator 5: tests two nouns `p` and `q` for equality, producing a boolean.
5+Generates: Nock operator 5. Tests two nouns `p` and `q` for equality, producing a boolean.
7
6
8−Produces
7+Regular form: *2-fixed*
9−--------
10
8
11−Twig: `[%dtts p=twig q=twig]`
12−
13−Accepts
14−-------
15−
16−`p` is a [`++twig`](). `q` is a twig.
17−
18−Tall form
19−---------
20−
21− .= p
22− q
23−
24−Wide form
25−---------
26−
27− .=(p q)
28−
29−Irregular form
30−--------------
31−
32− =(p q)
33−
34−Examples
9+Examples:
35−--------
36
10
37 ~zod/try=> =(0 0)
11 ~zod/try=> =(0 0)
38 %.y
12 %.y
@@ -55,7 +29,7 @@ of each `p` and `q`. In the first case of this example the tape `"a"` is
55actually the list `[97 0]` since the ASCII code for `'a'` is 97. The
29actually the list `[97 0]` since the ASCII code for `'a'` is 97. The
56following cases serve to show similar implicit down-casts.
30following cases serve to show similar implicit down-casts.
57
31
58− /~zod/try=> =isa |= a=@t
32+ /~zod/try=> =isa |= a/@t
59 ?: =(a 'a')
33 ?: =(a 'a')
60 'yes a'
34 'yes a'
61 'not a'
35 'not a'
@@ -65,7 +39,7 @@ following cases serve to show similar implicit down-casts.
65 /~zod/try=> (isa 'a')
39 /~zod/try=> (isa 'a')
66 'yes a'
40 'yes a'
67
41
68−In common practice `.=` is often used inside of [`?`]() runes, where
42+In common practice `.=` is often used inside of `?` runes, where
69switching on equality is needed. Here we construct a simple function to test
43switching on equality is needed. Here we construct a simple function to test
70if our argument is equal to `'a'` and produce either `'yes a'` or
44if our argument is equal to `'a'` and produce either `'yes a'` or
71`'not a'` accordingly.
45`'not a'` accordingly.
docs/system/hoon/runes/dt/dtwt.md+4−24
@@ -1,33 +1,13 @@
1−`.? dotwut`
1+# `:deep`, `.?`, "dotwut", `{$deep p/twig}`
2−===========
3
2
4Test if noun is cell or atom.
3Test if noun is cell or atom.
5
4
6−Nock operator 3: tests whether a noun is a cell or an
5+Generates: Nock operator 3. Tests whether a noun is a cell or an
7atom, producing true if it is the former and false if the latter.
6atom, producing true if it is the former and false if the latter.
8
7
9−Produces
8+Regular form: *1-fixed*
10−--------
11
9
12−Twig: `[%dtwt p=twig]`
13−
14−Accepts
15−-------
16−
17−`p` is a [`++twig`]().
18−
19−Tall form
20−---------
21−
22− .? p
23−
24−Wide form
25−---------
26−
27− .?(p)
28−
29−Examples
10+Examples:
30−--------
31
11
32 ~zod/try=> .?(~)
12 ~zod/try=> .?(~)
33 %.n
13 %.n
docs/system/hoon/runes/dt/dtzy.mddeleted−47
@@ -1,47 +0,0 @@
1−`dotzay`
2−========
3−
4−Odored atom.
5−
6−`dotzay` is a natural rune that produces a non-cubed atomic constant of
7−odor `p` and value `q`. `dotzay` is never used explicitly, but always
8−implicitly to give odors to atoms.
9−
10−Produces
11−--------
12−
13−Twig: `[%dtzy p=term q=@]`
14−
15−Sample
16−------
17−
18−`p` is a [`++term`](). `q` is an [atom]().
19−
20−Tall form
21−---------
22−
23−None
24−
25−Wide form
26−---------
27−
28−None
29−
30−Irregular form
31−--------------
32−
33−None
34−
35−Examples
36−--------
37−
38− ~zod/try=> (ream '12')
39− [%dtzy p=%ud q=12]
40− ~zod/try=> (ream '&')
41− [%dtzy p=%f q=0]
42− ~zod/try=> (ream '~.sam')
43− [%dtzy p=%ta q=7.168.371]
44−
45−Here we use [`++ream`]() to unpack how values are parsed. Passing what
46−what would appear to be constants reveals that they are in fact parsed
47−into an odor [`++term`] and their numeric atom representation.
docs/system/hoon/runes/dt/dtzz.mddeleted−47
@@ -1,47 +0,0 @@
1−`dotzaz`
2−========
3−
4−Cube.
5−
6−`dotzaz` is a natural rune that produces a cubed noun constant of value
7−`q` and odor `p`, if `q` is an atom. A cube is an atom whose type
8−contains only itself.
9−
10−Produces
11−--------
12−
13−Twig: `[%dtzz p=term q=*]`
14−
15−Sample
16−------
17−
18−`p` is a [`++term`](). `q` is an [noun]().
19−
20−Tall form
21−---------
22−
23−None
24−
25−Wide form
26−---------
27−
28−None
29−
30−Irregular form
31−--------------
32−
33−None
34−
35−Examples
36−--------
37−
38− ~zod/try=> (ream '%12')
39− [%dtzz p=%ud q=12]
40− ~zod/try=> (ream '%&')
41− [%dtzz p=%f q=0]
42− ~zod/try=> (ream '%sam')
43− [%dtzz p=%tas q=7.168.371]
44−
45−Here we use [`++ream`]() to unpack how values are parsed. Prefixing a
46−value with a `%` implicitly turns it into a `%cube` with the following
47−value: an odored noun.
docs/system/hoon/runes/kt/ktbr.md+8−28
@@ -1,36 +1,16 @@
1−`^| ketbar`
1+# `:iron`, `^|`, "ketbar", `{$iron p/twig}`
2−===========
3
2
4Make core context unreadable.
3Make core context unreadable.
5
4
6−Converts a core to a core whose [context]() is unreadable. Useful in
5+Converts an %gold core `p` to an %iron core. Useful in preventing type
7−preventing type fails when replacing one core with one context
6+fails when replacing one core with one context with another core with a
8−with another core with a different context. In hoon-specific terminonlogy, `^|` is a natural rune that converts a [`%gold`]() core into an [`%iron`]() core.
7+different context.
9
8
10−Produces
9+Regular form: *1-fixed*
11−--------
12
10
13−Twig: `[%ktbr p=twig]`
11+Examples:
14
12
15−Accepts
16−-------
17−
18−`p` is a [`++twig`]().
19−
20−Tall form
21−---------
22−
23− ^| p
24−
25−Wide form
26−---------
27−
28− ^|(p)
29−
30−Examples
31−--------
32−
33− /~zod/try=> =cor |= a=@
13+ /~zod/try=> =cor |= a/@
34 +(a)
14 +(a)
35 new var %cor
15 new var %cor
36 /~zod/try=> +<.cor
16 /~zod/try=> +<.cor
@@ -43,4 +23,4 @@ Examples
43 ! exit
23 ! exit
44
24
45Here we crete a simple gate and assign it to the shell variable `cor`.
25Here we crete a simple gate and assign it to the shell variable `cor`.
46−We can examine the sample of `cor` with `+<` (the [head]() of the [tail]()) to produce `a=0`. Assigning a new shell variable, `iro` as the `^|` of `cor` we can no longer peek in to its subject.
26+We can examine the sample of `cor` with `+<` (the head of the tail) to produce `a=0`. Assigning a new shell variable, `iro` as the `^|` of `cor` we can no longer peek in to its subject.
docs/system/hoon/runes/kt/ktdt.md+4−20
@@ -1,5 +1,4 @@
1−`^. ketdot`
1+# `:ward`, `^.`, "ketdot", `{$ward p/twig q/twig}`
2−===========
3
2
4Cast `q` to product type of `p`.
3Cast `q` to product type of `p`.
5
4
@@ -8,26 +7,11 @@ as casting `q` to the product type of `p`. Useful when you want
8to cast to the type of a function that you don't want to actually
7to cast to the type of a function that you don't want to actually
9run at runtime.
8run at runtime.
10
9
11−Produces
10+Regular form: *2-fixed*
12−--------
13
11
14−Twig: `[%ktdt p=twig q=twig]`
12+Examples:
15
13
16−Accepts
17−-------
18−
19−`p` is a [`++twig`](). `q` is a twig.
20−
21−Tall form
22−---------
23−
24− ^. p
25− q
26−
27−Examples
28−--------
29−
30− /~zod/try=> =cor |= [~ a=@]
14+ /~zod/try=> =cor |= [~ a/@]
31 [~ p=a]
15 [~ p=a]
32 changed %cor
16 changed %cor
33 /~zod/try=> ^.(cor [~ 97])
17 /~zod/try=> ^.(cor [~ 97])
docs/system/hoon/runes/kt/kthp.md+8−28
@@ -1,38 +1,18 @@
1−`^- kethep`
1+# `:cast`, `^-`, "kethep", `{$cast p/twig q/twig}`
2−===========
3
2
4Cast.
3Cast.
5
4
6−Casts `q` to the [span]() of `p`. The same as `^+`, except for that `q` is actually cast to the bunt of `q` (`$,(q)`). The easiest way to make a basic cast. Used when you already have already created a validator function ([mold]()) for a span.
5+Casts `q` to the span of `p`. The same as `^+`, except for that `q` is actually cast to the bunt of `q` (`$,(q)`). The easiest way to make a basic cast; used when you already have already created a validator function (mold) for a span.
7
6
8−Produces
7+Regular form: *2-fixed*
9−--------
10
8
11−Twig: `[%kthp p=mold q=twig]`
9+Irregular form:
12
10
13−Accepts
14−-------
15
11
16−`p` is a mold. `q` is a [`++twig`]().
12+ `p`q ^-(p q)
17
13
18−Tall form
19−---------
20
14
21− ^- p
22− q
23−
24−Wide form
25−---------
26−
27− ^-(p q)
28−
29−Irregular form
30−--------------
31−
32− `p`q
33−
34−Examples
15+Examples:
35−--------
36
16
37 ~zod/try=> (add 90 7)
17 ~zod/try=> (add 90 7)
38 97
18 97
@@ -45,8 +25,8 @@ Here we see a straightforward use of `^-` in both irregular and wide
45forms, simply casting an atom to a `@t`. `97` is the ASCII code for
25forms, simply casting an atom to a `@t`. `97` is the ASCII code for
46`'a'`.
26`'a'`.
47
27
48− /~zod/try=> =cor |= a=@
28+ /~zod/try=> =cor |= a/@
49− ^- (unit ,@ta)
29+ ^- (unit @ta)
50 [~ u=a]
30 [~ u=a]
51 new var %cor
31 new var %cor
52 /~zod/try=> (cor 97)
32 /~zod/try=> (cor 97)
docs/system/hoon/runes/kt/ktls.md+8−34
@@ -1,52 +1,31 @@
1−`^+ ketlus`
1+# `:like`, `^+`, "ketlus", `{$like p/twig q/twig}`
2−===========
3
2
4Cast `q` to an unbunted `p`.
3Cast `q` to an unbunted `p`.
5
4
6Casts `q` to the type of `p`, verifying that it contains
5Casts `q` to the type of `p`, verifying that it contains
7the type of `q`. Similar to `^+`, but doesn't bunt `p`. Used to
6the type of `q`. Similar to `^+`, but doesn't bunt `p`. Used to
8cast to types that have previously been made into validator
7cast to types that have previously been made into validator
9−functions (clams) with `$,`. For example, the arguments to a [`|=`]() are
8+functions (clams) with `$,`. For example, the arguments to a `|=` are
10−automatically bunted with a [`=|`](), so `^+` is used. Most often we use `^+` to cast when our type is already defined by something inside our context.
9+automatically bunted with a `=|`, so `^+` is used. Most often we use `^+` to cast when our type is already defined by something inside our context.
11
10
12−Produces
11+Regular form: *2 fixed*
13−--------
14
12
15−Twig: `[%ktls p=twig q=twig]`
16−
17−Sample
18−------
19−
20−`p` is a [`++twig`](). `q` is a twig.
21−
22−Tall form
23−---------
24−
25− ^+ p
26− q
27−
28−Wide form
29−---------
30−
31− ^+(p q)
32−
33−Examples
13+Examples:
34−--------
35
14
36 ~zod/try=> (add 90 7)
15 ~zod/try=> (add 90 7)
37 97
16 97
38 ~zod/try=> ^+('any text' (add 90 7))
17 ~zod/try=> ^+('any text' (add 90 7))
39 'a'
18 'a'
40
19
41−Here we use a ['++cord']() (which could be any cord), `'any text'` to cast our
20+Here we use a '++cord' (which could be any cord), `'any text'` to cast our
42result to a cord.
21result to a cord.
43
22
44− /~zod/try=> =cor |= a=[q=@ta r=@ s=@]
23+ /~zod/try=> =cor |= a/{q/@ta r/@ s/@}
45 [(cat 3 'new' q.a) (add r.a s.a) (sub r.a s.a)]
24 [(cat 3 'new' q.a) (add r.a s.a) (sub r.a s.a)]
46 new var %cor
25 new var %cor
47 /~zod/try=> (cor 'start' 6 3)
26 /~zod/try=> (cor 'start' 6 3)
48 [8.390.876.208.525.960.558 9 3]
27 [8.390.876.208.525.960.558 9 3]
49− /~zod/try=> =cor |= a=[q=@ta r=@ s=@]
28+ /~zod/try=> =cor |= a/[q/@ta r/@ s/@]
50 ^+ a
29 ^+ a
51 [(cat 3 'new' q.a) (add r.a s.a) (sub r.a s.a)]
30 [(cat 3 'new' q.a) (add r.a s.a) (sub r.a s.a)]
52 changed %cor
31 changed %cor
@@ -60,8 +39,3 @@ the sum of the latter two as the second, and the differene as the third.
60In the first call you can see that our type information is lost, and we
39In the first call you can see that our type information is lost, and we
61produce our cord as an atom. By adding a `^+ a` we cast the result to
40produce our cord as an atom. By adding a `^+ a` we cast the result to
62our input, and type information is retained.
41our input, and type information is retained.
63−
64−Equivalent to
65−-------------
66−
67− ^-(_p q)
docs/system/hoon/runes/kt/ktpm.md+10−39
@@ -1,46 +1,17 @@
1−`^& ketpam`
1+# `:zinc`, `^&`, "ketpam", `{$zinc p/twig}`
2−===========
3
2
4Convert `%gold` to `%zinc`.
3Convert `%gold` to `%zinc`.
5
4
6−`^&` is a natural rune that converts a `%gold` core into a `%zinc` core.
5+Converts a `%gold` core `p` into a `%zinc` core.
7−At present, `%zinc` cores are not commonly used.
8
6
9−See also
10−--------
11−
12−ketbar, `^|`, %ktbr
13−============================
14−
15−Produces
16−--------
17−
18−Twig: `[%ktpm p=twig]`
19−
20−Sample
21−------
22−
23−`p` is a [twig]().
24−
25−Tall form
26−---------
27−
28− ^& p
29−
30−Wide form
31−---------
32−
33− ^&(p)
34−
35−Irregular form
36−--------------
37−
38−None
39−
40−Examples
7+Examples:
41−--------
42
8
43 ~zod/try=> |=(@ 1)
9 ~zod/try=> |=(@ 1)
44− <1.gcq [@ @n <250.yur 41.wda 374.hzt 100.kzl 1.ypj %164>]>
10+ < 1.odf
11+ {@ {our/@p now/@da eny/@uvI} $~ <282.ucw 42.juj 402.arm 110.jyx 1.ztu $151>}
12+ >
45 ~zod/try=> ^&(|=(@ 1))
13 ~zod/try=> ^&(|=(@ 1))
46− <1&gcq [@ @n <250.yur 41.wda 374.hzt 100.kzl 1.ypj %164>]>
14+ < 1&odf
15+ {@ {our/@p now/@da eny/@uvI} $~ <282.ucw 42.juj 402.arm 110.jyx 1.ztu $151>}
16+ >
17+
docs/system/hoon/runes/kt/ktsg.md+3−22
@@ -1,5 +1,4 @@
1−`^~ ketsig`
1+# `:burn`, `^~`, "ketsig", `{$burn p/twig}`
2−===========
3
2
4Try executing `p` at compile time.
3Try executing `p` at compile time.
5
4
@@ -7,25 +6,7 @@ Tries to execute `p` statically at compile time. If this
7fails, `p` remains dynamic. Primarily useful for
6fails, `p` remains dynamic. Primarily useful for
8optimization: when a value is static, `^~` can simplify the compilation.
7optimization: when a value is static, `^~` can simplify the compilation.
9
8
10−Produces
9+Regular form *1-fixed*
11−--------
12−
13−Twig: `[%ktsg p=twig]`
14−
15−Accepts
16−-------
17−
18−`p` is a [`++twig`]().
19−
20−Tall form
21−---------
22−
23− ^~ a
24−
25−Wide form
26−---------
27−
28− ^~(a)
29
10
30Examples
11Examples
31--------
12--------
@@ -35,7 +16,7 @@ Examples
35 /~zod/try=> (make '^~(|-(42))')
16 /~zod/try=> (make '^~(|-(42))')
36 [%1 p=42]
17 [%1 p=42]
37
18
38−Here we use [`++make`]() to examine the nock generated for a particular
19+Here we use `++make` to examine the nock generated for a particular
39computation. We start with a simple kicked trap, `|-`, that just
20computation. We start with a simple kicked trap, `|-`, that just
40generates the static value `42`. When we wrap our `|-` in a `^~` you can
21generates the static value `42`. When we wrap our `|-` in a `^~` you can
41see that our compilation is much simpler.
22see that our compilation is much simpler.
docs/system/hoon/runes/kt/ktts.md+4−31
@@ -1,41 +1,14 @@
1−`^= kettis`
1+# `:name`, `^=`, "kettis", `{$name p/toga q/twig}`
2−===========
3
2
4Wraps a variable name around a value.
3Wraps a variable name around a value.
5
4
6−
7`^=`, `kettis`, `[%ktts p=toga q=twig]` is a natural rune that wraps `q`
5`^=`, `kettis`, `[%ktts p=toga q=twig]` is a natural rune that wraps `q`
8−in the [`++toga`]() `p`. `^=` is most commonly used for assignment,
6+in the `++toga` `p`. `^=` is most commonly used for assignment,
9adding one or more names to values.
7adding one or more names to values.
10
8
11−Produces
9+Regular form: *2-fixed*
12−--------
13−
14−Twig: `[%ktts p=toga q=twig]`
15−
16−Accepts
17−-------
18−
19−`p` is a `++toga`. `q` is a [`++twig`]().
20−
21−Tall form
22−---------
23−
24− ^= p
25− q
26−
27−Wide form
28−---------
29−
30− ^=(p q)
31−
32−Irregular form
33−--------------
34−
35− p=q
36
10
37−Examples
11+Examples:
38−--------
39
12
40 ~zod/try=> a=1
13 ~zod/try=> a=1
41 a=1
14 a=1
docs/system/hoon/runes/kt/ktwt.md+5−28
@@ -1,36 +1,13 @@
1−`^? ketwut`
1+# `:lead`, `^?` "ketwut", `{$lead p/twig}`
2−===========
3
2
4−Convert `%gold` to `%lead`.
3+Convert core with unreadable sample to have unreadable sample and context.
5
4
6−Used to convert a [core]() whose context is unreadable (aka
5+Converts a %gold core `p` to a %lead core.
7−a %gold core) to a core both of whose context and sample are
8−unreadable (aka a %lead core). XX
9
6
7+Regular form: *1-fixed*
10
8
11
9
12−Produces
10+Examples:
13−--------
14−
15−Twig: `[%ktwt p=twig]`
16−
17−Sample
18−------
19−
20−`p` is a [`++twig`]().
21−
22−Tall form
23−---------
24−
25− ^? p
26−
27−Wide form
28−---------
29−
30− ^?(p)
31−
32−Examples
33−--------
34
11
35 ~zod/try=> |=(@ 1)
12 ~zod/try=> |=(@ 1)
36 <1.gcq [@ @n <250.yur 41.wda 374.hzt 100.kzl 1.ypj %164>]>
13 <1.gcq [@ @n <250.yur 41.wda 374.hzt 100.kzl 1.ypj %164>]>
docs/system/hoon/runes/sg/sgbc.md+3−24
@@ -1,33 +1,12 @@
1−`~$ sigbuc`
1+# `:poll`, `~$` "sigbuc", `{$poll p/term q/twig}`
2−===========
3
2
4Label for profiling.
3Label for profiling.
5
4
6Labels computation `q` as `p` for profiling.
5Labels computation `q` as `p` for profiling.
7
6
8−Produces
7+Irregular form: *2-fixed*
9−--------
10
8
11−Twig: `[%sgbc p=term q=twig]`
9+Examples:
12−
13−Accepts
14−-------
15−
16−`p` is a [`++term`](). `q` is a [`++twig`]().
17−
18−Tall form
19−---------
20−
21− ~$ p
22− q
23−
24−Wide form
25−---------
26−
27− ~$(p q)
28−
29−Examples
30−--------
31
10
32 ~zod/try=> (make '~$(foo |-($))')
11 ~zod/try=> (make '~$(foo |-($))')
33 [%10 p=[p=1.702.259.052 q=[%1 p=7.303.014]] q=[%8 p=[%1 p=[9 2 0 1]] q=[%9 p=2 q=[%0 p=1]]]]
12 [%10 p=[p=1.702.259.052 q=[%1 p=7.303.014]] q=[%8 p=[%1 p=[9 2 0 1]] q=[%9 p=2 q=[%0 p=1]]]]
docs/system/hoon/runes/sg/sgbr.md+7−21
@@ -1,28 +1,14 @@
1−`~| sigbar`
1+# `:show`, `~|` "sigbar", `{$show p/twig q/twig}`
2−===========
3
2
4`p` in stack trace if `q` crashes.
3`p` in stack trace if `q` crashes.
5
4
6−Presents the product of `p` in the stack trace if `q` crashes. `p` is only
5+Produces: `p` in the stack trace if `q` crashes. `p` is only
7evaluated if `q` crashes.
6evaluated if `q` crashes.
8
7
9−Produces
8+Regular form: *2-fixed*
10−--------
11
9
12−Twig: `[%sgbr p=twig q=twig]`
10+Examples:
13
11
14−Accepts
12+ > ~|('sample error message' !!)
15−-------
13+ 'sample error message'
16−
14+ ford: build failed ~[/g/~sivtyv-barnel/use/dojo/~sivtyv-barnel/inn/hand /g/~sivtyv-barnel/use/hood/~sivtyv-barnel/out/dojo/drum/phat/~sivtyv-barnel/dojo /d //term/1]
17−`p` is a [`++twig`](). `q` is a twig.
18−
19−Tall form
20−---------
21−
22− ~| p
23− q
24−
25−Wide form
26−---------
27−
28− ~|(p q)
docs/system/hoon/runes/sg/sgcb.md+4−25
@@ -1,34 +1,13 @@
1−`~_ sigcab`
1+# `:lurk`, `~_`, "sigcab", `{$lurk p/twig q/twig}`
2−===========
3
2
4Pre-formatted stackframe into stacktrace.
3Pre-formatted stackframe into stacktrace.
5
4
6Inserts pre-formatted stackframe `p` into the stacktrace of `q`.
5Inserts pre-formatted stackframe `p` into the stacktrace of `q`.
7−In hoon terminology, inserts `p`, a [trap]() producing a [++`tank`]() (pretty printed text), in the trace of `q`.
6+In hoon terminology, inserts `p`, a trap producing a ++`tank` (pretty printed text), in the trace of `q`.
8
7
9−Produces
8+Regular form: *2-fixed*
10−--------
11
9
12−Twig: `[%sgcb p=twig q=twig]`
13−
14−Accepts
15−-------
16−
17−`p` is a [`++twig`]() `q` is a twig
18−
19−Tall form
20−---------
21−
22− ~_ p
23− q
24−
25−Wide form
26−---------
27−
28− ~_(p q)
29−
30−Examples
10+Examples:
31−--------
32
11
33 ~zod/try=> (make '~_(+216 ~)')
12 ~zod/try=> (make '~_(+216 ~)')
34 [%10 p=[p=1.851.876.717 q=[p=[%1 p=[0 216]] q=[%0 p=1]]] q=[%1 p=0]]
13 [%10 p=[p=1.851.876.717 q=[p=[%1 p=[0 216]] q=[%0 p=1]]] q=[%1 p=0]]
docs/system/hoon/runes/sg/sgcn.md+6−34
@@ -1,52 +1,24 @@
1−`~% sigcen`
1+# `:fast`, `~%` "sigcen", `{$fast p/chum q/twig r/tyre s/twig}`
2−===========
3
2
4−Register jet.
3+General jet hint.
5
4
6Registers a jet in core `s` so that it can be called when that code is run.
5Registers a jet in core `s` so that it can be called when that code is run.
7
6
8−Produces
7+Regularm form: *4-fixed*
9−--------
10
8
11−Twig: `[%sgcn p=term q=twig r=tyre s=twig]`
9+Examples:
12−
13−Accepts
14−-------
15−
16−`p` is a [`++term`]() `q` is a [`++twig`]() `r` is a [`++tyre`]() `s` is a
17−twig.
18−
19−Tall form
20−---------
21−
22− ~% p
23− q
24− ==
25− p.i.r q.i.r
26− p.i.t.r q.i.t.r
27− ==
28− s
29−
30− ~% p
31− q
32− ~
33− s
34−
35−
36−Examples
37−--------
38
10
39 ++ aesc :: AES-256
11 ++ aesc :: AES-256
40 ~% %aesc + ~
12 ~% %aesc + ~
41 |%
13 |%
42 ++ en :: ECB enc
14 ++ en :: ECB enc
43 ~/ %en
15 ~/ %en
44− |= [a=@I b=@H] ^- @uxH
16+ |= {a/@I b/@H} ^- @uxH
45 =+ ahem
17 =+ ahem
46 (be & (ex a) b)
18 (be & (ex a) b)
47 ++ de :: ECB dec
19 ++ de :: ECB dec
48 ~/ %de
20 ~/ %de
49− |= [a=@I b=@H] ^- @uxH
21+ |= {a/@I b/@H} ^- @uxH
50 =+ ahem
22 =+ ahem
51 (be | (ix (ex a)) b)
23 (be | (ix (ex a)) b)
52 --
24 --
docs/system/hoon/runes/sg/sgfs.md+5−26
@@ -1,34 +1,13 @@
1−`~/ sigfas`
1+# `:funk`, `~/`, "sigfas", `{$funk p/chum q/twig}`
2−===========
3
2
4−XX.
3+XX HELP
5
4
6`~/` is a synthetic rune that implements one common case - a function arm in
5`~/` is a synthetic rune that implements one common case - a function arm in
7−a [book](), i.e. a library function - of the [`~%`]() [jet]() hint. Assumes the parent axis is `7` and that there are no children.
6+a book, i.e. a library function - of the `~%` jet hint. Assumes the parent axis is `7` and that there are no children.
8
7
9−Produces
8+Regular form: *2fixed*
10−--------
11
9
12−Twig: `[%sgfs p=term q=twig]`
10+Examples:
13−
14−Accepts
15−-------
16−
17−`p` is a [`++term`](). `q` is a [`++twig`]().
18−
19−Tall form
20−---------
21−
22− ~/ p
23− q
24−
25−Wide form
26−---------
27−
28− ~/(p q)
29−
30−Examples
31−--------
32
11
33 ~zod/try=> (make '~/ %bam |.(40)')
12 ~zod/try=> (make '~/ %bam |.(40)')
34 [%8 p=[%1 p=[1 40]] q=[%10 p=[p=1.953.718.630 q=[%1 p=[7.168.354 [0 7] 0]]] q=[%0 p=1]]]
13 [%8 p=[%1 p=[1 40]] q=[%10 p=[p=1.953.718.630 q=[%1 p=[7.168.354 [0 7] 0]]] q=[%0 p=1]]]
docs/system/hoon/runes/sg/sggl.md+4−33
@@ -1,43 +1,14 @@
1−`~< siggal`
1+# `~<`, "siggal", `{$thin p/$@(term {p/term q/twig}) q/twig}`
2−===========
3
2
4Hint to product.
3Hint to product.
5
4
6−`~<` is a synthetic rune that applies arbitrary [hint]() `p` to the
5+`~<` is a synthetic rune that applies arbitrary hint `p` to the
7product of `q`. `~<` is similar to `~>`, but computes `q` before
6product of `q`. `~<` is similar to `~>`, but computes `q` before
8applying the hint `p`.
7applying the hint `p`.
9
8
10−Produces
9+Irregular form: *2-fixed*
11−--------
12
10
13−Twig: `[%sggl p=$|(term [p=term q=twig]) q=twig]`
14−
15−Accepts
16−-------
17−
18−`p` is either a [`++term`]() or a `++term` twig pair. `q` is a twig.
19−
20−Tall form
21−---------
22−
23−`p=%foo`:
24−
25− ~< %foo
26− q
27−
28−`p=[p=%foo q=bar]`:
29−
30− ~< %foo.bar
31− q
32−
33−Wide form
34−---------
35−
36− ~<(%foo q)
37− ~<(%foo.bar q)
38−
39−Examples
11+Examples:
40−--------
41
12
42 ~zod/try=> (make '~<(%a 42)')
13 ~zod/try=> (make '~<(%a 42)')
43 [%7 p=[%1 p=42] q=[%10 p=97 q=[%0 p=1]]]
14 [%7 p=[%1 p=42] q=[%10 p=97 q=[%0 p=1]]]
docs/system/hoon/runes/sg/sggr.md+4−33
@@ -1,41 +1,12 @@
1−`~> siggar`
1+# `:hint`, `~>` "siggar", {$hint p/$@(term {p/term q/twig}) q/twig}
2−===========
3
2
4Arbitrary hint
3Arbitrary hint
5
4
6−`~>` is a natural rune that applies arbitrary hint `p` to `q`.
5+Applies arbitrary hint `p` to `q`.
7
6
8−Produces
7+Regular form: *2-fixed*
9−--------
10
8
11−Twig: `[%sggr p=$|(term [p=term q=twig]) q=twig]`
12−
13−Accepts
14−-------
15−
16−`p` is either a [`++term`]() or a term [`++twig`] pair. `q` is a twig.
17−
18−Tall form
19−---------
20−
21−`p=%foo`:
22−
23− ~> %foo
24− q
25−
26−`p=[p=%foo q=bar]`:
27−
28− ~> %foo.bar
29− q
30−
31−Wide form
32−---------
33−
34− ~>(%foo q)
35− ~>(%foo.bar q)
36−
37−Examples
9+Examples:
38−--------
39
10
40 ~zod/try=> (make '~>(%a 42)')
11 ~zod/try=> (make '~>(%a 42)')
41 [%10 p=97 q=[%1 p=42]]
12 [%10 p=97 q=[%1 p=42]]
docs/system/hoon/runes/sg/sgls.md+4−24
@@ -1,32 +1,12 @@
1−`~+ siglus`
1+# `:memo`, `~+`, "siglus", `{$memo p/@ q/twig}`
2−===========
3
2
4Memoize computation.
3Memoize computation.
5
4
6Hints to the interpreter to memoize (cache) the computation of `p`.
5Hints to the interpreter to memoize (cache) the computation of `p`.
7
6
8−Produces
7+Regular form: *1-fixed*
9−--------
10
8
11−Twig: `[%sgls p=twig]`
12−
13−Accepts
14−-------
15−
16−`p` is a [`++twig`]()
17−
18−Tall form
19−---------
20−
21− ~+ p
22−
23−Wide form
24−---------
25−
26− ~+(p)
27−
28−Examples
9+Examples:
29−--------
30
10
31 ~zod/try=> 20
11 ~zod/try=> 20
32 20
12 20
@@ -40,5 +20,5 @@ Examples
40 ~zod/try=> `@tas`1.869.440.365
20 ~zod/try=> `@tas`1.869.440.365
41 %memo
21 %memo
42
22
43−By using [`++make`]() to display the compiled nock, we can see that `~+`
23+By using `++make` to display the compiled nock, we can see that `~+`
44inserts a `%memo` hint.
24inserts a `%memo` hint.
docs/system/hoon/runes/sg/sgpm.md+5−50
@@ -1,60 +1,15 @@
1−`~& sigpam`
1+# `:dump`, `~&`, "sigpam", `{$dump p/@ud q/twig r/twig}`
2−===========
3
2
4Printf.
3Printf.
5
4
6−'Printf' or 'log' in other languages. Often used for debugging.
5+Prints `q` on the console before computing `r`. `p` is the log priority, 0-3
6+defaulting to 0. `p` is optional and is rarely used.
7
7
8−More specifically in hoon terminology, prints `q` on the console
8+Regular form: *fixed 2 or 3*
9−before computing `r`. `p` is the log priority, 0-3 defaulting to 0. `~&`
10−is similar to `printf` or `log` in other languages, and is very commonly
11−used for debugging.
12
9
13−`p` is optional and is rarely used.
14
10
15−Produces
11+Examples:
16−--------
17
12
18−Twig: `[%sgpm p=@ud q=twig r=twig]`
19−
20−Accepts
21−-------
22−
23−`p` is a [`@ud`]() `q` is a [`++twig`]() `r` is a twig.
24−
25−Tall form
26−---------
27−
28−Priority 0 (debug):
29−
30− ~& q
31− r
32−
33−Priority 1 (notice):
34−
35− ~& > q
36− r
37−
38−Priority 2 (warning):
39−
40− ~& >> q
41− r
42−
43−Priority 3 (alarm):
44−
45− ~& >>> q
46− r
47−
48−Wide form
49−---------
50−
51− ~&(>> q r)
52−
53−Examples
54−--------
55−
56− ~zod/try=> ~
57− ~
58 ~zod/try=> ~&('oops' ~)
13 ~zod/try=> ~&('oops' ~)
59 'oops'
14 'oops'
60 ~
15 ~
docs/system/hoon/runes/sg/sgts.md+3−24
@@ -1,34 +1,13 @@
1−`~= sigtis`
1+# `:ddup`, `~=` "sigtis", `{$ddup p/twig q/twig}`
2−===========
3
2
4Hint to avoid duplication.
3Hint to avoid duplication.
5
4
6Hints to the interpreter that `q` may produce a noun equal to the
5Hints to the interpreter that `q` may produce a noun equal to the
7already existing `p` in order to avoid storing the same noun twice.
6already existing `p` in order to avoid storing the same noun twice.
8
7
9−Produces
8+Regular form: *2-fixed*
10−--------
11
9
12−Twig `[%sgts p=twig q=twig]`
13−
14−Accepts
15−-------
16−
17−`p` is a [`++twig`](). `q` is a twig.
18−
19−Tall form
20−---------
21−
22− ~= p
23− q
24−
25−Wide form
26−---------
27−
28− ~=(p q)
29−
30−Examples
10+Examples:
31−--------
32
11
33 ~zod/try=> 20
12 ~zod/try=> 20
34 20
13 20
docs/system/hoon/runes/sg/sgwt.md+4−43
@@ -1,52 +1,13 @@
1−`~? sigwut`
1+# `:warn`, `~?`, "sigwut", `{$warn p/@ud q/twig r/twig s/twig}`
2−===========
3
2
4PrintF if `q` true.
3PrintF if `q` true.
5
4
6Same as `~&` except for that `r` is printed to the console if and only
5Same as `~&` except for that `r` is printed to the console if and only
7−if `q` evaluates to true.
6+if `q` evaluates to true. `p` is the priority level between 1-3 (defaults to 0) and is both optional and rarely used.
8
7
9−Produces
8+Regularm form *4-fixed*
10−--------
11
9
12−Twig: `[%sgwt p=@ud q=twig r=twig s=twig]`
13−
14−Accepts
15−-------
16−
17−`p` is a [`@ud`](). `q` is a [`++twig`](). `r` is a twig. `s` is a
18−twig.
19−
20−Tall form
21−---------
22−
23−Priority 0 (debug):
24−
25− ~& q
26− r
27−
28−Priority 1 (notice):
29−
30− ~& > q
31− r
32−
33−Priority 2 (warning):
34−
35− ~& >> q
36− r
37−
38−Priority 3 (alarm):
39−
40− ~& >>> q
41− r
42−
43−Wide form
44−---------
45−
46− ~&(>> q r)
47−
48−Examples
10+Examples:
49−--------
50
11
51 ~zod/try=> ~?((gth 1 2) 'oops' ~)
12 ~zod/try=> ~?((gth 1 2) 'oops' ~)
52 ~
13 ~
docs/system/hoon/runes/sg/sgzp.md+4−34
@@ -1,40 +1,10 @@
1−`~! sigzap`
1+# `:peep`, `~!`, "sigzap", `{$peep p/twig q/twig}`
2−===========
3
2
4Print type on compilation fail.
3Print type on compilation fail.
5
4
6−`~!` is a natural rune for debugging uses only, semantically equivalent
7−to [`++twig`] `q`. If compilation fails within `q`, `~!` will show the
8−type of `p` on the stacktrace.
5+Produces the type of `p` on the stacktrace if `q` fails. Used only for debugging purposes.
9
6
10−Produces
11−--------
12−
13−Twig: `[%sgzp p=twig q=twig]`
14−
15−Sample
16−------
17−
18−`p` is a twig, `q` is a twig.
19−
20−Tall form
21−---------
22−
23− ~! p
24− q
25−
26−Wide form
27−---------
28−
29− ~!(p q)
30−
31−Irregular form
32−--------------
33−
34−None
35−
36−Examples
7+Examples:
37−--------
38
8
39 ~zod/try=> a
9 ~zod/try=> a
40 ! -find-limb.a
10 ! -find-limb.a
@@ -55,5 +25,5 @@ of `'foo'`, `@t`.
55 ! find-none
25 ! find-none
56 ! exit
26 ! exit
57
27
58−Again, we use our unassigned variable `a` and the [cube]() `%foo`, whose
28+Again, we use our unassigned variable `a` and the cube `%foo`, whose
59type is in fact `%foo`.
29type is in fact `%foo`.
docs/system/hoon/runes/sm/smcl.md+6−38
@@ -1,48 +1,16 @@
1−`;: semcol`
1+# ``, `;:`, "semcol" `{$wad p/twig q/(list twig)}`
2−====
3
2
4Fold over tuple.
3Fold over tuple.
5
4
6Apply a binary function `p` to a tuple `q` with n elements. Similar to folding over the tuple `q`.
5Apply a binary function `p` to a tuple `q` with n elements. Similar to folding over the tuple `q`.
7
6
8−Syntax
7+Regular form: *running*
9−======
10
8
11−`;:` is a synthetic rune that applies `p`, a binary gate, to the n-ary
9+Irregular form:
12−tuple `q`. `;:` is similar to folding over the tuple `q`, producing the
13−final result.
14
10
15−Produces
11+`:(p i.q i.t.q i.t.t.q) ;:(p i.q i.t.q i.t.t.q)`
16−--------
17
12
18−Twig: `[%smcl p=twig q=tusk]`
19−
20−Accepts
21−-------
22−
23−`p` is a [`++twig`](). `q` is a [`++tusk`](), a list of twigs.
24−
25−Tall form
26−---------
27−
28− ;: p
29− i.q
30− i.t.q
31− i.t.t.q
32− ==
33−
34−Wide form
35−---------
36−
37− ;:(p i.q i.t.q i.t.t.q)
38−
39−Irregular form
40−--------------
41−
42− :(p i.q i.t.q i.t.t.q)
43−
44−Examples
13+Examples:
45−--------
46
14
47 ~zod/try=> (add 3 (add 4 5))
15 ~zod/try=> (add 3 (add 4 5))
48 12
16 12
@@ -61,5 +29,5 @@ gate `++add`.
61 ~zod/try=> `tape`(weld "foo" (weld "bar" "baz"))
29 ~zod/try=> `tape`(weld "foo" (weld "bar" "baz"))
62 "foobarbaz"
30 "foobarbaz"
63
31
64−Following on from our previous example, using `;:` with [`++weld`]() is
32+Following on from our previous example, using `;:` with `++weld` is
65convenient for concatenating multiple strings.
33convenient for concatenating multiple strings.
docs/system/hoon/runes/sm/smcn.mddeleted−82
@@ -1,82 +0,0 @@
1−`;% semcen`
2−====
3−
4−`%-` in `++sail`.
5−
6−Performs the same function as `%-`, except within XML template syntax
7−(aka sail). Passes `q`, a list of n arguments, to function `p`.
8−
9−Produces
10−--------
11−
12−Twig: [`++marl`]()
13−
14−Accepts
15−-------
16−
17−`p` is a [`++twig`]().
18−
19−Tall form
20−---------
21−
22− ;% p
23−
24−Wide form
25−---------
26−
27− %{p}
28−
29−(within quoted form)
30−
31−Examples
32−--------
33−
34− ~zod/try=>
35− ;div:"%{|=(a=marl (weld a a))} repeat"
36− [ [%div ~]
37− ~[
38− [g=[n=%$ a=~[[n=%$ v=" repeat"]]] c=~]
39− [g=[n=%$ a=~[[n=%$ v=" repeat"]]] c=~]
40− ]
41− ]
42− ~zod/try=>
43− (poxo ;div:"%{|=(a=marl (weld a a))} repeat")
44− "<div> repeat repeat</div>"
45−
46−In this simple example we use a function, `|=(a=marl (weld a a))` that
47−produces a `++marl` twice. Using the irregular form of `;%` we produce a
48−repeated child node `'repeat'`. [`++poxo`]() prints our result in XML.
49−
50− ~zod/try=>
51− ;=
52− ;% |=(a=marl (turn a |=(b=manx ;script(src (poxo b));)))
53− ; /gep/hart.js
54− ; /main/lib/urb.js
55− ; //cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.js
56− ==
57− ~[
58− [[%script [%src "/gep/hart.js
59− "] ~] ~]
60− [[%script [%src "/main/lib/urb.js
61− "] ~] ~]
62− [ [ %script
63− [%src "//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.js
64− "]
65− ~
66− ]
67− ~
68− ]
69− ]
70− ~zod/try=>
71− %- many:poxo :_ ~
72− ;=
73− ;% |=(a=marl (turn a |=(b=manx ;script(src (poxo b));)))
74− ; /gep/hart.js
75− ; /main/lib/urb.js
76− ; //cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.js
77− ==
78− "<script src="/gep/hart.js"></script><script src="/main/lib/urb.js"></script><script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.js"></script>"
79−
80−Here we go through a similar example, passing a list of urls for a
81−script tag to a gate that produces a `<script>` tag. Since we produce
82−multiple tags, we use `many:poxo` to print our result as XML.
docs/system/hoon/runes/sm/smdq.mddeleted−46
@@ -1,46 +0,0 @@
1−`;" semdoq`
2−====
3−
4−Make string.
5−
6−`semdoq` is a synthetic rune used to make strings, interpreted or not.
7−
8−Produces
9−--------
10−
11−Twig: `[%smdq p=(list beer)]`
12−
13−Sample
14−------
15−
16−`p` is a [`++list`]() of [`++beer`]()s.
17−
18−Irregular form
19−--------------
20−
21− "foo"
22−
23−Examples
24−--------
25−
26− ~zod/try=> "foo"
27− "foo"
28− ~zod/try=> "bar"
29− "bar"
30−
31−Here we see our most common case of `semdoq`, producing strings ([`++tape`]()s).
32−
33− ~zod/try=> "ba{<+(2)>}r"
34− "ba3r"
35−
36−In this case we include some simple string interpolation using `{` and
37−`}`.
38−
39− ~zod/try=> (ream '"foo"')
40− [%smdq p=~[102 111 111]]
41− ~zod/try=> (ream '"ba{<+(2)>}r"')
42− [ %smdq
43− p=~[98 97 [~ p=[%cltr p=~[[%hxgl p=~[[%dtls p=[%dtzy p=%ud q=2]]]]]]] 114]
44− ]
45−
46−Using [`++ream`]() we can see how our previous expressions are parsed.
docs/system/hoon/runes/sm/smhp.mddeleted−45
@@ -1,45 +0,0 @@
1−`;- semhep`
2−====
3−
4−Interpolate string.
5−
6−Interpolates a string (aka [++tape]()) into a [`++marl`](), our datastructure for XML.
7−
8−Produces
9−--------
10−
11−Twig: tape
12−
13−Sample
14−------
15−
16−`p` is a [`++twig`]().
17−
18−Tall form
19−---------
20−
21− ;- a
22−
23−Wide form
24−---------
25−
26− -{a}
27−
28−(within quoted form)
29−
30−Examples
31−--------
32−
33− ~zod/try=>
34− =+ c="contents!"
35− ;div: -{c}
36− [[%div ~] [[%~. [%~. "contents!"] ~] ~] ~]
37− ~zod/try=>
38− %- poxo
39− =+ c="contents!"
40− ;div: -{c}
41− "<div>contents!</div>"
42−
43−Here we add `c` to our context as a `++tape`, and interpolate it within
44−our `;div` using the irregular form of `;-`. By using [`++poxo`]() we
45−can see our result in XML form.
docs/system/hoon/runes/sm/smls.mddeleted−48
@@ -1,48 +0,0 @@
1−`;+ semlus`
2−====
3−
4−Interpolate `++manx`.
5−
6−`;+` is a virtual rune used within [`++sail`]() to interpolate a manx.
7−`;+` is useful when you need to dynamically produce a tag in a `++sail`
8−block.
9−
10−Produces
11−--------
12−
13−Twig: [`++manx`]()
14−
15−Sample
16−------
17−
18−`p` is a twig
19−
20−Tall form
21−---------
22−
23− ;+ a
24−
25−Wide form
26−---------
27−
28− +{a}
29−
30−(within quoted form)
31−
32−Examples
33−--------
34−
35− ~zod/try=>
36− =+ tag=;p(class "doc")
37− ;div ;+ tag
38− ==
39− [[%div ~] [[%p [%class "doc"] ~] ~] ~]
40− ~zod/try=>
41− %- poxo
42− =+ tag=;p(class "doc")
43− ;div ;+ tag
44− ==
45− "<div><p class="doc"></p></div>"
46−
47−Here we add `tag` to our context as a `;p` tag and use `;+` to add it to
48−our `;div`. Using [`++poxo`]() we can print our result as XML.
docs/system/hoon/runes/sm/smsg.md+4−28
@@ -1,36 +1,12 @@
1−`;~ semsig`
1+# `:dip`, `;~`, "semsig" `{$dip p/twig q/(list twig)}`
2−====
3
2
4Monad composer.
3Monad composer.
5
4
6−`;~` is a synthetic rune used to compose functions under a monad.
5+Composes a list of functions `p` and `q` under a monad. `q` can be 1 or more functions.
7
6
8−Produces
7+Regular form: 1-fixed, `q` is *running*
9−--------
10
8
11−Twig: `[%smsg p=(list beer)]`
9+Examples:
12−
13−Accepts
14−-------
15−
16−`p` is a [`++list`]() of [`++beer`]().
17−
18−Tall form
19−---------
20−
21− ;~ p
22− i.q
23− i.t.q
24− i.t.t.q
25− ==
26−
27−Wide form
28−---------
29−
30− ;~(p i.q i.t.q i.t.t.q)
31−
32−Examples
33−--------
34
10
35 ~zod/try=> =cmp |=([a=tape b=$+(char tape)] `tape`?~(a ~ (weld (b i.a) t.a)))
11 ~zod/try=> =cmp |=([a=tape b=$+(char tape)] `tape`?~(a ~ (weld (b i.a) t.a)))
36 ~zod/try=> ;~(cmp trip)
12 ~zod/try=> ;~(cmp trip)
docs/system/hoon/runes/sm/smsm.md+4−33
@@ -1,40 +1,11 @@
1−`;; semsem`
1+# `:fry`, `;;`, "semsem" `{$fry p/twig q/twig}`
2−====
3
2
4Fixpoint.
3Fixpoint.
5
4
6−`;;` is a synthetic rune that types `q` as a fixpoint of `p`. More
7−specifically, `;;` slams `q` through gate `p`, asserting that the
5+Slams `q` through gate `p`, asserting that the
8−resulting noun [`.=`]() the original, and produces it.
6+resulting noun is equal to `.=` the original, and produces it.
9
7
10−See also
8+Examples: XX Review closely
11−--------
12−
13−[`++hard`]()
14−
15−Produces
16−--------
17−
18−Twig: `[%smsm p=twig q=twig]`
19−
20−Accepts
21−-------
22−
23−`p` is a [`++twig`](). `q` is a twig.
24−
25−Tall form
26−---------
27−
28− ;; p
29− q
30−
31−Wide form
32−---------
33−
34− ;;(p q)
35−
36−Examples
37−--------
38
9
39 ~zod/try=> ^-(tape ~[97 98 99])
10 ~zod/try=> ^-(tape ~[97 98 99])
40 ! type-fail
11 ! type-fail
docs/system/hoon/runes/sm/smtr.mddeleted−50

This diff is too big to show here.

docs/system/hoon/runes/sm/smzz.mddeleted−79

This diff is too big to show here.

docs/system/hoon/runes/ts/.tsbr.md.swpnew file

Binary file not shown.

docs/system/hoon/runes/ts/.tscl.md.swpnew file

Binary file not shown.

docs/system/hoon/runes/ts/.tsdt.md.swpnew file

Binary file not shown.

docs/system/hoon/runes/ts/.tsgl.md.swpnew file

Binary file not shown.

docs/system/hoon/runes/ts/.tsgr.md.swpnew file

Binary file not shown.

docs/system/hoon/runes/ts/.tshp.md.swpnew file

Binary file not shown.

docs/system/hoon/runes/ts/.tskt.md.swpnew file

Binary file not shown.

docs/system/hoon/runes/ts/.tsls.md.swpnew file

Binary file not shown.

docs/system/hoon/runes/ts/.tssg.md.swpnew file

Binary file not shown.

docs/system/hoon/runes/ts/.tstr.md.swpnew file

Binary file not shown.

docs/system/hoon/runes/ts/tsbr.md+6−7

This diff is too big to show here.

docs/system/hoon/runes/ts/tscl.md+4−29

This diff is too big to show here.

docs/system/hoon/runes/ts/tsdt.md+2−35

This diff is too big to show here.

docs/system/hoon/runes/ts/tsgl.md+7−37

This diff is too big to show here.

docs/system/hoon/runes/ts/tsgr.md+7−28

This diff is too big to show here.

docs/system/hoon/runes/ts/tshp.md+6−32

This diff is too big to show here.

docs/system/hoon/runes/ts/tskt.md+7−44

This diff is too big to show here.

docs/system/hoon/runes/ts/tsls.md+5−33

This diff is too big to show here.

docs/system/hoon/runes/ts/tssg.md+3−34

This diff is too big to show here.

docs/system/hoon/runes/ts/tstr.md+3−29

This diff is too big to show here.

docs/system/hoon/runes/wt/wtbr.md+5−29

This diff is too big to show here.

docs/system/hoon/runes/wt/wtcl.md+5−25

This diff is too big to show here.

docs/system/hoon/runes/wt/wtdt.md+11−32

This diff is too big to show here.

docs/system/hoon/runes/wt/wtgl.md+3−28

This diff is too big to show here.

docs/system/hoon/runes/wt/wtgr.md+4−30

This diff is too big to show here.

docs/system/hoon/runes/wt/wthp.md+10−43

This diff is too big to show here.

docs/system/hoon/runes/wt/wtkt.md+7−30

This diff is too big to show here.

docs/system/hoon/runes/wt/wtls.md+10−55

This diff is too big to show here.

docs/system/hoon/runes/wt/wtpm.md+6−30

This diff is too big to show here.

docs/system/hoon/runes/wt/wtpt.md+2−32

This diff is too big to show here.

docs/system/hoon/runes/wt/wtsg.md+3−28

This diff is too big to show here.

docs/system/hoon/runes/wt/wtts.md+5−25

This diff is too big to show here.

docs/system/hoon/runes/wt/wtzp.md+3−28

This diff is too big to show here.

docs/system/hoon/runes/zp/.zpcb.md.swpnew file

Binary file not shown.

docs/system/hoon/runes/zp/.zpcm.md.swpnew file

Binary file not shown.

docs/system/hoon/runes/zp/.zpfs.md.swpnew file

Binary file not shown.

docs/system/hoon/runes/zp/.zpgr.md.swpnew file

Binary file not shown.

docs/system/hoon/runes/zp/.zpsm.md.swpnew file

Binary file not shown.

docs/system/hoon/runes/zp/.zpts.md.swpnew file

Binary file not shown.

docs/system/hoon/runes/zp/.zpwt.md.swpnew file

Binary file not shown.

docs/system/hoon/runes/zp/.zpzp.md.swpnew file

Binary file not shown.

docs/system/hoon/runes/zp/zpcb.mddeleted−57

This diff is too big to show here.

docs/system/hoon/runes/zp/zpcm.md+2−22

This diff is too big to show here.

docs/system/hoon/runes/zp/zpfs.mddeleted−59

This diff is too big to show here.

docs/system/hoon/runes/zp/zpgr.md+4−26

This diff is too big to show here.

docs/system/hoon/runes/zp/zpsm.md+3−24

This diff is too big to show here.

docs/system/hoon/runes/zp/zpts.md+4−24

This diff is too big to show here.

docs/system/hoon/runes/zp/zpwt.md+4−27

This diff is too big to show here.

docs/system/hoon/runes/zp/zpzp.md+6−25

This diff is too big to show here.