i raise you an org
commit262c9d8c887be81dd5b56600319fbed9381ba453
authorGalen Wolfe-Pauly <root@office-for.com>
dateMon 18 Apr 2016, 17:57 (11 years ago)
parent3fee830
695 files changed+204−21483
docs/programming.md+2−10
@@ -4,14 +4,6 @@ sort: 3
44
55# Programming
66
7−Urbit's programming language is called Hoon. It's a strict,
8−typed functional language without category theory. Hoon is not
9−closely related to any older language.
7+Nock is our interpreter, Hoon is our language and Arvo is our operating environment.
108
11−Hoon is named after a Wallace Stevens poem. Coincidentally, it
12−means "hooligan" in Australian. Practically, "Hoon" is a short
13−punchy name which search engines handle well.
14−
15−To learn to program in Urbit, traverse this tree depth-first:
16−
17−<list/>
9+<kids />
docs/programming/advanced.mddeleted−10
@@ -1,10 +0,0 @@
1−---
2−sort: 11
3−---
4−
5−# Advanced
6−
7−You've read through, or at least skimmed, the Core Hoon documents.
8−Here's the rest of what you need to know to program in Urbit.
9−
10−<list/>
docs/programming/advanced/arvo.mddeleted−9
@@ -1,9 +0,0 @@
1−---
2−sort: 1
3−---
4−
5−# Arvo programming
6−
7−Once you know Hoon, it's time to write programs that actually use Arvo.
8−
9−<list></list>
docs/programming/advanced/library/$.mddeleted−173
@@ -1,173 +0,0 @@
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/programming/advanced/library/src/1a/gate/add.mddeleted−39
@@ -1,39 +0,0 @@
1−### `++add`
2−
3−Add
4−
5−Produces the sum of `a` and `b`.
6−
7−Accepts
8−-------
9−
10−`a` is an atom.
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−An atom.
18−
19−Source
20−------
21−
22− ++ add :: add
23− ~/ %add
24− |= [a=@ b=@]
25− ^- @
26− ?: =(0 a) b
27− $(a (dec a), b +(b))
28−
29−Examples
30−--------
31−
32− ~zod/try=> (add 2 2)
33− 4
34− ~zod/try=> (add 1 1.000.000)
35− 1.000.001
36− ~zod/try=> (add 1.333 (mul 2 2))
37− 1.337
38−
39−***
docs/programming/advanced/library/src/1a/gate/dec.mddeleted−41
@@ -1,41 +0,0 @@
1−### `++dec`
2−
3−Decrement
4−
5−Decrements `a` by `1`.
6−
7−Accepts
8−-------
9−
10−`a` is an atom.
11−
12−Produces
13−--------
14−
15−An atom.
16−
17−Source
18−------
19−
20− ++ dec :: decrement
21− ~/ %dec
22− |= a/@
23− ~| %decrement-underflow
24− ?< =(0 a)
25− =+ b=0
26− |- ^- @
27− ?: =(a +(b)) b
28− $(b +(b))
29−
30−Examples
31−--------
32−
33− ~zod/try=> (dec 7)
34− 6
35− ~zod/try=> (dec 0)
36− ! decrement-underflow
37− ! exit
38−
39−
40−
41−***
docs/programming/advanced/library/src/1a/gate/div.mddeleted−45
@@ -1,45 +0,0 @@
1−### `++div`
2−
3−Divide
4−
5−Computes `a` divided by `b`.
6−
7−Accepts
8−-------
9−
10−`a` is an atom.
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−An atom.
18−
19−Source
20−------
21−
22− ++ div :: divide
23− ~/ %div
24− |= [a=@ b=@]
25− ^- @
26− ~| 'div'
27− ?< =(0 b)
28− =+ c=0
29− |-
30− ?: (lth a b) c
31− $(a (sub a b), c +(c))
32− ::
33−
34−Examples
35−--------
36−
37− ~zod/try=> (div 4 2)
38− 2
39− ~zod/try=> (div 17 8)
40− 2
41− ~zod/try=> (div 20 30)
42− 0
43−
44−
45−***
docs/programming/advanced/library/src/1a/gate/gte.mddeleted−41
@@ -1,41 +0,0 @@
1−### `++gte`
2−
3−Greater-than/equal
4−
5−Tests whether `a` is greater than a number `b`.
6−
7−Accepts
8−-------
9−
10−`a` is an atom.
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−A boolean.
18−
19−Source
20−------
21−
22− ++ gte :: greater-equal
23− ~/ %gte
24− |= {a/@ b/@}
25− ^- ?
26− !(lth a b)
27−
28−
29−Examples
30−--------
31−
32− ~zod/try=> (gte 100 10)
33− %.y
34− ~zod/try=> (gte 4 4)
35− %.y
36− ~zod/try=> (gte 3 4)
37− %.n
38−
39−
40−
41−***
docs/programming/advanced/library/src/1a/gate/gth.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++gth`
2−
3−Greater-than
4−
5−Tests whether `a` is greater than `b`.
6−
7−Accepts
8−-------
9−
10−`a` is an atom.
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−A boolean.
18−
19−Source
20−------
21−
22− ++ gth :: greater-than
23− ~/ %gth
24− |= {a/@ b/@}
25− ^- ?
26− !(lte a b)
27−
28−
29−
30−Examples
31−--------
32−
33− ~zod/try=> (gth 'd' 'c')
34− %.y
35− ~zod/try=> (gth ~h1 ~m61)
36− %.n
37−
38−
39−
40−***
docs/programming/advanced/library/src/1a/gate/lte.mddeleted−43
@@ -1,43 +0,0 @@
1−### `++lte`
2−
3−Less-than/equal
4−
5−Tests whether `a` is less than or equal to `b`.
6−
7−Accepts
8−-------
9−
10−`a` is an atom.
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−A boolean.
18−
19−Source
20−------
21−
22− ++ lte :: less-equal
23− ~/ %lte
24− |= {a/@ b/@}
25− |(=(a b) (lth a b))
26−
27− ::
28−
29−Examples
30−--------
31−
32− ~zod/try=> (lte 4 5)
33− %.y
34− ~zod/try=> (lte 5 4)
35− %.n
36− ~zod/try=> (lte 5 5)
37− %.y
38− ~zod/try=> (lte 0 0)
39− %.y
40−
41−
42−
43−***
docs/programming/advanced/library/src/1a/gate/lth.mddeleted−46
@@ -1,46 +0,0 @@
1−### `++lth`
2−
3−Less-than
4−
5−Tests whether `a` is less than `b`.
6−
7−Accepts
8−-------
9−
10−`a` is an [atom]().
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−A boolean.
18−
19−Source
20−------
21−
22− ++ lth :: less-than
23− ~/ %lth
24− |= {a/@ b/@}
25− ^- ?
26− ?& !=(a b)
27− |-
28− ?| =(0 a)
29− ?& !=(0 b)
30− $(a (dec a), b (dec b))
31− == == ==
32−
33−Examples
34−--------
35−
36− ~zod/try=> (lth 4 5)
37− %.y
38− ~zod/try=> (lth 5 4)
39− %.n
40− ~zod/try=> (lth 5 5)
41− %.n
42− ~zod/try=> (lth 5 0)
43− %.n
44−
45−
46−***
docs/programming/advanced/library/src/1a/gate/max.mddeleted−41
@@ -1,41 +0,0 @@
1−### `++max`
2−
3−Maximum
4−
5−Computes the greater of `a` and `b`.
6−
7−Accepts
8−-------
9−
10−`a` is an atom.
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−An atom.
18−
19−Source
20−------
21−
22− ++ max :: maximum
23− ~/ %max
24− |= {a/@ b/@}
25− ^- @
26− ?: (gth a b) a
27− b
28−
29−Examples
30−--------
31−
32− ~zod/try=> (max 10 100)
33− 100
34− ~zod/try=> (max 10.443 9)
35− 10.443
36− ~zod/try=> (max 0 1)
37− 1
38−
39−
40−
41−***
docs/programming/advanced/library/src/1a/gate/min.mddeleted−41
@@ -1,41 +0,0 @@
1−### `++min`
2−
3−Minimum
4−
5−Computes the lesser of `a` and `b`.
6−
7−Accepts
8−-------
9−
10−`a` is an atom.
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−An atom.
18−
19−Source
20−------
21−
22− ++ min :: minimum
23− ~/ %min
24− |= {a/@ b/@}
25− ^- @
26− ?: (lth a b) a
27− b
28−
29−Examples
30−--------
31−
32− ~zod/try=> (min 10 100)
33− 10
34− ~zod/try=> (min 10.443 9)
35− 9
36− ~zod/try=> (min 0 1)
37− 0
38−
39−
40−
41−***
docs/programming/advanced/library/src/1a/gate/mod.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++mod`
2−
3−Modulus
4−
5−Computes the remainder of dividing `a` by `b`.
6−
7−Accepts
8−-------
9−
10−`a` is an atom.
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−An atom.
18−
19−Source
20−------
21−
22− ++ mod :: remainder
23− ~/ %mod
24− |: [a=`@`1 b=`@`1]
25− ^- @
26− ?< =(0 b)
27− (sub a (mul b (div a b)))
28−
29−
30−Examples
31−--------
32−
33− ~zod/try=> (mod 5 2)
34− 1
35− ~zod/try=> (mod 5 5)
36− 0
37−
38−
39−
40−***
docs/programming/advanced/library/src/1a/gate/mul.mddeleted−41
@@ -1,41 +0,0 @@
1−### `++mul`
2−
3−Multiply
4−
5−Multiplies `a` by `b`.
6−
7−Accepts
8−-------
9−
10−`a` is an atom.
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−An atom.
18−
19−Source
20−------
21−
22− ++ mul :: multiply
23− ~/ %mul
24− |: [a=`@`1 b=`@`1]
25− ^- @
26− =+ c=0
27− |-
28− ?: =(0 a) c
29− $(a (dec a), c (add b c))
30−
31−Examples
32−--------
33−
34− ~zod/try=> (mul 3 4)
35− 12
36− ~zod/try=> (mul 0 1)
37− 0
38−
39−
40−
41−***
docs/programming/advanced/library/src/1a/gate/sub.mddeleted−45
@@ -1,45 +0,0 @@
1−### `++sub`
2−
3−Subtract
4−
5−Subtracts `b` from `a`.
6−
7−Accepts
8−-------
9−
10−`a` is an atom.
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−An atom.
18−
19−Source
20−------
21−
22− ++ sub :: subtract
23− ~/ %sub
24− |= [a=@ b=@]
25− ~| %subtract-underflow
26− ^- @
27− ?: =(0 b) a
28− $(a (dec a), b (dec b))
29−
30−Examples
31−--------
32−
33− ~zod/try=> (sub 10 5)
34− 5
35− ~zod/try=> (sub 243 44)
36− 199
37− ~zod/try=> (sub 5 0)
38− 5
39− ~zod/try=> (sub 0 5)
40− ! subtract-underflow
41− ! exit
42−
43−
44−
45−***
docs/programming/advanced/library/src/1a/title.mddeleted−1
@@ -1 +0,0 @@
1−# 1a: basic arithmetic
docs/programming/advanced/library/src/1b/gate/cap.mddeleted−46
@@ -1,46 +0,0 @@
1−### `++cap`
2−
3−Tree head
4−
5−Tests whether an `a` is in the head or tail of a noun. Produces the
6−cube `%2` if it is within the head, or the cube `%3` if it is
7−within the tail.
8−
9−Accepts
10−-------
11−
12−`a` is an atom.
13−
14−Produces
15−--------
16−
17−A cube.
18−
19−Source
20−------
21−
22− ++ cap :: tree head
23− ~/ %cap
24− |= a=@
25− ^- ?(%2 %3)
26− ?- a
27− %2 %2
28− %3 %3
29− ?(%0 %1) !!
30− * $(a (div a 2))
31− ==
32− ::
33−
34−Examples
35−--------
36−
37− ~zod/try=> (cap 4)
38− %2
39− ~zod/try=> (cap 6)
40− %3
41− ~zod/try=> (cap (add 10 9))
42− %2
43−
44−
45−
46−***
docs/programming/advanced/library/src/1b/gate/mas.mddeleted−50
@@ -1,50 +0,0 @@
1−### `++mas`
2−
3−Axis within head/tail?
4−
5−Computes the axis of `a` within either the head or tail of a noun (depends whether `a` lies within the the head or tail).
6−
7−Accepts
8−-------
9−
10−`a` is an [atom]().
11−
12−Produces
13−--------
14−
15−An atom.
16−
17−Source
18−------
19−
20− ++ mas :: tree body
21− ~/ %mas
22− |= a=@
23− ^- @
24− ?- a
25− 1 !!
26− 2 1
27− 3 1
28− * (add (mod a 2) (mul $(a (div a 2)) 2))
29− ==
30− ::
31−
32−Examples
33−--------
34−
35− ~zod/try=> (mas 3)
36− 1
37− ~zod/try=> (mas 4)
38− 2
39− ~zod/try=> (mas 5)
40− 3
41− ~zod/try=> (mas 6)
42− 2
43− ~zod/try=> (mas 0)
44− ! exit
45− ~zod/try=> (mas 1)
46− ! exit
47−
48−
49−
50−***
docs/programming/advanced/library/src/1b/gate/peg.mddeleted−45
@@ -1,45 +0,0 @@
1−### `++peg`
2−
3−Axis within axis
4−
5−Computes the axis of `b` within axis `a`.
6−
7−Accepts
8−-------
9−
10−`a` is an atom.
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−An atom.
18−
19−Source
20−------
21−
22− ++ peg :: tree connect
23− ~/ %peg
24− |= {a/@ b/@}
25− ^- @
26− ?- b
27− $1 a
28− $2 (mul a 2)
29− $3 +((mul a 2))
30− * (add (mod b 2) (mul $(b (div b 2)) 2))
31− ==
32−
33−Examples
34−--------
35−
36− ~zod/try=> (peg 4 1)
37− 4
38− ~zod/try=> (peg 4 2)
39− 8
40− ~zod/try=> (peg 8 45)
41− 269
42−
43−
44−
45−***
docs/programming/advanced/library/src/1b/title.mddeleted−1
@@ -1 +0,0 @@
1−# 1b: tree addressing
docs/programming/advanced/library/src/1c/mold/bloq.mddeleted−21
@@ -1,21 +0,0 @@
1−### `++bloq`
2−
3−Blocksize
4−
5−Atom representing a blocksize, by convention expressed as a power of 2.
6−
7−Source
8−------
9−
10− ++ bloq @ :: blockclass
11−
12−Examples
13−--------
14−
15− ~zod/try=> :: ++met measures how many bloqs long an atom is
16− ~zod/try=> (met 3 256)
17− 2
18− ~zod/try=> :: 256 is 2 bloqs of 2^3
19−
20−
21−***
docs/programming/advanced/library/src/1c/mold/each.mddeleted−22
@@ -1,22 +0,0 @@
1−### `++each`
2−
3−Mold of fork between two
4−
5−mold generator: produces a dicriminated fork between two types.
6−
7−Source
8−------
9−
10− ++ each
11− |* {a/$-(* *) b/$-(* *)} :: either a or b
12− $%({$& p/a} {$| p/b}) :: a default
13−
14−
15−Examples
16−--------
17−
18− > ? *(each cord time)
19− ?({$.y p/@t} {$.n p/@da})
20− [%.y p='']
21−
22−***
docs/programming/advanced/library/src/1c/mold/gate.mddeleted−29
@@ -1,29 +0,0 @@
1−### `++gate`
2−
3−Function
4−
5−A core with one arm, `$`--the empty name--which transforms a sample noun into a product
6−noun. If used dryly as a type, the subject must have a sample type of `*`.
7−
8−
9−Source
10−------
11−
12− ++ gate $-(* *) :: general gate
13−
14−
15−Examples
16−--------
17−
18−See also: `++lift`, `++cork`
19−
20− > ? gate
21− <1.ybc {* <110.jyx 1.ztu $151>}>
22− <1.ybc {* <110.jyx 1.ztu $151>}>
23−
24− > (`gate`|=(a/* [a 'b']) 1)
25− [1 'b']
26−
27−
28−
29−***
docs/programming/advanced/library/src/1c/mold/list.mddeleted−30
@@ -1,30 +0,0 @@
1−### `++list`
2−
3−List
4−
5−mold generator. `++list` generates a mold of a null-termanated list of a
6−homogenous type.
7−
8−
9−Source
10−------
11−
12− ++ list |* a/$-(* *) :: null-term list
13− $@($~ {i/a t/(list a)}) ::
14−
15−
16−Examples
17−--------
18−
19−See also: `++turn`, `++snag`
20−
21− > *(list)
22− ~
23− > `(list @)`"abc"
24− ~[97 98 99]
25− > (snag 0 "abc")
26− 'a'
27−
28−
29−
30−***
docs/programming/advanced/library/src/1c/mold/lone.mddeleted−12
@@ -1,12 +0,0 @@
1−### `++lone`
2−
3−`++lone` puts face of `p` on something.
4−
5−XX unused
6−
7−Source
8−------
9−
10− ++ lone |*(a/$-(* *) p/a) :: just one thing
11−
12−***
docs/programming/advanced/library/src/1c/mold/pair.mddeleted−23
@@ -1,23 +0,0 @@
1−### `++pair`
2−
3−Mold of pair of types
4−
5−mold generator. Produces a tuple of two of the types passed in.
6−
7−
8−Source
9−------
10−
11− ++ pair |*({a/$-(* *) b/$-(* *)} {p/a q/b}) :: just a pair
12−
13−
14−
15−Examples
16−--------
17−
18− ~zod/try=> *(pair bean cord)
19− [p=%.y q='']
20−
21−
22−
23−***
docs/programming/advanced/library/src/1c/mold/pole.mddeleted−23
@@ -1,23 +0,0 @@
1−### `++pole`
2−
3−Faceless list
4−
5−A `++list` without the faces `i` and `t`.
6−
7−Source
8−------
9−
10− ++ pole |* a/$-(* *) :: nameless list
11− $@($~ {a (pole a)}) ::
12−
13−
14−
15−Examples
16−--------
17−
18− ~zod/try=> `(pole char)`"asdf"
19− [~~a [~~s [~~d [~~f ~]]]]
20−
21−
22−
23−***
docs/programming/advanced/library/src/1c/mold/qual.mddeleted−21
@@ -1,21 +0,0 @@
1−### `++qual`
2−
3−Mold of 4 type tuple
4−
5−A `++qual` is a tuple of four of the types passed in.
6−
7−Source
8−------
9−
10− ++ qual |* {a/$-(* *) b/$-(* *) c/$-(* *) d/$-(* *)} :: just a quadruple
11− {p/a q/b r/c s/d} ::
12−
13−Examples
14−--------
15−
16− ~zod/try=> *(qual date time tape cord)
17− [p=[[a=%.y y=0] m=0 t=[d=0 h=0 m=0 s=0 f=~]] q=~292277024401-.1.1 r="" s='']
18−
19−
20−
21− ***
docs/programming/advanced/library/src/1c/mold/trap.mddeleted−25
@@ -1,25 +0,0 @@
1−### `++trap`
2−
3−Core with one arm `$`
4−
5−A trap is a core with one arm `++$`.
6−
7−Source
8−------
9−
10− ++ trap |*(a/_* _|?(*a)) :: makes perfect sense
11−
12−
13−Examples
14−--------
15−
16− ~zod/try=> *trap
17− <1.mws 101.jzo 1.ypj %164>
18− ~zod/try=> (*trap)
19− 0
20− ~zod/try=> (|.(42))
21− 42
22−
23−
24−
25−***
docs/programming/advanced/library/src/1c/mold/tree.mddeleted−23
@@ -1,23 +0,0 @@
1−### `++tree`
2−
3−Tree mold generator
4−
5−A `++tree` can be empty, or contain a node of a type and
6−left/right sub `++tree` of the same type. Pretty-printed with `{}`.
7−
8−Source
9−------
10−
11− ++ tree |* a/$-(* *) :: binary tree
12− $@($~ {n/a l/(tree a) r/(tree a)}) ::
13−
14−
15−Examples
16−--------
17−
18− ~zod/try=> `(tree {@ tape})`[[1 "hi"] [[2 "bye"] ~ ~] ~]
19− {[2 "bye"] [1 "hi"]}
20−
21−
22−
23−***
docs/programming/advanced/library/src/1c/mold/trel.mddeleted−22
@@ -1,22 +0,0 @@
1−### `++trel`
2−
3−Mold of three types
4−
5−`++mold` of the tuple of the three types passed in.
6−
7−Source
8−------
9−
10− ++ trel |* {a/$-(* *) b/$-(* *) c/$-(* *)} :: just a triple
11− {p/a q/b r/c} ::
12−
13−
14−Examples
15−--------
16−
17− ~zod/try=> *(trel @ud @t @s)
18− [p=0 q='' r=--0]
19−
20−
21−
22−***
docs/programming/advanced/library/src/1c/mold/unit.mddeleted−33
@@ -1,33 +0,0 @@
1−### `++unit`
2−
3−Maybe
4−
5−mold generator. A `++unit` is either `~` or `[~ u=a]` where `a` is the
6−type that was passed in.
7−
8−
9−Source
10−------
11−
12− ++ unit |* a/$-(* *) :: maybe
13− $@($~ {$~ u/a}) ::
14−
15−
16−Examples
17−--------
18−
19−See also: `++bind`
20−
21− ~zod/try=> ? *(unit time)
22− ?({$~ u/@da} $~)
23− ~
24−
25− ~zod/try=> > =a |= a/@
26− ^- (unit @)
27− ?~ a ~
28− [~ a]
29− > (a 2)
30− [~ u=2]
31−
32−
33−***
docs/programming/advanced/library/src/1c/title.mddeleted−1
@@ -1 +0,0 @@
1−# 1c: molds and mold builders
docs/programming/advanced/library/src/2a/gate/biff.mddeleted−39
@@ -1,39 +0,0 @@
1−### `++biff`
2−
3−Unit as argument
4−
5−Applies a function `b` that produces a unit to the unwrapped value of ++unit
6−`a` (`u.a`). If `a` is empty, `~` is produced.
7−
8−Accepts
9−-------
10−
11−`a` is a unit.
12−
13−`b` is a function that accepts a noun and produces a unit.
14−
15−Produces
16−--------
17−
18−A unit.
19−
20−Source
21−------
22−
23− ++ biff :: apply
24− |* {a/(unit) b/$-(* (unit))}
25− ?~ a ~
26− (b u.a)
27−
28−
29−Examples
30−--------
31−
32− ~zod/try=> (biff (some 5) |=(a/@ (some (add a 2))))
33− [~ u=7]
34− ~zod/try=> (biff ~ |=(a/@ (some (add a 2))))
35− ~
36−
37−
38−
39−***
docs/programming/advanced/library/src/2a/gate/bind.mddeleted−41
@@ -1,41 +0,0 @@
1−### `++bind`
2−
3−Non-unit function to unit, producing unit
4−
5−Applies a function `b` to the value (`u.a`) of a ++unit `a`, producing
6−a unit. Used when you want a function that does not accept or produce a
7−unit to both accept and produce a unit.
8−
9−Accepts
10−-------
11−
12−`a` is a unit.
13−
14−`b` is a function.
15−
16−Produces
17−--------
18−
19−A unit.
20−
21−Source
22−------
23−
24− ++ bind :: argue
25− |* {a/(unit) b/gate}
26− ?~ a ~
27− [~ u=(b u.a)]
28−
29−
30−Examples
31−--------
32−
33− ~zod/try=> (bind ((unit @) [~ 97]) ,@t)
34− [~ `a`]
35− ~zod/try=> =a |=(a/@ (add a 1))
36− ~zod/try=> (bind ((unit @) [~ 2]) a)
37− [~ 3]
38−
39−
40−
41−***
docs/programming/advanced/library/src/2a/gate/bond.mddeleted−42
@@ -1,42 +0,0 @@
1−### `++bond`
2−
3−Replace null
4−
5−Replaces an empty ++unit `b` with the product of a called trap
6−`a`. If the unit is not empty, then the original unit is produced.
7−
8−Accepts
9−-------
10−
11−`a` is a trap.
12−
13−`b` is a unit.
14−
15−Produces
16−--------
17−
18−Either the product of `a` or the value inside of unit `b`.
19−
20−Source
21−------
22−
23− ++ bond :: replace
24− |* a/(trap)
25− |* b/(unit)
26− ?~ b $:a
27− u.b
28−
29−
30−Examples
31−--------
32−
33− ~zod/try=> (bex 10)
34− 1.024
35− ~zod/try=> ((bond |.((bex 10))) ~)
36− 1.024
37− ~zod/try=> ((bond |.((bex 10))) (slaw %ud '123'))
38− 123
39−
40−
41−
42−***
docs/programming/advanced/library/src/2a/gate/both.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++both`
2−
3−Group unit values into pair
4−
5−Produces `~` if either `a` or `b` are empty. Otherwise, produces a
6−++unit whose value is a cell of the values of two input units `a` and
7−`b`.
8−
9−Accepts
10−-------
11−
12−`a` is a unit.
13−
14−`b` is a unit.
15−
16−Produces
17−--------
18−
19−A unit of the two initial values.
20−
21−Source
22−------
23−
24− ++ both :: all the above
25− |* {a/(unit) b/(unit)}
26− ?~ a ~
27− ?~ b ~
28− [~ u=[u.a u.b]]
29−
30−
31−Examples
32−--------
33−
34− ~zod/try=> (both (some 1) (some %b))
35− [~ u=[1 %b]]
36− ~zod/try=> (both ~ (some %b))
37− ~
38−
39−
40−***
docs/programming/advanced/library/src/2a/gate/clap.mddeleted−47
@@ -1,47 +0,0 @@
1−### `++clap`
2−
3−Apply function to two units
4−
5−Applies a binary function `c`--which does not usually accept or produce a `++unit`--
6−to the values of two units, `a` and `b`, producing a unit.
7−
8−Accepts
9−-------
10−
11−`a` is a unit.
12−
13−`b` is a unit.
14−
15−`c` is a function that performs a binary operation.
16−
17−Produces
18−--------
19−
20−A unit.
21−
22−Source
23−------
24−
25− ++ clap :: combine
26− |* {a/(unit) b/(unit) c/_|=(^ +<-)}
27− ?~ a b
28− ?~ b a
29− [~ u=(c u.a u.b)]
30−
31−
32−Examples
33−--------
34−
35− ~zod/try=> =u ((unit @t) [~ 'a'])
36− ~zod/try=> =v ((unit @t) [~ 'b'])
37− ~zod/try=> (clap u v |=([a=@t b=@t] (welp (trip a) (trip b))))
38− [~ u="ab"]
39− ~zod/try=> =a ((unit @u) [~ 1])
40− ~zod/try=> =b ((unit @u) [~ 2])
41− ~zod/try=> =c |=([a=@ b=@] (add a b))
42− ~zod/try=> (clap a b c)
43− [~ 3]
44−
45−
46−
47−***
docs/programming/advanced/library/src/2a/gate/drop.mddeleted−38
@@ -1,38 +0,0 @@
1−### `++drop`
2−
3−Unit to list
4−
5−Makes a ++list of the unwrapped value (`u.a`) of a `++unit` `a`.
6−
7−Accepts
8−-------
9−
10−`a` is a unit.
11−
12−Produces
13−--------
14−
15−A list.
16−
17−Source
18−------
19−
20− ++ drop :: enlist
21− |* a/(unit)
22− ?~ a ~
23− [i=u.a t=~]
24−
25−
26−Examples
27−--------
28−
29− ~zod/try=> =a ((unit @) [~ 97])
30− ~zod/try=> (drop a)
31− [i=97 t=~]
32− ~zod/try=> =a ((unit @) [~])
33− ~zod/try=> (drop a)
34− ~
35−
36−
37−
38−***
docs/programming/advanced/library/src/2a/gate/fall.mddeleted−37
@@ -1,37 +0,0 @@
1−### `++fall`
2−
3−Give unit a default value
4−
5−Produces a default value `b` for a `++unit` `a` in cases where `a` is null.
6−
7−Accepts
8−-------
9−
10−`a` is a unit.
11−
12−`b` is a noun that's used as the default value.
13−
14−Produces
15−--------
16−
17−Either a noun `b` or the unwrapped value of unit `a`.
18−
19−Source
20−------
21−
22− ++ fall :: default
23− |* {a/(unit) b/*}
24− ?~(a b u.a)
25−
26−
27−Examples
28−--------
29−
30− ~zod/try=> (fall ~ `a`)
31− `a`
32− ~zod/try=> (fall [~ u=0] `a`)
33− 0
34−
35−
36−
37−***
docs/programming/advanced/library/src/2a/gate/lift.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++lift`
2−
3−Curried bind
4−
5−Accepts a `++gate` `a` and produces a function that accepts `++unit`
6−`b` to which it applies `a`. Used when you want a function that does not accept
7−or produce a unit to both accept and produce a unit.
8−
9−Accepts
10−-------
11−
12−`a` is a gate.
13−
14−`b` is a unit.
15−
16−Produces
17−--------
18−
19−A unit.
20−
21−Source
22−------
23−
24− ++ lift :: lift gate (fmap)
25− |* a/gate :: flipped
26− |* b/(unit) :: curried
27− (bind b a) :: bind
28−
29−
30−Examples
31−--------
32−
33− ~zod/try=> ((lift dec) `(unit @)`~)
34− ~
35− ~zod/try=> ((lift dec) `(unit @)`[~ 20])
36− [~ 19]
37−
38−
39−
40−***
docs/programming/advanced/library/src/2a/gate/mate.mddeleted−52
@@ -1,52 +0,0 @@
1−### `++mate`
2−
3−Choose
4−
5−Accepts two units `a` and `b` whose values are expected to be
6−equivalent. If either is empty, then the value of the other is produced.
7−If neither are empty, it asserts that both values are the same and
8−produces that value. If the assertion fails, `++mate` crashes with
9−`'mate'` in the stack trace.
10−
11−Accepts
12−-------
13−
14−`a` is a unit.
15−
16−`b` is a unit.
17−
18−Produces
19−--------
20−
21−A unit or crash.
22−
23−Source
24−------
25−
26− ++ mate :: choose
27− |* {a/(unit) b/(unit)}
28− ?~ b a
29− ?~ a b
30− ?.(=(u.a u.b) ~|('mate' !!) a)
31−
32−
33−Examples
34−--------
35−
36− ~zod/try=> =a ((unit @) [~ 97])
37− ~zod/try=> =b ((unit @) [~ 97])
38− ~zod/try=> (mate a b)
39− [~ 97]
40− ~zod/try=> =a ((unit @) [~ 97])
41− ~zod/try=> =b ((unit @) [~])
42− ~zod/try=> (mate a b)
43− [~ 97]
44− ~zod/try=> =a ((unit @) [~ 97])
45− ~zod/try=> =b ((unit @) [~ 98])
46− ~zod/try=> (mate a b)
47− ! 'mate'
48− ! exit
49−
50−
51−
52−***
docs/programming/advanced/library/src/2a/gate/need.mddeleted−41
@@ -1,41 +0,0 @@
1−### `++need`
2−
3−Unwrap unit
4−
5−Retrieve the value from a `++unit` and crash if the unit is null.
6−
7−Accepts
8−-------
9−
10−`a` is a unit.
11−
12−Produces
13−--------
14−
15−Either the unwrapped value of `a` (`u.a`), or crash.
16−
17−Source
18−------
19−
20− ++ need :: demand
21− |* a/(unit)
22− ?~ a ~|(%need !!)
23− u.a
24−
25−
26−Examples
27−--------
28−
29− ~zod/try=> =a ((unit [@t @t]) [~ ['a' 'b']])
30− ~zod/try=> (need a)
31− ['a' 'b']
32− ~zod/try=> =a ((unit @ud) [~ 17])
33− ~zod/try=> (need a)
34− 17
35− ~zod/try=> =a ((unit @) [~])
36− ~zod/try=> (need a)
37− ! exit
38−
39−
40−
41−***
docs/programming/advanced/library/src/2a/gate/some.mddeleted−34
@@ -1,34 +0,0 @@
1−### `++some`
2−
3−Wrap value in a unit
4−
5−Takes any atom `a` and produces a [`++unit`]() with the value set to `a`.
6−
7−Accepts
8−-------
9−
10−`a` is a [noun]().
11−
12−Produces
13−--------
14−
15−A unit.
16−
17−Source
18−------
19−
20− ++ some :: lift (pure)
21− |* a=*
22− [~ u=a]
23−
24−Examples
25−--------
26−
27− ~zod/try=> (some [`a` `b`])
28− [~ u=[`a` `b`]]
29− ~zod/try=> (some &)
30− [~ u=%.y]
31−
32−
33−
34−***
docs/programming/advanced/library/src/2a/title.mddeleted−1
@@ -1 +0,0 @@
1−# 2a: unit logic
docs/programming/advanced/library/src/2b/gate/flop.mddeleted−41
@@ -1,41 +0,0 @@
1−Reverse
2−
3−### `++flop`
4−
5−Produces the list `a` in reverse order.
6−
7−Accepts
8−-------
9−
10−`a` is a list.
11−
12−Produces
13−--------
14−
15−A list.
16−
17−Source
18−------
19−
20− ++ flop :: reverse
21− ~/ %flop
22− |* a/(list)
23− => .(a (homo a))
24− ^+ a
25− =+ b=`_a`~
26− |-
27− ?~ a b
28− $(a t.a, b [i.a b])
29−
30−
31−
32−Examples
33−--------
34−
35− ~zod/try=> =a (limo [1 2 3 ~])
36− ~zod/try=> (flop a)
37− ~[3 2 1]
38−
39−
40−
41−***
docs/programming/advanced/library/src/2b/gate/homo.mddeleted−44
@@ -1,44 +0,0 @@
1−### `++homo`
2−
3−Homogenize
4−
5−Produces a `++list` whose type is a fork of all the contained types in the
6−list `a`. Used when you want to make all the types of the elements of a list the same.
7−
8−Accepts
9−-------
10−
11−`a` is a list.
12−
13−Produces
14−--------
15−
16−a list.
17−
18−Source
19−------
20−
21− ++ homo :: homogenize
22− |* a/(list)
23− ^+ =< $
24− |% +- $ ?:(*? ~ [i=(snag 0 a) t=$])
25− --
26− a
27−
28−
29−Examples
30−--------
31−
32− ~zod/try=> lyst
33− [i=1 t=[i=97 t=[i=2 t=[i=98 t=[i=[~ u=10] t=~]]]]]
34− ~zod/try=> (homo lyst)
35− ~[1 97 2 98 [~ u=10]]
36− ~zod/try=> =a (limo [1 2 3 ~])
37− ~zod/try=> a
38− [i=1 t=[i=2 t=[i=3 t=~]]]
39− ~zod/try=> (homo a)
40− ~[1 2 3]
41−
42−
43−
44−***
docs/programming/advanced/library/src/2b/gate/lent.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++lent`
2−
3−List length
4−
5−Produces the length of any `++list` `a` as an atom.
6−
7−Accepts
8−-------
9−
10−`a` is a list.
11−
12−Produces
13−--------
14−
15−an atom.
16−
17−Source
18−------
19−
20− ++ lent :: length
21− ~/ %lent
22− |= a/(list)
23− ^- @
24− =+ b=0
25− |-
26− ?~ a b
27− $(a t.a, b +(b))
28−
29−
30−Examples
31−--------
32−
33− ~zod/try=> (lent (limo [1 2 3 4 ~]))
34− 4
35− ~zod/try=> (lent (limo [1 'a' 2 'b' (some 10) ~]))
36− 5
37−
38−
39−
40−***
docs/programming/advanced/library/src/2b/gate/levy.mddeleted−43
@@ -1,43 +0,0 @@
1−### `++levy`
2−
3−Logical "and" on list
4−
5−Computes the Boolean logical "and" on the results of gate `b` applied to each individual element in `++list` `a`.
6−
7−Accepts
8−-------
9−
10−`a` is a list.
11−
12−`b` is a gate.
13−
14−Produces
15−--------
16−
17−A boolean.
18−
19−Source
20−------
21−
22− ++ levy
23− ~/ %levy :: all of
24− |* {a/(list) b/$-(* ?)}
25− |- ^- ?
26− ?~ a &
27− ?. (b i.a) |
28− $(a t.a)
29−
30−
31−Examples
32−--------
33−
34− ~zod/try=> =a |=(a/@ (lte a 1))
35− ~zod/try=> (levy (limo [0 1 2 1 ~]) a)
36− %.n
37− ~zod/try=> =a |=(a/@ (lte a 3))
38− ~zod/try=> (levy (limo [0 1 2 1 ~]) a)
39− %.y
40−
41−
42−
43−***
docs/programming/advanced/library/src/2b/gate/lien.mddeleted−37
@@ -1,37 +0,0 @@
1−### `++lien`
2−
3−Logical "or" on list
4−
5−Computes the Boolean logical "or" on the results of applying [gate]() `b` to every element of [`++list`]() `a`.
6−
7−Accepts
8−-------
9−
10−`a` is a list.
11−
12−`b` is a gate.
13−
14−Source
15−------
16−
17− ++ lien :: some of
18− ~/ %lien
19− |* {a/(list) b/$-(* ?)}
20− |- ^- ?
21− ?~ a |
22− ?: (b i.a) &
23− $(a t.a)
24−
25−Examples
26−--------
27−
28− ~zod/try=> =a |=(a=@ (gte a 1))
29− ~zod/try=> (lien (limo [0 1 2 1 ~]) a)
30− %.y
31− ~zod/try=> =a |=(a=@ (gte a 3))
32− ~zod/try=> (lien (limo [0 1 2 1 ~]) a)
33− %.n
34−
35−
36−
37−***
docs/programming/advanced/library/src/2b/gate/limo.mddeleted−35
@@ -1,35 +0,0 @@
1−### `++limo`
2−
3−List Constructor
4−
5−Turns a null-terminated tuple into a [`++list`]().
6−
7−Accepts
8−-------
9−
10−`a` is a null-terminated tuple.
11−
12−Produces
13−--------
14−
15−A `++list`.
16−
17−Source
18−------
19−
20− ++ limo :: listify
21− |* a=*
22− ^+ =< $
23− |% +- $ ?~(a ~ ?:(_? i=-.a t=$ $(a +.a)))
24− --
25− a
26−
27−Examples
28−--------
29−
30− ~zod/try=> (limo [1 2 3 ~])
31− [i=1 t=[i=2 t=[i=3 t=~]]]
32−
33−
34−
35−***
docs/programming/advanced/library/src/2b/gate/murn.mddeleted−43
@@ -1,43 +0,0 @@
1−### `++murn`
2−
3−Maybe transform
4−
5−Passes each member of `++list` `a` to gate `b`, which must produce a
6−`++unit`. Produces a new list with all the results that do not produce
7−`~`.
8−
9−Accepts
10−-------
11−
12−`a` is a list.
13−
14−`b` is a gate that produces a unit.
15−
16−Produces
17−--------
18−
19−A unit.
20−
21−Source
22−------
23−
24− ++ murn :: maybe transform
25− ~/ %murn
26− |* {a/(list) b/$-(* (unit))}
27− |-
28− ?~ a ~
29− =+ c=(b i.a)
30− ?~ c
31− $(a t.a)
32− [i=u.c t=$(a t.a)]
33−
34−Examples
35−--------
36−
37− ~zod/try=> =a |=(a=@ ?.((gte a 2) ~ (some (add a 10))))
38− ~zod/try=> (murn (limo [0 1 2 3 ~]) a)
39− [i=12 t=[i=13 t=~]]
40−
41−
42−
43−***
docs/programming/advanced/library/src/2b/gate/reap.mddeleted−39
@@ -1,39 +0,0 @@
1−### `++reap`
2−
3−Replicate
4−
5−Replicate: produces a `++list` containing `a` copies of `b`.
6−
7−Accepts
8−-------
9−
10−`b` is a noun.
11−
12−Produces
13−--------
14−
15−A list.
16−
17−Source
18−------
19−
20− ++ reap :: replicate
21− ~/ %reap
22− |* {a/@ b/*}
23− |- ^- (list _b)
24− ?~ a ~
25− [b $(a (dec a))]
26−
27−Examples
28−--------
29−
30− ~zod/try=> (reap 20 %a)
31− ~[%a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a]
32− ~zod/try=> (reap 5 ~s1)
33− ~[~s1 ~s1 ~s1 ~s1 ~s1]
34− ~zod/try=> `@dr`(roll (reap 5 ~s1) add)
35− ~s5
36−
37−
38−
39−***
docs/programming/advanced/library/src/2b/gate/reel.mddeleted−46
@@ -1,46 +0,0 @@
1−### `++reel`
2−
3−Right fold
4−
5−Right fold: moves right to left across a `++list` `a`, recursively slamming
6−a binary gate `b` with an element from `a` and an accumulator, producing
7−the final value of the accumulator.
8−
9−Accepts
10−-------
11−
12−`b` is a binary gate.
13−
14−Produces
15−--------
16−
17−The accumulator, which is a noun.
18−
19−Source
20−------
21−
22− ++ reel :: right fold
23− ~/ %reel
24− |* {a/(list) b/_|=({* *} +<+)}
25− |- ^+ +<+.b
26− ?~ a
27− +<+.b
28− (b i.a $(a t.a))
29−
30−
31−Examples
32−--------
33−
34− ~zod/try=> =sum =|([p=@ q=@] |.((add p q)))
35− ~zod/try=> (reel (limo [1 2 3 4 5 ~]) sum)
36− 15
37− ~zod/try=> =a =|([p=@ q=@] |.((sub p q)))
38− ~zod/try=> (reel (limo [6 3 1 ~]) a)
39− 4
40− ~zod/try=> (reel (limo [3 6 1 ~]) a)
41− ! subtract-underflow
42− ! exit
43−
44−
45−
46−***
docs/programming/advanced/library/src/2b/gate/roll.mddeleted−45
@@ -1,45 +0,0 @@
1−### `++roll`
2−
3−Left fold
4−
5−Left fold: moves left to right across a list `a`, recursively slamming a
6−binary [gate]() `b` with an element from the [`++list`]() and an accumulator,
7−producing the final value of the accumulator.
8−
9−Accepts
10−-------
11−
12−`b` is a binary [gate]().
13−
14−Produces
15−--------
16−
17−The accumulator, which is a [noun]().
18−
19−Source
20−------
21−
22− ++ roll :: left fold
23− ~/ %roll
24− |* [a=(list) b=_|=([* *] +<+)]
25− |- ^+ +<+.b
26− ?~ a
27− +<+.b
28− $(a t.a, b b(+<+ (b i.a +<+.b)))
29−
30−Examples
31−--------
32−
33− ~zod/try=> =sum =|([p=@ q=@] |.((add p q)))
34− ~zod/try=> (roll (limo [1 2 3 4 5 ~]) sum)
35− q=15
36− ~zod/try=> =a =|([p=@ q=@] |.((sub p q)))
37− ~zod/try=> (roll (limo [6 3 1 ~]) a)
38− ! subtract-underflow
39− ! exit
40− ~zod/try=> (roll (limo [1 3 6 ~]) a)
41− q=4
42−
43−
44−
45−***
docs/programming/advanced/library/src/2b/gate/scag.mddeleted−38
@@ -1,38 +0,0 @@
1−### `++scag`
2−
3−Prefix
4−
5−Accepts an atom `a` and [list]() `b`, producing the first `a` elements of
6−the front of the list.
7−
8−Accepts
9−-------
10−
11−`b` is a list.
12−
13−Produces
14−--------
15−
16−A list of the same type as `b`.
17−
18−Source
19−------
20−
21− ++ scag :: prefix
22− ~/ %scag
23− |* [a=@ b=(list)]
24− |- ^+ b
25− ?: |(?=(~ b) =(0 a)) ~
26− [i.b $(b t.b, a (dec a))]
27−
28−Examples
29−--------
30−
31− ~zod/try=> (scag 2 (limo [0 1 2 3 ~]))
32− [i=0 t=[i=1 t=~]]
33− ~zod/try=> (scag 10 (limo [1 2 3 4 ~]))
34− [i=1 t=[i=2 t=[i=3 t=[i=4 t=~]]]]
35−
36−
37−
38−***
docs/programming/advanced/library/src/2b/gate/skid.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++skid`
2−
3−Separate
4−
5−Separates a `++list` `a` into two lists - Those elements of `a` who produce
6−true when slammed to gate `b` and those who produce `%.n`.
7−
8−Accepts
9−-------
10−
11−`b` is a gate that accepts one argument and produces a loobean.
12−
13−Produces
14−--------
15−
16−A cell of two lists.
17−
18−Source
19−------
20−
21− ++ skid :: separate
22− ~/ %skid
23− |* {a/(list) b/$-(* ?)}
24− |- ^+ [p=a q=a]
25− ?~ a [~ ~]
26− =+ c=$(a t.a)
27− ?:((b i.a) [[i.a p.c] q.c] [p.c [i.a q.c]])
28−
29−
30−
31−Examples
32−--------
33−
34− ~zod/try=> =a |=(a/@ (gth a 1))
35− ~zod/try=> (skid (limo [0 1 2 3 ~]) a)
36− [p=[i=2 t=[i=3 t=~]] q=[i=0 t=[i=1 t=~]]]
37−
38−
39−
40−***
docs/programming/advanced/library/src/2b/gate/skim.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++skim`
2−
3−Suffix
4−
5−Cycles through the members of a list `a`, passing them to a gate `b` and
6−producing a list of all of the members that produce `%.y`. Inverse of
7−`++skip`.
8−
9−Accepts
10−-------
11−
12−`b` is a gate that accepts one argument and produces a boolean.
13−
14−Produces
15−--------
16−
17−A boolean
18−
19−Source
20−------
21−
22− ++ skim :: only
23− ~/ %skim
24− |* {a/(list) b/$-(* ?)}
25− |-
26− ^+ a
27− ?~ a ~
28− ?:((b i.a) [i.a $(a t.a)] $(a t.a))
29−
30−
31−Examples
32−--------
33−
34− ~zod/try=> =a |=(a/@ (gth a 1))
35− ~zod/try=> (skim (limo [0 1 2 3 ~]) a)
36− [i=2 t=[i=3 t=~]]
37−
38−
39−
40−***
docs/programming/advanced/library/src/2b/gate/skip.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++skip`
2−
3−Except
4−
5−Cycles through the members of `++list` `a`, passing them to a gate `b`.
6−Produces a list of all of the members that produce `%.n`. Inverse of
7−`++skim`.
8−
9−Accepts
10−-------
11−
12−`b` is a gate that accepts one argument and produces a loobean.
13−
14−Produces
15−--------
16−
17−A list of the same type as `a`.
18−
19−Source
20−------
21−
22− ++ skip :: except
23− ~/ %skip
24− |* {a/(list) b/$-(* ?)}
25− |-
26− ^+ a
27− ?~ a ~
28− ?:((b i.a) $(a t.a) [i.a $(a t.a)])
29−
30−
31−Examples
32−--------
33−
34− ~zod/try=> =a |=(a/@ (gth a 1))
35− ~zod/try=> (skip (limo [0 1 2 3 ~]) a)
36− [i=0 t=[i=1 t=~]]
37−
38−
39−
40−***
docs/programming/advanced/library/src/2b/gate/slag.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++slag`
2−
3−Suffix
4−
5−Accepts an atom `a` and list `b`, producing the remaining elements from
6−`b` starting at `a`.
7−
8−Accepts
9−-------
10−
11−`b` is a list.
12−
13−Produces
14−--------
15−
16−A list of the same type as `b`.
17−
18−Source
19−------
20−
21− ++ slag :: suffix
22− ~/ %slag
23− |* {a/@ b/(list)}
24− |- ^+ b
25− ?: =(0 a) b
26− ?~ b ~
27− $(b t.b, a (dec a))
28−
29−
30−Examples
31−--------
32−
33− ~zod/try=> (slag 2 (limo [1 2 3 4 ~]))
34− [i=3 t=[i=4 t=~]]
35− ~zod/try=> (slag 1 (limo [1 2 3 4 ~]))
36− [i=2 t=[i=3 t=[i=4 t=~]]]
37−
38−
39−
40−***
docs/programming/advanced/library/src/2b/gate/snag.mddeleted−41
@@ -1,41 +0,0 @@
1−### `++snag`
2−
3−Index
4−
5−Accepts an atom `a` and a `++list` `b`, producing the element at the index
6−of `a`and failing if the list is null. Lists are 0-indexed.
7−
8−Accepts
9−-------
10−
11−`b` is a list.
12−
13−Produces
14−--------
15−
16−Produces an element of `b`, or crashes if no element exists at that index.
17−
18−Source
19−------
20−
21− ++ snag :: index
22− ~/ %snag
23− |* {a/@ b/(list)}
24− |-
25− ?~ b
26− ~|('snag-fail' !!)
27− ?: =(0 a) i.b
28− $(b t.b, a (dec a))
29−
30−
31−Examples
32−--------
33−
34− ~zod/try=> (snag 2 "asdf")
35− ~~d
36− ~zod/try=> (snag 0 `(list ,@ud)`~[1 2 3 4])
37− 1
38−
39−
40−
41−***
docs/programming/advanced/library/src/2b/gate/sort.mddeleted−43
@@ -1,43 +0,0 @@
1−### `++sort`
2−
3−Quicksort
4−
5−Quicksort: accepts a `++list` `a` and a gate `b` which accepts two nouns and
6−produces a loobean. `++sort` then produces a list of the elements of `a`,
7−sorted according to `b`.
8−
9−Accepts
10−-------
11−
12−`b` is a gate that ccepts two nouns and produces a boolean.
13−
14−Produces
15−--------
16−
17−A list
18−
19−Source
20−------
21−
22− ++ sort !. :: quicksort
23− ~/ %sort
24− |* {a/(list) b/$-([* *] ?)}
25− => .(a ^.(homo a))
26− |- ^+ a
27− ?~ a ~
28− %+ weld
29− $(a (skim t.a |=(c/_i.a (b c i.a))))
30− ^+ t.a
31− [i.a $(a (skim t.a |=(c/_i.a !(b c i.a))))]
32−
33−
34−Examples
35−--------
36−
37− ~zod/try=> =a =|({p=@ q=@} |.((gth p q)))
38− ~zod/try=> (sort (limo [0 1 2 3 ~]) a)
39− ~[3 2 1 0]
40−
41−
42−
43−***
docs/programming/advanced/library/src/2b/gate/swag.mddeleted−36
@@ -1,36 +0,0 @@
1−### `++swag`
2−
3−Infix
4−
5−Similar to `substr` in Javascript: extracts a string infix, beginning at
6−inclusive index `a`, producing `b` number of characters.
7−
8−Accepts
9−-------
10−
11−`c` is a list.
12−
13−Produces
14−--------
15−
16−A list of the same type as `c`.
17−
18−Source
19−------
20−
21− ++ swag :: infix
22− |* {{a/@ b/@} c/(list)}
23− (scag +<-> (slag +<-< c))
24−
25−
26−Examples
27−--------
28−
29− ~zod/try=> (swag [2 5] "roly poly")
30− "ly po"
31− ~zod/try=> (swag [2 2] (limo [1 2 3 4 ~]))
32− [i=3 t=[i=4 t=~]]
33−
34−
35−
36−***
docs/programming/advanced/library/src/2b/gate/turn.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++turn`
2−
3−Gate to list
4−
5−Accepts a `++list` `a` and a gate `b`. Produces a list with the gate applied
6−to each element of the original list.
7−
8−Accepts
9−-------
10−
11−`b` is a gate.
12−
13−Produces
14−--------
15−
16−A list.
17−
18−Source
19−------
20−
21− ++ turn :: transform
22− ~/ %turn
23− |* {a/(list) b/$-(* *)}
24− |-
25− ?~ a ~
26− [i=(b i.a) t=$(a t.a)]
27−
28−
29−Examples
30−--------
31−
32− ~zod/try=> (turn (limo [104 111 111 110 ~]) ,@t)
33− <|h o o n|>
34− ~zod/try=> =a |=(a/@ (add a 4))
35− ~zod/try=> (turn (limo [1 2 3 4 ~]) a)
36− ~[5 6 7 8]
37−
38−
39−
40−***
docs/programming/advanced/library/src/2b/gate/weld.mddeleted−34
@@ -1,34 +0,0 @@
1−### `++weld`
2−
3−Concatenate
4−
5−Concatenate two `++list`s `a` and `b`.
6−
7−Accepts
8−-------
9−
10−`a` and `b` are lists.
11−
12−Source
13−------
14−
15− ++ weld :: concatenate
16− ~/ %weld
17− |* {a/(list) b/(list)}
18− => .(a ^.(homo a), b ^.(homo b))
19− |- ^+ b
20− ?~ a b
21− [i.a $(a t.a)]
22−
23−
24−Examples
25−--------
26−
27− ~zod/try=> (weld "urb" "it")
28− ~[~~u ~~r ~~b ~~i ~~t]
29− ~zod/try=> (weld (limo [1 2 ~]) (limo [3 4 ~]))
30− ~[1 2 3 4]
31−
32−
33−
34−***
docs/programming/advanced/library/src/2b/gate/welp.mddeleted−48
@@ -1,48 +0,0 @@
1−### `++welp`
2−
3−Perfect weld
4−
5−Concatenate two `++list`s `a` and `b` without losing their type information
6−to homogenization.
7−
8−Accepts
9−-------
10−
11−`a` is a list.
12−
13−`b` is a list.
14−
15−Produces
16−--------
17−
18−A list.
19−
20−Source
21−------
22−
23− ++ welp :: perfect weld
24− =| {* *}
25− |%
26− +- $
27− ?~ +<-
28− +<-(. +<+)
29− +<-(+ $(+<- +<->))
30− --
31−
32−
33−Examples
34−--------
35−
36− ~zod/try=> (welp "foo" "bar")
37− "foobar"
38− ~zod/arvo=/hoon/hoon> (welp ~[60 61 62] ~[%a %b %c])
39− [60 61 62 %a %b %c ~]
40− ~zod/arvo=/hoon/hoon>? (welp ~[60 61 62] ~[%a %b %c])
41− [60 61 62 %a %b %c ~]
42− [@ud @ud @ud %a %b %c %~]
43− ~zod/arvo=/hoon/hoon> (welp [sa+1 so+2 ~] si/3)
44− [[%sa 1] [%so 2] %si 3]
45−
46−
47−
48−***
docs/programming/advanced/library/src/2b/gate/zing.mddeleted−41
@@ -1,41 +0,0 @@
1−### `++zing`
2−
3−Cons
4−
5−Turns a `++list` of lists into a single list by promoting the elements of
6−each sublist into the higher.
7−
8−Accepts
9−-------
10−
11−A list of lists.
12−
13−Produces
14−--------
15−
16−A list.
17−
18−Source
19−------
20−
21− ++ zing :: promote
22− =| *
23− |%
24− +- $
25− ?~ +<
26− +<
27− (welp +<- $(+< +<+))
28− --
29−
30−
31−
32−Examples
33−--------
34−
35− ~zod/try=> (zing (limo [(limo ['a' 'b' 'c' ~]) (limo ['e' 'f' 'g' ~]) (limo ['h' 'i' 'j' ~]) ~]))
36− ~['a' 'b' 'c' 'e' 'f' 'g' 'h' 'i' 'j']
37− ~zod/try=> (zing (limo [(limo [1 'a' 2 'b' ~]) (limo [3 'c' 4 'd' ~]) ~]))
38− ~[1 97 2 98 3 99 4 100]
39−
40−
41−***
docs/programming/advanced/library/src/2b/title.mddeleted−1
@@ -1 +0,0 @@
1−# 2b: list logic
docs/programming/advanced/library/src/2c/gate/bex.mddeleted−39
@@ -1,39 +0,0 @@
1−### `++bex`
2−
3−Binary exponent
4−
5−Computes the result of `2^a`, producing an atom.
6−
7−Accepts
8−-------
9−
10−`a` is an atom.
11−
12−Produces
13−--------
14−
15−An atom.
16−
17−Source
18−------
19−
20− ++ bex :: binary exponent
21− ~/ %bex
22− |= a/@
23− ^- @
24− ?: =(0 a) 1
25− (mul 2 $(a (dec a)))
26−
27−Examples
28−--------
29−
30− ~zod/try=> (bex 4)
31− 16
32− ~zod/try=> (bex (add 19 1))
33− 1.048.576
34− ~zod/try=> (bex 0)
35− 1
36−
37−
38−
39−***
docs/programming/advanced/library/src/2c/gate/can.mddeleted−49
@@ -1,49 +0,0 @@
1−
2−### `++can`
3−
4−Assemble
5−
6−Produces an atom from a list `b` of length-value pairs `p` and `q`,
7−where `p` is the length in bloqs of size `a`, and `q` is an atomic
8−value.
9−
10−Accepts
11−-------
12−
13−`a` is a block size (see `++bloq`).
14−
15−`b` is a `++list` of length value pairs, `p` and `q`.
16−
17−Produces
18−--------
19−
20−An atom.
21−
22−Source
23−------
24−
25− ++ can :: assemble
26− ~/ %can
27− |= [a/bloq b/(list [p=@ q=@])]
28− ^- @
29− ?~ b 0
30− (mix (end a p.i.b q.i.b) (lsh a p.i.b $(b t.b)))
31−
32−Examples
33−--------
34−
35− ~zod/try=> `@ub`(can 3 ~[[1 1]])
36− 0b1
37− ~zod/try=> `@ub`(can 0 ~[[1 255]])
38− 0b1
39− ~zod/try=> `@ux`(can 3 [3 0xc1] [1 0xa] ~)
40− 0xa00.00c1
41− ~zod/try=> `@ux`(can 3 [3 0xc1] [1 0xa] [1 0x23] ~)
42− 0x23.0a00.00c1
43− ~zod/try=> `@ux`(can 4 [3 0xc1] [1 0xa] [1 0x23] ~)
44− 0x23.000a.0000.0000.00c1
45− ~zod/try=> `@ux`(can 3 ~[[1 'a'] [2 'bc']])
46− 0x63.6261
47−
48−
49−***
docs/programming/advanced/library/src/2c/gate/cat.mddeleted−55
@@ -1,55 +0,0 @@
1−### `++cat`
2−
3−Concatenate
4−
5−Concatenates two atoms, `b` and `c`, according to bloq size `a`, producing an
6−atom.
7−
8−Accepts
9−-------
10−
11−`a` is a block size (see `++bloq`).
12−
13−`b` is an atom.
14−
15−`c` is an atom.
16−
17−Produces
18−--------
19−
20−An atom.
21−
22−Source
23−------
24−
25− ++ cat :: concatenate
26− ~/ %cat
27− |= {a/bloq b/@ c/@}
28− (add (lsh a (met a b) c) b)
29−
30−
31−Examples
32−--------
33−
34− ~zod/try=> `@ub`(cat 3 1 0)
35− 0b1
36− ~zod/try=> `@ub`(cat 0 1 1)
37− 0b11
38− ~zod/try=> `@ub`(cat 0 2 1)
39− 0b110
40− ~zod/try=> `@ub`(cat 2 1 1)
41− 0b1.0001
42− ~zod/try=> `@ub`256
43− 0b1.0000.0000
44− ~zod/try=> `@ub`255
45− 0b1111.1111
46− ~zod/try=> `@ub`(cat 3 256 255)
47− 0b1111.1111.0000.0001.0000.0000
48− ~zod/try=> `@ub`(cat 2 256 255)
49− 0b1111.1111.0001.0000.0000
50− ~zod/try=> (cat 3 256 255)
51− 16.711.936
52−
53−
54−
55−***
docs/programming/advanced/library/src/2c/gate/cut.mddeleted−51
@@ -1,51 +0,0 @@
1−### `++cut`
2−
3−Slice
4−
5−Slices `c` blocks of size `a` that are `b` blocks from the end of `d`.
6−
7−Accepts
8−-------
9−
10−`a` is a block size (see ++bloq).
11−
12−`b` is an atom.
13−
14−`c` is an atom.
15−
16−Produces
17−--------
18−
19−An atom.
20−
21−Source
22−------
23−
24− ++ cut :: slice
25− ~/ %cut
26− |= {a/bloq {b/@u c/@u} d/@}
27− (end a c (rsh a b d))
28−
29−Examples
30−--------
31−
32− ~zod/try=> (cut 0 [1 1] 2)
33− 1
34− ~zod/try=> (cut 0 [2 1] 4)
35− 1
36− ~zod/try=> `@t`(cut 3 [0 3] 'abcdefgh')
37− 'abc'
38− ~zod/try=> `@t`(cut 3 [1 3] 'abcdefgh')
39− 'bcd'
40− ~zod/try=> `@ub`(cut 0 [0 3] 0b1111.0000.1101)
41− 0b101
42− ~zod/try=> `@ub`(cut 0 [0 6] 0b1111.0000.1101)
43− 0b1101
44− ~zod/try=> `@ub`(cut 0 [4 6] 0b1111.0000.1101)
45− 0b11.0000
46− ~zod/try=> `@ub`(cut 0 [3 6] 0b1111.0000.1101)
47− 0b10.0001
48−
49−
50−
51−***
docs/programming/advanced/library/src/2c/gate/end.mddeleted−53
@@ -1,53 +0,0 @@
1−### `++end`
2−
3−Tail
4−
5−Produces an atom by taking the last `b` blocks of size `a` from `c`.
6−
7−Accepts
8−-------
9−
10−`a` is a block size (see `++bloq`).
11−
12−`b` is an atom.
13−
14−`c` is an atom.
15−
16−Produces
17−--------
18−
19−An atom.
20−
21−
22−Source
23−------
24−
25− ++ end :: tail
26− ~/ %end
27− |= {a/bloq b/@u c/@}
28− (mod c (bex (mul (bex a) b)))
29−
30−
31−Examples
32−--------
33−
34− ~zod/try=> `@ub`12
35− 0b1100
36− ~zod/try=> `@ub`(end 0 3 12)
37− 0b100
38− ~zod/try=> (end 0 3 12)
39− 4
40− ~zod/try=> `@ub`(end 1 3 12)
41− 0b1100
42− ~zod/try=> (end 1 3 12)
43− 12
44− ~zod/try=> `@ux`'abc'
45− 0x63.6261
46− ~zod/try=> `@ux`(end 3 2 'abc')
47− 0x6261
48− ~zod/try=> `@t`(end 3 2 'abc')
49− 'ab'
50−
51−
52−
53−***
docs/programming/advanced/library/src/2c/gate/fil.mddeleted−48
@@ -1,48 +0,0 @@
1−### `++fil`
2−
3−Fill bloqstream
4−
5−Produces an atom by repeating `c` for `b` blocks of size `a`.
6−
7−Accepts
8−-------
9−
10−`a` is a block size (see `++bloq`).
11−
12−`b` is an atom.
13−
14−`c` is an atom.
15−
16−Produces
17−--------
18−
19−An atom.
20−
21−Source
22−------
23−
24− ++ fil :: fill bloqstream
25− |= {a/bloq b/@u c/@}
26− =+ n=0
27− =+ d=c
28− |- ^- @
29− ?: =(n b)
30− (rsh a 1 d)
31− $(d (add c (lsh a 1 d)), n +(n))
32−
33−
34−Examples
35−--------
36−
37− ~zod/try=> `@t`(fil 3 5 %a)
38− 'aaaaa'
39− ~zod/try=> `@t`(fil 5 10 %ceeb)
40− 'ceebceebceebceebceebceebceebceebceebceeb'
41− ~zod/try=> `@t`(fil 4 10 %eced)
42− 'ʇʇʇʇʇʇʇʇʇʇed'
43− ~zod/try=> `@tas`(fil 4 10 %bf)
44− %bfbfbfbfbfbfbfbfbfbf
45−
46−
47−
48−***
docs/programming/advanced/library/src/2c/gate/lsh.mddeleted−48
@@ -1,48 +0,0 @@
1−### `++lsh`
2−
3−Left-shift
4−
5−Produces an atom by left-shifting `c` by `b` blocks of size `a`.
6−
7−Accepts
8−-------
9−
10−`a` is a block size (see `++bloq`).
11−
12−`b` is an atom.
13−
14−`c` is an atom.
15−
16−Produces
17−--------
18−
19−An atom.
20−
21−Source
22−------
23−
24− ++ lsh :: left-shift
25− ~/ %lsh
26− |= {a/bloq b/@u c/@}
27− (mul (bex (mul (bex a) b)) c)
28−
29−
30−Examples
31−--------
32−
33− ~zod/try=> `@ub`1
34− 0b1
35− ~zod/try=> `@ub`(lsh 0 1 1)
36− 0b10
37− ~zod/try=> (lsh 0 1 1)
38− 2
39− ~zod/try=> `@ub`255
40− 0b1111.1111
41− ~zod/try=> `@ub`(lsh 3 1 255)
42− 0b1111.1111.0000.0000
43− ~zod/try=> (lsh 3 1 255)
44− 65.280
45−
46−
47−
48−***
docs/programming/advanced/library/src/2c/gate/met.mddeleted−39
@@ -1,39 +0,0 @@
1−### `++met`
2−
3−Measure
4−
5−Computes the number of blocks of size `a` in `b`, producing an atom.
6−
7−`a` is a block size (see `++bloq`).
8−
9−`b` is an atom.
10−
11−Source
12−------
13−
14− ++ met :: measure
15− ~/ %met
16− |= {a/bloq b/@}
17− ^- @
18− =+ c=0
19− |-
20− ?: =(0 b) c
21− $(b (rsh a 1 b), c +(c))
22−
23−Examples
24−--------
25−
26− ~zod/try=> (met 0 1)
27− 1
28− ~zod/try=> (met 0 2)
29− 2
30− ~zod/try=> (met 3 255)
31− 1
32− ~zod/try=> (met 3 256)
33− 2
34− ~zod/try=> (met 3 'abcde')
35− 5
36−
37−
38−
39−***
docs/programming/advanced/library/src/2c/gate/rap.mddeleted−43
@@ -1,43 +0,0 @@
1−### `++rap`
2−
3−Assemble non-zero
4−
5−Concatenates a list of atoms `b` using blocksize `a`, producing an atom.
6−
7−Accepts
8−-------
9−
10−`a` is a block size (see `++bloq`).
11−
12−`b` is a `++list` of atoms.
13−
14−Produces
15−--------
16−
17−An atom.
18−
19−Source
20−------
21−
22− ++ rap :: assemble nonzero
23− ~/ %rap
24− |= {a/bloq b/(list @)}
25− ^- @
26− ?~ b 0
27− (cat a i.b $(b t.b))
28−
29−Examples
30−--------
31−
32− ~zod/try=> `@ub`(rap 2 (limo [1 2 3 4 ~]))
33− 0b100.0011.0010.0001
34− ~zod/try=> `@ub`(rap 1 (limo [1 2 3 4 ~]))
35− 0b1.0011.1001
36− ~zod/try=> (rap 0 (limo [0 0 0 ~]))
37− 0
38− ~zod/try=> (rap 0 (limo [1 0 1 ~]))
39− 3
40−
41−
42−
43−***
docs/programming/advanced/library/src/2c/gate/rep.mddeleted−51
@@ -1,51 +0,0 @@
1−### `++rep`
2−
3−Assemble single
4−
5−Produces an atom by assembling a list of atoms `b` using block size `a`.
6−
7−Accepts
8−-------
9−
10−`a` is a block size (see `++bloq`).
11−
12−`b` is a list of atoms.
13−
14−Produces
15−--------
16−
17−An atom.
18−
19−Source
20−------
21−
22− ++ rep :: assemble single
23− ~/ %rep
24− |= {a/bloq b/(list @)}
25− ^- @
26− =+ c=0
27− |-
28− ?~ b 0
29− (con (lsh a c (end a 1 i.b)) $(c +(c), b t.b))
30−
31−Examples
32−--------
33−
34− ~zod/try=> `@ub`(rep 2 (limo [1 2 3 4 ~]))
35− 0b100.0011.0010.0001
36− ~zod/try=> (rep 0 (limo [0 0 1 ~]))
37− 4
38− ~zod/try=> (rep 0 (limo [0 0 0 1 ~]))
39− 8
40− ~zod/try=> (rep 0 (limo [0 1 0 0 ~]))
41− 2
42− ~zod/try=> (rep 0 (limo [0 1 0 1 ~]))
43− 10
44− ~zod/try=> (rep 0 (limo [0 1 0 1 0 1 ~]))
45− 42
46− ~zod/try=> `@ub`42
47− 0b10.1010
48−
49−
50−
51−***
docs/programming/advanced/library/src/2c/gate/rip.mddeleted−51
@@ -1,51 +0,0 @@
1−### `++rip`
2−
3−Disassemble
4−
5−Produces a list of atoms from the bits of `b` using block size `a`.
6−
7−Accepts
8−-------
9−
10−`a` is a block size (see `++bloq`).
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−A list of atoms.
18−
19−Source
20−------
21−
22− ++ rip :: disassemble
23− ~/ %rip
24− |= {a/bloq b/@}
25− ^- (list @)
26− ?: =(0 b) ~
27− [(end a 1 b) $(b (rsh a 1 b))]
28−
29−Examples
30−--------
31−
32− ~zod/try=> `@ub`155
33− 0b1001.1011
34− ~zod/try=> (rip 0 155)
35− ~[1 1 0 1 1 0 0 1]
36− ~zod/try=> (rip 2 155)
37− ~[11 9]
38− ~zod/try=> (rip 1 155)
39− ~[3 2 1 2]
40− ~zod/try=> `@ub`256
41− 0b1.0000.0000
42− ~zod/try=> (rip 0 256)
43− ~[0 0 0 0 0 0 0 0 1]
44− ~zod/try=> (rip 2 256)
45− ~[0 0 1]
46− ~zod/try=> (rip 3 256)
47− ~[0 1]
48−
49−
50−
51−***
docs/programming/advanced/library/src/2c/gate/rsh.mddeleted−57
@@ -1,57 +0,0 @@
1−### `++rsh`
2−
3−Right-shift
4−
5−Right-shifts `c` by `b` blocks of size `a`, producing an atom.
6−
7−Accepts
8−-------
9−
10−`a` is a block size (see `++bloq`).
11−
12−`b` is an atom.
13−
14−`c` is an atom.
15−
16−Produces
17−--------
18−
19−An atom.
20−
21−Source
22−------
23−
24− ++ rsh :: right-shift
25− ~/ %rsh
26− |= {a/bloq b/@u c/@}
27− (div c (bex (mul (bex a) b)))
28−
29−Examples
30−--------
31−
32− ~zod/try=> `@ub`145
33− 0b1001.0001
34− ~zod/try=> `@ub`(rsh 1 1 145)
35− 0b10.0100
36− ~zod/try=> (rsh 1 1 145)
37− 36
38− ~zod/try=> `@ub`(rsh 2 1 145)
39− 0b1001
40− ~zod/try=> (rsh 2 1 145)
41− 9
42− ~zod/try=> `@ub`10
43− 0b1010
44− ~zod/try=> `@ub`(rsh 0 1 10)
45− 0b101
46− ~zod/try=> (rsh 0 1 10)
47− 5
48− ~zod/try=> `@ux`'abc'
49− 0x63.6261
50− ~zod/try=> `@t`(rsh 3 1 'abc')
51− 'bc'
52− ~zod/try=> `@ux`(rsh 3 1 'abc')
53− 0x6362
54−
55−
56−
57−***
docs/programming/advanced/library/src/2c/gate/swp.mddeleted−42
@@ -1,42 +0,0 @@
1−### `++swp`
2−
3−Reverse block order
4−
5−Switches little endian to big and vice versa: produces an atom by
6−reversing the block order of `b` using block size `a`.
7−
8−
9−Accepts
10−-------
11−
12−`a` is a block size (see `++bloq`).
13−
14−`b` is an atom.
15−
16−Produces
17−--------
18−
19−An atom
20−
21−Source
22−------
23−
24− ++ swap |=({a/bloq b/@} (rep a (flop (rip a b)))) :: reverse bloq order
25−
26−Examples
27−--------
28−
29− ~zod/try=> `@ub`24
30− 0b1.1000
31− ~zod/try=> (swap 0 24)
32− 3
33− ~zod/try=> `@ub`3
34− 0b11
35− ~zod/try=> (swap 0 0)
36− 0
37− ~zod/try=> (swap 0 128)
38− 1
39−
40−
41−
42−***
docs/programming/advanced/library/src/2c/gate/xeb.mddeleted−44
@@ -1,44 +0,0 @@
1−### `++xeb`
2−
3−Binary logarithm
4−
5−Computes the base-2 logarithm of `a`, producing an atom.
6−
7−Accepts
8−-------
9−
10−`a` is an atom.
11−
12−Produces
13−--------
14−
15−An atom.
16−
17−Source
18−------
19−
20− ++ xeb :: binary logarithm
21− ~/ %xeb
22− |= a/@
23− ^- @
24− (met 0 a)
25−
26−Examples
27−--------
28−
29− ~zod/try=> (xeb 31)
30− 5
31− ~zod/try=> (xeb 32)
32− 6
33− ~zod/try=> (xeb 49)
34− 6
35− ~zod/try=> (xeb 0)
36− 0
37− ~zod/try=> (xeb 1)
38− 1
39− ~zod/try=> (xeb 2)
40− 2
41−
42−
43−
44−***
docs/programming/advanced/library/src/2c/title.mddeleted−1
@@ -1 +0,0 @@
1−# 2c: bit arithmetic
docs/programming/advanced/library/src/2d/gate/con.mddeleted−58
@@ -1,58 +0,0 @@
1−### `++con`
2−
3−Binary OR
4−
5−Computes the bit-wise logical OR of two [atom]()s, `a` and `b`, producing an
6−atom.
7−
8−Accepts
9−-------
10−
11−`a` is an atom
12−
13−`b` is an atom
14−
15−Produces
16−--------
17−
18−An atom.
19−
20−Source
21−------
22−
23− ++ con :: binary or
24− ~/ %con
25− |= {a/@ b/@}
26− =+ [c=0 d=0]
27− |- ^- @
28− ?: ?&(=(0 a) =(0 b)) d
29− %= $
30− a (rsh 0 1 a)
31− b (rsh 0 1 b)
32− c +(c)
33− d %+ add d
34− %^ lsh 0 c
35− ?& =(0 (end 0 1 a))
36− =(0 (end 0 1 b))
37− ==
38− ==
39−
40−Examples
41−--------
42−
43− ~zod/try=> (con 0b0 0b1)
44− 1
45− ~zod/try=> (con 0 1)
46− 1
47− ~zod/try=> (con 0 0)
48− 0
49− ~zod/try=> `@ub`(con 0b1111.0000 0b1.0011)
50− 0b1111.0011
51− ~zod/try=> (con 4 4)
52− 4
53− ~zod/try=> (con 10.000 234)
54− 10.234
55−
56−
57−
58−***
docs/programming/advanced/library/src/2d/gate/dis.mddeleted−62
@@ -1,62 +0,0 @@
1−### `++dis`
2−
3−Binary AND
4−
5−Computes the bit-wise logical AND of two atoms `a` and `b`, producing an
6−atom.
7−
8−Accepts
9−-------
10−
11−`a` is an atom.
12−
13−`b` is an atom.
14−
15−Produces
16−--------
17−
18−An atom.
19−
20−Source
21−------
22−
23− ++ dis :: binary and
24− ~/ %dis
25− |= {a/@ b/@}
26− =| {c/@ d/@}
27− |- ^- @
28− ?: ?|(=(0 a) =(0 b)) d
29− %= $
30− a (rsh 0 1 a)
31− b (rsh 0 1 b)
32− c +(c)
33− d %+ add d
34− %^ lsh 0 c
35− ?| =(0 (end 0 1 a))
36− =(0 (end 0 1 b))
37− ==
38− ==
39−
40−Examples
41−--------
42−
43− ~zod/try=> `@ub`9
44− 0b1001
45− ~zod/try=> `@ub`5
46− 0b101
47− ~zod/try=> `@ub`(dis 9 5)
48− 0b1
49− ~zod/try=> (dis 9 5)
50− 1
51− ~zod/try=> `@ub`534
52− 0b10.0001.0110
53− ~zod/try=> `@ub`987
54− 0b11.1101.1011
55− ~zod/try=> `@ub`(dis 534 987)
56− 0b10.0001.0010
57− ~zod/try=> (dis 534 987)
58− 530
59−
60−
61−
62−***
docs/programming/advanced/library/src/2d/gate/mix.mddeleted−54
@@ -1,54 +0,0 @@
1−### `++mix`
2−
3−Binary XOR
4−
5−Produces the bit-wise logical XOR of `a` and `b`, producing an atom.
6−
7−Accepts
8−-------
9−
10−`a` is an atom
11−
12−`b` is an atom
13−
14−Produces
15−--------
16−
17−An atom.
18−
19−Source
20−------
21−
22− ++ mix :: binary xor
23− ~/ %mix
24− |= {a/@ b/@}
25− ^- @
26− =+ [c=0 d=0]
27− |-
28− ?: ?&(=(0 a) =(0 b)) d
29− %= $
30− a (rsh 0 1 a)
31− b (rsh 0 1 b)
32− c +(c)
33− d (add d (lsh 0 c =((end 0 1 a) (end 0 1 b))))
34− ==
35−
36−Examples
37−--------
38−
39− ~zod/try=> `@ub`2
40− 0b10
41− ~zod/try=> `@ub`3
42− 0b11
43− ~zod/try=> `@ub`(mix 2 3)
44− 0b1
45− ~zod/try=> (mix 2 3)
46− 1
47− ~zod/try=> `@ub`(mix 2 2)
48− 0b0
49− ~zod/try=> (mix 2 2)
50− 0
51−
52−
53−
54−***
docs/programming/advanced/library/src/2d/gate/not.mddeleted−47
@@ -1,47 +0,0 @@
1−### `++not`
2−
3−Binary NOT
4−
5−Computes the bit-wise logical NOT of the bottom `b` blocks of size `a`
6−of `c`.
7−
8−Accepts
9−-------
10−
11−`a` is a block size (see `++bloq`).
12−
13−`b` is an atom.
14−
15−`c` is an atom.
16−
17−Produces
18−--------
19−
20−An atom.
21−
22−Source
23−------
24−
25− ++ not |= {a/bloq b/@ c/@} :: binary not (sized)
26− (mix c (dec (bex (mul b (bex a)))))
27−
28−
29−Examples
30−--------
31−
32− ~zod/try=> `@ub`24
33− 0b1.1000
34− ~zod/try=> (not 0 5 24)
35− 7
36− ~zod/try=> `@ub`7
37− 0b111
38− ~zod/try=> (not 2 5 24)
39− 1.048.551
40− ~zod/try=> (not 2 5 1.048.551)
41− 24
42− ~zod/try=> (not 1 1 (not 1 1 10))
43− 10
44−
45−
46−
47−***
docs/programming/advanced/library/src/2d/title.mddeleted−1
@@ -1 +0,0 @@
1−# 2d: bit logic
docs/programming/advanced/library/src/2e/gate/fnv.mddeleted−35
@@ -1,35 +0,0 @@
1−### `++fnv`
2−
3−Hashes an atom with the 32-bit FNV non-cryptographic hash algorithm.
4−Multiplies `a` by the prime number 16,777,619 and then takes the block
5−of size 5 off the product's end, producing an atom.
6−
7−Accepts
8−-------
9−
10−`a` is an atom.
11−
12−Produces
13−--------
14−
15−An atom.
16−
17−
18−Source
19−------
20−
21− ++ fnv |=(a/@ (end 5 1 (mul 16.777.619 a))) :: FNV scrambler
22−
23−Examples
24−--------
25−
26− ~zod/try=> (fnv 10.000)
27− 272.465.456
28− ~zod/try=> (fnv 10.001)
29− 289.243.075
30− ~zod/try=> (fnv 1)
31− 16.777.619
32−
33−
34−
35−***
docs/programming/advanced/library/src/2e/gate/mug.mddeleted−57
@@ -1,57 +0,0 @@
1−### `++mug`
2−
3−Hashes `a` with the 31-bit nonzero FNV-1a non-cryptographic hash
4−algorithm, producing an atom.
5−
6−Accepts
7−-------
8−
9−A is a noun.
10−
11−Produces
12−--------
13−
14−An atom.
15−
16−Source
17−------
18−
19− ++ mug :: 31bit nonzero FNV1a
20− ~/ %mug
21− |= a/*
22− ?^ a
23− =+ b=[p=$(a -.a) q=$(a +.a)]
24− |- ^- @
25− =+ c=(fnv (mix p.b (fnv q.b)))
26− =+ d=(mix (rsh 0 31 c) (end 0 31 c))
27− ?. =(0 c) c
28− $(q.b +(q.b))
29− =+ b=2.166.136.261
30− |- ^- @
31− =+ c=b
32− =+ [d=0 e=(met 3 a)]
33− |- ^- @
34− ?: =(d e)
35− =+ f=(mix (rsh 0 31 c) (end 0 31 c))
36− ?. =(0 f) f
37− ^$(b +(b))
38− $(c (fnv (mix c (cut 3 [d 1] a))), d +(d))
39−
40−
41−Examples
42−--------
43−
44− ~zod/try=> (mug 10.000)
45− 178.152.889
46− ~zod/try=> (mug 10.001)
47− 714.838.017
48− ~zod/try=> (mug 1)
49− 67.918.732
50− ~zod/try=> (mug (some 10))
51− 1.872.403.737
52− ~zod/try=> (mug (limo [1 2 3 4 5 ~]))
53− 1.067.931.605
54−
55−
56−
57−***
docs/programming/advanced/library/src/2e/gate/mum.mddeleted−62
@@ -1,62 +0,0 @@
1−### `++mum`
2−
3−XX document
4−
5−Accepts
6−-------
7−
8−Produces
9−--------
10−
11−Source
12−------
13−
14− ++ mum :: mug with murmur3
15− ~/ %mum
16− |= a/*
17− |^ (trim ?@(a a (mix $(a -.a) (mix 0x7fff.ffff $(a +.a)))))
18− ++ spec :: standard murmur3
19− |= {syd/@ key/@}
20− ?> (lte (met 5 syd) 1)
21− =+ ^= row
22− |= {a/@ b/@}
23− (con (end 5 1 (lsh 0 a b)) (rsh 0 (sub 32 a) b))
24− =+ mow=|=({a/@ b/@} (end 5 1 (mul a b)))
25− =+ len=(met 5 key)
26− =- =. goc (mix goc len)
27− =. goc (mix goc (rsh 4 1 goc))
28− =. goc (mow goc 0x85eb.ca6b)
29− =. goc (mix goc (rsh 0 13 goc))
30− =. goc (mow goc 0xc2b2.ae35)
31− (mix goc (rsh 4 1 goc))
32− ^= goc
33− =+ [inx=0 goc=syd]
34− |- ^- @
35− ?: =(inx len) goc
36− =+ kop=(cut 5 [inx 1] key)
37− =. kop (mow kop 0xcc9e.2d51)
38− =. kop (row 15 kop)
39− =. kop (mow kop 0x1b87.3593)
40− =. goc (mix kop goc)
41− =. goc (row 13 goc)
42− =. goc (end 5 1 (add 0xe654.6b64 (mul 5 goc)))
43− $(inx +(inx))
44−
45−
46−Examples
47−--------
48−
49− ~zod/try=> (mum 10.000)
50− 1.232.632.901
51− ~zod/try=> (mum 10.001)
52− 658.093.079
53− ~zod/try=> (mum 1)
54− 818.387.364
55− ~zod/try=> (mum (some 10))
56− 1.177.215.703
57− ~zod/try=> (mum ~[1 2 3 4 5])
58− 1.517.902.092
59−
60−
61−
62−***
docs/programming/advanced/library/src/2e/title.mddeleted−1
@@ -1 +0,0 @@
1−# 2e: insecure hashing
docs/programming/advanced/library/src/2f/gate/aor.mddeleted−64
@@ -1,64 +0,0 @@
1−### `++aor`
2−
3−Alphabetic order
4−
5−Computes whether `a` and `b` are in alphabetical order, producing a
6−boolean.
7−
8−Accepts
9−-------
10−
11−`a` is a noun.
12−
13−`b` is a noun.
14−
15−Produces
16−--------
17−
18−A boolean atom.
19−
20−
21−Source
22−------
23−
24− ++ aor :: a-order
25− ~/ %aor
26− |= {a/* b/*}
27− ^- ?
28− ?: =(a b) &
29− ?. ?=(@ a)
30− ?: ?=(@ b) |
31− ?: =(-.a -.b)
32− $(a +.a, b +.b)
33− $(a -.a, b -.b)
34− ?. ?=(@ b) &
35− |-
36− =+ [c=(end 3 1 a) d=(end 3 1 b)]
37− ?: =(c d)
38− $(a (rsh 3 1 a), b (rsh 3 1 b))
39− (lth c d)
40−
41−
42−Examples
43−--------
44−
45− ~zod/try=> (aor 'a' 'b')
46− %.y
47− ~zod/try=> (aor 'b' 'a')
48− %.n
49− ~zod/try=> (aor "foo" "bar")
50− %.n
51− ~zod/try=> (aor "bar" "foo")
52− %.y
53− ~zod/try=> (aor "abcdefz" "abcdefa")
54− %.n
55− ~zod/try=> (aor "abcdefa" "abcdefz")
56− %.y
57− ~zod/try=> (aor 10.000 17.000)
58− %.y
59− ~zod/try=> (aor 10 9)
60− %.n
61−
62−
63−
64−***
docs/programming/advanced/library/src/2f/gate/dor.mddeleted−55
@@ -1,55 +0,0 @@
1−### `++dor`
2−
3−Numeric order
4−
5−Computes whether `a` and `b` are in ascending numeric order, producing a
6−boolean.
7−
8−Accepts
9−-------
10−
11−`a` is a noun.
12−
13−`b` is a noun.
14−
15−Produces
16−--------
17−
18−A boolean atom.
19−
20−Source
21−------
22−
23− ++ dor :: d-order
24− ~/ %dor
25− |= {a/* b/*}
26− ^- ?
27− ?: =(a b) &
28− ?. ?=(@ a)
29− ?: ?=(@ b) |
30− ?: =(-.a -.b)
31− $(a +.a, b +.b)
32− $(a -.a, b -.b)
33− ?. ?=(@ b) &
34− (lth a b)
35−
36−
37−Examples
38−--------
39−
40− ~zod/try=> (dor 1 2)
41− %.y
42− ~zod/try=> (dor 2 1)
43− %.n
44− ~zod/try=> (dor ~[1 2 3] ~[1 2 4])
45− %.y
46− ~zod/try=> (dor ~[1 2 4] ~[1 2 3])
47− %.n
48− ~zod/try=> (dor (limo ~[99 100 10.000]) ~[99 101 10.000])
49− %.y
50− ~zod/try=> (dor ~[99 101 10.999] (limo ~[99 100 10.000]))
51− %.n
52−
53−
54−
55−***
docs/programming/advanced/library/src/2f/gate/gor.mddeleted−59
@@ -1,59 +0,0 @@
1−### `++gor`
2−
3−Hash order
4−
5−XX revisit
6−
7−Accepts
8−-------
9−
10−`a` is a noun.
11−
12−`b` is a noun.
13−
14−Produces
15−--------
16−
17−A boolean atom.
18−
19−Source
20−------
21−
22− ++ gor :: g-order
23− ~/ %gor
24− |= {a/* b/*}
25− ^- ?
26− =+ [c=(mug a) d=(mug b)]
27− ?: =(c d)
28− (dor a b)
29− (lth c d)
30−
31−
32−Examples
33−--------
34−
35− ~zod/try=> (gor 'd' 'c')
36− %.y
37− ~zod/try=> 'd'
38− 'd'
39− ~zod/try=> 'c'
40− ~zod/try=> `@ud`'d'
41− 100
42− ~zod/try=> `@ud`'c'
43− 99
44− ~zod/try=> (mug 'd')
45− 1.628.185.714
46− ~zod/try=> (mug 'c')
47− 1.712.073.811
48− ~zod/try=> (gor 'd' 'c')
49− %.y
50− ~zod/try=> (gor 'c' 'd')
51− %.n
52− ~zod/try=> (gor "foo" "bar")
53− %.n
54− ~zod/try=> (gor (some 10) (limo [1 2 3 ~]))
55− %.n
56−
57−
58−
59−***
docs/programming/advanced/library/src/2f/gate/hor.mddeleted−53
@@ -1,53 +0,0 @@
1−### `++hor`
2−
3−Hash order
4−
5−XX revisit
6−
7−Recursive hash comparator gate.
8−
9−Accepts
10−-------
11−
12−`a` is a noun.
13−
14−`b` is a noun.
15−
16−Produces
17−--------
18−
19−A boolean atom.
20−
21−
22−Source
23−------
24−
25− ++ hor :: h-order
26− ~/ %hor
27− |= {a/* b/*}
28− ^- ?
29− ?: ?=(@ a)
30− ?. ?=(@ b) &
31− (gor a b)
32− ?: ?=(@ b) |
33− ?: =(-.a -.b)
34− (gor +.a +.b)
35− (gor -.a -.b)
36− ::
37−
38−
39−Examples
40−--------
41−
42− ~zod/try=> (hor . 1)
43− %.n
44− ~zod/try=> (hor 1 2)
45− %.y
46− ~zod/try=> (hor "abc" "cba")
47− %.y
48− ~zod/try=> (hor 'c' 'd')
49− %.n
50−
51−
52−
53−***
docs/programming/advanced/library/src/2f/gate/vor.mddeleted−42
@@ -1,42 +0,0 @@
1−### `++vor`
2−
3−Double hash comparator gate.
4−
5−XX revisit
6−
7−Accepts
8−-------
9−
10−`a` is a noun
11−
12−`b` is a noun
13−
14−Produces
15−-------
16−
17−Source
18−------
19−
20− ++ vor :: v-order
21− ~/ %vor
22− |= {a/* b/*}
23− ^- ?
24− =+ [c=(mug (mug a)) d=(mug (mug b))]
25− ?: =(c d)
26− (dor a b)
27− (lth c d)
28−
29−
30−Examples
31−--------
32−
33− ~zod/try=> (vor 'f' 'g')
34− %.y
35− ~zod/try=> (vor 'a' 'z')
36− %.n
37− ~zod/try=> (vor 43.326 41.106)
38− %.n
39−
40−
41−
42−***
docs/programming/advanced/library/src/2f/title.mddeleted−1
@@ -1 +0,0 @@
1−# 2f: noun ordering
docs/programming/advanced/library/src/2g/title.mddeleted−1
@@ -1 +0,0 @@
1−# 2g: unsigned powers
docs/programming/advanced/library/src/2h/core/in.mddeleted−600
@@ -1,600 +0,0 @@
1−
2−### `++in`
3−
4−Set operations
5−
6−Core whose arms contain a variety of functions that operate on `++set`s. Its sample accepts the input `++set` to be manipulated.
7−
8−Accepts
9−-------
10−
11−A `++set`.
12−
13−Source
14−------
15−
16− ++ in :: set engine
17− ~/ %in
18− |_ a/(set)
19−
20−Examples
21−--------
22−
23− ~zod/try=> ~(. in (sa "asd"))
24− <13.evb [nlr(^$1{@tD $1}) <414.fvk 101.jzo 1.ypj %164>]>
25−
26−### `+-all:in`
27−
28−Logical AND
29−
30−Computes the logical AND on every element in `a` slammed with `b`,
31−producing a boolean.
32−
33−Accepts
34−-------
35−
36−`a` is a `++set`.
37−
38−`b` is a wet gate that accepts a noun and produces a boolean.
39−
40−Produces
41−--------
42−
43−A boolean.
44−
45−Source
46−------
47−
48− +- all :: logical AND
49− ~/ %all
50− |* b/$-(* ?)
51− |- ^- ?
52− ?~ a
53− &
54− ?&((b n.a) $(a l.a) $(a r.a))
55−
56−
57−Examples
58−--------
59−
60− ~zod/try=> =b (sa `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
61− ~zod/try=> (~(all in b) |=(a/* ?@(+.a & |)))
62− %.n
63− ~zod/try=> =b (sa `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
64− ~zod/try=> (~(all in b) |=(a/@t (gte a 100)))
65− %.y
66−
67−------------------------------------------------------------------------
68−
69−### `+-any:in`
70−
71−Logical OR
72−
73−Computes the logical OR on every element of `a` slammed with `b`.
74−
75−Accepts
76−-------
77−
78−`a` is a `++set`.
79−
80−`b` is a gate that accepts a noun and produces a boolean.
81−
82−Produces
83−--------
84−
85−A boolean.
86−
87−Source
88−------
89−
90− +- any :: logical OR
91− ~/ %any
92− |* b/$-(* ?)
93− |- ^- ?
94− ?~ a
95− |
96− ?|((b n.a) $(a l.a) $(a r.a))
97− ::
98−
99−
100−Examples
101−--------
102−
103− ~zod/try=> =b (sa `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
104− ~zod/try=> (~(any in b) |=(a/* ?@(+.a & |)))
105− %.y
106− ~zod/try=> =b (sa `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
107− ~zod/try=> (~(any in b) |=(a/@t (lte a 100)))
108− %.n
109−
110−------------------------------------------------------------------------
111−
112−### `+-del:in`
113−
114−Remove noun
115−
116−Removes `b` from the `++set` `a`.
117−
118−Accepts
119−-------
120−
121−`a` is a set.
122−
123−`b` is a noun.
124−
125−Produces
126−--------
127−
128−A set.
129−
130−Source
131−------
132−
133− +- del :: b without any a
134− ~/ %del
135− |* b/*
136− |- ^+ a
137− ?~ a
138− ~
139− ?. =(b n.a)
140− ?: (hor b n.a)
141− [n.a $(a l.a) r.a]
142− [n.a l.a $(a r.a)]
143− |- ^- {$?($~ _a)}
144− ?~ l.a r.a
145− ?~ r.a l.a
146− ?: (vor n.l.a n.r.a)
147− [n.l.a l.l.a $(l.a r.l.a)]
148− [n.r.a $(r.a l.r.a) r.r.a]
149− ::
150−
151−
152−Examples
153−--------
154−
155− ~zod/try=> =b (sa `(list @t)`['a' 'b' 'c' ~])
156− ~zod/try=> (~(del in b) 'a')
157− {'c' 'b'}
158− ~zod/try=> =b (sa `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
159− ~zod/try=> (~(del in b) 'john')
160− {'bonita' 'madeleine' 'daniel'}
161− ~zod/try=> (~(del in b) 'susan')
162− {'bonita' 'madeleine' 'daniel' 'john'}
163−
164−------------------------------------------------------------------------
165−
166−### `+-dig:in`
167−
168−Axis a in b
169−
170−Produce the axis of `b` within `a`.
171−
172−Accepts
173−-------
174−
175−`a` is a `++set`.
176−
177−`b` is a noun.
178−
179−Produces
180−--------
181−
182−The `++unit` of an atom.
183−
184−Source
185−------
186−
187− +- dig :: axis of a in b
188− |= b/*
189− =+ c=1
190− |- ^- (unit @)
191− ?~ a ~
192− ?: =(b n.a) [~ u=(peg c 2)]
193− ?: (hor b n.a)
194− $(a l.a, c (peg c 6))
195− $(a r.a, c (peg c 7))
196− ::
197−
198−
199−
200−Examples
201−--------
202−
203− ~zod/try=> =a (sa `(list @)`[1 2 3 4 5 6 7 ~])
204− ~zod/try=> a
205− {5 4 7 6 1 3 2}
206− ~zod/try=> -.a
207− n=6
208− ~zod/try=> (~(dig in a) 7)
209− [~ 12]
210− ~zod/try=> (~(dig in a) 2)
211− [~ 14]
212− ~zod/try=> (~(dig in a) 6)
213− [~ 2]
214−
215−------------------------------------------------------------------------
216−
217−### `+-gas:in`
218−
219−Concatenate
220−
221−Insert the elements of a `++list` `b` into a `++set` `a`.
222−
223−Accepts
224−-------
225−
226−`a` is a set.
227−
228−`b` is a list.
229−
230−Produces
231−--------
232−
233−A `++set`.
234−
235−Source
236−------
237−
238− +- gas :: concatenate
239− ~/ %gas
240− |= b/(list _?>(?=(^ a) n.a))
241− |- ^+ a
242− ?~ b
243− a
244− $(b t.b, a (put i.b))
245− ::
246−
247−
248−Examples
249−--------
250−
251− ~zod/try=> b
252− {'bonita' 'madeleine' 'rudolf' 'john'}
253− ~zod/try=> (~(gas in b) `(list @t)`['14' 'things' 'number' '1.337' ~])
254− {'1.337' '14' 'number' 'things' 'bonita' 'madeleine' 'rudolf' 'john'}
255− ~zod/try=> (~(gas in s) `(list ,@t)`['1' '2' '3' ~])
256− {'1' '3' '2' 'e' 'd' 'a' 'c' 'b'}
257−
258−------------------------------------------------------------------------
259−
260−### `+-has:in`
261−
262−b in a?
263−
264−Checks if `b` is an element of `a`, producing a boolean.
265−
266−Accepts
267−-------
268−
269−`a` is a [`++set`]().
270−
271−`b` is a [noun]().
272−
273−Produces
274−--------
275−
276−A boolean.
277−
278−Source
279−------
280−
281− +- has :: b exists in a check
282− ~/ %has
283− |* b/*
284− |- ^- ?
285− ?~ a
286− |
287− ?: =(b n.a)
288− &
289− ?: (hor b n.a)
290− $(a l.a)
291− $(a r.a)
292− ::
293−
294−
295−Examples
296−--------
297−
298− ~zod/try=> =a (~(gas in `(set @t)`~) `(list @t)`[`a` `b` `c` ~])
299− ~zod/try=> (~(has in a) `a`)
300− %.y
301− ~zod/try=> (~(has in a) 'z')
302− %.n
303−
304−------------------------------------------------------------------------
305−
306−### `+-int:in`
307−
308−Intersection
309−
310−Produces a set of the intersection between two `++set`s of the same type,
311−`a` and `b`.
312−
313−Accepts
314−-------
315−
316−`a` is a set.
317−
318−`b` is a set.
319−
320−Produces
321−--------
322−
323−A `++set`.
324−
325−Source
326−------
327−
328− +- int :: intersection
329− ~/ %int
330− |* b/_a
331− |- ^+ a
332− ?~ b
333− ~
334− ?~ a
335− ~
336− ?. (vor n.a n.b)
337− $(a b, b a)
338− ?: =(n.b n.a)
339− [n.a $(a l.a, b l.b) $(a r.a, b r.b)]
340− ?: (hor n.b n.a)
341− %- uni(a $(a l.a, b [n.b l.b ~])) $(b r.b)
342− %- uni(a $(a r.a, b [n.b ~ r.b])) $(b l.b)
343− ::
344−
345−
346−
347−Examples
348−--------
349−
350− ~zod/try=> (~(int in (sa "ac")) (sa "ha"))
351− {~~a}
352− ~zod/try=> (~(int in (sa "acmo")) ~)
353− {}
354− ~zod/try=> (~(int in (sa "acmo")) (sa "ham"))
355− {~~a ~~m}
356− ~zod/try=> (~(int in (sa "acmo")) (sa "lep"))
357− {}
358−
359−------------------------------------------------------------------------
360−
361−### `+-put:in`
362−
363−Put b in a
364−
365−Add an element `b` to the `++set` `a`.
366−
367−Accepts
368−-------
369−
370−`a` is a set.
371−
372−`b` is a noun.
373−
374−Produces
375−--------
376−
377−A `++set`.
378−
379−Source
380−------
381−
382− +- put :: puts b in a, sorted
383− ~/ %put
384− |* b/*
385− |- ^+ a
386− ?~ a
387− [b ~ ~]
388− ?: =(b n.a)
389− a
390− ?: (hor b n.a)
391− =+ c=$(a l.a)
392− ?> ?=(^ c)
393− ?: (vor n.a n.c)
394− [n.a c r.a]
395− [n.c l.c [n.a r.c r.a]]
396− =+ c=$(a r.a)
397− ?> ?=(^ c)
398− ?: (vor n.a n.c)
399− [n.a l.a c]
400− [n.c [n.a l.a l.c] r.c]
401− ::
402−
403−
404−Examples
405−--------
406−
407− ~zod/try=> =a (~(gas in `(set @t)`~) `(list @t)`[`a` `b` `c` ~])
408− ~zod/try=> =b (~(put in a) `d`)
409− ~zod/try=> b
410− {`d` `a` `c` `b`}
411− ~zod/try=> -.l.+.b
412− n=`d`
413−
414−------------------------------------------------------------------------
415−
416−### `+-rep:in`
417−
418−Accumulate
419−
420−Accumulate the elements of `a` using a gate `c` and an accumulator `b`.
421−
422−Accepts
423−--------
424−
425−`a` is a `++set`.
426−
427−`b` is a noun.
428−
429−`c` is a gate.
430−
431−Produces
432−--------
433−
434−A noun.
435−
436−Source
437−------
438−
439− +- rep :: replace by product
440− |* b/_|=({* *} +<+)
441− |-
442− ?~ a +<+.b
443− $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
444−
445−
446−
447−Examples
448−--------
449−
450− ~zod/try=> =a (~(gas in *(set @)) [1 2 3 ~])
451− ~zod/try=> a
452− {1 3 2}
453− ~zod/try=> (~(rep in a) 0 |=([a/@ b/@] (add a b)))
454− 6
455−
456−------------------------------------------------------------------------
457−
458−### `+-tap:in`
459−
460−Set to list
461−
462−Flattens the `++set` `a` into a `++list`.
463−
464−Accepts
465−-------
466−
467−`a` is an set.
468−
469−Produces
470−--------
471−
472−A list.
473−
474−Source
475−------
476−
477− +- tap :: convert to list
478− ~/ %tap
479− |= b/(list _?>(?=(^ a) n.a))
480− ^+ b
481− ?~ a
482− b
483− $(a r.a b [n.a $(a l.a)])
484− ::
485−
486−
487−
488−Examples
489−--------
490−
491− ~zod/try=> =s (sa `(list @t)`['a' 'b' 'c' 'd' 'e' ~])
492− ~zod/try=> s
493− {'e' 'd' 'a' 'c' 'b'}
494− ~zod/try=> (~(tap in s) `(list @t)`['1' '2' '3' ~])
495− ~['b' 'c' 'a' 'd' 'e' '1' '2' '3']
496− ~zod/try=> b
497− {'bonita' 'madeleine' 'daniel' 'john'}
498− ~zod/try=> (~(tap in b) `(list ,@t)`['david' 'people' ~])
499− ~['john' 'daniel' 'madeleine' 'bonita' 'david' 'people']
500−
501−------------------------------------------------------------------------
502−
503−### `+-uni:in`
504−
505−Union
506−
507−Produces a set of the union between two [`++set`]()s of the same type, `a` and
508−`b`.
509−
510−Accepts
511−-------
512−
513−`a` is a set.
514−
515−`b` is a set.
516−
517−Produces
518−--------
519−
520−A set.
521−
522−Source
523−------
524−
525− +- uni :: union
526− ~/ %uni
527− |* b/_a
528− ?: =(a b) a
529− |- ^+ a
530− ?~ b
531− a
532− ?~ a
533− b
534− ?: (vor n.a n.b)
535− ?: =(n.b n.a)
536− [n.b $(a l.a, b l.b) $(a r.a, b r.b)]
537− ?: (hor n.b n.a)
538− $(a [n.a $(a l.a, b [n.b l.b ~]) r.a], b r.b)
539− $(a [n.a l.a $(a r.a, b [n.b ~ r.b])], b l.b)
540− ?: =(n.a n.b)
541− [n.b $(b l.b, a l.a) $(b r.b, a r.a)]
542− ?: (hor n.a n.b)
543− $(b [n.b $(b l.b, a [n.a l.a ~]) r.b], a r.a)
544− $(b [n.b l.b $(b r.b, a [n.a ~ r.a])], a l.a)
545− ::
546−
547−
548−Examples
549−--------
550−
551− ~zod/try=> (~(uni in (sa "ac")) (sa "ha"))
552− {~~a ~~c ~~h}
553− ~zod/try=> (~(uni in (sa "acmo")) ~)
554− {~~a ~~c ~~m ~~o}
555− ~zod/try=> (~(uni in (sa "acmo")) (sa "ham"))
556− {~~a ~~c ~~m ~~o ~~h}
557− ~zod/try=> (~(uni in (sa "acmo")) (sa "lep"))
558− {~~e ~~a ~~c ~~m ~~l ~~o ~~p}
559−
560−------------------------------------------------------------------------
561−
562−### `+-wyt:in`
563−
564−Set size
565−
566−Produce the number of elements in [`++set`]() `a` as an atom.
567−
568−Accepts
569−-------
570−
571−`a` is an set.
572−
573−Produces
574−--------
575−
576−An atom.
577−
578−Source
579−------
580−
581− +- wyt :: size of set
582− |- ^- @
583− ?~(a 0 +((add $(a l.a) $(a r.a))))
584− --
585−
586−
587−
588−Examples
589−--------
590−
591− ~zod/try=> =a (~(put in (~(put in (sa)) 'a')) 'b')
592− ~zod/try=> ~(wyt in a)
593− 2
594− ~zod/try=> b
595− {'bonita' 'madeleine' 'daniel' 'john'}
596− ~zod/try=> ~(wyt in b)
597− 4
598−
599−
600−***
docs/programming/advanced/library/src/2h/title.mddeleted−1
@@ -1 +0,0 @@
1−# 2h: set logic
docs/programming/advanced/library/src/2i/core/by.mddeleted−583
@@ -1,583 +0,0 @@
1−### `++by`
2−
3−Map operations
4−
5− ++ by :: map engine
6− ~/ %by
7− |_ a/(map)
8−
9−
10−Container 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−
13−`a` is a map.
14−
15− ~zod/try=> ~(. by (mo (limo [%a 1] [%b 2] ~)))
16− <19.irb [nlr([p={%a %b} q=@ud]) <414.rvm 101.jzo 1.ypj %164>]>
17−
18−------------------------------------------------------------------------
19−
20−### `+-all:by`
21−
22−Logical AND
23−
24− +- all :: logical AND
25− ~/ %all
26− |* b/$-(* ?)
27− |- ^- ?
28− ?~ a
29− &
30− ?&((b q.n.a) $(a l.a) $(a r.a))
31− ::
32−
33−
34−Computes the logical AND on the results of slamming every element in map
35−`a` with gate `b`. Produces a loobean.
36−
37−`a` is a map.
38−
39−`b` is a wet gate.
40−
41− ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
42− ~zod/try=> (~(all by b) |=(a/* ?@(a & |)))
43− %.n
44− ~zod/try=> =a (mo `(list {@t @u})`[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
45− ~zod/try=> (~(all by a) |=(a/@ (lte a 6)))
46− %.y
47− ~zod/try=> (~(all by a) |=(a/@ (lte a 4)))
48− %.n
49−
50−------------------------------------------------------------------------
51−
52−### `+-any:by`
53−
54−Logical OR
55−
56− +- any :: logical OR
57− ~/ %any
58− |* b=$+(* ?)
59− |- ^- ?
60− ?~ a
61− |
62− ?|((b q.n.a) $(a l.a) $(a r.a))
63−
64−Computes the logical OR on the results of slamming every element with
65−gate `b`. Produces a loobean.
66−
67−`a` is a map.
68−
69−`b` is a wet gate.
70−
71− ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
72− ~zod/try=> (~(all by b) |=(a/* ?@(a & |)))
73− %.y
74− ~zod/try=> =a (mo `(list {@t @u})`[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
75− ~zod/try=> (~(any by a) |=(a=@ (lte a 4)))
76− %.y
77−
78−------------------------------------------------------------------------
79−
80−### `+-del:by`
81−
82−Delete
83−
84− +- del :: delete at key b
85− ~/ %del
86− |* b/*
87− |- ^+ a
88− ?~ a
89− ~
90− ?. =(b p.n.a)
91− ?: (gor b p.n.a)
92− [n.a $(a l.a) r.a]
93− [n.a l.a $(a r.a)]
94− |- ^- {$?($~ _a)}
95− ?~ l.a r.a
96− ?~ r.a l.a
97− ?: (vor p.n.l.a p.n.r.a)
98− [n.l.a l.l.a $(l.a r.l.a)]
99− [n.r.a $(r.a l.r.a) r.r.a]
100− ::
101−
102−Produces map `a` with the element located at key `b` removed.
103−
104−`a` is a map.
105−
106−`b` is a key as a noun.
107−
108− ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
109− ~zod/try=> (~(del by b) `a`)
110− {[p=`b` q=[2 3]]}
111−
112−------------------------------------------------------------------------
113−
114−### `+-dig:by`
115−
116−Axis of key
117−
118− +- dig :: axis of b key
119− |= b/*
120− =+ c=1
121− |- ^- (unit @)
122− ?~ a ~
123− ?: =(b p.n.a) [~ u=(peg c 2)]
124− ?: (gor b p.n.a)
125− $(a l.a, c (peg c 6))
126− $(a r.a, c (peg c 7))
127− ::
128−
129−
130−Produce the axis of key `b` within map `a`.
131−
132−`a` is a map.
133−
134−`b` is a key as a noun.
135−
136− ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
137− ~zod/try=> (~(dig by b) `b`)
138− [~ 2]
139−
140−------------------------------------------------------------------------
141−
142−### `+-gas:by`
143−
144−Concatenate
145−
146− +- gas :: concatenate
147− ~/ %gas
148− |= b/(list _?>(?=(^ a) n.a))
149− |- ^+ a
150− ?~ b
151− a
152− $(b t.b, a (put i.b))
153− ::
154−
155−
156−Insert a list of key-value pairs `b` into map `a`.
157−
158−`a` is a map.
159−
160−`b` is a list of cells of key-value nouns `p` and `q`.
161−
162− ~zod/try=> =a (mo `(list {@t *})`[[`a` 1] [`b` 2] ~])
163− ~zod/try=> =b `(list {@t *})`[[`c` 3] [`d` 4] ~]
164− ~zod/try=> (~(gas by a) b)
165− {[p=`d` q=4] [p=`a` q=1] [p=`c` q=3] [p=`b` q=2]}
166−
167−------------------------------------------------------------------------
168−
169−### `+-get:by`
170−
171−Grab unit value
172−
173− +- get :: unit value by key
174− ~/ %get
175− |* b=*
176− |- ^- ?(~ [~ u=_?>(?=(^ a) q.n.a)])
177− ?~ a
178− ~
179− ?: =(b p.n.a)
180− [~ u=q.n.a]
181− ?: (gor b p.n.a)
182− $(a l.a)
183− $(a r.a)
184−
185−Produce the unit value of the value located at key `b` within map `a`.
186−
187−`a` is a map
188−
189−`b` is a key as a noun
190−
191− ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
192− ~zod/try=> (~(get by b) `b`)
193− [~ [2 3]]
194−
195−------------------------------------------------------------------------
196−
197−### `+-got:by`
198−
199−Assert
200−
201− +- got
202− |* b/*
203− (need (get b))
204−
205−Produce the value located at key `b` within map `a`. Crash if key `b`
206−does not exist.
207−
208−`a` is a map.
209−
210−`b` is a key.
211−
212− ~zod/try=> =m (mo `(list {@t *})`[['a' 1] ['b' 2] ~])
213− ~zod/try=> m
214− {[p='a' q=1] [p='b' q=2]}
215− ~zod/try=> (~(get by m) 'a')
216− [~ 1]
217− ~zod/try=> (~(got by m) 'a')
218− 1
219− ~zod/try=> (~(got by m) 'c')
220− ! exit
221−
222−------------------------------------------------------------------------
223−
224−### `+-has:by`
225−
226−Key existence check
227−
228− +- has :: key existence check
229− ~/ %has
230− |* b/*
231− !=(~ (get b))
232−
233−
234−Checks whether map `a` contains an element with key `b`, producing a
235−loobean.
236−
237−`a` is a map.
238−
239−`b` is a key as a noun.
240−
241− ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
242− ~zod/try=> (~(has by b) `b`)
243− %.y
244− ~zod/try=> (~(has by b) `c`)
245− %.n
246−
247−------------------------------------------------------------------------
248−
249−### `+-int:by`
250−
251−Intersection
252−
253− +- int :: intersection
254− ~/ %int
255− |* b/_a
256− |- ^+ a
257− ?~ b
258− ~
259− ?~ a
260− ~
261− ?: (vor p.n.a p.n.b)
262− ?: =(p.n.b p.n.a)
263− [n.b $(a l.a, b l.b) $(a r.a, b r.b)]
264− ?: (gor p.n.b p.n.a)
265− %- uni(a $(a l.a, b [n.b l.b ~])) $(b r.b)
266− %- uni(a $(a r.a, b [n.b ~ r.b])) $(b l.b)
267− ?: =(p.n.a p.n.b)
268− [n.b $(b l.b, a l.a) $(b r.b, a r.a)]
269− ?: (gor p.n.a p.n.b)
270− %- uni(a $(b l.b, a [n.a l.a ~])) $(a r.a)
271− %- uni(a $(b r.b, a [n.a ~ r.a])) $(a l.a)
272− ::
273−
274−Produces a map of the (key) intersection between two maps of the same
275−type, `a` and `b`. If both maps have an identical key that point to
276−different values, the element from map `b` is used.
277−
278−`a` is a map.
279−
280−`b` is a map.
281−
282− ~zod/try=> =n (mo `(list {@t *})`[['a' 1] ['c' 3] ~])
283− ~zod/try=> n
284− {[p='a' q=1] [p='c' q=3]}
285− ~zod/try=> m
286− {[p='a' q=1] [p='b' q=2]}
287− ~zod/try=> (~(int by m) n)
288− {[p='a' q=1]}
289− ~ravpel-holber/try=> =p (mo `(list {@t *})`[['a' 2] ['b' 2] ~])
290− ~zod/try=> p
291− {[p='a' q=2] [p='b' q=2]}
292− ~zod/try=> (~(int by p) n)
293− {[p='a' q=2]}
294− ~zod/try=> =q (mo `(list {@t *})`[['a' 2] ['c' 2] ~])
295− ~zod/try=> q
296− {[p='a' q=2] [p='b' q=2]}
297− ~zod/try=> (~(int by p) q)
298− {[p='a' q=2] [p='b' q=2]}
299− ~zod/try=> =o (mo `(list {@t *})`[['c' 3] ['d' 4] ~])
300− ~zod/try=> (~(int by m) o)
301− {}
302−
303−
304−------------------------------------------------------------------------
305−
306−### `+-mar:by`
307−
308−Assert and Add
309−
310− +- mar :: add with validation
311− |* [b=_?>(?=(^ a) p.n.a) c=(unit ,_?>(?=(^ a) q.n.a))]
312− ?~ c
313− (del b)
314− (put b u.c)
315−
316−Produces map `a` with the addition of a key-value pair, where the value
317−is a nonempty unit.
318−
319−Accept a noun and a unit of a noun of the type of the map's keys and
320−values, respectively. Validate that the value is not null and put the
321−pair in the map. If the value is null, delete the key.
322−
323−XX This arm is broken, asana task 15186618346453
324−
325− ~zod/try=> m
326− {[p='a' q=1] [p='b' q=2]}
327− ~zod/try=> (~(mar by m) 'c' (some 3))
328− ! -find-limb.n
329− ! find-none
330− ! exit
331− ~zod/try=> (~(mar by m) 'c' ~)
332− ! -find-limb.n
333− ! find-none
334− ! exit
335− ~zod/try=> (~(mar by m) 'b' ~)
336− ! -find-limb.n
337− ! find-none
338− ! exit
339−
340−------------------------------------------------------------------------
341−
342−### `+-put:by`
343−
344−Add key-value pair
345−
346− +- put :: adds key-value pair
347− ~/ %put
348− |* {b/* c/*}
349− |- ^+ a
350− ?~ a
351− [[b c] ~ ~]
352− ?: =(b p.n.a)
353− ?: =(c q.n.a)
354− a
355− [[b c] l.a r.a]
356− ?: (gor b p.n.a)
357− =+ d=$(a l.a)
358− ?> ?=(^ d)
359− ?: (vor p.n.a p.n.d)
360− [n.a d r.a]
361− [n.d l.d [n.a r.d r.a]]
362− =+ d=$(a r.a)
363− ?> ?=(^ d)
364− ?: (vor p.n.a p.n.d)
365− [n.a l.a d]
366− [n.d [n.a l.a l.d] r.d]
367− ::
368−
369−Produces `a` with the addition of the key-value pair of `b` and `c`.
370−
371−`a` is a map.
372−
373−`b` is a key of the same type as the keys in `a`.
374−
375−`c` is a value of the same type of the values in `a`.
376−
377− ~zod/try=> m
378− {[p='a' q=1] [p='b' q=2]}
379− ~zod/try=> (~(put by m) 'c' 3)
380− {[p='a' q=1] [p='c' q=3] [p='b' q=2]}
381− ~zod/try=> (~(put by m) "zod" 26)
382− ! type-fail
383− ! exit
384− ~zod/try=> (~(put by m) 'a' 2)
385− {[p='a' q=2] [p='b' q=2]}
386−
387−------------------------------------------------------------------------
388−
389−### `+-rep:by`
390−
391− +- rep :: replace by product
392− |* b/_|=({* *} +<+)
393− |-
394− ?~ a +<+.b
395− $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
396− ::
397−
398−Accumulate using gate from values in map
399−
400−XX interface changing.
401−
402−------------------------------------------------------------------------
403−
404−### `+-rib:by`
405−
406− +- rib :: transform + product
407− |* {b/* c/$-(* *)}
408− |- ^+ [b a]
409− ?~ a [b ~]
410− =+ d=(c n.a b)
411− =. n.a +.d
412− =+ e=$(a l.a, b -.d)
413− =+ f=$(a r.a, b -.e)
414− [-.f [n.a +.e +.f]]
415− ::
416−
417−Replace values with accumulator
418−
419−XX interface changing, possibly disappearing
420−
421−------------------------------------------------------------------------
422−
423−### `+-run:by`
424−
425−Transform values
426−
427− +- run :: apply gate to values
428− |* b/$-(* *)
429− |-
430− ?~ a a
431− [n=[p=p.n.a q=(b q.n.a)] l=$(a l.a) r=$(a r.a)]
432−
433−Iterates over every value in set `a` using gate `b`. Produces a map.
434−
435−`a` is a map.
436−
437−`b` is a wet gate.
438−
439− ~zod/try=> m
440− {[p='a' q=1] [p='b' q=2]}
441− ~zod/try=> ^+(m (~(run by m) dec))
442− {[p='a' q=0] [p='b' q=1]}
443− ~zod/try=> `(map @tas @t)`(~(run by m) (cury scot %ux))
444− {[p=%a q='0x1'] [p=%b q='0x2']}
445−
446−------------------------------------------------------------------------
447−
448−### `+-tap:by`
449−
450−Listify pairs
451−
452− +- tap :: listify pairs
453− ~/ %tap
454− |= b/(list _?>(?=(^ a) n.a))
455− ^+ b
456− ?~ a
457− b
458− $(a r.a, b [n.a $(a l.a)])
459− ::
460−
461−Produces the list of all elements in map `a` that is prepended to list
462−`b`, which is empty by default.
463−
464−`a` is a map.
465−
466−`b` is a list.
467−
468− {[p='a' q=1] [p='b' q=2]}
469− ~zod/try=> `*`m
470− [[98 2] [[97 1] 0 0] 0]
471− ~zod/try=> (~(tap by m))
472− ~[[p='b' q=2] [p='a' q=1]]
473− ~zod/try=> `*`(~(tap by m))
474− [[98 2] [97 1] 0]
475−
476−------------------------------------------------------------------------
477−
478−### `+-uni:by`
479−
480−Union
481−
482− +- uni :: union, merge
483− ~/ %uni
484− |* b/_a
485− |- ^+ a
486− ?~ b
487− a
488− ?~ a
489− b
490− ?: (vor p.n.a p.n.b)
491− ?: =(p.n.b p.n.a)
492− [n.b $(a l.a, b l.b) $(a r.a, b r.b)]
493− ?: (gor p.n.b p.n.a)
494− $(a [n.a $(a l.a, b [n.b l.b ~]) r.a], b r.b)
495− $(a [n.a l.a $(a r.a, b [n.b ~ r.b])], b l.b)
496− ?: =(p.n.a p.n.b)
497− [n.b $(b l.b, a l.a) $(b r.b, a r.a)]
498− ?: (gor p.n.a p.n.b)
499− $(b [n.b $(b l.b, a [n.a l.a ~]) r.b], a r.a)
500− $(b [n.b l.b $(b r.b, a [n.a ~ r.a])], a l.a)
501−
502−Produces a map of the union between the keys of `a` and `b`. If `b`
503−shares a key with `a`, the tuple from `a` is preserved.
504−
505−`a` is a map.
506−
507−`b` is a map.
508−
509− ~zod/try=> m
510− {[p='a' q=1] [p='b' q=2]}
511− ~zod/try=> o
512− {[p='d' q=4] [p='c' q=3]}
513− ~zod/try=> (~(uni by m) o)
514− {[p='d' q=4] [p='a' q=1] [p='c' q=3] [p='b' q=2]}
515− ~zod/try=> (~(uni by m) ~)
516− {[p='a' q=1] [p='b' q=2]}
517− ~zod/try=> n
518− {[p='a' q=1] [p='c' q=9]}
519− ~zod/try=> (~(uni by o) n)
520− {[p='d' q=4] [p='a' q=1] [p='c' q=3]}
521− ~zod/try=> =n (mo `(list ,[@t *])`[['a' 1] ['c' 9] ~])
522− ~zod/try=> n
523− {[p='a' q=1] [p='c' q=9]}
524− ~zod/try=> (~(uni by o) n)
525− {[p='d' q=4] [p='a' q=1] [p='c' q=9]}
526−
527−------------------------------------------------------------------------
528−
529−### `+-urn:by`
530−
531−Turn (with key)
532−
533− +- urn :: apply gate to nodes
534− |* b/$-({* *} *)
535− |-
536− ?~ a ~
537− [n=[p=p.n.a q=(b p.n.a q.n.a)] l=$(a l.a) r=$(a r.a)]
538−
539−Iterates over every value in map `a` using gate `b`, which accepts both
540−the key and the value of each element as its sample.
541−
542−`a` is a map.
543−
544−`b` is a wet gate that accepts two nouns (a key and a value) and
545−produces a noun (the new value).
546−
547− ~zod/try=> m
548− {[p='a' q=1] [p='b' q=2]}
549− ~zod/try=> (~(urn by m) |=(a=[p=* q=*] q.a))
550− {[p='a' q=1] [p='b' q=2]}
551− ~zod/try=> (~(urn by m) |=(a=[p=* q=*] 7))
552− {[p='a' q=7] [p='b' q=7]}
553− ~zod/try=> (~(urn by m) |=(a=[p=* q=*] p.a))
554− {[p='a' q=97] [p='b' q=98]}
555−
556−------------------------------------------------------------------------
557−
558−### `+-wyt:by`
559−
560−Depth
561−
562− +- wyt :: depth of map
563− |- ^- @
564− ?~(a 0 +((add $(a l.a) $(a r.a))))
565−
566−Produce the depth of the tree map `a`.
567−
568−`a` is a map.
569−
570− ~zod/try=> m
571− {[p='a' q=1] [p='b' q=2]}
572− ~zod/try=> o
573− {[p='d' q=4] [p='c' q=3]}
574− ~zod/try=> ~(wyt by m)
575− 2
576− ~zod/try=> ~(wyt by o)
577− 2
578− ~zod/try=> ~(wyt by (~(uni by m) o))
579− 4
580−
581−
582−
583−***
docs/programming/advanced/library/src/2i/title.mddeleted−1
@@ -1 +0,0 @@
1−# 2i: map logic
docs/programming/advanced/library/src/2j/core/ja.mddeleted−76
@@ -1,76 +0,0 @@
1−### `++ja`
2−
3−Jar engine
4−
5− |_ a/(jar)
6−
7−A container arm for `++jar` operation arms. A `++jar` is a `++map` of
8−`++list`s. The contained arms inherit the sample jar.
9−
10−`a` is a jar.
11−
12− ~zod/try=> ~(. ja (mo (limo a/"ho" b/"he" ~)))
13− <2.dgz [nlr([p={%a %b} q=""]) <414.fvk 101.jzo 1.ypj %164>]>
14−
15−------------------------------------------------------------------------
16−
17−### `+-get:ja`
18−
19−Grab value by key
20−
21− +- get :: gets list by key
22− |* b/*
23− =+ c=(~(get by a) b)
24− ?~(c ~ u.c)
25− ::
26−
27−Produces a list retrieved from jar `a` using the key `b`.
28−
29−`a` is a `++jar`.
30−
31−`b` is a key of the same type as the keys in `a`.
32−
33− ~zod/try=> =l (mo `(list ,[@t (list ,@)])`[['a' `(list ,@)`[1 2 3 ~]] ['b' `(list ,@)`[4 5 6 ~]] ~])
34− ~zod/try=> l
35− {[p='a' q=~[1 2 3]] [p='b' q=~[4 5 6]]}
36− ~zod/try=> (~(get ja l) 'a')
37− ~[1 2 3]
38− ~zod/try=> (~(get ja l) 'b')
39− ~[4 5 6]
40− ~zod/try=> (~(get ja l) 'c')
41− ~
42−
43−------------------------------------------------------------------------
44−
45−### `+-add:ja`
46−
47−Prepend to list
48−
49− +- add :: adds key-list pair
50− |* {b/* c/*}
51− =+ d=(get b)
52− (~(put by a) b [c d])
53−
54−Produces jar `a` with value `c` prepended to the list located at key
55−`b`.
56−
57−`a` is a jar.
58−
59−`b` is a key of the same type as the keys in `a`.
60−
61−`c` is a value of the same type as the values in `a`.
62−
63− ~zod/try=> =l (mo `(list ,[@t (list ,@)])`[['a' `(list ,@)`[1 2 3 ~]] ['b' `(list ,@)`[4 5 6 ~]] ~])
64− ~zod/try=> l
65− {[p='a' q=~[1 2 3]] [p='b' q=~[4 5 6]]}
66− ~zod/try=> (~(add ja l) 'b' 7)
67− {[p='a' q=~[1 2 3]] [p='b' q=~[7 4 5 6]]}
68− ~zod/try=> (~(add ja l) 'a' 100)
69− {[p='a' q=~[100 1 2 3]] [p='b' q=~[4 5 6]]}
70− ~zod/try=> (~(add ja l) 'c' 7)
71− {[p='a' q=~[1 2 3]] [p='c' q=~[7]] [p='b' q=~[4 5 6]]}
72− ~zod/try=> (~(add ja l) 'c' `(list ,@)`[7 8 9 ~])
73− ! type-fail
74− ! exit
75−
76−**
docs/programming/advanced/library/src/2j/core/ju.mddeleted−142
@@ -1,142 +0,0 @@
1−### `++ju`
2−
3−Jug operations
4−
5− ++ ju :: jug engine
6− |/ a/(jug)
7−
8−Container arm for jug operation arms. A `++jug` is a `++map` of
9−`++sets`. The contained arms inherit its sample jug, `a`.
10−
11−`a` is a jug.
12−
13− ~zod/try=> ~(. ju (mo (limo a/(sa "ho") b/(sa "he") ~)))
14− <2.dgz [nlr([p={%a %b} q={nlr(^$1{@tD $1}) nlr(^$3{@tD $3})}]) <414.fvk 101.jzo 1.ypj %164>]>
15−
16−### `+-del:ju`
17−
18−Remove
19−
20− +- del :: del key-set pair
21− |* {b/* c/*}
22− ^+ a
23− =+ d=(get b)
24− =+ e=(~(del in d) c)
25− ?~ e
26− (~(del by a) b)
27− (~(put by a) b e)
28− ::
29−
30−
31−Produces jug `a` with value `c` removed from set located at key `b`.
32−
33−`a` is a jug.
34−
35−`b` is a key of the same type as the keys in `a`.
36−
37−`c` is the value of the same type of the keys in `a` that is to be
38−removed.
39−
40− ~zod/try=> s
41− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
42− ~zod/try=> (~(del ju s) 'a' 1)
43− {[p='a' q={3 2}] [p='b' q={5 4 6}]}
44− ~zod/try=> (~(del ju s) 'c' 7)
45− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
46−
47−------------------------------------------------------------------------
48−
49−### `+-get:ju`
50−
51−Retrieve set
52−
53− +- get :: gets set by key
54− |* b/*
55− =+ c=(~(get by a) b)
56− ?~(c ~ u.c)
57− ::
58−
59−Produces a set retrieved from jar `a` using key `b`.
60−
61−`a` is a jar.
62−
63−`b` is a key of the same type as the keys in `a`.
64−
65− ~zod/try=> s
66− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
67− ~zod/try=> (~(get ju s) 'a')
68− {1 3 2}
69− ~zod/try=> (~(get ju s) 'b')
70− {5 4 6}
71− ~zod/try=> (~(get ju s) 'c')
72− ~
73−
74−------------------------------------------------------------------------
75−
76−### `+-has:ju`
77−
78−Check contents
79−
80− +- has :: existence check
81− |* {b/* c/*}
82− ^- ?
83− (~(has in (get b)) c)
84− ::
85−
86−
87−Computes whether a value `c` exists within the set located at key `b`
88−with jar `a`. Produces a loobean.
89−
90−`a` is a set.
91−
92−`b` is a key as a noun.
93−
94−`c` is a value as a noun.
95−
96− ~zod/try=> s
97− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
98− ~zod/try=> (~(has ju s) 'a' 3)
99− %.y
100− ~zod/try=> (~(has ju s) 'b' 6)
101− %.y
102− ~zod/try=> (~(has ju s) 'a' 7)
103− %.n
104− ~zod/try=> (~(has jus s) 'c' 7)
105− ! -find-limb.jus
106− ! find-none
107− ! exit
108− ~zod/try=> (~(has ju s) 'c' 7)
109− %.n
110−
111−------------------------------------------------------------------------
112−
113−### `+-put:ju`
114−
115−Add key-set pair
116−
117− +- put :: add key-set pair
118− |* {b/* c/*}
119− ^+ a
120− =+ d=(get b)
121− (~(put by a) b (~(put in d) c))
122−
123−Produces jar `a` with `c` added to the set value located at key `b`.
124−
125−`a` is a set.
126−
127−`b` is a key as a noun.
128−
129−`c` is a value.
130−
131− ~zod/try=> s
132− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
133− ~zod/try=> (~(put ju s) 'a' 7)
134− {[p='a' q={7 1 3 2}] [p='b' q={5 4 6}]}
135− ~zod/try=> (~(put ju s) 'a' 1)
136− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
137− ~zod/try=> (~(put ju s) 'c' 7)
138− {[p='a' q={1 3 2}] [p='c' q={7}] [p='b' q={5 4 6}]}
139−
140−
141−
142−***
docs/programming/advanced/library/src/2j/title.mddeleted−1
@@ -1 +0,0 @@
1−# 2j: jar and jug logic
docs/programming/advanced/library/src/2k/core/to.mddeleted−337
@@ -1,337 +0,0 @@
1−### `++to`
2−
3−Queue operations
4−
5−Container arm for queue operation arms. The contained arms inherit its
6−sample `++qeu` `a`.
7−
8−Accepts
9−-------
10−
11−`a` is a queue, ++qeu.
12−
13−Source
14−------
15−
16− ++ to :: queue engine
17− |/ a/(qeu)
18−
19−### `+-bal:to`
20−
21−Balance
22−
23−Vertically rebalances queue `a`.
24−
25−Accepts
26−-------
27−
28−`a` is a queue.
29−
30−Produces
31−--------
32−
33−A queue.
34−
35−Source
36−------
37−
38− +- bal
39− |- ^+ a
40− ?~ a ~
41− ?. |(?=($~ l.a) (vor n.a n.l.a))
42− $(a [n.l.a l.l.a $(a [n.a r.l.a r.a])])
43− ?. |(?=($~ r.a) (vor n.a n.r.a))
44− $(a [n.r.a $(a [n.a l.a l.r.a]) r.r.a])
45− a
46− ::
47−
48−
49−Examples
50−--------
51−
52− ~zod/try=> `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~]
53− {"a" "b" "c" "d" "e" "f" "g"}
54− ~zod/try=> `*`["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− ~zod/try=> ~(bal to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~])
57− {"a" "b" "c" "d" "e" "f" "g"}
58− ~zod/try=> `*`~(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−
61−------------------------------------------------------------------------
62−
63−### `+-dep:to`
64−
65−Maximum Depth
66−
67−Produces the maximum depth of leaves (r.a and l.a) in queue `a`.
68−
69−Accepts
70−-------
71−
72−`a` is a queue.
73−
74−Produces
75−--------
76−
77−An atom.
78−
79−Source
80−------
81−
82− +- dep :: max depth of queue
83− |- ^- @
84− ?~ a 0
85− +((max $(a l.a) $(a r.a)))
86− ::
87−
88−
89−Examples
90−--------
91−
92− ~zod/try=> =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 7 ~])
93− ~zod/try=> ~(dep to a)
94− 4
95− ~zod/try=> =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 ~])
96− ~zod/try=> ~(dep to a)
97− 3
98− ~zod/try=> =a (~(gas to `(qeu @)`~) `(list @)`[1 2 ~])
99− ~zod/try=> ~(dep to a)
100− 2
101− ~zod/try=> ~(dep to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~])
102− 7
103− ~zod/try=> ~(dep to ~(bal to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~]))
104− 4
105−
106−------------------------------------------------------------------------
107−
108−### `+-gas`
109−
110−Push list
111−
112−Push all elements of `++list` `b` into the `++queue`.
113−
114−Accepts
115−-------
116−
117−`a` is a queue.
118−
119−`b` is a list.
120−
121−Produces
122−--------
123−
124−A queue.
125−
126−Source
127−------
128−
129− +- gas :: insert list to queue
130− |= b=(list ,_?>(?=(^ a) n.a))
131− |- ^+ a
132− ?~(b a $(b t.b, a (put(+< a) i.b)))
133− ::
134−
135−Examples
136−--------
137−
138− ~zod/try=> (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 ~])
139− {3 2 1}
140− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 ~])
141− ~zod/try=> =b `(list ,@)`[4 5 6 ~]
142− ~zod/try=> (~(gas to a) b)
143− {6 5 4 3 2 1}
144−
145−------------------------------------------------------------------------
146−
147−### `+-get:to`
148−
149−Pop
150−
151−Produces the head and tail `++queue` of `a`.
152−
153−Accepts
154−-------
155−
156−`a` is a queue.
157−
158−Produces
159−--------
160−
161−The last element in `a` along with the rest of queue `a`.
162−
163−Source
164−------
165−
166− +- get :: head-tail pair
167− |- ^+ ?>(?=(^ a) [p=n.a q=*(qeu _n.a)])
168− ?~ a
169− !!
170− ?~ r.a
171− [n.a l.a]
172− =+ b=$(a r.a)
173− :- p.b
174− ?: |(?=($~ q.b) (vor n.a n.q.b))
175− [n.a l.a q.b]
176− [n.q.b [n.a l.a l.q.b] r.q.b]
177− ::
178−
179−Examples
180−--------
181−
182− ~zod/try=> =s (~(gas to *(qeu @)) `(list @)`~[1 2 3])
183− ~zod/try=> ~(get to s)
184− [p=1 q={3 2}]
185− ~zod/try=> ~(get to ~)
186− ! exit
187−
188−------------------------------------------------------------------------
189−
190−### `+-nap:to`
191−
192−Remove last element
193−
194−Removes the head of `++queue` `a`, producing the resulting queue.
195−
196−Accepts
197−-------
198−
199−`a` is a queue.
200−
201−Produces
202−--------
203−
204−A queue.
205−
206−Source
207−------
208−
209− +- nap :: removes head
210− ?> ?=(^ a)
211− ?: =(~ l.a) r.a
212− =+ b=get(a l.a)
213− bal(a ^+(a [p.b q.b r.a]))
214− ::
215−
216−Examples
217−--------
218−
219− ~zod/try=> =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 ~])
220− ~zod/try=> -.a
221− n=6
222− ~zod/try=> =b ~(nap to a)
223− ~zod/try=> -.b
224− n=2
225− ~zod/try=> b
226− {5 4 3 2 1}
227− ~zod/try=> a
228− {6 5 4 3 2 1}
229−
230−------------------------------------------------------------------------
231−
232−### `+-put:to`
233−
234−Insert
235−
236−Accept any noun `b` and adds to `++queue` `a` as the head, producing the
237−resulting queue.
238−
239−Accepts
240−-------
241−
242−`a` is a queue.
243−
244−`b` is any noun.
245−
246−Produces
247−--------
248−
249−A queue.
250−
251−Source
252−------
253−
254− +- put :: insert new tail
255− |* b/*
256− |- ^+ a
257− ?~ a
258− [b ~ ~]
259− bal(a a(l $(a l.a)))
260− ::
261−
262−
263−Examples
264−--------
265−
266− ~zod/try=> (~(gas to `(qeu @)`~) `(list @)`[3 1 2 4 5 6 ~])
267− ~zod/try=> (~(put to a) 7)
268− {7 6 5 4 2 1 3}
269−
270−------------------------------------------------------------------------
271−
272−### `+-tap:to`
273−
274−Queue to list
275−
276−Produces `++queue` `a` as a `++list` from front to back.
277−
278−Accepts
279−-------
280−
281−`a` is a queue.
282−
283−Source
284−------
285−
286− +- tap :: adds list to end
287− |= b/(list _?>(?=(^ a) n.a))
288− =+ z=0 :: XX breaks jet match
289− ^+ b
290− ?~ a
291− b
292− $(a r.a, b [n.a $(a l.a)])
293− ::
294−
295−Examples
296−--------
297−
298− ~zod/try=> =a (~(gas to `(qeu @)`~) `(list @)`[3 1 2 4 5 6 ~])
299− ~zod/try=> `*`a
300− [6 0 2 [4 [5 0 0] 0] 1 0 3 0 0]
301− ~zod/try=> (~(tap to a) `(list @)`[99 100 101 ~])
302− ~[3 1 2 4 5 6 99 100 101]
303−
304−------------------------------------------------------------------------
305−
306−### `+-top:to`
307−
308−Produces the head of `++queue` `a` as a `++unit` (an empty queue has no head).
309−
310−Accepts
311−-------
312−
313−`a` is a queue.
314−
315−Produces
316−--------
317−
318−A unit.
319−
320−Source
321−------
322−
323− +- top :: produces head
324− |- ^- (unit _?>(?=(^ a) n.a))
325− ?~ a ~
326− ?~(r.a [~ n.a] $(a r.a))
327−
328−Examples
329−--------
330−
331− ~zod/try=> =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 ~])
332− ~zod/try=> ~(top to a)
333− [~ 1]
334−
335−
336−
337−***
docs/programming/advanced/library/src/2k/title.mddeleted−1
@@ -1 +0,0 @@
1−# 2k: queue logic
docs/programming/advanced/library/src/2l/title.mddeleted−1
@@ -1 +0,0 @@
1−# 2l: container from container
docs/programming/advanced/library/src/2m/title.mddeleted−1
@@ -1 +0,0 @@
1−# 2m: container from noun
docs/programming/advanced/library/src/2n/gate/cork.mddeleted−28
@@ -1,28 +0,0 @@
1−### `++cork`
2−
3−Build `f` such that `(f x) .= (b (a x))`.
4−
5−`a` is a noun.
6−
7−`b` is a gate.
8−
9−Source
10−------
11−
12− ++ cork |*({a/_|=(* **) b/gate} (corl b a)) :: compose forward
13−
14−
15−Examples
16−--------
17−
18− ~zod/try=> (:(cork dec dec dec) 20)
19− 17
20− ~zod/try=> =mal (mo (limo a+15 b+23 ~))
21− ~zod/try=> ((cork ~(got by mal) dec) %a)
22− 14
23− ~zod/try=> ((cork ~(got by mal) dec) %b)
24− 22
25−
26−
27−
28−***
docs/programming/advanced/library/src/2n/gate/corl.mddeleted−29
@@ -1,29 +0,0 @@
1−### `++corl`
2−
3−Gate compose
4−
5−XX Revisit
6−
7−`a` is a gate.
8−
9−`b` is a noun.
10−
11−Source
12−------
13−
14− ++ corl :: compose backwards
15− |* {a/gate b/_|=(* **)}
16− =< +:|.((a (b))) :: span check
17− |* c/_+<.b
18− (a (b c))
19− ::
20−
21−Examples
22−--------
23−
24− ~zod/try=> ((corl (lift bex) (slat %ud)) '2')
25− [~ 4]
26−
27−
28−
29−***
docs/programming/advanced/library/src/2n/gate/curr.mddeleted−38
@@ -1,38 +0,0 @@
1−### `++curr`
2−
3−Right curry
4−
5−Right curry a gate, binding the tail of its sample
6−
7−Accepts
8−-------
9−
10−`a` is a gate.
11−
12−`c` is a noun.
13−
14−Produces
15−--------
16−
17−
18−Source
19−------
20−
21− ++ curr :: curry right
22− |* {a/_|=(^ **) c/*}
23− |* b/_+<+.a
24− (a b c)
25− ::
26−
27−Examples
28−--------
29−
30− ~zod/try=> =tep (curr scan sym)
31− ~zod/try=> `@t`(tep "asd")
32− 'asd'
33− ~zod/try=> `@t`(tep "lek-om")
34− 'lek-om'
35−
36−
37−
38−***
docs/programming/advanced/library/src/2n/gate/cury.mddeleted−38
@@ -1,38 +0,0 @@
1−### `++cury`
2−
3−Curry a gate, binding the head of its sample
4−
5−Accepts
6−-------
7−
8−`a` is a gate.
9−
10−`b` is a noun.
11−
12−Produces
13−--------
14−
15−A gate.
16−
17−Source
18−------
19−
20− ++ cury :: curry left
21− |* {a/_|=(^ **) b/*}
22− |* c/_+<+.a
23− (a b c)
24− ::
25−
26−
27−Examples
28−--------
29−
30− ~zod/try=> =mol (cury add 2)
31− ~zod/try=> (mol 4)
32− 6
33− ~zod/try=> (mol 7)
34− 9
35−
36−
37−
38−***
docs/programming/advanced/library/src/2n/gate/hard.mddeleted−30
@@ -1,30 +0,0 @@
1−### `++hard`
2−
3−Demands that a specific type be produced, crashing the program is it is
4−not.
5−
6−Source
7−------
8−
9− ++ cury :: curry left
10− |* {a/_|=(^ **) b/*}
11− |* c/_+<+.a
12− (a b c)
13− ::
14−
15−Examples
16−--------
17−
18− ~zod/try=> ((hard (list)) (limo [1 2 3 ~]))
19− ~[1 2 3]
20− ~zod/try=> ((hard @) (add 2 2))
21− 4
22− ~zod/try=> ((hard @t) (crip "Tape to cord, bro!"))
23− 'Tape to cord, bro'
24− ~zod/try=> ((hard tape) (crip "...Tape to cord, bro?..."))
25− ! hard
26− ! exit
27−
28−
29−
30−***
docs/programming/advanced/library/src/2n/gate/soft.mddeleted−32
@@ -1,32 +0,0 @@
1−### `++soft`
2−
3−Politely requests a specific type to be produced, producing null if it
4−is not.
5−
6−Source
7−------
8−
9− ++ soft :: maybe coerce to span
10− |* han/$-(* *)
11− |= fud/* ^- (unit han)
12− =+ gol=(han fud)
13− ?.(=(gol fud) ~ [~ gol])
14− ::
15−
16−Examples
17−--------
18−
19− ~zod/try=> ((soft %4) (add 2 2))
20− [~ %4]
21− ~zod/try=> ((soft @) (add 2 2))
22− [~ 4]
23− ~zod/try=> ((soft %5) (add 2 2))
24− ~
25− ~zod/try=> ((soft @t) (crip "Tape to cord, Woohoo!"))
26− [~ 'Tape to cord, Woohoo!']
27− ~zod/try=> ((soft @t) (trip 'Cmon man... Tape to cord? Please?!'))
28− ~
29−
30−
31−
32−***
docs/programming/advanced/library/src/2n/title.mddeleted−1
@@ -1 +0,0 @@
1−# 2n: functional hacks
docs/programming/advanced/library/src/2o/mold/jar.mddeleted−33
@@ -1,33 +0,0 @@
1−### `++jar`
2−
3−
4−Tile generator. A `++jar` is a `++map` of `++list`.
5−
6−Source
7−------
8−
9− ++ jar |*({a/$-(* *) b/$-(* *)} (map a (list b))) :: map of lists
10−
11−
12−Examples
13−--------
14−
15−See also: `++ja`, `++by`, `++map`, `++list`
16−
17− ~zod/try=> =a (limo [1 2 ~])
18− ~zod/try=> a
19− [i=1 t=[i=2 t=~]]
20− ~zod/try=> =b (limo [3 4 ~])
21− ~zod/try=> b
22− [i=3 t=[i=4 t=~]]
23− ~zod/try=> =c (mo (limo [[%a a] [%b b] ~]))
24− ~zod/try=> c
25− {[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− [i=1 t=[i=2 t=~]]
28− ~zod/try=> (~(get ja c) %c)
29− ~
30−
31−
32−
33−***
docs/programming/advanced/library/src/2o/mold/jug.mddeleted−31
@@ -1,31 +0,0 @@
1−### `++jug`
2−
3−mold generator. A `++jug` is a `++map` of `++set`s.
4−
5−Source
6−------
7−
8− ++ jug |*({a/$-(* *) b/$-(* *)} (map a (set b))) :: map of sets
9−
10−
11−Examples
12−--------
13−
14−See also: `++ju`, `++by`, `++map`, `++set`
15−
16− ~zod/try=> =a (sa (limo [1 2 ~]))
17− ~zod/try=> a
18− {1 2}
19− ~zod/try=> =b (sa (limo [3 4 ~]))
20− ~zod/try=> b
21− {4 3}
22− ~zod/try=> =c (mo (limo [[%a a] [%b b] ~]))
23− ~zod/try=> c
24− {[p=%a q={1 2}] [p=%b q={4 3}]}
25− ~zod/try=> (~(get ju c) %b)
26− {4 3}
27− ~zod/try=> (~(put ju c) [%b 5])
28− {[p=%a q={1 2}] [p=%b q={5 4 3}]}
29−
30−
31−***
docs/programming/advanced/library/src/2o/mold/map.mddeleted−28
@@ -1,28 +0,0 @@
1−### `++map`
2−
3−Map
4−
5−mold generator. A `++map` is a treap of
6−key-value pairs.
7−
8−
9−Source
10−------
11−
12− ++ map |* {a/$-(* *) b/$-(* *)} :: associative tree
13− $@($~ {n/{p/a q/b} l/(map a b) r/(map a b)}) ::
14−
15−
16−Examples
17−--------
18−
19−See also: `++by`
20−
21− ~zod/try=>? *(map @t @u)
22− nlr({p/@t q/@u})
23− {}
24− ~zod/try=> (molt `(list (pair * *))`[[a+1 b+2] ~])
25− {[p=[97 1] q=[98 2]]}
26−
27−
28−***
docs/programming/advanced/library/src/2o/mold/qeu.mddeleted−25
@@ -1,25 +0,0 @@
1−### `++qeu`
2−
3−Queue
4−
5−mold generator. An ordered [treap](http://en.wikipedia.org/wiki/Treap) of
6−items.
7−
8−Source
9−------
10−
11− ++ qeu |* a/$-(* *) :: queue
12− $@($~ {n/a l/(qeu a) r/(qeu a)}) ::
13−
14−
15−Examples
16−--------
17−
18− ~zod/try=> (qeu time)
19− <1.qyo [* <1.sxx [a=<1.ebd [* <101.jzo 1.ypj %164>]> <101.jzo 1.ypj %164>]>]>
20− ~zod/try=> (~(gas to *(qeu time)) [~2014.1.1 ~2014.1.2 ~])
21− {~2014.1.2 ~2014.1.1}
22−
23−
24−
25−***
docs/programming/advanced/library/src/2o/mold/set.mddeleted−28
@@ -1,28 +0,0 @@
1−### `++set`
2−
3−Set
4−
5−mold generator. A `++set` is a treap with unique values.
6−
7−Source
8−------
9−
10− ++ set |* a/$-(* *) :: set
11− $@($~ {n/a l/(set a) r/(set a)}) ::
12−
13−
14−Examples
15−--------
16−
17−See also: `++in`
18−
19− ~zod/try=> (sa "abc")
20− {~~a ~~c ~~b}
21− ~zod/try=> (~(put in (sa "abc")) %d)
22− {~~d ~~a ~~c ~~b}
23− ~zod/try=> (~(put in (sa "abc")) %a)
24− {~~a ~~c ~~b}
25−
26−
27−
28−***
docs/programming/advanced/library/src/2o/title.mddeleted−1
@@ -1 +0,0 @@
1−# 2o: normalizing containers
docs/programming/advanced/library/src/2p/gate/cue.mddeleted−55
@@ -1,55 +0,0 @@
1−### `++cue`
2−
3−Unpack atom to noun
4−
5−Produces a noun unpacked from atom `a`. The inverse of jam.
6−
7−Accepts
8−-------
9−
10−`a` is an atom.
11−
12−Produces
13−--------
14−
15−A `++noun`.
16−
17−Source
18−------
19−
20− ++ cue :: unpack
21− ~/ %cue
22− |= a/@
23− ^- *
24− =+ b=0
25− =+ m=`(map @ *)`~
26− =< q
27− |- ^- {p/@ q/* r/(map @ *)}
28− ?: =(0 (cut 0 [b 1] a))
29− =+ c=(rub +(b) a)
30− [+(p.c) q.c (~(put by m) b q.c)]
31− =+ c=(add 2 b)
32− ?: =(0 (cut 0 [+(b) 1] a))
33− =+ u=$(b c)
34− =+ v=$(b (add p.u c), m r.u)
35− =+ w=[q.u q.v]
36− [(add 2 (add p.u p.v)) w (~(put by r.v) b w)]
37− =+ d=(rub c a)
38− [(add 2 p.d) (need (~(get by m) q.d)) m]
39− ::
40−
41−
42−Examples
43−--------
44−
45− ~zod/try=> (cue 12)
46− 1
47− ~zod/try=> (cue 817)
48− [1 1]
49− ~zod/try=> (cue 4.657)
50− [1 2]
51− ~zod/try=> (cue 39.689)
52− [0 19]
53−
54−
55−***
docs/programming/advanced/library/src/2p/gate/jam.mddeleted−60
@@ -1,60 +0,0 @@
1−### `++jam`
2−
3−Unpack noun to atom
4−
5−Produces an atom unpacked from noun `a`. The inverse of cue.
6−
7−Accepts
8−-------
9−
10−`a` is a noun.
11−
12−Produces
13−--------
14−
15−An atom.
16−
17−Source
18−------
19−
20− ++ jam :: pack
21− ~/ %jam
22− |= a/*
23− ^- @
24− =+ b=0
25− =+ m=`(map * @)`~
26− =< q
27− |- ^- {p/@ q/@ r/(map * @)}
28− =+ c=(~(get by m) a)
29− ?~ c
30− => .(m (~(put by m) a b))
31− ?: ?=(@ a)
32− =+ d=(mat a)
33− [(add 1 p.d) (lsh 0 1 q.d) m]
34− => .(b (add 2 b))
35− =+ d=$(a -.a)
36− =+ e=$(a +.a, b (add b p.d), m r.d)
37− [(add 2 (add p.d p.e)) (mix 1 (lsh 0 2 (cat 0 q.d q.e))) r.e]
38− ?: ?&(?=(@ a) (lte (met 0 a) (met 0 u.c)))
39− =+ d=(mat a)
40− [(add 1 p.d) (lsh 0 1 q.d) m]
41− =+ d=(mat u.c)
42− [(add 2 p.d) (mix 3 (lsh 0 2 q.d)) m]
43− ::
44−
45−
46−Examples
47−--------
48−
49− ~zod/try=> (jam 1)
50− 12
51− ~zod/try=> (jam [1 1])
52− 817
53− ~zod/try=> (jam [1 2])
54− 4.657
55− ~zod/try=> (jam [~ u=19])
56− 39.689
57−
58−
59−
60−***
docs/programming/advanced/library/src/2p/gate/mat.mddeleted−57
@@ -1,57 +0,0 @@
1−### `++mat`
2−
3−Length-encode
4−
5−Produces a cell whose tail `q` is atom `a` with a bit representation of
6−its length prepended to it (as the least significant bits). The head `p`
7−is the length of `q` in bits.
8−
9−Accepts
10−-------
11−
12−`a` is an atom.
13−
14−Produces
15−--------
16−
17−A cell of two atoms, `p` and `q`.
18−
19−Source
20−------
21−
22− ++ mat :: length-encode
23− ~/ %mat
24− |= a/@
25− ^- {p/@ q/@}
26− ?: =(0 a)
27− [1 1]
28− =+ b=(met 0 a)
29− =+ c=(met 0 b)
30− :- (add (add c c) b)
31− (cat 0 (bex c) (mix (end 0 (dec c) b) (lsh 0 (dec c) a)))
32− ::
33−
34−
35−Examples
36−--------
37−
38− ~zod/try=> (mat 0xaaa)
39− [p=20 q=699.024]
40− ~zod/try=> (met 0 q:(mat 0xaaa))
41− 20
42− ~zod/try=> `@ub`q:(mat 0xaaa)
43− 0b1010.1010.1010.1001.0000
44− ~zod/try=> =a =-(~&(- -) `@ub`0xaaa)
45− 0b1010.1010.1010
46− ~zod/try=> =b =-(~&(- -) `@ub`(xeb a))
47− 0b1100
48− ~zod/try=> =b =-(~&(- -) `@ub`(met 0 a))
49− 0b1100
50− ~zod/try=> =c =-(~&(- -) (xeb b))
51− 4
52− ~zod/try=> [`@ub`a `@ub`(end 0 (dec c) b) `@ub`(bex c)]
53− [0b1010.1010.1010 0b100 0b1.0000]
54−
55−
56−
57−***
docs/programming/advanced/library/src/2p/gate/rub.mddeleted−52
@@ -1,52 +0,0 @@
1−### `++rub`
2−
3−Length-decode
4−
5−The inverse of `++mat`. Accepts a cell of index `a` and a bitstring `b`
6−and produces the cell whose tail `q` is the decoded atom at index `a`
7−and whose head is the length of the encoded atom `q`, by which the
8−offset `a` is advanced. Only used internally as a helper cue.
9−
10−Accepts
11−-------
12−
13−`a` is an atom.
14−
15−`b` is a bitstring as an atom.
16−
17−Produces
18−--------
19−
20−A cell of two atoms, `p` and `q`.
21−
22−Source
23−------
24−
25− ++ rub :: length-decode
26− ~/ %rub
27− |= {a/@ b/@}
28− ^- {p/@ q/@}
29− =+ ^= c
30− =+ [c=0 m=(met 0 b)]
31− |- ?< (gth c m)
32− ?. =(0 (cut 0 [(add a c) 1] b))
33− c
34− $(c +(c))
35− ?: =(0 c)
36− [1 0]
37− =+ d=(add a +(c))
38− =+ e=(add (bex (dec c)) (cut 0 [d (dec c)] b))
39− [(add (add c c) e) (cut 0 [(add d (dec c)) e] b)]
40−
41−
42−Examples
43−--------
44−
45− ~zod/try=> `@ub`(jam 0xaaa)
46− 0b1.0101.0101.0101.0010.0000
47− ~zod/try=> (rub 1 0b1.0101.0101.0101.0010.0000)
48− [p=20 q=2.730]
49− ~zod/try=> `@ux`q:(rub 1 0b1.0101.0101.0101.0010.0000)
50− 0xaaa
51−
52−***
docs/programming/advanced/library/src/2p/title.mddeleted−1
@@ -1 +0,0 @@
1−# 2p: serialization
docs/programming/advanced/library/src/2q/mold/char.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++char`
2−
3−Char
4−
5−A single character. odor `@tD` designates a single unicode byte. All
6−parsers consume `++tape`s, which are lists of `++char`.
7−
8−
9−Source
10−------
11−
12− ++ char @tD :: UTF-8 byte
13−
14−Examples
15−--------
16−
17− ~zod/try=> *char
18− ''
19− ~zod/try> (char 97)
20− 'a'
21−
22−
23−
24−***
docs/programming/advanced/library/src/2q/mold/cord.mddeleted−30
@@ -1,30 +0,0 @@
1−### `++cord`
2−
3−UTF-8 text
4−
5−One of Hoon's two string types (the other being `++tape`). A cord is an
6−atom of UTF-8 text. `++trip` and `++crip` convert between cord and
7−`++tape`.
8−
9−Source
10−------
11−
12− ++ cord @t :: text atom (UTF-8)
13−
14−Examples
15−--------
16−
17−Odor `@t` designates a Unicode atom, little-endian: the first character
18−in the text is the low byte.
19−
20− ~zod/try=> `@ux`'foobar'
21− 0x7261.626f.6f66
22−
23− ~zod/try=> `@`'urbit'
24− 499.984.265.845
25− ~zod/try=> (cord 499.984.265.845)
26− 'urbit'
27−
28−
29−
30−***
docs/programming/advanced/library/src/2q/mold/date.mddeleted−23
@@ -1,23 +0,0 @@
1−### `++date`
2−
3−Point in time
4−
5−A boolean designating AD or BC, a year atom, a month
6−atom, and a `++tarp`, which is a day atom and a time.
7−
8−Source
9−------
10−
11− ++ date {{a/? y/@ud} m/@ud t/tarp} :: parsed date
12−
13−
14−Examples
15−--------
16−
17−See also: `++year`, `++yore` `++stud`, `++dust`
18−
19− ~zod/try=> `date`(yore ~2014.6.6..21.09.15..0a16)
20− [[a=%.y y=2.014] m=6 t=[d=6 h=21 m=9 s=15 f=~[0xa16]]]
21−
22−
23−***
docs/programming/advanced/library/src/2q/mold/tang.mddeleted−9
@@ -1,9 +0,0 @@
1−### `++tang`
2−
3− ++ tang (list tank) :: general error
4−
5−Unused XX
6−
7−
8−
9−***
docs/programming/advanced/library/src/2q/mold/tank.mddeleted−41
@@ -1,41 +0,0 @@
1−### `++tank`
2−
3−Pretty-printing structure.
4−
5−A `++tank` is one of three cases: a `%leaf`
6−is simply a string; a `%palm` is XX need more information; and a `%rose` is a
7−list of `++tank` delimted by the strings in `p`.
8−
9−
10−Source
11−------
12−
13− ++ tank $% {$leaf p/tape} :: printing formats
14− $: $palm :: backstep list
15− p/{p/tape q/tape r/tape s/tape} ::
16− q/(list tank) ::
17− == ::
18− $: $rose :: flat list
19− p/{p/tape q/tape r/tape} :: mid open close
20− q/(list tank) ::
21− == ::
22− == ::
23−
24−Examples
25−--------
26−
27− ~zod/try=> >(bex 20) (bex 19)<
28− [%rose p=[p=" " q="[" r="]"] q=~[[%leaf p="1.048.576"] [%leaf p="524.288"]]]
29− ~zod/try=> (wash [0 80] >(bex 20) (bex 19)<) :: at 80 cols
30− <<"[1.048.576 524.288]">>
31− ~zod/try=> (wash [0 15] >(bex 20) (bex 19)<) :: at 15 cols (two lines)
32− <<"[ 1.048.576" " 524.288" "]">>
33−
34− ~zod/try=> [(bex 150) (bex 151)] :: at 80 cols
35− [ 1.427.247.692.705.959.881.058.285.969.449.495.136.382.746.624
36− 2.854.495.385.411.919.762.116.571.938.898.990.272.765.493.248
37− ]
38−
39−
40−
41−***
docs/programming/advanced/library/src/2q/mold/tape.mddeleted−23
@@ -1,23 +0,0 @@
1−
2−### `++tape`
3−
4−List of chars
5−
6−One of Hoon's two string types, the other being `++cord`. A tape is a
7−list of chars.
8−
9−Source
10−------
11−
12− ++ tape (list char) :: like a string
13−
14−Examples
15−--------
16−
17− ~zod/try=> `(list ,char)`"foobar"
18− "foobar"
19− ~zod/try=> `(list ,@)`"foobar"
20− ~[102 111 111 98 97 114]
21−
22−
23−***
docs/programming/advanced/library/src/2q/mold/tarp.mddeleted−29
@@ -1,29 +0,0 @@
1−### `++tarp`
2−
3−Day through second
4−
5−The remaining part of a `++date`: day, hour, minute, second and a list
6−of `@ux` for precision.
7−
8−Source
9−------
10−
11− ++ tarp {d/@ud h/@ud m/@ud s/@ud f/(list @ux)} :: parsed time
12−
13−
14−Examples
15−--------
16−
17−
18− ~zod/try=> -<-
19− ~2014.9.20..00.43.33..b52a
20− ~zod/try=> :: the time is always in your context at -<-
21− ~zod/try=> (yell -<-)
22− [d=106.751.991.820.278 h=0 m=43 s=39 f=~[0x54d1]]
23−
24− ~zod/try=> (yell ~d20)
25− [d=20 h=0 m=0 s=0 f=~]
26−
27−
28−
29−***
docs/programming/advanced/library/src/2q/mold/term.mddeleted−30
@@ -1,30 +0,0 @@
1−### `++term`
2−
3−Hoon constants
4−
5−A restricted text atom for Hoon constants. The only characters permitted are
6−lowercase ASCII, `-`, and `0-9`, the latter two of which can neither be the first or last
7−character. The syntax for `@tas` is the text itself, always preceded by `%`.
8−This means a term is always cubical. The empty `@tas` has a special syntax,
9−`$`.
10−
11−
12−Source
13−------
14−
15− ++ term @tas :: Hoon ASCII subset
16−
17−Examples
18−--------
19−
20− ~zod/try=> *term
21− %$
22−
23− ~zod/try=> %dead-fish9
24− %dead-fish9
25− ~zod/try=> -:!>(%dead-fish9)
26− [%cube p=271.101.667.197.767.630.546.276 q=[%atom p=%tas]]
27−
28−
29−
30−***
docs/programming/advanced/library/src/2q/mold/wain.mddeleted−14
@@ -1,14 +0,0 @@
1−### `++wain`
2−
3− ++ wain (list cord) :: text lines (no \n)
4−
5−A list of lines. A `++wain` is used instead of a single `++cord` with
6−`\n`.
7−
8−See also: `++lore`, `++role`
9−
10− ~zod/try=> `wain`/som/del/rok
11− <|som del rok|>
12−
13−
14−***
docs/programming/advanced/library/src/2q/mold/wall.mddeleted−27
@@ -1,27 +0,0 @@
1−### `++wall`
2−
3−List of lines
4−
5−
6−A `++wall` is used instead of a single `++tape` with
7−`\n`.
8−
9−Source
10−------
11−
12− ++ wall (list tape) :: text lines (no \n)
13−
14−Examples
15−--------
16−
17−See also: `++wash`
18−
19− ~zod/try=> `wall`(wash [0 20] leaf+<(bex 256)>)
20− <<
21− "115.792.089.237.316.195.423.570.985.008.687.907.853.269.984.665.640.564.039.457.584.007.913.129.639.936"
22− >>
23−
24−
25−
26−
27−***
docs/programming/advanced/library/src/2q/title.mddeleted−1
@@ -1 +0,0 @@
1−# 2q: molds and mold builders
docs/programming/advanced/library/src/3a/core/fe.mddeleted−419
@@ -1,419 +0,0 @@
1−### `++fe` :: modulo bloq
2−
3−Modulo bloq
4−
5−Core containing XX
6−
7−Accepts
8−-------
9−
10−`a` is a `++bloq`.
11−
12−Source
13−------
14−
15− |_ a=bloq
16−
17−### `++dif`
18−
19−Produces the difference between two atoms in the modular basis
20−representation.
21−
22−Accepts
23−-------
24−
25−`a` is a `++bloq`.
26−
27−`b` is an atom.
28−
29−`c` is an atom.
30−
31−Produces
32−--------
33−
34−A `@s`
35−
36−Source
37−------
38−
39− ++ dif |=([b/@ c/@] (sit (sub (add out (sit b)) (sit c))))
40−
41−Examples
42−--------
43−
44− ~zod/try=> (~(dif fe 3) 63 64)
45− 255
46− ~zod/try=> (~(dif fe 3) 5 10)
47− 251
48− ~zod/try=> (~(dif fe 3) 0 1)
49− 255
50− ~zod/try=> (~(dif fe 0) 9 10)
51− 1
52− ~zod/try=> (~(dif fe 0) 9 11)
53− 0
54− ~zod/try=> (~(dif fe 0) 9 12)
55− 1
56− ~zod/try=> (~(dif fe 2) 9 12)
57− 13
58− ~zod/try=> (~(dif fe 2) 63 64)
59− 15
60−
61−------------------------------------------------------------------------
62−
63−### `++inv`
64−
65−Invert mod field
66−
67−Inverts the order of the modular field.
68−
69−Accepts
70−-------
71−
72−`b` is a `++bloq`.
73−
74−Produces
75−--------
76−
77−An atom.
78−
79−
80−Source
81−------
82−
83− ++ inv |=(b/@ (sub (dec out) (sit b)))
84−
85−Examples
86−--------
87−
88− ~zod/try=> (~(inv fe 3) 255)
89− 0
90− ~zod/try=> (~(inv fe 3) 256)
91− 255
92− ~zod/try=> (~(inv fe 3) 0)
93− 255
94− ~zod/try=> (~(inv fe 3) 1)
95− 254
96− ~zod/try=> (~(inv fe 3) 2)
97− 253
98− ~zod/try=> (~(inv fe 3) 55)
99− 200
100−
101−------------------------------------------------------------------------
102−
103−### `++net`
104−
105−Reverse bytes
106−
107−Revereses bytes within block.
108−
109−Accepts
110−-------
111−
112−`b` is a `++bloq`.
113−
114−Produces
115−--------
116−
117−An atom.
118−
119−Source
120−------
121−
122− ++ net |= b/@ ^- @
123− => .(b (sit b))
124− ?: (lte a 3)
125− b
126− =+ c=(dec a)
127− %+ con
128− (lsh c 1 $(a c, b (cut c [0 1] b)))
129− $(a c, b (cut c [1 1] b))
130−
131−Examples
132−--------
133−
134− ~zod/try=> (~(net fe 3) 64)
135− 64
136− ~zod/try=> (~(net fe 3) 128)
137− 128
138− ~zod/try=> (~(net fe 3) 255)
139− 255
140− ~zod/try=> (~(net fe 3) 256)
141− 0
142− ~zod/try=> (~(net fe 3) 257)
143− 1
144− ~zod/try=> (~(net fe 3) 500)
145− 244
146− ~zod/try=> (~(net fe 3) 511)
147− 255
148− ~zod/try=> (~(net fe 3) 512)
149− 0
150− ~zod/try=> (~(net fe 3) 513)
151− 1
152− ~zod/try=> (~(net fe 3) 0)
153− 0
154− ~zod/try=> (~(net fe 3) 1)
155− 1
156− ~zod/try=> (~(net fe 0) 1)
157− 1
158− ~zod/try=> (~(net fe 0) 2)
159− 0
160− ~zod/try=> (~(net fe 0) 3)
161− 1
162− ~zod/try=> (~(net fe 6) 1)
163− 72.057.594.037.927.936
164− ~zod/try=> (~(net fe 6) 2)
165− 144.115.188.075.855.872
166− ~zod/try=> (~(net fe 6) 3)
167− 216.172.782.113.783.808
168− ~zod/try=> (~(net fe 6) 4)
169− 288.230.376.151.711.744
170− ~zod/try=> (~(net fe 6) 5)
171− 360.287.970.189.639.680
172− ~zod/try=> (~(net fe 6) 6)
173− 432.345.564.227.567.616
174− ~zod/try=> (~(net fe 6) 7)
175− 504.403.158.265.495.552
176− ~zod/try=> (~(net fe 6) 512)
177− 562.949.953.421.312
178− ~zod/try=> (~(net fe 6) 513)
179− 72.620.543.991.349.248
180−
181−------------------------------------------------------------------------
182−
183−### `++out`
184−
185−Max integer value
186−
187−The maximum integer value that the current block can store.
188−
189−Accepts
190−-------
191−
192−A `++bloq`.
193−
194−Produces
195−--------
196−
197−An atom.
198−
199−Source
200−------
201−
202− ++ out (bex (bex a))
203−
204−Examples
205−--------
206−
207− ~zod/try=> ~(out fe 0)
208− 2
209− ~zod/try=> ~(out fe 1)
210− 4
211− ~zod/try=> ~(out fe 2)
212− 16
213− ~zod/try=> ~(out fe 3)
214− 256
215− ~zod/try=> ~(out fe 4)
216− 65.536
217− ~zod/try=> ~(out fe 10)
218− \/179.769.313.486.231.590.772.930.519.078.902.473.361.797.697.894.230.657.\/
219− 273.430.081.157.732.675.805.500.963.132.708.477.322.407.536.021.120.113.
220− 879.871.393.357.658.789.768.814.416.622.492.847.430.639.474.124.377.767.
221− 893.424.865.485.276.302.219.601.246.094.119.453.082.952.085.005.768.838.
222− 150.682.342.462.881.473.913.110.540.827.237.163.350.510.684.586.298.239.
223− 947.245.938.479.716.304.835.356.329.624.224.137.216
224− \/ \/
225−
226−------------------------------------------------------------------------
227−
228−### `++rol`
229−
230−Roll left
231−
232−Roll `d` to the left by `c` `b`-sized blocks.
233−
234−Accepts
235−-------
236−
237−`a` is a `++bloq`.
238−
239−`b` is a `++bloq`.
240−
241−`c` is an atom.
242−
243−`d` is an atom.
244−
245−Produces
246−--------
247−
248−An atom.
249−
250−Source
251−------
252−
253− ++ rol |= [b/bloq c/@ d/@] ^- @ :: roll left
254− =+ e=(sit d)
255− =+ f=(bex (sub a b))
256− =+ g=(mod c f)
257− (sit (con (lsh b g e) (rsh b (sub f g) e)))
258−
259−Examples
260−--------
261−
262− ~zod/try=> `@ux`(~(rol fe 6) 4 3 0xabac.dedf.1213)
263− 0x1213.0000.abac.dedf
264− ~zod/try=> `@ux`(~(rol fe 6) 4 2 0xabac.dedf.1213)
265− 0xdedf.1213.0000.abac
266− ~zod/try=> `@t`(~(rol fe 5) 3 1 'dfgh')
267− 'hdfg'
268− ~zod/try=> `@t`(~(rol fe 5) 3 2 'dfgh')
269− 'ghdf'
270− ~zod/try=> `@t`(~(rol fe 5) 3 0 'dfgh')
271− 'dfgh'
272−
273−------------------------------------------------------------------------
274−
275−### `++ror`
276−
277−Roll right
278−
279−Roll `d` to the right by `c` `b`-sized blocks.
280−
281−Accepts
282−-------
283−
284−`a` is a `++bloq`.
285−
286−`b` is a `++bloq`.
287−
288−`c` is an atom.
289−
290−`d` is an atom.
291−
292−Produces
293−--------
294−
295−An atom.
296−
297−Source
298−------
299−
300− ++ ror |= {b/bloq c/@ d/@} ^- @ :: roll right
301− =+ e=(sit d)
302− =+ f=(bex (sub a b))
303− =+ g=(mod c f)
304− (sit (con (rsh b g e) (lsh b (sub f g) e)))
305−
306−
307−Examples
308−--------
309−
310− ~zod/try=> `@ux`(~(ror fe 6) 4 1 0xabac.dedf.1213)
311− 0x1213.0000.abac.dedf
312− ~zod/try=> `@ux`(~(ror fe 6) 3 5 0xabac.dedf.1213)
313− 0xacde.df12.1300.00ab
314− ~zod/try=> `@ux`(~(ror fe 6) 3 3 0xabac.dedf.1213)
315− 0xdf12.1300.00ab.acde
316− ~zod/try=> `@t`(~(rol fe 5) 3 0 'hijk')
317− 'hijk'
318− ~zod/try=> `@t`(~(rol fe 5) 3 1 'hijk')
319− 'khij'
320− ~zod/try=> `@t`(~(rol fe 5) 3 2 'hijk')
321− 'jkhi'
322−
323−------------------------------------------------------------------------
324−
325−### `++sum`
326−
327−Sum
328−
329−Sum two numbers in this modular field.
330−
331−Accepts
332−-------
333−
334−`a` is a `++bloq`.
335−
336−`b` is an atom.
337−
338−`c` is an atom.
339−
340−Produces
341−--------
342−
343−An atom.
344−
345−Source
346−------
347−
348− ++ sum |=([b/@ c/@] (sit (add b c))) :: wrapping add
349−
350−Examples
351−--------
352−
353− ~zod/try=> (~(sum fe 3) 10 250)
354− 4
355− ~zod/try=> (~(sum fe 0) 0 1)
356− 1
357− ~zod/try=> (~(sum fe 0) 0 2)
358− 0
359− ~zod/try=> (~(sum fe 2) 14 2)
360− 0
361− ~zod/try=> (~(sum fe 2) 14 3)
362− 1
363− ~zod/try=> (~(sum fe 4) 10.000 256)
364− 10.256
365− ~zod/try=> (~(sum fe 4) 10.000 100.000)
366− 44.464
367−
368−### `++sit`
369−
370−Atom in mod block representation
371−
372−Produce an atom in the current modular block representation.
373−
374−Accepts
375−-------
376−
377−`a` is a `++bloq`.
378−
379−`b` is an atom.
380−
381−Produces
382−--------
383−
384−An atom.
385−
386−Source
387−------
388−
389− ++ sit |=(b/@ (end a 1 b)) :: enforce modulo
390−
391−Examples
392−--------
393−
394− ~zod/try=> (~(sit fe 3) 255)
395− 255
396− ~zod/try=> (~(sit fe 3) 256)
397− 0
398− ~zod/try=> (~(sit fe 3) 257)
399− 1
400− ~zod/try=> (~(sit fe 2) 257)
401− 1
402− ~zod/try=> (~(sit fe 2) 10.000)
403− 0
404− ~zod/try=> (~(sit fe 2) 100)
405− 4
406− ~zod/try=> (~(sit fe 2) 19)
407− 3
408− ~zod/try=> (~(sit fe 2) 17)
409− 1
410− ~zod/try=> (~(sit fe 0) 17)
411− 1
412− ~zod/try=> (~(sit fe 0) 0)
413− 0
414− ~zod/try=> (~(sit fe 0) 1)
415− 1
416−
417−
418−
419−***
docs/programming/advanced/library/src/3a/core/si.mddeleted−480
@@ -1,480 +0,0 @@
1−### `++si`
2−
3− ++ si !: :: signed integer
4− |%
5−
6−Container core for the signed integer functions.
7−
8−------------------------------------------------------------------------
9−
10−### `++abs`
11−
12−Absolute value
13−
14−Produces the absolute value of a signed integer.
15−
16−Accepts
17−-------
18−
19−`a` is a signed integer, `@s`.
20−
21−Produces
22−--------
23−
24−An atom.
25−
26−Source
27−------
28−
29− ++ abs |=(a/@s (add (end 0 1 a) (rsh 0 1 a))) :: absolute value
30−
31−Examples
32−--------
33−
34− ~zod/try=> (abs:si -2)
35− 2
36− ~zod/try=> (abs:si -10.000)
37− 10.000
38− ~zod/try=> (abs:si --2)
39− 2
40−
41−------------------------------------------------------------------------
42−
43−### `++dif`
44−
45−Difference
46−
47−Produces the difference between two signed integers `b` and `c`.
48−
49−Accepts
50−-------
51−
52−`a` is a signed integer, `@s`.
53−
54−`b` is a signed integer, `@s`.
55−
56−Produces
57−--------
58−
59−A `@s`.
60−
61−
62−Source
63−------
64−
65− ++ dif |= [a/@s b/@s] :: subtraction
66− (sum a (new !(syn b) (abs b)))
67−
68−Examples
69−--------
70−
71− ~zod/try=> (dif:si --10 -7)
72− --17
73− ~zod/try=> (dif:si --10 --7)
74− --3
75− ~zod/try=> (dif:si `@s`0 --7)
76− -7
77− ~zod/try=> (dif:si `@s`0 `@s`7)
78− --4
79−
80−------------------------------------------------------------------------
81−
82−### `++dul`
83−
84−Modulus
85−
86−Produces the modulus of two signed integers.
87−
88−Accepts
89−-------
90−
91−`a` is a signed integer, `@s`.
92−
93−`b` is an atom.
94−
95−Produces
96−--------
97−
98−An atom.
99−
100−Source
101−------
102−
103− ++ dul |= [a/@s b/@] :: modulus
104− =+(c=(old a) ?:(-.c (mod +.c b) (sub b +.c)))
105−
106−Examples
107−--------
108−
109− ~zod/try=> (dul:si --9 3)
110− 0
111− ~zod/try=> (dul:si --9 4)
112− 1
113− ~zod/try=> (dul:si --9 5)
114− 4
115− ~zod/try=> (dul:si --9 6)
116− 3
117− ~zod/try=> (dul:si --90 --10)
118− 10
119−
120−------------------------------------------------------------------------
121−
122−### `++fra`
123−
124−Divide
125−
126−Produces the quotient of two signed integers.
127−
128−Accepts
129−-------
130−
131−`a` is a signed integer, `@s`.
132−
133−`b` is a signed integer, `@s`.
134−
135−Produces
136−--------
137−
138−An atom.
139−
140−Source
141−------
142−
143− ++ fra |= [a/@s b/@s] :: divide
144− (new =(0 (mix (syn a) (syn b))) (div (abs a) (abs b)))
145−
146−Examples
147−--------
148−
149− ~zod/try=> (fra:si --10 -2)
150− -5
151− ~zod/try=> (fra:si -20 -5)
152− --4
153−
154−------------------------------------------------------------------------
155−
156−### `++new`
157−
158−Signed integer
159−
160−Produces a signed integer from a loobean sign value `a` and an atom `b`.
161−
162−Accepts
163−-------
164−
165−`a` is a loobean.
166−
167−`b` is an atom.
168−
169−Produces
170−--------
171−
172−A `@s`
173−
174−Source
175−------
176−
177− ++ new |= [a/? b/@] :: [sign value] to @s
178− `@s`?:(a (mul 2 b) ?:(=(0 b) 0 +((mul 2 (dec b)))))
179−
180−Examples
181−--------
182−
183− ~zod/try=> (new:si [& 10])
184− --10
185− ~zod/try=> (new:si [| 10])
186− -10
187− ~zod/try=> (new:si [%.y 7])
188− --7
189−
190−------------------------------------------------------------------------
191−
192−### `++old`
193−
194−sign value
195−
196−Produces the cell `[sign value]` representations of a signed integer.
197−
198−Accepts
199−-------
200−
201−`a` is a `@s`.
202−
203−Produces
204−--------
205−
206−A cell of a boolean and an atom.
207−
208−Source
209−------
210−
211− ++ old |=(a/@s [(syn a) (abs a)]) :: [sign value]
212−
213−Examples
214−--------
215−
216− ~zod/try=> (old:si 7)
217− ! type-fail
218− ! exit
219− ~zod/try=> (old:si -7)
220− [%.n 7]
221− ~zod/try=> (old:si --7)
222− [%.y 7]
223− ~zod/try=> (old:si `@s`7)
224− [%.n 4]
225− ~zod/try=> (old:si -0)
226− [%.y 0]
227−
228−------------------------------------------------------------------------
229−
230−### `++pro`
231−
232−Multiply
233−
234−Produces the product of two signed integers.
235−
236−Accepts
237−-------
238−
239−`a` is a `@s`.
240−
241−`b` is a `@s`.
242−
243−Produces
244−--------
245−
246−A `@s`.
247−
248−Source
249−------
250−
251− ++ pro |= [a/@s b/@s] :: multiplication
252− (new =(0 (mix (syn a) (syn b))) (mul (abs a) (abs b)))
253−
254−Examples
255−--------
256−
257− ~zod/try=> (pro:si -4 --2)
258− -8
259− ~zod/try=> (pro:si -4 -2)
260− --8
261− ~zod/try=> (pro:si --10.000.000 -10)
262− -100.000.000
263− ~zod/try=> (pro:si -1.337 --0)
264− --0
265−
266−------------------------------------------------------------------------
267−
268−### `++rem`
269−
270−Remainder
271−
272−Produces the remainder from a division of two signed integers.
273−
274−Accepts
275−-------
276−
277−`a` is a `@s`.
278−
279−`b` is a `@s`.
280−
281−Produces
282−--------
283−
284−A `@sd`.
285−
286−Source
287−------
288−
289− ++ rem |=([a/@s b/@s] (dif a (pro b (fra a b)))) :: remainder
290−
291−Examples
292−--------
293−
294− ~zod/try=> (rem:si -10 -4)
295− -2
296− ~zod/try=> (rem:si --10 --4)
297− --2
298− ~zod/try=> (rem:si --10 -4)
299− --2
300− ~zod/try=> (rem:si --7 --3)
301− --1
302− ~zod/try=> (rem:si --0 --10.000)
303− --0
304−
305−------------------------------------------------------------------------
306−
307−### `++sum`
308−
309−Add
310−
311−Sum two signed integers.
312−
313−Accepts
314−-------
315−
316−`b` is a `@s`.
317−
318−`c` is a signed integer `@s`.
319−
320−Produces
321−--------
322−
323−A `@s`.
324−
325−Source
326−------
327−
328− ++ sum |= [a/@s b/@s] :: addition
329− ~| %si-sum
330− =+ [c=(old a) d=(old b)]
331− ?: -.c
332− ?: -.d
333− (new & (add +.c +.d))
334− ?: (gte +.c +.d)
335− (new & (sub +.c +.d))
336− (new | (sub +.d +.c))
337− ?: -.d
338− ?: (gte +.c +.d)
339− (new | (sub +.c +.d))
340− (new & (sub +.d +.c))
341− (new | (add +.c +.d))
342−
343−Examples
344−--------
345−
346− ~zod/try=> (sum:si --10 --10)
347− --20
348− ~zod/try=> (sum:si --10 -0)
349− --10
350− ~zod/try=> (sum:si -10 -7)
351− -17
352− ~zod/try=> (sum:si -10 --7)
353− -3
354−
355−------------------------------------------------------------------------
356−
357−### `++sun`
358−
359−Signed from unsigned
360−
361−Produces a signed integer from an unsigned integer.
362−
363−Note that the result must be manually cast to some `@s` odor to be
364−inferred as an unsigned integer in the type system.
365−
366−Accepts
367−-------
368−
369−`a` is a `@u`.
370−
371−Produces
372−--------
373−
374−A `@s`.
375−
376−Source
377−------
378−
379− ++ sun |=(a/@u (mul 2 a)) :: @u to @s
380−
381−Examples
382−--------
383−
384− ~zod/try=> `@s`10
385− --5
386− ~zod/try=> (sun:si 10)
387− 20
388− ~zod/try=> `@s`(sun:si 10)
389− --10
390− ~zod/try=> `@sd`(sun:si 10)
391− --10
392− ~zod/try=> `@sd`(sun:si 12.345)
393− --12.345
394−
395−------------------------------------------------------------------------
396−
397−### `++syn`
398−
399−Sign
400−
401−Produce the sign of a signed integer, where `&` is posiitve, and `|` is negative.
402−
403−Accepts
404−-------
405−
406−`a` is a `@s`.
407−
408−Produces
409−--------
410−
411−A boolean.
412−
413−Source
414−------
415−
416− ++ syn |=(a/@s =(0 (end 0 1 a))) :: sign test
417−
418−Examples
419−--------
420−
421− ~zod/try=> (syn:si -2)
422− %.n
423− ~zod/try=> (syn:si --2)
424− %.y
425− ~zod/try=> (syn:si -0)
426− %.y
427−
428−------------------------------------------------------------------------
429−
430−### `++cmp`
431−
432−Compare
433−
434−Compare two signed integers.
435−
436−Accepts
437−-------
438−
439−`b` is a `@s`.
440−
441−`c` is a `@s`.
442−
443−Produces
444−--------
445−
446−A `@s`.
447−
448−Source
449−------
450−
451− ++ cmp |= [a/@s b/@s] :: compare
452− ^- @s
453− ?: =(a b)
454− --0
455− ?: (syn a)
456− ?: (syn b)
457− ?: (gth a b)
458− --1
459− -1
460− --1
461− ?: (syn b)
462− -1
463− ?: (gth a b)
464− -1
465− --1
466−
467−Examples
468−--------
469−
470− ~zod/try=> (cmp:si --10 --10)
471− --0
472− ~zod/try=> (cmp:si --10 -0)
473− --1
474− ~zod/try=> (cmp:si -10 -7)
475− -1
476− ~zod/try=> (cmp:si -10 --7)
477− -1
478−
479−
480−***
docs/programming/advanced/library/src/3a/gate/egcd.mddeleted−42
@@ -1,42 +0,0 @@
1−### `++egcd`
2−
3−GCD
4−
5− ++ egcd !: :: schneier's egcd
6− |= {a/@ b/@}
7− =+ si
8− =+ [c=(sun a) d=(sun b)]
9− =+ [u=[c=(sun 1) d=--0] v=[c=--0 d=(sun 1)]]
10− |- ^- {d/@ u/@s v/@s}
11− ?: =(--0 c)
12− [(abs d) d.u d.v]
13− :: ?> ?& =(c (sum (pro (sun a) c.u) (pro (sun b) c.v)))
14− :: =(d (sum (pro (sun a) d.u) (pro (sun b) d.v)))
15− :: ==
16− =+ q=(fra d c)
17− %= $
18− c (dif d (pro q c))
19− d c
20− u [(dif d.u (pro q c.u)) c.u]
21− v [(dif d.v (pro q c.v)) c.v]
22− ==
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−***
docs/programming/advanced/library/src/3a/title.mddeleted−1
@@ -1 +0,0 @@
1−# 3a: signed and modular ints
docs/programming/advanced/library/src/3b/title.mddeleted−1
@@ -1 +0,0 @@
1−# 3b: floating point
docs/programming/advanced/library/src/3c/core/yo.mddeleted−258
@@ -1,258 +0,0 @@
1−### `++yo`
2−
3− ++ yo :: time constants core
4−
5−Useful constants for interacting with earth time.
6−
7−### `++cet`
8−
9−Days in a century. Derived by multiplying the number of days in a year
10−(365) by the number of years in a century (100), then adding the number
11−days from leap years in a century (24).
12−
13−Produces
14−--------
15−
16−An atom.
17−
18−Source
19−------
20−
21− |% ++ cet 36.524 :: (add 24 (mul 100 365))
22−
23−Examples
24−--------
25−
26− ~zod/try=> cet:yo
27− 36.524
28− ~zod/try=> (add 365 cet:yo)
29− 36.889
30− ~zod/try=> (sub (add 24 (mul 100 365)) cet:yo)
31− 0
32−
33−------------------------------------------------------------------------
34−
35−### `++day`
36−
37−Number of seconds in a day.
38−
39−Produces
40−--------
41−
42−An atom.
43−
44−Source
45−------
46−
47− ++ day 86.400 :: (mul 24 hor)
48−
49−Examples
50−--------
51−
52− ~zod/try=> day:yo
53− 86.400
54− ~zod/try=> (add 60 day:yo)
55− 86.460
56−
57−------------------------------------------------------------------------
58−
59−### `++era`
60−
61−XX Revisit
62−
63−Produces
64−--------
65−
66−An atom.
67−
68−Source
69−------
70−
71− ++ era 146.097 :: (add 1 (mul 4 cet))
72−
73−Examples
74−--------
75−
76−
77−------------------------------------------------------------------------
78−
79−### `++hor`
80−
81−Seconds in hour
82−
83−The number of seconds in an hour. Derived by multiplying the number of
84−seconds in a minute by the minutes in an hour.
85−
86−Produces
87−--------
88−
89−An atom.
90−
91−Source
92−------
93−
94− ++ hor 3.600 :: (mul 60 mit)
95−
96−Examples
97−--------
98−
99− ~zod/try=> hor:yo
100− 3.600
101− ~zod/try=> (div hor:yo 60)
102− 60
103−
104−------------------------------------------------------------------------
105−
106−### `++jes`
107−
108−XX Revisit
109−
110−Produces
111−--------
112−
113−An atom.
114−
115−Source
116−------
117−
118− ++ jes 106.751.991.084.417 :: (mul 730.692.561 era)
119−
120−Examples
121−--------
122−
123− ~zod/try=> jes:yo
124− 106.751.991.084.417
125−
126−------------------------------------------------------------------------
127−
128−### `++mit`
129−
130−Seconds in minute
131−
132−The number of seconds in a minute.
133−
134−Produces
135−--------
136−
137−An atom.
138−
139−Source
140−------
141−
142− ++ mit 60
143−
144−Examples
145−--------
146−
147− ~zod/try=> mit:yo
148− 60
149−
150−------------------------------------------------------------------------
151−
152−### `++moh`
153−
154−Days in month
155−
156−The days in each month of the Gregorian common year. A list of unsigned
157−decimal atoms (Either 28, 30, or 31) denoting the number of days in the
158−month at the year at that index.
159−
160−Produces
161−--------
162−
163−A `++list` of `@ud`
164−
165−Source
166−------
167−
168− ++ moh `(list @ud)`[31 28 31 30 31 30 31 31 30 31 30 31 ~]
169−
170−Examples
171−--------
172−
173− ~zod/try=> moh:yo
174− ~[31 28 31 30 31 30 31 31 30 31 30 31]
175− ~zod/try=> (snag 4 moh:yo)
176− 31
177−
178−------------------------------------------------------------------------
179−
180−### `++moy`
181−
182−Moh with leapyear
183−
184−The days in each month of the Gregorian leap-year. A list of unsigned
185−decimal atoms (Either 29,30, or 31) denoting the number of days in the
186−month at the leap-year at that index.
187−
188−Examples
189−--------
190−
191−A `++list` of `@ud`
192−
193−Source
194−------
195−
196− ++ moy `(list @ud)`[31 29 31 30 31 30 31 31 30 31 30 31 ~]
197−
198−Examples
199−--------
200−
201− ~zod/try=> moy:yo
202− ~[31 29 31 30 31 30 31 31 30 31 30 31]
203− ~zod/try=> (snag 1 moy:yo)
204− 29
205−
206−------------------------------------------------------------------------
207−
208−### `++qad`
209−
210−Seconds in 4 years
211−
212−The number of seconds in four years. Derived by adding one second to the
213−number of seconds in four years.
214−
215−Produces
216−--------
217−
218−An atom.
219−
220−Source
221−------
222−
223− ++ qad 126.144.001 :: (add 1 (mul 4 yer))
224−
225−Examples
226−--------
227−
228− ~zod/try=> qad:yo
229− 126.144.001
230−
231−------------------------------------------------------------------------
232−
233−### `++yer`
234−
235−Seconds in year
236−
237−The number of seconds in a year. Derived by multiplying the number of
238−seconds in a day by 365.
239−
240−Produces
241−--------
242−
243−An atom.
244−
245−Source
246−------
247−
248− ++ yer 31.536.000 :: (mul 365 day)
249−
250−Examples
251−--------
252−
253− ~zod/try=> yer:yo
254− 31.536.000
255−
256−
257−
258−***
docs/programming/advanced/library/src/3c/gate/yall.mddeleted−57
@@ -1,57 +0,0 @@
1−### `++yall`
2−
3−Time since beginning of time
4−
5−Produce the date tuple of `[y=@ud m=@ud d=@ud]` of the year, month, and
6−day from a number of days from the beginning of time.
7−
8−Accepts
9−-------
10−
11−`day` is a [`@ud`]()
12−
13−Produces
14−--------
15−
16−
17−Source
18−------
19−
20− ++ yall :: day / to day of year
21− |= day/@ud
22− ^- {y/@ud m/@ud d/@ud}
23− =+ [era=0 cet=0 lep=*?]
24− => .(era (div day era:yo), day (mod day era:yo))
25− => ^+ .
26− ?: (lth day +(cet:yo))
27− .(lep &, cet 0)
28− => .(lep |, cet 1, day (sub day +(cet:yo)))
29− .(cet (add cet (div day cet:yo)), day (mod day cet:yo))
30− =+ yer=(add (mul 400 era) (mul 100 cet))
31− |- ^- {y/@ud m/@ud d/@ud}
32− =+ dis=?:(lep 366 365)
33− ?. (lth day dis)
34− =+ ner=+(yer)
35− $(yer ner, day (sub day dis), lep =(0 (end 0 2 ner)))
36− |- ^- {y/@ud m/@ud d/@ud}
37− =+ [mot=0 cah=?:(lep moy:yo moh:yo)]
38− |- ^- {y/@ud m/@ud d/@ud}
39− =+ zis=(snag mot cah)
40− ?: (lth day zis)
41− [yer +(mot) +(day)]
42− $(mot +(mot), day (sub day zis))
43− ::
44−
45−Examples
46−--------
47−
48− ~zod/try=> (yall 198)
49− [y=0 m=7 d=17]
50− ~zod/try=> (yall 90.398)
51− [y=247 m=7 d=3]
52− ~zod/try=> (yall 0)
53− [y=0 m=1 d=1]
54−
55−
56−
57−***
docs/programming/advanced/library/src/3c/gate/yawn.mddeleted−63
@@ -1,63 +0,0 @@
1−### `++yawn`
2−
3−Days since beginning of time
4−
5−Inverse of `yall`, computes number of days A.D. from y/m/d date as the
6−tuple `[yer=@ud mot=@ud day=@ud]`.
7−
8−Accepts
9−-------
10−
11−`yer` is an unsigned decimal, `@ud`.
12−
13−`mon` is an unsigned decimal, `@ud`.
14−
15−`day` is an unsigned decimal, `@ud`.
16−
17−Produces
18−--------
19−
20−A `@ud`.
21−
22−Source
23−------
24−
25− ++ yawn :: days since Jesus
26− |= {yer/@ud mot/@ud day/@ud}
27− ^- @ud
28− => .(mot (dec mot), day (dec day))
29− => ^+ .
30− %= .
31− day
32− =+ cah=?:((yelp yer) moy:yo moh:yo)
33− |- ^- @ud
34− ?: =(0 mot)
35− day
36− $(mot (dec mot), cah (slag 1 cah), day (add day (snag 0 cah)))
37− ==
38− |- ^- @ud
39− ?. =(0 (mod yer 4))
40− =+ ney=(dec yer)
41− $(yer ney, day (add day ?:((yelp ney) 366 365)))
42− ?. =(0 (mod yer 100))
43− =+ nef=(sub yer 4)
44− $(yer nef, day (add day ?:((yelp nef) 1.461 1.460)))
45− ?. =(0 (mod yer 400))
46− =+ nec=(sub yer 100)
47− $(yer nec, day (add day ?:((yelp nec) 36.525 36.524)))
48− (add day (mul (div yer 400) (add 1 (mul 4 36.524))))
49− ::
50−
51−Examples
52−--------
53−
54− ~zod/try=> (yawn 2.014 8 4)
55− 735.814
56− ~zod/try=> (yawn 1.776 7 4)
57− 648.856
58− ~zod/try=> (yawn 1.990 10 11)
59− 727.116
60−
61−
62−
63−***
docs/programming/advanced/library/src/3c/gate/year.mddeleted−38
@@ -1,38 +0,0 @@
1−### `++year`
2−
3−Accept a parsed date of form `[[a=? y=@ud] m=@ud t=tarp]` and produce
4−its `@d`representation.
5−
6−Accepts
7−-------
8−
9−`det` is a `++date`
10−
11−Produces
12−--------
13−
14−A `@d`.
15−
16−Source
17−------
18−
19− ++ year :: date to @d
20− |= det/date
21− ^- @da
22− =+ ^= yer
23− ?: a.det
24− (add 292.277.024.400 y.det)
25− (sub 292.277.024.400 (dec y.det))
26− =+ day=(yawn yer m.det d.t.det)
27− (yule day h.t.det m.t.det s.t.det f.t.det)
28− ::
29−
30−Examples
31−--------
32−
33− ~zod/try=> (year [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=4 s=57 f=~[0xd940]]])
34− 0x8000000d227df4e9d940000000000000
35−
36−
37−
38−***
docs/programming/advanced/library/src/3c/gate/yell.mddeleted−42
@@ -1,42 +0,0 @@
1−### `++yell`
2−
3−Produce a parsed daily time format from an atomic date.
4−
5−`now` is a `@d`.
6−
7−Source
8−------
9−
10− ++ yell :: tarp from @d
11− |= now/@d
12− ^- tarp
13− =+ sec=(rsh 6 1 now)
14− =+ ^= fan
15− =+ [muc=4 raw=(end 6 1 now)]
16− |- ^- (list @ux)
17− ?: |(=(0 raw) =(0 muc))
18− ~
19− => .(muc (dec muc))
20− [(cut 4 [muc 1] raw) $(raw (end 4 muc raw))]
21− =+ day=(div sec day:yo)
22− => .(sec (mod sec day:yo))
23− =+ hor=(div sec hor:yo)
24− => .(sec (mod sec hor:yo))
25− =+ mit=(div sec mit:yo)
26− => .(sec (mod sec mit:yo))
27− [day hor mit sec fan]
28− ::
29−
30−
31−Examples
32−--------
33−
34− ~zod/try=> (yell ~2014.3.20..05.42.53..7456)
35− [d=106.751.991.820.094 h=5 m=42 s=53 f=~[0x7456]]
36− ~zod/try=> (yell ~2014.6.9..19.09.40..8b66)
37− [d=106.751.991.820.175 h=19 m=9 s=40 f=~[0x8b66]]
38− ~zod/try=> (yell ~1776.7.4)
39− [d=106.751.991.733.273 h=0 m=0 s=0 f=~]
40−
41−
42−***
docs/programming/advanced/library/src/3c/gate/yelp.mddeleted−39
@@ -1,39 +0,0 @@
1−### `++yelp`
2−
3−Leap-week?
4−
5−Determines whether a year contains an ISO 8601 leap week. Produces a
6−loobean.
7−
8−Accepts
9−-------
10−
11−`yer` is an unsigned decimal, `@ud`.
12−
13−Produces
14−--------
15−
16−A boolean.
17−
18−Source
19−------
20−
21− ++ yelp :: leap year
22− |= yer=@ud ^- ?
23− &(=(0 (mod yer 4)) |(!=(0 (mod yer 100)) =(0 (mod yer 400))))
24−
25−Examples
26−--------
27−
28− ~zod/try=> (yelp 2.014)
29− %.n
30− ~zod/try=> (yelp 2.008)
31− %.y
32− ~zod/try=> (yelp 0)
33− %.y
34− ~zod/try=> (yelp 14.011)
35− %.n
36−
37−
38−
39−***
docs/programming/advanced/library/src/3c/gate/yore.mddeleted−39
@@ -1,39 +0,0 @@
1−### `++yore`
2−
3−Produces a `++date` from a `@d`
4−
5−Accepts
6−-------
7−
8−`now` is a `@d`.
9−
10−Produces
11−--------
12−
13−A `++date`.
14−
15−Source
16−------
17−
18− ++ yore :: @d to date
19− |= now/@da
20− ^- date
21− =+ rip=(yell now)
22− =+ ger=(yall d.rip)
23− :- ?: (gth y.ger 292.277.024.400)
24− [a=& y=(sub y.ger 292.277.024.400)]
25− [a=| y=+((sub 292.277.024.400 y.ger))]
26− [m.ger d.ger h.rip m.rip s.rip f.rip]
27− ::
28−
29−Examples
30−--------
31−
32− ~zod/try=> (yore -<-)
33− [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=17 s=1 f=~[0x700d]]]
34− ~zod/try=> (yore -<-)
35− [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=28 s=53 f=~[0x7b82]]]
36−
37−
38−
39−***
docs/programming/advanced/library/src/3c/gate/yule.mddeleted−58
@@ -1,58 +0,0 @@
1−### `++yule`
2−
3−Daily time to time atom
4−
5−Accept a `++tarp`, a parsed daily time, and produces a time atom,
6−`@d`.
7−
8−Accepts
9−-------
10−
11−`rip` is a `++tarp`.
12−
13−Produces
14−--------
15−
16−A `@d`.
17−
18−Source
19−------
20−
21− ++ yule :: time atom
22− |= rip/tarp
23− ^- @d
24− =+ ^= sec ;: add
25− (mul d.rip day:yo)
26− (mul h.rip hor:yo)
27− (mul m.rip mit:yo)
28− s.rip
29− ==
30− =+ ^= fac =+ muc=4
31− |- ^- @
32− ?~ f.rip
33− 0
34− => .(muc (dec muc))
35− (add (lsh 4 muc i.f.rip) $(f.rip t.f.rip))
36− (con (lsh 6 1 sec) fac)
37− ::
38−
39−Examples
40−--------
41−
42− ~zod/try=> =murica (yell ~1776.7.4)
43− ~zod/try=> murica
44− [d=106.751.991.733.273 h=0 m=0 s=0 f=~]
45− ~zod/try=> (yule murica)
46− 0x8000000b62aaf5800000000000000000
47− ~zod/try=> `@da`(yule murica)
48− ~1776.7.4
49− ~zod/try=> `@da`(yule (yell ~2014.3.20..05.42.53..7456))
50− ~2014.3.20..05.42.53..7456
51− ~zod/try=> `tarp`[31 12 30 0 ~]
52− [d=31 h=12 m=30 s=0 f=~]
53− ~zod/try=> `@dr`(yule `tarp`[31 12 30 0 ~])
54− ~d31.h12.m30
55−
56−
57−
58−***
docs/programming/advanced/library/src/3c/title.mddeleted−1
@@ -1 +0,0 @@
1−# 3c: urbit time
docs/programming/advanced/library/src/3d/core/og.mddeleted−57
@@ -1,57 +0,0 @@
1−
2−### `++og`
3−
4− ++ og :: shax-powered rng
5− ~/ %og
6− |_ a/@
7−
8−XX document
9−
10−### `++rad`
11−
12− ++ rad :: random in range
13− |= b/@ ^- @
14− =+ c=(raw (met 0 b))
15− ?:((lth c b) c $(a +(a)))
16− ::
17−
18−XX document
19−
20−### `++rads`
21−
22− ++ rads :: random continuation
23− |= b/@
24− =+ r=(rad b)
25− [r +>.$(a (shas %og-s r))]
26−
27−XX document
28−
29−### `++raw`
30−
31− ++ raw :: random bits
32− ~/ %raw
33− |= b/@ ^- @
34− %+ can
35− 0
36− =+ c=(shas %og-a (mix b a))
37− |- ^- (list [@ @])
38− ?: =(0 b)
39− ~
40− =+ d=(shas %og-b (mix b (mix a c)))
41− ?: (lth b 256)
42− [[b (end 0 b d)] ~]
43− [[256 d] $(c d, b (sub b 256))]
44−
45−XX document
46−
47−### `++raws`
48−
49− ++ raws :: random bits continuation
50− |= b/@
51− =+ r=(raw b)
52− [r +>.$(a (shas %og-s r))]
53− --
54−
55−
56−
57−***
docs/programming/advanced/library/src/3d/gate/shad.mddeleted−10
@@ -1,10 +0,0 @@
1−### `++shad`
2−
3− ++ shad |=(ruz/@ (shax (shax ruz))) :: double sha-256
4−
5−
6−XX document
7−
8−
9−
10−***
docs/programming/advanced/library/src/3d/gate/shaf.mddeleted−13
@@ -1,13 +0,0 @@
1−### `++shaf`
2−
3− ++ shaf :: half sha-256
4− |= [sal/@ ruz/@]
5− =+ haz=(shas sal ruz)
6− (mix (end 7 1 haz) (rsh 7 1 haz))
7− ::
8−
9−XX document
10−
11−
12−
13−***
docs/programming/advanced/library/src/3d/gate/shak.mddeleted−12
@@ -1,12 +0,0 @@
1−### `++shak`
2−
3− ++ shak :: XX shd be PBKDF
4− |= [who/@p wud/@]
5− (shas (mix %shak who) wud)
6− ::
7−
8−XX document
9−
10−
11−
12−***
docs/programming/advanced/library/src/3d/gate/shal.mddeleted−120
@@ -1,120 +0,0 @@
1−### `++shal`
2−
3− ++ shal :: sha-512 with length
4− ~/ %shal
5− |= {len/@ ruz/@} ^- @
6− => .(ruz (cut 3 [0 len] ruz))
7− =+ [few==>(fe .(a 6)) wac=|=({a/@ b/@} (cut 6 [a 1] b))]
8− =+ [sum=sum.few ror=ror.few net=net.few inv=inv.few]
9− =+ ral=(lsh 0 3 len)
10− =+ ^= ful
11− %+ can 0
12− :~ [ral ruz]
13− [8 128]
14− [(mod (sub 1.920 (mod (add 8 ral) 1.024)) 1.024) 0]
15− [128 (~(net fe 7) ral)]
16− ==
17− =+ lex=(met 10 ful)
18− =+ ^= kbx 0x6c44.198c.4a47.5817.5fcb.6fab.3ad6.faec.
19− 597f.299c.fc65.7e2a.4cc5.d4be.cb3e.42b6.
20− 431d.67c4.9c10.0d4c.3c9e.be0a.15c9.bebc.
21− 32ca.ab7b.40c7.2493.28db.77f5.2304.7d84.
22− 1b71.0b35.131c.471b.113f.9804.bef9.0dae.
23− 0a63.7dc5.a2c8.98a6.06f0.67aa.7217.6fba.
24− f57d.4f7f.ee6e.d178.eada.7dd6.cde0.eb1e.
25− d186.b8c7.21c0.c207.ca27.3ece.ea26.619c.
26− c671.78f2.e372.532b.bef9.a3f7.b2c6.7915.
27− a450.6ceb.de82.bde9.90be.fffa.2363.1e28.
28− 8cc7.0208.1a64.39ec.84c8.7814.a1f0.ab72.
29− 78a5.636f.4317.2f60.748f.82ee.5def.b2fc.
30− 682e.6ff3.d6b2.b8a3.5b9c.ca4f.7763.e373.
31− 4ed8.aa4a.e341.8acb.391c.0cb3.c5c9.5a63.
32− 34b0.bcb5.e19b.48a8.2748.774c.df8e.eb99.
33− 1e37.6c08.5141.ab53.19a4.c116.b8d2.d0c8.
34− 106a.a070.32bb.d1b8.f40e.3585.5771.202a.
35− d699.0624.5565.a910.d192.e819.d6ef.5218.
36− c76c.51a3.0654.be30.c24b.8b70.d0f8.9791.
37− a81a.664b.bc42.3001.a2bf.e8a1.4cf1.0364.
38− 9272.2c85.1482.353b.81c2.c92e.47ed.aee6.
39− 766a.0abb.3c77.b2a8.650a.7354.8baf.63de.
40− 5338.0d13.9d95.b3df.4d2c.6dfc.5ac4.2aed.
41− 2e1b.2138.5c26.c926.27b7.0a85.46d2.2ffc.
42− 1429.2967.0a0e.6e70.06ca.6351.e003.826f.
43− d5a7.9147.930a.a725.c6e0.0bf3.3da8.8fc2.
44− bf59.7fc7.beef.0ee4.b003.27c8.98fb.213f.
45− a831.c66d.2db4.3210.983e.5152.ee66.dfab.
46− 76f9.88da.8311.53b5.5cb0.a9dc.bd41.fbd4.
47− 4a74.84aa.6ea6.e483.2de9.2c6f.592b.0275.
48− 240c.a1cc.77ac.9c65.0fc1.9dc6.8b8c.d5b5.
49− efbe.4786.384f.25e3.e49b.69c1.9ef1.4ad2.
50− c19b.f174.cf69.2694.9bdc.06a7.25c7.1235.
51− 80de.b1fe.3b16.96b1.72be.5d74.f27b.896f.
52− 550c.7dc3.d5ff.b4e2.2431.85be.4ee4.b28c.
53− 1283.5b01.4570.6fbe.d807.aa98.a303.0242.
54− ab1c.5ed5.da6d.8118.923f.82a4.af19.4f9b.
55− 59f1.11f1.b605.d019.3956.c25b.f348.b538.
56− e9b5.dba5.8189.dbbc.b5c0.fbcf.ec4d.3b2f.
57− 7137.4491.23ef.65cd.428a.2f98.d728.ae22
58− =+ ^= hax 0x5be0.cd19.137e.2179.1f83.d9ab.fb41.bd6b.
59− 9b05.688c.2b3e.6c1f.510e.527f.ade6.82d1.
60− a54f.f53a.5f1d.36f1.3c6e.f372.fe94.f82b.
61− bb67.ae85.84ca.a73b.6a09.e667.f3bc.c908
62− =+ i=0
63− |- ^- @
64− ?: =(i lex)
65− (rep 6 (turn (rip 6 hax) net))
66− =+ ^= wox
67− =+ dux=(cut 10 [i 1] ful)
68− =+ wox=(rep 6 (turn (rip 6 dux) net))
69− =+ j=16
70− |- ^- @
71− ?: =(80 j)
72− wox
73− =+ :* l=(wac (sub j 15) wox)
74− m=(wac (sub j 2) wox)
75− n=(wac (sub j 16) wox)
76− o=(wac (sub j 7) wox)
77− ==
78− =+ x=:(mix (ror 0 1 l) (ror 0 8 l) (rsh 0 7 l))
79− =+ y=:(mix (ror 0 19 m) (ror 0 61 m) (rsh 0 6 m))
80− =+ z=:(sum n x o y)
81− $(wox (con (lsh 6 j z) wox), j +(j))
82− =+ j=0
83− =+ :* a=(wac 0 hax)
84− b=(wac 1 hax)
85− c=(wac 2 hax)
86− d=(wac 3 hax)
87− e=(wac 4 hax)
88− f=(wac 5 hax)
89− g=(wac 6 hax)
90− h=(wac 7 hax)
91− ==
92− |- ^- @
93− ?: =(80 j)
94− %= ^$
95− i +(i)
96− hax %+ rep 6
97− :~ (sum a (wac 0 hax))
98− (sum b (wac 1 hax))
99− (sum c (wac 2 hax))
100− (sum d (wac 3 hax))
101− (sum e (wac 4 hax))
102− (sum f (wac 5 hax))
103− (sum g (wac 6 hax))
104− (sum h (wac 7 hax))
105− ==
106− ==
107− =+ l=:(mix (ror 0 28 a) (ror 0 34 a) (ror 0 39 a)) :: S0
108− =+ m=:(mix (dis a b) (dis a c) (dis b c)) :: maj
109− =+ n=(sum l m) :: t2
110− =+ o=:(mix (ror 0 14 e) (ror 0 18 e) (ror 0 41 e)) :: S1
111− =+ p=(mix (dis e f) (dis (inv e) g)) :: ch
112− =+ q=:(sum h o p (wac j kbx) (wac j wox)) :: t1
113− $(j +(j), a (sum q n), b a, c b, d c, e (sum d q), f e, g f, h g)
114− ::
115−
116−XX document
117−
118−
119−
120−***
docs/programming/advanced/library/src/3d/gate/sham.mddeleted−14
@@ -1,14 +0,0 @@
1−### `++sham`
2−
3− ++ sham :: noun hash
4− |= yux/* ^- @uvH ^- @
5− ?@ yux
6− (shaf %mash yux)
7− (shaf %sham (jam yux))
8− ::
9−
10−XX document
11−
12−
13−
14−***
docs/programming/advanced/library/src/3d/gate/shan.mddeleted−74
@@ -1,74 +0,0 @@
1−### `++shan`
2−
3− ++ shan :: sha-1 (deprecated)
4− |= ruz/@
5− =+ [few==>(fe .(a 5)) wac=|=({a/@ b/@} (cut 5 [a 1] b))]
6− =+ [sum=sum.few ror=ror.few rol=rol.few net=net.few inv=inv.few]
7− =+ ral=(lsh 0 3 (met 3 ruz))
8− =+ ^= ful
9− %+ can 0
10− :~ [ral ruz]
11− [8 128]
12− [(mod (sub 960 (mod (add 8 ral) 512)) 512) 0]
13− [64 (~(net fe 6) ral)]
14− ==
15− =+ lex=(met 9 ful)
16− =+ kbx=0xca62.c1d6.8f1b.bcdc.6ed9.eba1.5a82.7999
17− =+ hax=0xc3d2.e1f0.1032.5476.98ba.dcfe.efcd.ab89.6745.2301
18− =+ i=0
19− |-
20− ?: =(i lex)
21− (rep 5 (flop (rip 5 hax)))
22− =+ ^= wox
23− =+ dux=(cut 9 [i 1] ful)
24− =+ wox=(rep 5 (turn (rip 5 dux) net))
25− =+ j=16
26− |- ^- @
27− ?: =(80 j)
28− wox
29− =+ :* l=(wac (sub j 3) wox)
30− m=(wac (sub j 8) wox)
31− n=(wac (sub j 14) wox)
32− o=(wac (sub j 16) wox)
33− ==
34− =+ z=(rol 0 1 :(mix l m n o))
35− $(wox (con (lsh 5 j z) wox), j +(j))
36− =+ j=0
37− =+ :* a=(wac 0 hax)
38− b=(wac 1 hax)
39− c=(wac 2 hax)
40− d=(wac 3 hax)
41− e=(wac 4 hax)
42− ==
43− |- ^- @
44− ?: =(80 j)
45− %= ^$
46− i +(i)
47− hax %+ rep 5
48− :~
49− (sum a (wac 0 hax))
50− (sum b (wac 1 hax))
51− (sum c (wac 2 hax))
52− (sum d (wac 3 hax))
53− (sum e (wac 4 hax))
54− ==
55− ==
56− =+ fx=(con (dis b c) (dis (not 5 1 b) d))
57− =+ fy=:(mix b c d)
58− =+ fz=:(con (dis b c) (dis b d) (dis c d))
59− =+ ^= tem
60− ?: &((gte j 0) (lte j 19))
61− :(sum (rol 0 5 a) fx e (wac 0 kbx) (wac j wox))
62− ?: &((gte j 20) (lte j 39))
63− :(sum (rol 0 5 a) fy e (wac 1 kbx) (wac j wox))
64− ?: &((gte j 40) (lte j 59))
65− :(sum (rol 0 5 a) fz e (wac 2 kbx) (wac j wox))
66− :(sum (rol 0 5 a) fy e (wac 3 kbx) (wac j wox))
67− $(j +(j), a tem, b a, c (rol 0 30 b), d c, e d)
68− ::
69−
70−XX document
71−
72−
73−
74−***
docs/programming/advanced/library/src/3d/gate/shas.mddeleted−12
@@ -1,12 +0,0 @@
1−### `++shas`
2−
3− ++ shas :: salted hash
4− |= [sal/@ ruz/@]
5− (shax (mix sal (shax ruz)))
6− ::
7−
8−XX document
9−
10−
11−
12−***
docs/programming/advanced/library/src/3d/gate/shaw.mddeleted−10
@@ -1,10 +0,0 @@
1−### `++shaw`
2−
3− ++ shaw :: hash to nbits
4− |= [sal/@ len/@ ruz/@]
5− (~(raw og (shas sal (mix len ruz))) len)
6− ::
7−
8−
9−
10−***
docs/programming/advanced/library/src/3d/gate/shax.mddeleted−13
@@ -1,13 +0,0 @@
1−### `++shax`
2−
3−++ shax :: sha-256
4− ~/ %shax
5− |= ruz/@ ^- @
6− (shay [(met 3 ruz) ruz])
7−::
8−
9−XX document
10−
11−
12−
13−***
docs/programming/advanced/library/src/3d/gate/shaz.mddeleted−9
@@ -1,9 +0,0 @@
1−### `++shaz`
2−
3− ++ shaz :: sha-512
4− |= ruz/@ ^- @
5− (shal [(met 3 ruz) ruz])
6−
7−
8−
9−***
docs/programming/advanced/library/src/3d/title.mddeleted−1
@@ -1 +0,0 @@
1−# 3d: SHA hash family
docs/programming/advanced/library/src/3e/core/aesc.mddeleted−714
@@ -1,714 +0,0 @@
1−### `++aesc`
2−
3− ++ aesc :: AES-256
4− ~% %aesc + ~
5− |%
6−
7−XX document
8−
9−### `++en`
10−
11− ++ en :: ECB enc
12− ~/ %en
13− |= [a=@I b=@H] ^- @uxH
14− =+ ahem
15− (be & (ex a) b)
16−
17−XX document
18−
19−### `++de`
20−
21− ++ de :: ECB dec
22− ~/ %de
23− |= [a=@I b=@H] ^- @uxH
24− =+ ahem
25− (be | (ix (ex a)) b)
26− --
27−
28−XX document
29−
30−### `++ahem`
31−
32− ++ ahem :: AES helpers
33− :: XX should be in aesc, isn't for performance reasons
34− =>
35− =+ =+ [gr=(ga 8 0x11b 3) few==>(fe .(a 5))]
36− =+ [pro=pro.gr dif=dif.gr pow=pow.gr ror=ror.few]
37− [pro=pro dif=dif pow=pow ror=ror nnk=8 nnb=4 nnr=14]
38− => |%
39−
40−XX document
41−
42−### `++cipa`
43−
44− ++ cipa :: AES params
45− $_ ^? |%
46−
47−XX document
48−
49−### `++co`
50−
51− ++ co [0xe 0xb 0xd 0x9]
52−
53−XX document
54−
55−### `++ix`
56−
57− ++ ix :: key expand, inv
58− |= a=@ ^- @
59− =+ [i=1 j=_@ b=_@ c=co:pin]
60− |-
61− ?: =(nnr i)
62− a
63− => .(b (cut 7 [i 1] a))
64− => .(b (rep 5 (mcol (pode 5 4 b) c)))
65− => .(j (sub nnr i))
66− %= $
67− i +(i)
68− a
69− %+ can 7
70− :~ [i (cut 7 [0 i] a)]
71− [1 b]
72− [j (cut 7 [+(i) j] a)]
73− ==
74− ==
75− --
76− ::
77−
78−XX document
79−
80−### `++ro`
81−
82− ++ ro [0 3 2 1]
83−
84−XX document
85−
86−### `++su`
87−
88− ++ su 0x7d0c.2155.6314.69e1.26d6.77ba.7e04.2b17.
89− 6199.5383.3cbb.ebc8.b0f5.2aae.4d3b.e0a0.
90− ef9c.c993.9f7a.e52d.0d4a.b519.a97f.5160.
91− 5fec.8027.5910.12b1.31c7.0788.33a8.dd1f.
92− f45a.cd78.fec0.db9a.2079.d2c6.4b3e.56fc.
93− 1bbe.18aa.0e62.b76f.89c5.291d.711a.f147.
94− 6edf.751c.e837.f9e2.8535.ade7.2274.ac96.
95− 73e6.b4f0.cecf.f297.eadc.674f.4111.913a.
96− 6b8a.1301.03bd.afc1.020f.3fca.8f1e.2cd0.
97− 0645.b3b8.0558.e4f7.0ad3.bc8c.00ab.d890.
98− 849d.8da7.5746.155e.dab9.edfd.5048.706c.
99− 92b6.655d.cc5c.a4d4.1698.6886.64f6.f872.
100− 25d1.8b6d.49a2.5b76.b224.d928.66a1.2e08.
101− 4ec3.fa42.0b95.4cee.3d23.c2a6.3294.7b54.
102− cbe9.dec4.4443.8e34.87ff.2f9b.8239.e37c.
103− fbd7.f381.9ea3.40bf.38a5.3630.d56a.0952
104− --
105− ::
106−
107−XX document
108−
109−### `++pen`
110−
111− ++ pen :: encrypt
112− ^- cipa
113− |%
114−
115−XX document
116−
117−### `++co`
118−
119− ++ co [0xe 0xb 0xd 0x9]
120−
121−XX document
122−
123−### `++ix`
124−
125− ++ ix :: key expand, inv
126− |= a=@ ^- @
127− =+ [i=1 j=_@ b=_@ c=co:pin]
128− |-
129− ?: =(nnr i)
130− a
131− => .(b (cut 7 [i 1] a))
132− => .(b (rep 5 (mcol (pode 5 4 b) c)))
133− => .(j (sub nnr i))
134− %= $
135− i +(i)
136− a
137− %+ can 7
138− :~ [i (cut 7 [0 i] a)]
139− [1 b]
140− [j (cut 7 [+(i) j] a)]
141− ==
142− ==
143− --
144− ::
145−
146−XX document
147−
148−### `++ro`
149−
150− ++ ro [0 3 2 1]
151−
152−XX document
153−
154−### `++su`
155−
156− ++ su 0x7d0c.2155.6314.69e1.26d6.77ba.7e04.2b17.
157− 6199.5383.3cbb.ebc8.b0f5.2aae.4d3b.e0a0.
158− ef9c.c993.9f7a.e52d.0d4a.b519.a97f.5160.
159− 5fec.8027.5910.12b1.31c7.0788.33a8.dd1f.
160− f45a.cd78.fec0.db9a.2079.d2c6.4b3e.56fc.
161− 1bbe.18aa.0e62.b76f.89c5.291d.711a.f147.
162− 6edf.751c.e837.f9e2.8535.ade7.2274.ac96.
163− 73e6.b4f0.cecf.f297.eadc.674f.4111.913a.
164− 6b8a.1301.03bd.afc1.020f.3fca.8f1e.2cd0.
165− 0645.b3b8.0558.e4f7.0ad3.bc8c.00ab.d890.
166− 849d.8da7.5746.155e.dab9.edfd.5048.706c.
167− 92b6.655d.cc5c.a4d4.1698.6886.64f6.f872.
168− 25d1.8b6d.49a2.5b76.b224.d928.66a1.2e08.
169− 4ec3.fa42.0b95.4cee.3d23.c2a6.3294.7b54.
170− cbe9.dec4.4443.8e34.87ff.2f9b.8239.e37c.
171− fbd7.f381.9ea3.40bf.38a5.3630.d56a.0952
172− --
173− ::
174−
175−XX document
176−
177−### `++pin`
178−
179− ++ pin :: decrypt
180− ^- cipa
181− |%
182−
183−XX document
184−
185−### `++co`
186−
187− ++ co [0xe 0xb 0xd 0x9]
188−
189−XX document
190−
191−### `++ix`
192−
193− ++ ix :: key expand, inv
194− |= a=@ ^- @
195− =+ [i=1 j=_@ b=_@ c=co:pin]
196− |-
197− ?: =(nnr i)
198− a
199− => .(b (cut 7 [i 1] a))
200− => .(b (rep 5 (mcol (pode 5 4 b) c)))
201− => .(j (sub nnr i))
202− %= $
203− i +(i)
204− a
205− %+ can 7
206− :~ [i (cut 7 [0 i] a)]
207− [1 b]
208− [j (cut 7 [+(i) j] a)]
209− ==
210− ==
211− --
212− ::
213−
214−XX document
215−
216−### `++ro`
217−
218− ++ ro [0 3 2 1]
219−
220−XX document
221−
222−### `++su`
223−
224− ++ su 0x7d0c.2155.6314.69e1.26d6.77ba.7e04.2b17.
225− 6199.5383.3cbb.ebc8.b0f5.2aae.4d3b.e0a0.
226− ef9c.c993.9f7a.e52d.0d4a.b519.a97f.5160.
227− 5fec.8027.5910.12b1.31c7.0788.33a8.dd1f.
228− f45a.cd78.fec0.db9a.2079.d2c6.4b3e.56fc.
229− 1bbe.18aa.0e62.b76f.89c5.291d.711a.f147.
230− 6edf.751c.e837.f9e2.8535.ade7.2274.ac96.
231− 73e6.b4f0.cecf.f297.eadc.674f.4111.913a.
232− 6b8a.1301.03bd.afc1.020f.3fca.8f1e.2cd0.
233− 0645.b3b8.0558.e4f7.0ad3.bc8c.00ab.d890.
234− 849d.8da7.5746.155e.dab9.edfd.5048.706c.
235− 92b6.655d.cc5c.a4d4.1698.6886.64f6.f872.
236− 25d1.8b6d.49a2.5b76.b224.d928.66a1.2e08.
237− 4ec3.fa42.0b95.4cee.3d23.c2a6.3294.7b54.
238− cbe9.dec4.4443.8e34.87ff.2f9b.8239.e37c.
239− fbd7.f381.9ea3.40bf.38a5.3630.d56a.0952
240− --
241− ::
242−
243−XX document
244−
245−### `++mcol`
246−
247− ++ mcol
248− |= [a=(list ,@) b=[p=@ q=@ r=@ s=@]] ^- (list ,@)
249− =+ c=[p=_@ q=_@ r=_@ s=_@]
250− |- ^- (list ,@)
251− ?~ a ~
252− => .(p.c (cut 3 [0 1] i.a))
253− => .(q.c (cut 3 [1 1] i.a))
254− => .(r.c (cut 3 [2 1] i.a))
255− => .(s.c (cut 3 [3 1] i.a))
256− :_ $(a t.a)
257− %+ rep 3
258− %+ turn
259− %- limo
260− :~ [[p.c p.b] [q.c q.b] [r.c r.b] [s.c s.b]]
261− [[p.c s.b] [q.c p.b] [r.c q.b] [s.c r.b]]
262− [[p.c r.b] [q.c s.b] [r.c p.b] [s.c q.b]]
263− [[p.c q.b] [q.c r.b] [r.c s.b] [s.c p.b]]
264− ==
265− |= [a=[@ @] b=[@ @] c=[@ @] d=[@ @]]
266− :(dif (pro a) (pro b) (pro c) (pro d))
267− ::
268−
269−XX document
270−
271−### `++pode`
272−
273− ++ pode :: explode to block
274− |= [a=bloq b=@ c=@] ^- (list ,@)
275− =+ d=(rip a c)
276− =+ m=(met a c)
277− |-
278− ?: =(m b)
279− d
280− $(m +(m), d (weld d (limo [0 ~])))
281−
282−XX document
283−
284−### `++sube`
285−
286− ++ sube :: s-box word
287− |= [a=@ b=@] ^- @
288− (rep 3 (turn (pode 3 4 a) |=(c=@ (cut 3 [c 1] b))))
289− --
290− |%
291−
292−XX document
293−
294−### `++be`
295−
296− ++ be :: block cipher
297− |= [a=? b=@ c=@H] ^- @uxH
298− ~| %be-aesc
299− => %= .
300− +
301− => +
302− |%
303−
304−XX document
305−
306−### `++ankh`
307−
308− ++ ankh
309− |= [a=cipa b=@ c=@]
310− (pode 5 nnb (cut 5 [(mul (ix.a b) nnb) nnb] c))
311−
312−XX document
313−
314−### `++sark`
315−
316− ++ sark
317− |= [c=(list ,@) d=(list ,@)] ^- (list ,@)
318− ?~ c ~
319− ?~ d !!
320− [(mix i.c i.d) $(c t.c, d t.d)]
321−
322−XX document
323−
324−### `++srow`
325−
326− ++ srow
327− |= [a=cipa b=(list ,@)] ^- (list ,@)
328− =+ [c=0 d=~ e=ro.a]
329− |-
330− ?: =(c nnb)
331− d
332− :_ $(c +(c))
333− %+ rep 3
334− %+ turn
335− (limo [0 p.e] [1 q.e] [2 r.e] [3 s.e] ~)
336− |= [f=@ g=@]
337− (cut 3 [f 1] (snag (mod (add g c) nnb) b))
338−
339−XX document
340−
341−### `++subs`
342−
343− ++ subs
344− |= [a=cipa b=(list ,@)] ^- (list ,@)
345− ?~ b ~
346− [(sube i.b su.a) $(b t.b)]
347− --
348− ==
349− =+ [d=?:(a pen pin) e=(pode 5 nnb c) f=1]
350− => .(e (sark e (ankh d 0 b)))
351− |-
352− ?. =(nnr f)
353− => .(e (subs d e))
354− => .(e (srow d e))
355− => .(e (mcol e co.d))
356− => .(e (sark e (ankh d f b)))
357− $(f +(f))
358− => .(e (subs d e))
359− => .(e (srow d e))
360− => .(e (sark e (ankh d nnr b)))
361− (rep 5 e)
362−
363−XX document
364−
365−### `++ex`
366−
367− ++ ex :: key expand
368− |= a=@I ^- @
369− =+ [b=a c=0 d=su:pen i=nnk]
370− |-
371− ?: =(i (mul nnb +(nnr)))
372− b
373− => .(c (cut 5 [(dec i) 1] b))
374− => ?: =(0 (mod i nnk))
375− => .(c (ror 3 1 c))
376− => .(c (sube c d))
377− .(c (mix c (pow (dec (div i nnk)) 2)))
378− ?: &((gth nnk 6) =(4 (mod i nnk)))
379− .(c (sube c d))
380− .
381− => .(c (mix c (cut 5 [(sub i nnk) 1] b)))
382− => .(b (can 5 [i b] [1 c] ~))
383− $(i +(i))
384−
385−XX document
386−
387−### `++ix`
388−
389− ++ ix :: key expand, inv
390− |= a=@ ^- @
391− =+ [i=1 j=_@ b=_@ c=co:pin]
392− |-
393− ?: =(nnr i)
394− a
395− => .(b (cut 7 [i 1] a))
396− => .(b (rep 5 (mcol (pode 5 4 b) c)))
397− => .(j (sub nnr i))
398− %= $
399− i +(i)
400− a
401− %+ can 7
402− :~ [i (cut 7 [0 i] a)]
403− [1 b]
404− [j (cut 7 [+(i) j] a)]
405− ==
406− ==
407− --
408− ::
409−
410−XX document
411−
412−### `++curt`
413−
414− ++ curt :: curve25519
415− |= [a=@ b=@]
416− => %= .
417− +
418− => +
419− =+ =+ [p=486.662 q=(sub (bex 255) 19)]
420− =+ fq=~(. fo q)
421− [p=p q=q fq=fq]
422− |%
423−
424−XX document
425−
426−### `++cla`
427−
428− ++ cla
429− |= raw=@
430− =+ low=(dis 248 (cut 3 [0 1] raw))
431− =+ hih=(con 64 (dis 127 (cut 3 [31 1] raw)))
432− =+ mid=(cut 3 [1 30] raw)
433− (can 3 [[1 low] [30 mid] [1 hih] ~])
434−
435−XX document
436−
437−### `++sqr`
438−
439− ++ sqr |=(a=@ (mul a a))
440−
441−XX document
442−
443−### `++inv`
444−
445− ++ inv |=(a=@ (~(exp fo q) (sub q 2) a))
446−
447−XX document
448−
449−### `++cad`
450−
451− ++ cad
452− |= [n=[x=@ z=@] m=[x=@ z=@] d=[x=@ z=@]]
453− =+ ^= xx
454− ;: mul 4 z.d
455− %- sqr %- abs:si
456− %+ dif:si
457− (sun:si (mul x.m x.n))
458− (sun:si (mul z.m z.n))
459− ==
460− =+ ^= zz
461− ;: mul 4 x.d
462− %- sqr %- abs:si
463− %+ dif:si
464− (sun:si (mul x.m z.n))
465− (sun:si (mul z.m x.n))
466− ==
467− [(sit.fq xx) (sit.fq zz)]
468−
469−XX document
470−
471−### `++cub`
472−
473− ++ cub
474− |= [x=@ z=@]
475− =+ ^= xx
476− %+ mul
477− %- sqr %- abs:si
478− (dif:si (sun:si x) (sun:si z))
479− (sqr (add x z))
480− =+ ^= zz
481− ;: mul 4 x z
482− :(add (sqr x) :(mul p x z) (sqr z))
483− ==
484− [(sit.fq xx) (sit.fq zz)]
485− --
486− ==
487− =+ one=[b 1]
488− =+ i=253
489− =+ r=one
490− =+ s=(cub one)
491− |-
492− ?: =(i 0)
493− =+ x=(cub r)
494− (sit.fq (mul -.x (inv +.x)))
495− =+ m=(rsh 0 i a)
496− ?: =(0 (mod m 2))
497− $(i (dec i), s (cad r s one), r (cub r))
498− $(i (dec i), r (cad r s one), s (cub s))
499− ::
500−
501−XX document
502−
503−### `++ed`
504−
505− ++ ed :: ed25519
506− =>
507− =+ =+ [b=256 q=(sub (bex 255) 19)]
508− =+ fq=~(. fo q)
509− =+ ^= l
510− %+ add
511− (bex 252)
512− 27.742.317.777.372.353.535.851.937.790.883.648.493
513− =+ d=(dif.fq 0 (fra.fq 121.665 121.666))
514− =+ ii=(exp.fq (div (dec q) 4) 2)
515− [b=b q=q fq=fq l=l d=d ii=ii]
516− ~% %coed +> ~
517− |%
518−
519−### `++norm`
520−
521− ++ norm |=(x=@ ?:(=(0 (mod x 2)) x (sub q x)))
522− ::
523−
524−XX document
525−
526−### `++xrec`
527−
528− ++ xrec :: recover x-coord
529− |= y=@ ^- @
530− =+ ^= xx
531− %+ mul (dif.fq (mul y y) 1)
532− (inv.fq +(:(mul d y y)))
533− =+ x=(exp.fq (div (add 3 q) 8) xx)
534− ?: !=(0 (dif.fq (mul x x) (sit.fq xx)))
535− (norm (pro.fq x ii))
536− (norm x)
537− ::
538−
539−XX document
540−
541−### `++ward`
542−
543− ++ ward :: edwards multiply
544− |= [pp=[@ @] qq=[@ @]] ^- [@ @]
545− =+ dp=:(pro.fq d -.pp -.qq +.pp +.qq)
546− =+ ^= xt
547− %+ pro.fq
548− %+ sum.fq
549− (pro.fq -.pp +.qq)
550− (pro.fq -.qq +.pp)
551− (inv.fq (sum.fq 1 dp))
552− =+ ^= yt
553− %+ pro.fq
554− %+ sum.fq
555− (pro.fq +.pp +.qq)
556− (pro.fq -.pp -.qq)
557− (inv.fq (dif.fq 1 dp))
558− [xt yt]
559− ::
560−
561−XX document
562−
563−### `++scam`
564−
565− ++ scam :: scalar multiply
566− |= [pp=[@ @] e=@] ^- [@ @]
567− ?: =(0 e)
568− [0 1]
569− =+ qq=$(e (div e 2))
570− => .(qq (ward qq qq))
571− ?: =(1 (dis 1 e))
572− (ward qq pp)
573− qq
574− ::
575−
576−XX document
577−
578−### `++etch`
579−
580− ++ etch :: encode point
581− |= pp=[@ @] ^- @
582− (can 0 ~[[(sub b 1) +.pp] [1 (dis 1 -.pp)]])
583− ::
584−
585−XX document
586−
587−### `++curv`
588−
589− ++ curv :: point on curve?
590− |= [x=@ y=@] ^- ?
591− .= 0
592− %+ dif.fq
593− %+ sum.fq
594− (pro.fq (sub q (sit.fq x)) x)
595− (pro.fq y y)
596− (sum.fq 1 :(pro.fq d x x y y))
597− ::
598−
599−XX document
600−
601−### `++deco`
602−
603− ++ deco :: decode point
604− |= s=@ ^- (unit ,[@ @])
605− =+ y=(cut 0 [0 (dec b)] s)
606− =+ si=(cut 0 [(dec b) 1] s)
607− =+ x=(xrec y)
608− => .(x ?:(!=(si (dis 1 x)) (sub q x) x))
609− =+ pp=[x y]
610− ?. (curv pp)
611− ~
612− [~ pp]
613− ::
614−
615−XX document
616−
617−### `++bb`
618−
619− ++ bb
620− =+ bby=(pro.fq 4 (inv.fq 5))
621− [(xrec bby) bby]
622− ::
623− --
624− ~% %ed + ~
625− |%
626−
627−XX document
628−
629−### `++puck`
630−
631− ++ puck :: public key
632− ~/ %puck
633− |= sk=@I ^- @
634− ?: (gth (met 3 sk) 32) !!
635− =+ h=(shal (rsh 0 3 b) sk)
636− =+ ^= a
637− %+ add
638− (bex (sub b 2))
639− (lsh 0 3 (cut 0 [3 (sub b 5)] h))
640− =+ aa=(scam bb a)
641− (etch aa)
642−
643−XX document
644−
645−### `++suck`
646−
647− ++ suck :: keypair from seed
648− |= se=@I ^- @uJ
649− =+ pu=(puck se)
650− (can 0 ~[[b se] [b pu]])
651− ::
652−
653−XX document
654−
655−### `++sign`
656−
657− ++ sign :: certify
658− ~/ %sign
659− |= [m=@ se=@] ^- @
660− =+ sk=(suck se)
661− =+ pk=(cut 0 [b b] sk)
662− =+ h=(shal (rsh 0 3 b) sk)
663− =+ ^= a
664− %+ add
665− (bex (sub b 2))
666− (lsh 0 3 (cut 0 [3 (sub b 5)] h))
667− =+ ^= r
668− =+ hm=(cut 0 [b b] h)
669− =+ ^= i
670− %+ can 0
671− :~ [b hm]
672− [(met 0 m) m]
673− ==
674− (shaz i)
675− =+ rr=(scam bb r)
676− =+ ^= ss
677− =+ er=(etch rr)
678− =+ ^= ha
679− %+ can 0
680− :~ [b er]
681− [b pk]
682− [(met 0 m) m]
683− ==
684− (~(sit fo l) (add r (mul (shaz ha) a)))
685− (can 0 ~[[b (etch rr)] [b ss]])
686− ::
687−
688−XX document
689−
690−### `++veri`
691−
692− ++ veri :: validate
693− ~/ %veri
694− |= [s=@ m=@ pk=@] ^- ?
695− ?: (gth (div b 4) (met 3 s)) |
696− ?: (gth (div b 8) (met 3 pk)) |
697− =+ cb=(rsh 0 3 b)
698− =+ rr=(deco (cut 0 [0 b] s))
699− ?~ rr |
700− =+ aa=(deco pk)
701− ?~ aa |
702− =+ ss=(cut 0 [b b] s)
703− =+ ha=(can 3 ~[[cb (etch u.rr)] [cb pk] [(met 3 m) m]])
704− =+ h=(shaz ha)
705− =((scam bb ss) (ward u.rr (scam u.aa h)))
706− ::
707− --
708− ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
709−
710−XX document
711−
712−
713−
714−***
docs/programming/advanced/library/src/3e/title.mddeleted−1
@@ -1 +0,0 @@
1−# 3e: AES encryption
docs/programming/advanced/library/src/3f/core/ob.mddeleted−265
@@ -1,265 +0,0 @@
1−### `++ob`
2−
3−Reversible scrambling core, v2
4−
5− ++ ob
6− |%
7−
8−A core for performing reversible scrambling operations for the `@p` phonetic base.
9−
10−------------------------------------------------------------------------
11−
12−### `++feen`
13−
14−Conceal structure, v2
15−
16−Randomly permutes atoms that fit into 17 to 32 bits into one another. If the
17−atom fits into 33 to 64 bits, does the same permutation on the low 32 bits
18−only. Otherwise, passes the atom through unchanged.
19−
20−Accepts
21−-------
22−
23−An atom.
24−
25−Produces
26−--------
27−
28−An atom.
29−
30−Source
31−------
32−
33− ++ feen :: conceal structure v2
34− |= pyn/@ ^- @
35− ?: &((gte pyn 0x1.0000) (lte pyn 0xffff.ffff))
36− (add 0x1.0000 (fice (sub pyn 0x1.0000)))
37− ?: &((gte pyn 0x1.0000.0000) (lte pyn 0xffff.ffff.ffff.ffff))
38− =+ lo=(dis pyn 0xffff.ffff)
39− =+ hi=(dis pyn 0xffff.ffff.0000.0000)
40− %+ con hi
41− (add 0x1.0000 (fice (sub lo 0x1.0000)))
42− pyn
43− ::
44−
45−
46−Examples
47−--------
48−
49−XX
50−
51−------------------------------------------------------------------------
52−
53−### `++fend`
54−
55−XX
56−
57−Randomly permutes atoms that fit into 17 to 32 bits into one another, and
58−randomly permutes the low 32 bits of atoms that fit into 33 to 64 bits;
59−otherwise, passes the atom through unchanged. The permutation is the inverse of
60−the one applied by `++feen`.
61−
62−Accepts
63−-------
64−
65−An atom.
66−
67−Produces
68−--------
69−
70−An atom.
71−
72−Source
73−------
74−
75− ++ fend :: restore structure v2
76− |= cry/@ ^- @
77− ?: &((gte cry 0x1.0000) (lte cry 0xffff.ffff))
78− (add 0x1.0000 (teil (sub cry 0x1.0000)))
79− ?: &((gte cry 0x1.0000.0000) (lte cry 0xffff.ffff.ffff.ffff))
80− =+ lo=(dis cry 0xffff.ffff)
81− =+ hi=(dis cry 0xffff.ffff.0000.0000)
82− %+ con hi
83− (add 0x1.0000 (teil (sub lo 0x1.0000)))
84− cry
85− ::
86−
87−Examples
88−--------
89−
90−------------------------------------------------------------------------
91−
92−### `++fice`
93−
94−XX
95−
96−
97−Accepts
98−-------
99−
100−An atom.
101−
102−Produces
103−--------
104−
105−An atom.
106−
107−Source
108−------
109−
110− ++ fice :: adapted from
111− |= nor/@ :: black and rogaway
112− ^- @ :: "ciphers with
113− =+ ^= sel :: arbitrary finite
114− %+ rynd 2 :: domains", 2002
115− %+ rynd 1
116− %+ rynd 0
117− [(mod nor 65.535) (div nor 65.535)]
118− (add (mul 65.535 -.sel) +.sel)
119− ::
120−
121−
122−Examples
123−--------
124−
125−------------------------------------------------------------------------
126−
127−### `++teil`
128−
129−XX
130−
131−Applies the reverse of the Feistel-like cipher applied by `++fice`. Unlike
132−a conventional Feistel cipher that is its own inverse if keys are used in
133−reverse order, this Feistel-like cipher uses two moduli that must be swapped
134−when applying the reverse transformation.
135−
136−Accepts
137−-------
138−
139−An atom.
140−
141−Produces
142−--------
143−
144−An atom.
145−
146−Source
147−------
148−
149− ++ teil :: reverse ++fice
150− |= vip/@
151− ^- @
152− =+ ^= sel
153− %+ rund 0
154− %+ rund 1
155− %+ rund 2
156− [(mod vip 65.535) (div vip 65.535)]
157− (add (mul 65.535 -.sel) +.sel)
158− ::
159−
160−
161−
162−Examples
163−--------
164−
165−------------------------------------------------------------------------
166−
167−### `++rynd`
168−
169−XX
170−
171−A single round of the Feistel-like cipher `++fice`. AES (`++aesc`) is
172−used as the round function.
173−
174−Accepts
175−-------
176−
177−A cell of three atoms, `n`, `l`, and `r`.
178−
179−Produces
180−--------
181−
182−A cell of two atoms.
183−
184−Source
185−------
186−
187− ++ rynd :: feistel round
188− |= [n/@ l/@ r/@]
189− ^- [@ @]
190− :- r
191− ?~ (mod n 2)
192− (~(sum fo 65.535) l (en:aesc (snag n raku) r))
193− (~(sum fo 65.536) l (en:aesc (snag n raku) r))
194−
195−Examples
196−--------
197−
198−------------------------------------------------------------------------
199−
200−### `++rund`
201−
202−XX
203−
204−A single round of the Feistel-like reverse cipher `++teil`.
205−
206−Accepts
207−-------
208−
209−A cell of three atoms, `n`, `l`, and `r`.
210−
211−Produces
212−--------
213−
214−A cell of two atoms.
215−
216−Source
217−------
218−
219− ++ rund :: reverse round
220− |= {n/@ l/@ r/@}
221− ^- {@ @}
222− :- r
223− ?~ (mod n 2)
224− (~(dif fo 65.535) l (en:aesc (snag n raku) r))
225− (~(dif fo 65.536) l (en:aesc (snag n raku) r))
226−
227−Examples
228−--------
229−
230−------------------------------------------------------------------------
231−
232−### `++raku`
233−
234−XX
235−
236−
237−Accepts
238−-------
239−
240−A list of atoms of odor `@ux` (hexadecimal).
241−
242−Produces
243−--------
244−
245−Arbitrary keys for use with `++aesc`.
246−
247−Source
248−------
249−
250− ++ raku
251− ^- (list ,@ux)
252− :~ 0x15f6.25e3.083a.eb3e.7a55.d4db.fb99.32a3.
253− 43af.2750.219e.8a24.e5f8.fac3.6c36.f968
254− 0xf2ff.24fe.54d0.1abd.4b2a.d8aa.4402.8e88.
255− e82f.19ec.948d.b1bb.ed2e.f791.83a3.8133
256− 0xa3d8.6a7b.400e.9e91.187d.91a7.6942.f34a.
257− 6f5f.ab8e.88b9.c089.b2dc.95a6.aed5.e3a4
258− ==
259−
260−Examples
261−--------
262−
263−
264−
265−***
docs/programming/advanced/library/src/3f/core/un.mddeleted−369
@@ -1,369 +0,0 @@
1−### `++un`
2−
3−Reversible scrambling core
4−
5− ++ un :: =(x (wred (wren x)))
6− |%
7−
8−A core that contains arms that perform reversible scrambling operations.
9−Used in the `@p` phonetic base.
10−
11−------------------------------------------------------------------------
12−
13−### `++wren`
14−
15−Conceal structure
16−
17−Scrambles a bytestring `pyn` by adding the current position to each
18−byte, looking it up in an s-box, and then performing the XOR operation
19−on the result, pushing it forward. Produces an atom.
20−
21−Accepts
22−-------
23−
24−`pyn` is an atom.
25−
26−
27−Produces
28−--------
29−
30−An atom.
31−
32−Source
33−------
34−
35− ++ wren :: conceal structure
36− |= pyn/@ ^- @
37− =+ len=(met 3 pyn)
38− ?: =(0 len)
39− 0
40− => .(len (dec len))
41− =+ mig=(zaft (xafo len (cut 3 [len 1] pyn)))
42− %+ can 3
43− %- flop ^- (list {@ @})
44− :- [1 mig]
45− |- ^- (list {@ @})
46− ?: =(0 len)
47− ~
48− => .(len (dec len))
49− =+ mog=(zyft :(mix mig (end 3 1 len) (cut 3 [len 1] pyn)))
50− [[1 mog] $(mig mog)]
51− ::
52−
53−
54−Examples
55−--------
56−
57− ~zod/try=> `@ux`(wren:un 'testing')
58− 0x30.bf6a.b9fe.7d8f
59− ~zod/try=> `@ux`'testing'
60− 0x67.6e69.7473.6574
61− ~zod/try=> `@da`(wred:un (wren:un ~2001.2.5))
62− ~2001.2.5
63−
64−------------------------------------------------------------------------
65−
66−### `++wred`
67−
68−Restore structure
69−
70−Unscrambles a bytestring `cry` by subtracting the current position from
71−each byte, looking it up in an s-box, and performing the XOR operation
72−on the result, pushing it forward. Produces an atom.
73−
74−Accepts
75−-------
76−
77−`cry` is an atom.
78−
79−Produces
80−--------
81−
82−Source
83−------
84−
85− ++ wred :: restore structure
86− |= cry/@ ^- @
87− =+ len=(met 3 cry)
88− ?: =(0 len)
89− 0
90− => .(len (dec len))
91− =+ mig=(cut 3 [len 1] cry)
92− %+ can 3
93− %- flop ^- (list {@ @})
94− :- [1 (xaro len (zart mig))]
95− |- ^- (list {@ @})
96− ?: =(0 len)
97− ~
98− => .(len (dec len))
99− =+ mog=(cut 3 [len 1] cry)
100− [[1 :(mix mig (end 3 1 len) (zyrt mog))] $(mig mog)]
101− ::
102−
103−Examples
104−--------
105−
106− ~zod/try=> (wred:un 0x30.bf6a.b9fe.7d8f)
107− 29.113.321.805.538.676
108− ~zod/try=> `@t`(wred:un 0x30.bf6a.b9fe.7d8f)
109− 'testing'
110− ~zod/try=> (wred:un (wren:un 200.038.426))
111− 200.038.426
112−
113−------------------------------------------------------------------------
114−
115−### `++xafo`
116−
117−Add modulo 255
118−
119−Produces the sum of two atoms modulo 255, encoded as a nonzero byte.
120−
121−Accepts
122−-------
123−
124−A cell of two atoms, `a` and `b`.
125−
126−Source
127−------
128−
129− ++ xafo |=([a/@ b/@] +((mod (add (dec b) a) 255)))
130−
131−Examples
132−--------
133−
134− ~zod/try=> (xafo:un 5 6)
135− 11
136− ~zod/try=> (xafo:un 256 20)
137− 21
138−
139−------------------------------------------------------------------------
140−
141−### `++xaro`
142−
143−Subtract modulo 255
144−
145−Produces the difference between two atoms modulo 255, encoded as a
146−nonzero byte.
147−
148−Accepts
149−-------
150−
151−A cell of two atoms, `a` and `b`.
152−
153−Produces
154−--------
155−
156−An atom.
157−
158−Source
159−------
160−
161− ++ xaro |=([a/@ b/@] +((mod (add (dec b) (sub 255 (mod a 255))) 255)))
162−
163−Examples
164−--------
165−
166− ~zod/try=> (xaro:un 17 57)
167− 40
168− ~zod/try=> (xaro:un 265 12)
169− 2
170−
171−------------------------------------------------------------------------
172−
173−### `++zaft`
174−
175−Look up in 255 sub box
176−
177−The inverse of `++zart`. Looks up a nonzero byte `a`in a substiution
178−box with 255 values, producing a unique nonzero byte.
179−
180−Accepts
181−-------
182−
183−`a` is an atom of one byte in length.
184−
185−
186−Produces
187−--------
188−
189−An atom.
190−
191−Source
192−------
193−
194− ++ zaft :: forward 255-sbox
195− |= a/@D
196− =+ ^= b
197− 0xcc.75bc.86c8.2fb1.9a42.f0b3.79a0.92ca.21f6.1e41.cde5.fcc0.
198− 7e85.51ae.1005.c72d.1246.07e8.7c64.a914.8d69.d9f4.59c2.8038.
199− 1f4a.dca2.6fdf.66f9.f561.a12e.5a16.f7b0.a39f.364e.cb70.7318.
200− 1de1.ad31.63d1.abd4.db68.6a33.134d.a760.edee.5434.493a.e323.
201− 930d.8f3d.3562.bb81.0b24.43cf.bea5.a6eb.52b4.0229.06b2.6704.
202− 78c9.45ec.d75e.58af.c577.b7b9.c40e.017d.90c3.87f8.96fa.1153.
203− 0372.7f30.1c32.ac83.ff17.c6e4.d36d.6b55.e2ce.8c71.8a5b.b6f3.
204− 9d4b.eab5.8b3c.e7f2.a8fe.9574.5de0.bf20.3f15.9784.9939.5f9c.
205− e609.564f.d8a4.b825.9819.94aa.2c08.8e4c.9b22.477a.2840.3ed6.
206− 3750.6ef1.44dd.89ef.6576.d00a.fbda.9ed2.3b6c.7b0c.bde9.2ade.
207− 5c88.c182.481a.1b0f.2bfd.d591.2726.57ba
208− (cut 3 [(dec a) 1] b)
209− ::
210−
211−Examples
212−--------
213−
214− ~zod/try=> (zaft:un 0x12)
215− 42
216− ~zod/try=> (zaft:un 0xff)
217− 204
218− ~zod/try=> (zaft:un 0x0)
219− ! decrement-underflow
220− ! exit
221−
222−------------------------------------------------------------------------
223−
224−### `++zart`
225−
226−Reverse look up in 255 sub box
227−
228−The inverse of `++zaft`. Looks up the index of a nonzero byte `a` in
229−the substitution box with 255 values, producing a unique nonzero byte.
230−
231−Accepts
232−-------
233−
234−`a` is an atom of one byte in length.
235−
236−Produces
237−--------
238−
239−An atom.
240−
241−Source
242−------
243−
244− ++ zart :: reverse 255-sbox
245− |= a/@D
246− =+ ^= b
247− 0x68.4f07.ea1c.73c9.75c2.efc8.d559.5125.f621.a7a8.8591.5613.
248− dd52.40eb.65a2.60b7.4bcb.1123.ceb0.1bd6.3c84.2906.b164.19b3.
249− 1e95.5fec.ffbc.f187.fbe2.6680.7c77.d30e.e94a.9414.fd9a.017d.
250− 3a7e.5a55.8ff5.8bf9.c181.e5b6.6ab2.35da.50aa.9293.3bc0.cdc6.
251− f3bf.1a58.4130.f844.3846.744e.36a0.f205.789e.32d8.5e54.5c22.
252− 0f76.fce7.4569.0d99.d26e.e879.dc16.2df4.887f.1ffe.4dba.6f5d.
253− bbcc.2663.1762.aed7.af8a.ca20.dbb4.9bc7.a942.834c.105b.c4d4.
254− 8202.3e61.a671.90e6.273d.bdab.3157.cfa4.0c2e.df86.2496.f7ed.
255− 2b48.2a9d.5318.a343.d128.be9c.a5ad.6bb5.6dfa.c5e1.3408.128d.
256− 2c04.0339.97a1.2ff0.49d0.eeb8.6c0a.0b37.b967.c347.d9ac.e072.
257− e409.7b9f.1598.1d3f.33de.8ce3.8970.8e7a
258− (cut 3 [(dec a) 1] b)
259− ::
260−
261−Examples
262−--------
263−
264− ~zod/try=> `@ux`(zart:un 204)
265− 0xff
266− ~zod/try=> `@ux`(zart:un 42)
267− 0x12
268−
269−------------------------------------------------------------------------
270−
271−### `++zyft`
272−
273−Lookup byte in 256 sub box
274−
275−The inverse of `++zyrt`. Looks up a byte `a` in a substituion box
276−with 256 values, producing a byte.
277−
278−Accepts
279−-------
280−
281−`a` is an atom of one byte in length.
282−
283−Produces
284−--------
285−
286−An atom.
287−
288−Source
289−------
290−
291− ++ zyft :: forward 256-sbox
292− |= a/@D
293− =+ ^= b
294− 0xbb49.b71f.b881.b402.17e4.6b86.69b5.1647.115f.dddb.7ca5.
295− 8371.4bd5.19a9.b092.605d.0d9b.e030.a0cc.78ba.5706.4d2d.
296− 986a.768c.f8e8.c4c7.2f1c.effe.3cae.01c0.253e.65d3.3872.
297− ce0e.7a74.8ac6.daac.7e5c.6479.44ec.4143.3d20.4af0.ee6c.
298− c828.deca.0377.249f.ffcd.7b4f.eb7d.66f2.8951.042e.595a.
299− 8e13.f9c3.a79a.f788.6199.9391.7fab.6200.4ce5.0758.e2f1.
300− 7594.c945.d218.4248.afa1.e61a.54fb.1482.bea4.96a2.3473.
301− 63c2.e7cb.155b.120a.4ed7.bfd8.b31b.4008.f329.fca3.5380.
302− 9556.0cb2.8722.2bea.e96e.3ac5.d1bc.10e3.2c52.a62a.b1d6.
303− 35aa.d05e.f6a8.0f3b.31ed.559d.09ad.f585.6d21.fd1d.8d67.
304− 370b.26f4.70c1.b923.4684.6fbd.cf8b.5036.0539.9cdc.d93f.
305− 9068.1edf.8f33.b632.d427.97fa.9ee1
306− (cut 3 [a 1] b)
307− ::
308−
309−Examples
310−--------
311−
312− ~zod/try=> (zyft:un 0x12)
313− 57
314− ~zod/try=> (zyft:un 0x0)
315− 225
316− ~zod/try=> (zyft:un 0xff)
317− 187
318−
319−------------------------------------------------------------------------
320−
321−### `++zyrt`
322−
323−Reverse lookup byte in 256 sub box
324−
325−The inverse of `++zyft`. Looks up a byte `a` in a substituion box
326−with 256 values, producing a byte.
327−
328−Accepts
329−-------
330−
331−`a` is an atom of one byte in length.
332−
333−Produces
334−--------
335−
336−An atom.
337−
338−Source
339−------
340−
341− ++ zyrt :: reverse 256-sbox
342− |= a/@D
343− =+ ^= b
344− 0x9fc8.2753.6e02.8fcf.8b35.2b20.5598.7caa.c9a9.30b0.9b48.
345− 47ce.6371.80f6.407d.00dd.0aa5.ed10.ecb7.0f5a.5c3a.e605.
346− c077.4337.17bd.9eda.62a4.79a7.ccb8.44cd.8e64.1ec4.5b6b.
347− 1842.ffd8.1dfb.fd07.f2f9.594c.3be3.73c6.2cb6.8438.e434.
348− 8d3d.ea6a.5268.72db.a001.2e11.de8c.88d3.0369.4f7a.87e2.
349− 860d.0991.25d0.16b9.978a.4bf4.2a1a.e96c.fa50.85b5.9aeb.
350− 9dbb.b2d9.a2d1.7bba.66be.e81f.1946.29a8.f5d2.f30c.2499.
351− c1b3.6583.89e1.ee36.e0b4.6092.937e.d74e.2f6f.513e.9615.
352− 9c5d.d581.e7ab.fe74.f01b.78b1.ae75.af57.0ec2.adc7.3245.
353− 12bf.2314.3967.0806.31dc.cb94.d43f.493c.54a6.0421.c3a1.
354− 1c4a.28ac.fc0b.26ca.5870.e576.f7f1.616d.905f.ef41.33bc.
355− df4d.225e.2d56.7fd6.1395.a3f8.c582
356− (cut 3 [a 1] b)
357−
358−Examples
359−--------
360−
361− ~zod/try=> `@ux`(zyrt:un 57)
362− 0x12
363− ~zod/try=> `@ux`(zyrt:un 225)
364− 0x0
365− ~zod/try=> `@ux`(zyrt:un 187)
366− 0xff
367−
368−
369−***
docs/programming/advanced/library/src/3f/title.mddeleted−1
@@ -1 +0,0 @@
1−# 3f: scrambling
docs/programming/advanced/library/src/3g/mold/coin.mddeleted−38
@@ -1,38 +0,0 @@
1−### `++coin`
2−
3−Noun literal syntax cases
4−
5−Noun literal syntax cases: atoms, jammed nouns, and nestable tuples.
6−Parsed and printed using `++so` and `++co` cores.
7−
8−Source
9−------
10−
11− ++ coin $% {$$ p/dime} ::
12− {$blob p/*} ::
13− {$many p/(list coin)} ::
14− == ::
15−
16−Examples
17−--------
18−
19− ~zod/try=> `coin`(need (slay '~s1'))
20− [%$ p=[p=~.dr q=18.446.744.073.709.551.616]]
21− ~zod/try=> `coin`(need (slay '0x2b59'))
22− [%$ p=[p=~.ux q=11.097]]
23−
24− ~zod/try=> ~(rend co [%many ~[[%$ %ud 1] [%$ %tas 'a'] [%$ %s -2]]])
25− "._1_a_-2__"
26− ~zod/try=> ._1_a_-2__
27− [1 %a -2]
28−
29− ~zod/try=> `@uv`(jam [3 4])
30− 0v2cd1
31− ~zod/try=> (slay '~02cd1')
32− [~ [%blob p=[3 4]]]
33− ~zod/try=> ~02cd1
34− [3 4]
35−
36−
37−
38−***
docs/programming/advanced/library/src/3g/mold/dime.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++dime`
2−
3−Odor-atom pair
4−
5−Used in `++coin`. Convenience methods `++scot` and `++scow` (in
6−Section 2eL) print dimes as `++cord` and `++tape`, respectively.
7−`++slat`, `++slav`, and `++slaw` are used to parse atoms of
8−specific odors.
9−
10−Source
11−------
12−
13− ++ dime {p/@ta q/@} ::
14−
15−
16−Examples
17−--------
18−
19− ~zod/try=> +>:(slay '0x123')
20− p=[p=~.ux q=291]
21−
22−
23−
24−***
docs/programming/advanced/library/src/3g/mold/edge.mddeleted−25
@@ -1,25 +0,0 @@
1−### `++edge`
2−
3−Parsing location metadata
4−
5−Optional result `p` and parsing continuation `q`.
6−
7−Source
8−------
9−
10− ++ hair {p/@ud q/@ud} :: parsing trace
11−
12−
13−Examples
14−--------
15−
16−See also: Section 2eD, `++rule`
17−
18− ~zod/try=> *edge
19− [p=[p=0 q=0] q=~]
20− ~zod/try=> (tall:vast [1 1] "a b")
21− [p=[p=1 q=2] q=[~ [p=[%cnzz p=~[%a]] q=[p=[p=1 q=2] q=" b"]]]]
22−
23−
24−
25−***
docs/programming/advanced/library/src/3g/mold/hair.mddeleted−28
@@ -1,28 +0,0 @@
1−### `++hair`
2−
3−Parsing line and column
4−
5−A pair of two [`@ud`]() used in parsing indicating line and column number.
6−
7−Source
8−------
9−
10− ++ hair {p/@ud q/@ud} :: parsing trace
11−
12−
13−Examples
14−--------
15−
16− ~zod/try=> *hair
17− [p=0 q=0]
18−
19− ~zod/try=> `hair`[1 1] :: parsing starts at [1 1] as a convention.
20− [p=1 q=1]
21− ~zod/try=> ((plus ace) [1 1] " --")
22− [p=[p=1 q=4] q=[~ u=[p=[~~. " "] q=[p=[p=1 q=4] q="--"]]]]
23− ~zod/try=> `hair`p:((plus ace) [1 1] " --")
24− [p=1 q=4]
25−
26−
27−
28−***
docs/programming/advanced/library/src/3g/mold/like.mddeleted−33
@@ -1,33 +0,0 @@
1−### `++like`
2−
3−Mold generator for an edge
4−
5−`++like` generates an `++edge` with a parsed result set to a specific type.
6−
7−Source
8−------
9−
10− ++ like |* a/$-(* *) :: generic edge
11− |= b/_`*`[(hair) ~] ::
12− :- p=(hair -.b) ::
13− ^= q ::
14− ?@ +.b ~ ::
15− :- ~ ::
16− u=[p=(a +>-.b) q=[p=(hair -.b) q=(tape +.b)]] ::
17−
18−
19−Examples
20−--------
21− ~zod/try=> *(like char)
22− [p=[p=0 q=0] q=~]
23−
24− ~zod/try=> (ace [1 1] " a")
25− [p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q="a"]]]]
26− ~zod/try=> `(like char)`(ace [1 1] " a")
27− [p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q="a"]]]]
28− ~zod/try=> `(like ,@)`(ace [1 1] " a")
29− [p=[p=1 q=2] q=[~ [p=32 q=[p=[p=1 q=2] q="a"]]]]
30−
31−
32−
33−***
docs/programming/advanced/library/src/3g/mold/nail.mddeleted−22
@@ -1,22 +0,0 @@
1−### `++nail`
2−
3−Location, remainder of parsed text
4−
5−Indicates parsing position `p`, and remaining text to be parsed `q`.
6−
7−Source
8−------
9−
10− ++ nail {p/hair q/tape} :: parsing input
11−
12−
13−Examples
14−--------
15−
16− ~zod/try=> +<:;~(plug cab cab)
17− c=tub=[p=[p=0 q=0] q=""]
18− ~zod/try=> :: tub is a ++nail
19−
20−
21−
22−***
docs/programming/advanced/library/src/3g/mold/path.mddeleted−22
@@ -1,22 +0,0 @@
1−### `++path`
2−
3−Filesystem path
4−
5−A `++path` is a list of `++span`s aka `@ta`. Used in
6−`%clay` and `%eyre` extensively.
7−
8−Source
9−------
10−
11− ++ path (list knot) :: filesys location
12−
13−
14−Examples
15−--------
16−
17− ~zod/try=> `path`"abc"
18− /a/b/c
19−
20−
21−
22−***
docs/programming/advanced/library/src/3g/mold/pint.mddeleted−25
@@ -1,25 +0,0 @@
1−### `++pint`
2−
3−Parsing range
4−
5−Mostly used for stacktraces. A `++pint` is a pair of
6−`++hair`, indicating from `p` to `q`.
7−
8−Source
9−------
10−
11− ++ pint {p/{p/@ q/@} q/{p/@ q/@}} :: line+column range
12−
13−
14−Examples
15−--------
16−
17− ~zod/try=> !:(!!)
18− ! /~zod/try/~2014.9.20..01.22.04..52e3/:<[1 4].[1 6]>
19− ~zod/try=> :: !! always produces a crash
20− ~zod/try=> `pint`[[1 4] [1 6]]
21− [p=[p=1 q=4] q=[p=1 q=6]]
22−
23−
24−
25−***
docs/programming/advanced/library/src/3g/mold/rule.mddeleted−30
@@ -1,30 +0,0 @@
1−### `++rule`
2−
3−Parsing rule
4−
5−`++rule` is an empty parsing rule, but it is used to check
6−that parsing rules match this with `_`.
7−
8−
9−Source
10−------
11−
12− ++ rule _|=(nail *edge) :: parsing rule
13−
14−
15−Examples
16−--------
17−
18− ~zod/try=> *rule
19− [p=[p=0 q=0] q=[~ [p=0 q=[p=[p=0 q=0] q=""]]]]
20−
21− ~zod/try=> ^+(rule [|=(a=nail [p.a ~])]:|6)
22− <1.dww [tub=[p=[p=@ud q=@ud] q=""] <101.jzo 1.ypj %164>]>
23− ~zod/try=> (^+(rule [|=(a=nail [p.a ~ u=['a' a]])]:|6) [1 1] "hi")
24− [p=[p=1 q=1] q=[~ [p=97 q=[p=[p=1 q=1] q="hi"]]]]
25− ~zod/try=> ([|=(a=nail [p.a ~ u=['a' a]])]:|6 [1 1] "hi")
26− [[p=1 q=1] ~ u=['a' p=[p=1 q=1] q="hi"]]
27−
28−
29−
30−***
docs/programming/advanced/library/src/3g/mold/spot.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++spot`
2−
3−Stack trace line
4−
5−A `++spot` is what we print after crashing.
6−
7−Source
8−------
9−
10− ++ spot {p/path q/pint} :: range in file
11−
12−
13−Examples
14−--------
15−
16− ~zod/try=> :into /=main=/bin/fail/hoon '!: !!'
17− + /~zod/main/359/bin/fail/hoon
18− ~zod/try=> :fail
19− ! /~zod/main/~2014.9.22..18.40.56..ef04/bin/fail/:<[1 5].[1 7]>
20− ! exit
21−
22−
23−
24−***
docs/programming/advanced/library/src/3g/mold/toon.mddeleted−31
@@ -1,31 +0,0 @@
1−### `++toon`
2−
3−Nock computation result
4−
5−Either success (`%0`), a block with list of requests blocked on (`%1`), or
6−failure with stack trace (`%2`).
7−
8−Source
9−------
10−
11− ++ toon $% {$0 p/*} :: success
12− {$1 p/(list)} :: blocks
13− {$2 p/(list tank)} :: stack trace
14− == ::
15−
16−
17−Examples
18−--------
19− ~zod/try=> (mock [[20 21] 0 3] $~)
20− [%0 p=21]
21− ~zod/try=> (mock [[0] !=(.^(cy//=main/1))] ,~)
22− [%1 p=~[[31.075 1.685.027.454 1.852.399.981 49 0]]]
23− ~zod/try=> (path [31.075 1.685.027.454 1.852.399.981 49 0])
24− /cy/~zod/main/1
25−
26− ~zod/try=> (mock [[1 2] !=(!:(+(.)))] ,~)
27− [%2 p=~[[%leaf p="/~zod/try/~2014.9.23..18.34.32..d3c5/:<[1 20].[1 24]>"]]]
28−
29−
30−
31−***
docs/programming/advanced/library/src/3g/mold/wonk.mddeleted−31
@@ -1,31 +0,0 @@
1−### `++wonk`
2−
3−XX Not a model?
4−
5−Pull result out of a `++edge`, or crash if there's no result.
6−
7−Source
8−------
9−
10− ++ wonk |*(veq=edge ?~(q.veq !! p.u.q.veq)) ::
11−
12−Examples
13−--------
14−
15−See also: [`++edge`]()
16−
17− ~zod/try=> (wide:vast [1 1] "(add 2 2)")
18− [ p=[p=1 q=10]
19− q
20− [ ~
21− [ p=[%cnhp p=[%cnzz p=~[%add]] q=~[[%dtzy p=%ud q=2] [%dtzy p=%ud q=2]]]
22− q=[p=[p=1 q=10] q=""]
23− ]
24− ]
25− ]
26− ~zod/try=> (wonk (wide:vast [1 1] "(add 2 2)"))
27− [%cnhp p=[%cnzz p=~[%add]] q=~[[%dtzy p=%ud q=2] [%dtzy p=%ud q=2]]]
28−
29−
30−
31−***
docs/programming/advanced/library/src/3g/title.mddeleted−1
@@ -1 +0,0 @@
1−# 3g: molds and mold builders
docs/programming/advanced/library/src/4a/core/po.mddeleted−205
@@ -1,205 +0,0 @@
1−### `++po`
2−
3− ++ po
4− ~/ %po
5− =+ :- ^= sis :: prefix syllables
6− 'dozmarbinwansamlitsighidfidlissogdirwacsabwissib\
7− /rigsoldopmodfoglidhopdardorlorhodfolrintogsilmir\
8− /holpaslacrovlivdalsatlibtabhanticpidtorbolfosdot\
9− /losdilforpilramtirwintadbicdifrocwidbisdasmidlop\
10− /rilnardapmolsanlocnovsitnidtipsicropwitnatpanmin\
11− /ritpodmottamtolsavposnapnopsomfinfonbanporworsip\
12− /ronnorbotwicsocwatdolmagpicdavbidbaltimtasmallig\
13− /sivtagpadsaldivdactansidfabtarmonranniswolmispal\
14− /lasdismaprabtobrollatlonnodnavfignomnibpagsopral\
15− /bilhaddocridmocpacravripfaltodtiltinhapmicfanpat\
16− /taclabmogsimsonpinlomrictapfirhasbosbatpochactid\
17− /havsaplindibhosdabbitbarracparloddosbortochilmac\
18− /tomdigfilfasmithobharmighinradmashalraglagfadtop\
19− /mophabnilnosmilfopfamdatnoldinhatnacrisfotribhoc\
20− /nimlarfitwalrapsarnalmoslandondanladdovrivbacpol\
21− /laptalpitnambonrostonfodponsovnocsorlavmatmipfap'
22− ^= dex :: suffix syllables
23− 'zodnecbudwessevpersutletfulpensytdurwepserwylsun\
24− /rypsyxdyrnuphebpeglupdepdysputlughecryttyvsydnex\
25− /lunmeplutseppesdelsulpedtemledtulmetwenbynhexfeb\
26− /pyldulhetmevruttylwydtepbesdexsefwycburderneppur\
27− /rysrebdennutsubpetrulsynregtydsupsemwynrecmegnet\
28− /secmulnymtevwebsummutnyxrextebfushepbenmuswyxsym\
29− /selrucdecwexsyrwetdylmynmesdetbetbeltuxtugmyrpel\
30− /syptermebsetdutdegtexsurfeltudnuxruxrenwytnubmed\
31− /lytdusnebrumtynseglyxpunresredfunrevrefmectedrus\
32− /bexlebduxrynnumpyxrygryxfeptyrtustyclegnemfermer\
33− /tenlusnussyltecmexpubrymtucfyllepdebbermughuttun\
34− /bylsudpemdevlurdefbusbeprunmelpexdytbyttyplevmyl\
35− /wedducfurfexnulluclennerlexrupnedlecrydlydfenwel\
36− /nydhusrelrudneshesfetdesretdunlernyrsebhulryllud\
37− /remlysfynwerrycsugnysnyllyndyndemluxfedsedbecmun\
38− /lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes'
39− |%
40−
41−Provides the phonetic syllables and name generators for the Urbit naming
42−system. The two faces, `sis` and `dex` are available to the arms
43−contained in this section.
44−
45−
46−------------------------------------------------------------------------
47−
48−### `++ind`
49−
50−Parse prefix
51−
52−Produces the byte of the right-hand syllable `a`.
53−
54−Accepts
55−-------
56−
57−`a` is an atom.
58−
59−Produces
60−--------
61−
62−A `++unit` of an atom.
63−
64−Source
65−------
66−
67− ++ ind ~/ %ind :: parse suffix
68− |= a/@tas
69− =+ b=0
70− |- ^- (unit @)
71− ?:(=(256 b) ~ ?:(=(a (tod b)) [~ b] $(b +(b))))
72−
73−Examples
74−--------
75−
76− ~zod/try=> (ind:po 'zod')
77− [~ 0]
78− ~zod/try=> (ind:po 'zam')
79− ~
80− ~zod/try=> (ind:po 'del')
81− [~ 37]
82−
83−------------------------------------------------------------------------
84−
85−### `++ins`
86−
87−Parse suffix
88−
89−Produces the byte of the left-hand phonetic syllable `b`.
90−
91−Accepts
92−-------
93−
94−`a` is an atom.
95−
96−Produces
97−--------
98−A `++unit` of an atom.
99−
100−Source
101−------
102−
103− ++ ins ~/ %ins :: parse prefix
104− |= a/@tas
105− =+ b=0
106− |- ^- (unit @)
107− ?:(=(256 b) ~ ?:(=(a (tos b)) [~ b] $(b +(b))))
108−
109−
110−Examples
111−--------
112−
113− ~zod/try=> (ins:po 'mar')
114− [~ 1]
115− ~zod/try=> (ins:po 'son')
116− [~ 164]
117− ~zod/try=> (ins:po 'pit')
118− [~ 242]
119− ~zod/try=> (ins:po 'pok')
120− ~
121−
122−------------------------------------------------------------------------
123−
124−### `++tod`
125−
126−Fetch prefix
127−
128−Produces the phonetic prefix syllable from index `a` within `dex` as an
129−atom.
130−
131−Accepts
132−-------
133−
134−`a` is an atom
135−
136−Produces
137−--------
138−
139−An atom.
140−
141−
142−Source
143−------
144−
145− ++ tod ~/ %tod :: fetch suffix
146− |=(a/@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] dex)))
147−
148−
149−
150−Examples
151−--------
152−
153− ~zod/try=> `@t`(tod:po 1)
154− 'nec'
155− ~zod/try=> `@t`(tod:po 98)
156− 'dec'
157− ~zod/try=> `@t`(tod:po 0)
158− 'zod'
159− ~zod/try=> `@t`(tod:po 150)
160− 'ryg'
161− ~zod/try=> `@t`(tod:po 255)
162− 'fes'
163− ~zod/try=> `@t`(tod:po 256)
164− ! exit
165−
166−------------------------------------------------------------------------
167−
168−### `++tos`
169−
170−Fetch suffix
171−
172−Produces the phonetic prefix syllable from index `a` within `sis` as an
173−atom.
174−
175−Accepts
176−-------
177−
178−`a` is an atom.
179−
180−Produces
181−--------
182−
183−An atom.
184−
185−Source
186−------
187−
188− ++ tos ~/ %tos :: fetch suffix
189− |=(a/@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] sis)))
190−
191−Examples
192−--------
193−
194− ~zod/try=> `@t`(tos:po 0)
195− 'doz'
196− ~zod/try=> `@t`(tos:po 120)
197− 'fab'
198− ~zod/try=> `@t`(tos:po 43)
199− 'pid'
200− ~zod/try=> `@t`(tos:po 253)
201− 'mat'
202−
203−------------------------------------------------------------------------
204−
205−***
docs/programming/advanced/library/src/4a/title.mddeleted−1
@@ -1 +0,0 @@
1−# 4a: exotic bases
docs/programming/advanced/library/src/4b/core/at.mddeleted−150
@@ -1,150 +0,0 @@
1−### `++at`
2−
3− ++ at
4− |_ a/@
5−
6−XX document
7−
8−### `++r`
9−
10− ++ r
11− ?: ?& (gte (met 3 a) 2)
12− |-
13− ?: =(0 a)
14− &
15− =+ vis=(end 3 1 a)
16− ?& ?|(=('-' vis) ?&((gte vis 'a') (lte vis 'z')))
17− $(a (rsh 3 1 a))
18− ==
19− ==
20− rtam
21− ?: (lte (met 3 a) 2)
22− rud
23− rux
24− ::
25−
26−XX document
27−
28−### `++rf`
29−
30− ++ rf `tape`[?-(a $& '&', $| '|', * !!) ~]
31−
32−
33−XX document
34−
35−### `++rn`
36−
37− ++ rn `tape`[?>(=(0 a) '~') ~]
38−
39−XX document
40−
41−### `++rt`
42−
43− ++ rt `tape`['\'' (weld (mesc (trip a)) `tape`['\'' ~])]
44−
45−XX document
46−
47−### `++rta`
48−
49− ++ rta rt
50−
51−XX document
52−
53−### `++rtam`
54−
55− ++ rtam `tape`['%' (trip a)]
56−
57−XX document
58−
59−### `++rub`
60−
61− ++ rub `tape`['0' 'b' (rum 2 ~ |=(b/@ (add '0' b)))]
62−
63−XX document
64−
65−### `++rud`
66−
67− ++ rud (rum 10 ~ |=(b/@ (add '0' b)))
68−
69−XX document
70−
71−### `++rum`
72−
73− ++ rum
74− |= {b/@ c/tape d/$-(@ @)}
75− ^- tape
76− ?: =(0 a)
77− [(d 0) c]
78− =+ e=0
79− |- ^- tape
80− ?: =(0 a)
81− c
82− =+ f=&(!=(0 e) =(0 (mod e ?:(=(10 b) 3 4))))
83− %= $
84− a (div a b)
85− c [(d (mod a b)) ?:(f [?:(=(10 b) ',' '-') c] c)]
86− e +(e)
87− ==
88− ::
89−
90−
91−XX document
92−
93−### `++rup`
94−
95− ++ rup
96− =+ b=(met 3 a)
97− ^- tape
98− :- '-'
99− |- ^- tape
100− ?: (gth (met 5 a) 1)
101− %+ weld
102− $(a (rsh 5 1 a), b (sub b 4))
103− `tape`['-' '-' $(a (end 5 1 a), b 4)]
104− ?: =(0 b)
105− ['~' ~]
106− ?: (lte b 1)
107− (trip (tos:po a))
108− |- ^- tape
109− ?: =(2 b)
110− =+ c=(rsh 3 1 a)
111− =+ d=(end 3 1 a)
112− (weld (trip (tod:po c)) (trip (tos:po (mix c d))))
113− =+ c=(rsh 3 2 a)
114− =+ d=(end 3 2 a)
115− (weld ^$(a c, b (met 3 c)) `tape`['-' $(a (mix c d), b 2)])
116− ::
117−
118−XX document
119−
120−### `++ruv`
121−
122− ++ ruv
123− ^- tape
124− :+ '0'
125− 'v'
126− %^ rum
127− 64
128− ~
129− |= b/@
130− ?: =(63 b)
131− '+'
132− ?: =(62 b)
133− '-'
134− ?:((lth b 26) (add 65 b) ?:((lth b 52) (add 71 b) (sub b 4)))
135− ::
136−
137−XX document
138−
139−### `++rux`
140−
141− ++ rux `tape`['0' 'x' (rum 16 ~ |=(b/@ (add b ?:((lth b 10) 48 87))))]
142− --
143− :::::::::::::::::::::::::::::::::::::::::::::::::::::: ::
144−
145−XX document
146−
147−------------------------------------------------------------------------
148−
149−
150−***
docs/programming/advanced/library/src/4b/gate/cass.mddeleted−39
@@ -1,39 +0,0 @@
1−
2−### `++cass`
3−
4−To lowercase
5−
6−Produce the case insensitive (all lowercase) [`++cord`]() of a [`++tape`]().
7−
8−Accepts
9−-------
10−
11−`vib` is a `++tape`.
12−
13−Produces
14−--------
15−
16−A `++cord`.
17−
18−Source
19−------
20−
21− ++ cass :: lowercase
22− |= vib/tape
23− %+ rap 3
24− (turn vib |=(a/@ ?.(&((gte a 'A') (lte a 'Z')) a (add 32 a))))
25−
26−Examples
27−--------
28−
29− ~zod/try=> (cass "john doe")
30− 7.309.170.810.699.673.450
31− ~zod/try=> `cord`(cass "john doe")
32− 'john doe'
33− ~zod/try=> (cass "abc, 123, !@#")
34− 2.792.832.775.110.938.439.066.079.945.313
35− ~zod/try=> `cord`(cass "abc, 123, !@#")
36− 'abc, 123, !@#'
37−
38−
39−***
docs/programming/advanced/library/src/4b/gate/crip.mddeleted−33
@@ -1,33 +0,0 @@
1−### `++crip`
2−
3−Tape to cord
4−
5−Produce a `++cord` from a `++tape`.
6−
7−Accepts
8−-------
9−
10−`a` is a `++tape`.
11−
12−Produces
13−--------
14−
15−A `++cord`.
16−
17−Source
18−------
19−
20− ++ crip |=(a=tape `@t`(rap 3 a)) :: tape to cord
21−
22−Examples
23−--------
24−
25− ~zod/try=> (crip "john doe")
26− 'john doe'
27− ~zod/try=> (crip "abc 123 !@#")
28− 'abc 123 !@#'
29− ~zod/try=> `@ud`(crip "abc")
30− 6.513.249
31−
32−
33−***
docs/programming/advanced/library/src/4b/gate/cuss.mddeleted−41
@@ -1,41 +0,0 @@
1−### `++cuss`
2−
3−To uppercase
4−
5−Turn all occurances of lowercase letters in any `++tape` into uppercase
6−letters, as a `++cord`.
7−
8−Accepts
9−-------
10−
11−`vib` is a `++tape`.
12−
13−Produces
14−--------
15−
16−A `++cord`.
17−
18−Source
19−------
20−
21− ++ cuss :: uppercase
22− |= vib=tape
23− ^- @t
24− %+ rap 3
25− (turn vib |=(a=@ ?.(&((gte a 'a') (lte a 'z')) a (sub a 32))))
26− ::
27−
28−Examples
29−--------
30−
31− ~zod/try=> (cuss "john doe")
32− 'JOHN DOE'
33− ~zod/try=> (cuss "abc ABC 123 !@#")
34− 'ABC ABC 123 !@#'
35− ~zod/try=> `@ud`(cuss "abc")
36− 4.407.873
37− ~zod/try=> (cuss "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsQqRrVvWwXxYyZz")
38− 'AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSQQRRVVWWXXYYZZ'
39−
40−
41−***
docs/programming/advanced/library/src/4b/gate/mesc.mddeleted−44
@@ -1,44 +0,0 @@
1−### `++mesc`
2−
3−Escape special chars
4−
5−Escape special characters, used in `++show`.
6−
7−Accepts
8−-------
9−
10−`vib` is a `++tape`.
11−
12−Produces
13−--------
14−
15−A `++tape`.
16−
17−Source
18−------
19−
20− ++ mesc :: ctrl code escape
21− |= vib/tape
22− ^- tape
23− ?~ vib
24− ~
25− ?: =('\\' i.vib)
26− ['\\' '\\' $(vib t.vib)]
27− ?: ?|((gth i.vib 126) (lth i.vib 32) =(`@`39 i.vib))
28− ['\\' (welp ~(rux at i.vib) '/' $(vib t.vib))]
29− [i.vib $(vib t.vib)]
30− ::
31−
32−Examples
33−--------
34−
35− /~zod/try=> (mesc "ham lus")
36− "ham lus"
37− /~zod/try=> (mesc "bas\\hur")
38− "bas\\\\hur"
39− /~zod/try=> (mesc "as'saß")
40− "as\0x27/sa\0xc3/\0x9f/"
41−
42−
43−
44−***
docs/programming/advanced/library/src/4b/gate/runt.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++runt`
2−
3−Prepend `n` times
4−
5−Add `a` repetitions of character `b` to the head of `++tape` `c`.
6−
7−Accepts
8−-------
9−
10−`a` and `b` are atoms.
11−
12−`c` is a `++tape`.
13−
14−Produces
15−--------
16−
17−A `++tape`.
18−
19−Source
20−------
21−
22− ++ runt :: prepend repeatedly
23− |= [[a/@ b/@] c/tape]
24− ^- tape
25− ?: =(0 a)
26− c
27− [b $(a (dec a))]
28− ::
29−
30−Examples
31−--------
32−
33− /~zod/try=> (runt [2 '/'] "ham")
34− "//ham"
35− /~zod/try=> (runt [10 'a'] "")
36− "aaaaaaaaaa"
37−
38−
39−
40−***
docs/programming/advanced/library/src/4b/gate/sand.mddeleted−38
@@ -1,38 +0,0 @@
1−### `++sand`
2−
3−Soft-cast by odor
4−
5−Soft-cast validity by odor.
6−
7−Accepts
8−-------
9−
10−`a` is a `++span` (`@ta`).
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−A `(unit @)`.
18−
19−Source
20−------
21−
22− ++ sand :: atom sanity
23− |= a/@ta
24− |= b/@ ^- (unit @)
25− ?.(((sane a) b) ~ [~ b])
26− ::
27−
28−Examples
29−--------
30−
31− /~zod/try=> `(unit @ta)`((sand %ta) 'sym-som')
32− [~ ~.sym-som]
33− /~zod/try=> `(unit @ta)`((sand %ta) 'err!')
34− ~
35−
36−
37−
38−***
docs/programming/advanced/library/src/4b/gate/sane.mddeleted−70
@@ -1,70 +0,0 @@
1−### `++sane`
2−
3−Check odor validity
4−
5−Check validity by odor. Produces a gate.
6−
7−Accepts
8−-------
9−
10−`a` is a `++span` (`@ta`).
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−A boolean.
18−
19−Source
20−------
21−
22− ++ sane :: atom sanity
23− |= a/@ta
24− |= b/@ ^- ?
25− ?. =(%t (end 3 1 a))
26− ~|(%sane-stub !!)
27− =+ [inx=0 len=(met 3 b)]
28− ?: =(%tas a)
29− |- ^- ?
30− ?: =(inx len) &
31− =+ cur=(cut 3 [inx 1] b)
32− ?& ?| &((gte cur 'a') (lte cur 'z'))
33− &(=('-' cur) !=(0 inx) !=(len inx))
34− &(&((gte cur '0') (lte cur '9')) !=(0 inx))
35− ==
36− $(inx +(inx))
37− ==
38− ?: =(%ta a)
39− |- ^- ?
40− ?: =(inx len) &
41− =+ cur=(cut 3 [inx 1] b)
42− ?& ?| &((gte cur 'a') (lte cur 'z'))
43− &((gte cur '0') (lte cur '9'))
44− |(=('-' cur) =('~' cur) =('_' cur) =('.' cur))
45− ==
46− $(inx +(inx))
47− ==
48− |- ^- ?
49− ?: =(0 b) &
50− =+ cur=(end 3 1 b)
51− ?: &((lth cur 32) !=(10 cur)) |
52− =+ len=(teff cur)
53− ?& |(=(1 len) =+(i=1 |-(|(=(i len) &((gte (cut 3 [i 1] b) 128) $(i +(i)))))))
54− $(b (rsh 3 len b))
55− ==
56− ::
57−
58−Examples
59−--------
60−
61− /~zod/try=> ((sane %tas) %mol)
62− %.y
63− /~zod/try=> ((sane %tas) 'lam')
64− %.y
65− /~zod/try=> ((sane %tas) 'more ace')
66− %.n
67−
68−
69−
70−***
docs/programming/advanced/library/src/4b/gate/teff.mddeleted−38
@@ -1,38 +0,0 @@
1−### `++teff`
2−
3−UTF8 Length
4−
5−Produces the number of utf8 bytes.
6−
7−Accepts
8−-------
9−
10−`a` is a `@t`.
11−
12−Produces
13−--------
14−
15−An atom.
16−
17−Source
18−------
19−
20− |= a/@t ^- @
21− =+ b=(end 3 1 a)
22− ~| %bad-utf8
23− ?: =(0 b)
24− ?>(=(`@`0 a) 0)
25− ?> |((gte b 32) =(10 b))
26− ?:((lte b 127) 1 ?:((lte b 223) 2 ?:((lte b 239) 3 4)))
27−
28−Examples
29−--------
30−
31− /~zod/try=> (teff 'a')
32− 1
33− /~zod/try=> (teff 'ß')
34− 2
35−
36−
37−
38−***
docs/programming/advanced/library/src/4b/gate/trim.mddeleted−43
@@ -1,43 +0,0 @@
1−### `++trim`
2−
3−Tape split
4−
5−Split first `a` characters off `++tape` `b`.
6−
7−Accepts
8−-------
9−
10−`a` is an atom.
11−
12−`b` is a `++tape`.
13−
14−Produces
15−--------
16−
17−A cell of `++tape`s, `p` and `q`.
18−
19−Source
20−------
21−
22− ++ trim :: 31-bit nonzero
23− |= key/@
24− =+ syd=0xcafe.babe
25− |- ^- @
26− =+ haz=(spec syd key)
27− =+ ham=(mix (rsh 0 31 haz) (end 0 31 haz))
28− ?.(=(0 ham) ham $(syd +(syd)))
29− --
30− ::
31−
32−
33−Examples
34−--------
35−
36− /~zod/try=> (trim 5 "lasok termun")
37− [p="lasok" q=" termun"]
38− /~zod/try=> (trim 5 "zam")
39− [p="zam" q=""]
40−
41−
42−
43−***
docs/programming/advanced/library/src/4b/gate/trip.mddeleted−41
@@ -1,41 +0,0 @@
1−### `++trip`
2−
3−Cord to tape
4−
5−Produce a `++tape` from `++cord`.
6−
7−Accepts
8−-------
9−
10−`a` is an atom.
11−
12−Produces
13−--------
14−
15−A `++tape`.
16−
17−Source
18−------
19−
20− ++ trip :: cord to tape
21− ~/ %trip
22− |= a/@ ^- tape
23− ?: =(0 (met 3 a))
24− ~
25− [^-(@ta (end 3 1 a)) $(a (rsh 3 1 a))]
26− ::
27−
28−
29−Examples
30−--------
31−
32− /~zod/try=> (trip 'john doe')
33− "john doe"
34− /~zod/try=> (trip 'abc 123 !@#')
35− "abc 123 !@#"
36− /~zod/try=> (trip 'abc')
37− "abc"
38−
39−
40−
41−***
docs/programming/advanced/library/src/4b/gate/tuba.mddeleted−36
@@ -1,36 +0,0 @@
1−### `++tuba`
2−
3−UTF8 to UTF32 tape
4−
5−Convert `++tape` to a `++list` of codepoints (`@c`).
6−
7−Accepts
8−-------
9−
10−`a` is a `++tape`.
11−
12−Produces
13−--------
14−
15−A `++list` of codepoints `@c`.
16−
17−Source
18−------
19−
20− ++ tuba :: utf8 to utf32 tape
21− |= a/tape
22− ^- (list @c)
23− (rip 5 (turf (rap 3 a))) :: XX horrible
24− ::
25−
26−Examples
27−--------
28−
29− /~zod/try=> (tuba "я тут")
30− ~[~-~44f. ~-. ~-~442. ~-~443. ~-~442.]
31− /~zod/try=> (tuba "chars")
32− ~[~-c ~-h ~-a ~-r ~-s]
33−
34−
35−
36−***
docs/programming/advanced/library/src/4b/gate/tufa.mddeleted−37
@@ -1,37 +0,0 @@
1−### `++tufa`
2−
3−UTF32 to UTF8 tape
4−
5−Wrap a `++list` of utf32 codepoints into a utf8 `++tape`.
6−
7−Accepts
8−-------
9−
10−`a` is a `++list` of `@c`.
11−
12−Produces
13−--------
14−
15−A `++tape`.
16−
17−Source
18−------
19−
20− ++ tufa :: utf32 to utf8 tape
21− |= a=(list @c)
22− ^- tape
23− ?~ a ""
24− (weld (rip 3 (tuft i.a)) $(a t.a))
25− ::
26−
27−Examples
28−--------
29−
30− /~zod/try=> (tufa ~[~-~44f. ~-. ~-~442. ~-~443. ~-~442.])
31− "я тут"
32− /~zod/try=> (tufa ((list @c) ~[%a %b 0xb1 %c]))
33− "ab±c"
34−
35−
36−
37−***
docs/programming/advanced/library/src/4b/gate/tuft.mddeleted−61
@@ -1,61 +0,0 @@
1−### `++tuft`
2−
3−UTF32 to UTF8 text
4−
5−Convert utf32 glyph to
6−LSB utf8 `++cord`.
7−
8−Accepts
9−-------
10−
11−`a` is a codepoint (`@c`).
12−
13−Produces
14−--------
15−
16−A `++cord`.
17−
18−Source
19−------
20−
21− ++ tuft :: utf32 to utf8 text
22− |= a/@c
23− ^- @t
24− %+ rap 3
25− |- ^- (list @)
26− ?: =(`@`0 a)
27− ~
28− =+ b=(end 5 1 a)
29− =+ c=$(a (rsh 5 1 a))
30− ?: (lte b 0x7f)
31− [b c]
32− ?: (lte b 0x7ff)
33− :* (mix 0b1100.0000 (cut 0 [6 5] b))
34− (mix 0b1000.0000 (end 0 6 b))
35− c
36− ==
37− ?: (lte b 0xffff)
38− :* (mix 0b1110.0000 (cut 0 [12 4] b))
39− (mix 0b1000.0000 (cut 0 [6 6] b))
40− (mix 0b1000.0000 (end 0 6 b))
41− c
42− ==
43− :* (mix 0b1111.0000 (cut 0 [18 3] b))
44− (mix 0b1000.0000 (cut 0 [12 6] b))
45− (mix 0b1000.0000 (cut 0 [6 6] b))
46− (mix 0b1000.0000 (end 0 6 b))
47− c
48− ==
49− ::
50−
51−Examples
52−--------
53−
54− /~zod/try=> (tuft `@c`%a)
55− 'a'
56− /~zod/try=> (tuft `@c`0xb6)
57− '¶'
58−
59−
60−
61−***
docs/programming/advanced/library/src/4b/gate/turf.mddeleted−58
@@ -1,58 +0,0 @@
1−### `++turf`
2−
3−UTF8 to UTF32 cord
4−
5−Convert utf8 (`++cord`) to utf32 codepoints.
6−
7−Accepts
8−-------
9−
10−`a` is a `@t`.
11−
12−Produces
13−--------
14−
15−A `@c`, UTF-32 codepoint.
16−
17−Source
18−------
19−
20− ++ turf :: utf8 to utf32
21− |= a/@t
22− ^- @c
23− %+ rap 5
24− |- ^- (list @c)
25− =+ b=(teff a)
26− ?: =(0 b) ~
27− =+ ^= c
28− %+ can 0
29− %+ turn
30− ^- (list {p/@ q/@})
31− ?+ b !!
32− $1 [[0 7] ~]
33− $2 [[8 6] [0 5] ~]
34− $3 [[16 6] [8 6] [0 4] ~]
35− $4 [[24 6] [16 6] [8 6] [0 3] ~]
36− ==
37− |=({p/@ q/@} [q (cut 0 [p q] a)])
38− ?. =((tuft c) (end 3 b a)) ~|(%bad-utf8 !!)
39− [c $(a (rsh 3 b a))]
40− ::
41−
42−Examples
43−--------
44−
45− /~zod/try=> (turf 'my ßam')
46− ~-my.~df.am
47− /~zod/try=> 'я тут'
48− 'я тут'
49− /~zod/try=> (turf 'я тут')
50− ~-~44f..~442.~443.~442.
51− /~zod/try=> `@ux`'я тут'
52− 0x82.d183.d182.d120.8fd1
53− /~zod/try=> `@ux`(turf 'я тут')
54− 0x442.0000.0443.0000.0442.0000.0020.0000.044f
55−
56−
57−
58−***
docs/programming/advanced/library/src/4b/gate/wack.mddeleted−47
@@ -1,47 +0,0 @@
1−### `++wack`
2−
3−Coin format encode
4−
5−Escape `++span` `~` as `~~` and `_` as `~-`. Used for printing.
6−
7−Accepts
8−-------
9−
10−`a` is a `++span` (`@ta`).
11−
12−Produces
13−--------
14−
15−A `++span` (`@ta`).
16−
17−Source
18−------
19−
20− ++ wack :: coin format
21− |= a/@ta
22− ^- @ta
23− =+ b=(rip 3 a)
24− %+ rap 3
25− |- ^- tape
26− ?~ b
27− ~
28− ?: =('~' i.b) ['~' '~' $(b t.b)]
29− ?: =('_' i.b) ['~' '-' $(b t.b)]
30− [i.b $(b t.b)]
31− ::
32−
33−Examples
34−--------
35−
36− /~zod/try=> (wack '~20_sam~')
37− ~.~~20~-sam~~
38− /~zod/try=> `@t`(wack '~20_sam~')
39− '~~20~-sam~~'
40− ~zod/try=> ~(rend co %many ~[`ud/5 `ta/'~20_sam'])
41− "._5_~~.~~20~-sam__"
42− ~zod/try=> ._5_~~.~~20~-sam__
43− [5 ~.~20_sam]
44−
45−
46−
47−***
docs/programming/advanced/library/src/4b/gate/wick.mddeleted−48
@@ -1,48 +0,0 @@
1−### `++wick`
2−
3−Coin format decode
4−
5−Unescape `++span` `~~` as `~` and `~-` as `_`.
6−
7−Accepts
8−-------
9−
10−`a` is a an atom.
11−
12−Produces
13−--------
14−
15−A `++span` `@ta`.
16−
17−Source
18−------
19−
20− ++ wick :: knot format
21− |= a/@
22− ^- (unit @ta)
23− =+ b=(rip 3 a)
24− =- ?^(b ~ (some (rap 3 (flop c))))
25− =| c/tape
26− |- ^- {b/tape c/tape}
27− ?~ b [~ c]
28− ?. =('~' i.b)
29− $(b t.b, c [i.b c])
30− ?~ t.b [b ~]
31− ?- i.t.b
32− $'~' $(b t.t.b, c ['~' c])
33− $'-' $(b t.t.b, c ['_' c])
34− @ [b ~]
35− ==
36− ::
37−
38−Examples
39−--------
40−
41− /~zod/try=> `@t`(wick '~-ams~~lop')
42− '_ams~lop'
43− /~zod/try=> `@t`(wick (wack '~20_sam~'))
44− '~20_sam~'
45−
46−
47−
48−***
docs/programming/advanced/library/src/4b/gate/woad.mddeleted−62
@@ -1,62 +0,0 @@
1−### `++woad`
2−
3−Unescape cord
4−
5−Unescape `++cord` codepoints.
6−
7−Accepts
8−-------
9−
10−`a` is a `@ta`.
11−
12−Produces
13−--------
14−
15−A `++cord`.
16−
17−Source
18−------
19−
20− ++ woad :: cord format
21− |= a/@ta
22− ^- @t
23− %+ rap 3
24− |- ^- (list @)
25− ?: =(`@`0 a)
26− ~
27− =+ b=(end 3 1 a)
28− =+ c=(rsh 3 1 a)
29− ?: =('.' b)
30− [' ' $(a c)]
31− ?. =('~' b)
32− [b $(a c)]
33− => .(b (end 3 1 c), c (rsh 3 1 c))
34− ?+ b =- (weld (rip 3 (tuft p.d)) $(a q.d))
35− ^= d
36− =+ d=0
37− |- ^- {p/@ q/@}
38− ?: =('.' b)
39− [d c]
40− ?< =(0 c)
41− %= $
42− b (end 3 1 c)
43− c (rsh 3 1 c)
44− d %+ add (mul 16 d)
45− %+ sub b
46− ?: &((gte b '0') (lte b '9')) 48
47− ?>(&((gte b 'a') (lte b 'z')) 87)
48− ==
49− $'.' ['.' $(a c)]
50− $'~' ['~' $(a c)]
51− ==
52− ::
53−
54−Examples
55−--------
56−
57− /~zod/try=> (woad ~.~b6.20.as)
58− '¶20 as'
59−
60−
61−
62−***
docs/programming/advanced/library/src/4b/gate/wood.mddeleted−53
@@ -1,53 +0,0 @@
1−### `++wood`
2−
3−Escape cord
4−
5−Escape `++cord` codepoints.
6−
7−Accepts
8−-------
9−
10−`a` is a `++span` (`@ta`).
11−
12−Produces
13−--------
14−
15−A `++span` (`@ta`).
16−
17−Source
18−------
19−
20− ++ wood :: cord format
21− |= a/@t
22− ^- @ta
23− %+ rap 3
24− |- ^- (list @)
25− ?: =(`@`0 a)
26− ~
27− =+ b=(teff a)
28− =+ c=(turf (end 3 b a))
29− =+ d=$(a (rsh 3 b a))
30− ?: ?| &((gte c 'a') (lte c 'z'))
31− &((gte c '0') (lte c '9'))
32− =(`@`'-' c)
33− ==
34− [c d]
35− ?+ c
36− :- '~'
37− =+ e=(met 2 c)
38− |- ^- tape
39− ?: =(0 e)
40− ['.' d]
41− =. e (dec e)
42− =+ f=(rsh 2 e c)
43− [(add ?:((lte f 9) 48 87) f) $(c (end 2 e c))]
44− ::
45−
46−Examples
47−--------
48−
49− /~zod/try=> (wood 'my ßam')
50− ~.my.~df.am
51−
52−
53−***
docs/programming/advanced/library/src/4b/title.mddeleted−1
@@ -1 +0,0 @@
1−# 4b: text processing
docs/programming/advanced/library/src/4c/core/re.mddeleted−250
@@ -1,250 +0,0 @@
1−### `++re`
2−
3−Pretty-printing engine
4−
5−Pretty-printing engine that accepts a `++tank` sample and contains arms that perform computation on it.
6−
7−Accepts
8−-------
9−
10−`tac` is a `++tank`.
11−
12−Produces
13−--------
14−
15− ++ re
16− |_ tac/tank
17−
18−Examples
19−--------
20−
21− /~zod/try=> ~(. re leaf+"ham")
22− <2.gdc {tac/{$leaf ""} <402.arm 110.jyx 1.ztu $151>}>
23−
24−### `++ram`
25−
26−Flatten to tape
27−
28−Flatten `++tank` out into a `++tape`.
29−
30−Accepts
31−-------
32−
33−`tac` is a `++tank`, taken from sample of `++re` core.
34−
35−Produces
36−--------
37−
38−A `++tape`.
39−
40−Source
41−------
42−
43− ++ ram
44− ^- tape
45− ?- -.tac
46− $leaf p.tac
47− $palm ram(tac [%rose [p.p.tac (weld q.p.tac r.p.tac) s.p.tac] q.tac])
48− $rose
49− %+ weld
50− q.p.tac
51− |- ^- tape
52− ?~ q.tac
53− r.p.tac
54− =+ voz=$(q.tac t.q.tac)
55− (weld ram(tac i.q.tac) ?~(t.q.tac voz (weld p.p.tac voz)))
56− ==
57− ::
58−
59−Examples
60−--------
61−
62− /~zod/try=> ~(ram re leaf+"foo")
63− "foo"
64− /~zod/try=> ~(ram re rose+["." "(" ")"]^~[leaf+"bar" leaf+"baz" leaf+"bam"])
65− "(bar.baz.bam)"
66−
67−### `++win`
68−
69−Render at indent
70−
71−Render at indent level `tab` and width `edg`.
72−
73−Accepts
74−-------
75−
76−`tac` is a `++tank`, taken from sample of `++re` core.
77−
78−`tab` and `edg` are atoms.
79−
80−Produces
81−--------
82−
83−A `++wall` (`++list` of `++tapes`).
84−
85−Source
86−------
87−
88− ++ win
89− |= {tab/@ edg/@}
90− =+ lug=`wall`~
91− |^ |- ^- wall
92− ?- -.tac
93− $leaf (rig p.tac)
94− $palm
95− ?: fit
96− (rig ram)
97− ?~ q.tac
98− (rig q.p.tac)
99− ?~ t.q.tac
100− (rig(tab (add 2 tab), lug $(tac i.q.tac)) q.p.tac)
101− => .(q.tac `(list tank)`q.tac)
102− =+ lyn=(mul 2 (lent q.tac))
103− =+ ^= qyr
104− |- ^- wall
105− ?~ q.tac
106− lug
107− %= ^$
108− tac i.q.tac
109− tab (add tab (sub lyn 2))
110− lug $(q.tac t.q.tac, lyn (sub lyn 2))
111− ==
112− (wig(lug qyr) q.p.tac)
113− ::
114−
115−Examples
116−--------
117−
118− /~zod/try=> (~(win re leaf+"samoltekon-lapdok") 0 20)
119− <<"samoltekon-lapdok">>
120− /~zod/try=> (~(win re leaf+"samoltekon-lapdok") 0 10)
121− <<"\/samolt\/" " ekon-l" " apdok" "\/ \/">>
122− /~zod/try=> (~(win re rose+["--" "[" "]"]^~[leaf+"1423" leaf+"2316"]) 0 20)
123− <<"[1423--2316]">>
124− /~zod/try=> (~(win re rose+["--" "[" "]"]^~[leaf+"1423" leaf+"2316"]) 0 10)
125− <<"[ 1423" " 2316" "]">>
126−
127−### `++din`
128−
129−XX document
130−
131−Accepts
132−-------
133−
134−Produces
135−--------
136−
137−Source
138−------
139−
140− ++ din (mod (add 2 tab) (mul 2 (div edg 3)))
141−
142−
143−----------------------------------------------------------------------
144−
145−### `++fit`
146−
147−Fit on one line test
148−
149−Determine whether `tac` fits on one line. Internal to `++win`
150−
151−Accepts
152−-------
153−
154−Produces
155−--------
156−
157−Source
158−------
159−
160−++ fit (lte (lent ram) (sub edg tab))
161−
162−
163−Examples
164−--------
165−
166−
167−
168−
169−----------------------------------------------------------------------
170−
171−### `++rig`
172−
173−Wrap in `\/`
174−
175−Wrap `++tape` in `\/` if it doesn't fit at current indentation. Internal to
176−`++win`
177−
178−Accepts
179−-------
180−
181−`tac` is a `++tank`, taken from sample of `++re` core.
182−
183−`hom` is a `++tape`.
184−
185−Produces
186−--------
187−
188−A `++wall` (list of `++tape`s).
189−
190−Source
191−------
192−
193− ++ rig
194− |= hom/tape
195− ^- wall
196− ?: & ::(lte (lent hom) (sub edg tab))
197− [(runt [tab ' '] hom) lug]
198− => .(tab (add tab 2), edg (sub edg 2))
199− =+ mut=(trim (sub edg tab) hom)
200− :- (runt [(sub tab 2) ' '] ['\\' '/' (weld p.mut `_hom`['\\' '/' ~])])
201− => .(hom q.mut)
202− |-
203− ?~ hom
204− :- %+ runt
205− [(sub tab 2) ' ']
206− ['\\' '/' (runt [(sub edg tab) ' '] ['\\' '/' ~])]
207− lug
208− => .(mut (trim (sub edg tab) hom))
209− [(runt [tab ' '] p.mut) $(hom q.mut)]
210− ::
211−
212−Examples
213−--------
214−
215−### `++wig`
216−
217−`++win` render tape
218−
219−Render `++tape`. Internal to `++win`.
220−
221−Accepts
222−-------
223−
224−`tac` is a `++tank`, taken from sample of `++re` core.
225−
226−`hom` is a `++tape`.
227−
228−Produces
229−--------
230−
231− ++ wig
232− |= hom/tape
233− ^- wall
234− ?~ lug
235− (rig hom)
236− =+ lin=(lent hom)
237− =+ wug=:(add 1 tab lin)
238− ?. =+ mir=i.lug
239− |- ?~ mir
240− |
241− ?|(=(0 wug) ?&(=(' ' i.mir) $(mir t.mir, wug (dec wug))))
242− (rig hom) :: ^ XX regular form?
243− [(runt [tab ' '] (weld hom `tape`[' ' (slag wug i.lug)])) t.lug]
244− --
245− --
246−
247−
248−
249−
250−***
docs/programming/advanced/library/src/4c/gate/show.mddeleted−105
@@ -1,105 +0,0 @@
1−### `++show`
2−
3− ++ show :: XX deprecated, use span
4− |= vem/*
5− |^ ^- tank
6− ?: ?=(@ vem)
7− [%leaf (mesc (trip vem))]
8− ?- vem
9− {s/$~ c/*}
10− [%leaf '\'' (weld (mesc (tape +.vem)) `tape`['\'' ~])]
11− ::
12− {s/$a c/@} [%leaf (mesc (trip c.vem))]
13− {s/$b c/*} (shop c.vem |=(a/@ ~(rub at a)))
14− {s/{$c p/@} c/*}
15− :+ %palm
16− [['.' ~] ['-' ~] ~ ~]
17− [[%leaf (mesc (trip p.s.vem))] $(vem c.vem) ~]
18− ::
19− {s/$d c/*} (shop c.vem |=(a/@ ~(rud at a)))
20− {s/$k c/*} (tank c.vem)
21− {s/$h c/*}
22− :+ %rose
23− [['/' ~] ['/' ~] ~]
24− =+ yol=((list @ta) c.vem)
25− (turn yol |=(a/@ta [%leaf (trip a)]))
26− ::
27− {s/$l c/*} (shol c.vem)
28− {s/$o c/*}
29− %= $
30− vem
31− :- [%m '%h:<[%d %d].[%d %d]>']
32− [-.c.vem +<-.c.vem +<+.c.vem +>-.c.vem +>+.c.vem ~]
33− ==
34− ::
35− {s/$p c/*} (shop c.vem |=(a/@ ~(rup at a)))
36− {s/$q c/*} (shop c.vem |=(a/@ ~(r at a)))
37− {s/$r c/*} $(vem [[%r ' ' '{' '}'] c.vem])
38− {s/$t c/*} (shop c.vem |=(a/@ ~(rt at a)))
39− {s/$v c/*} (shop c.vem |=(a/@ ~(ruv at a)))
40− {s/$x c/*} (shop c.vem |=(a/@ ~(rux at a)))
41− {s/{$m p/@} c/*} (shep p.s.vem c.vem)
42− {s/{$r p/@} c/*}
43− $(vem [[%r ' ' (cut 3 [0 1] p.s.vem) (cut 3 [1 1] p.s.vem)] c.vem])
44− ::
45− {s/{$r p/@ q/@ r/@} c/*}
46− :+ %rose
47− :* p=(mesc (trip p.s.vem))
48− q=(mesc (trip q.s.vem))
49− r=(mesc (trip r.s.vem))
50− ==
51− |- ^- (list tank)
52− ?@ c.vem
53− ~
54− [^$(vem -.c.vem) $(c.vem +.c.vem)]
55− ::
56− {s/$z c/*} $(vem [[%r %$ %$ %$] c.vem])
57− * !!
58− ==
59−
60−XX document
61−
62−### `++shep`
63−
64− ++ shep
65− |= {fom/@ gar/*}
66− ^- tank
67− =+ l=(met 3 fom)
68− =+ i=0
69− :- %leaf
70− |- ^- tape
71− ?: (gte i l)
72− ~
73− =+ c=(cut 3 [i 1] fom)
74− ?. =(37 c)
75− (weld (mesc [c ~]) $(i +(i)))
76− =+ d=(cut 3 [+(i) 1] fom)
77− ?. .?(gar)
78− ['\\' '#' $(i (add 2 i))]
79− (weld ~(ram re (show d -.gar)) $(i (add 2 i), gar +.gar))
80− ::
81−
82−XX document
83−
84−### `++shop`
85−
86− ++ shop
87− |= {aug/* vel/$-(a/@ tape)}
88− ^- tank
89− ?: ?=(@ aug)
90− [%leaf (vel aug)]
91− :+ %rose
92− [[' ' ~] ['[' ~] [']' ~]]
93− => .(aug `*`aug)
94− |- ^- (list tank)
95− ?: ?=(@ aug)
96− [^$ ~]
97− [^$(aug -.aug) $(aug +.aug)]
98− ::
99−
100−
101−XX document
102−
103−
104−
105−***
docs/programming/advanced/library/src/4c/title.mddeleted−1
@@ -1 +0,0 @@
1−# 4c: tank printer
docs/programming/advanced/library/src/4d/gate/last.mddeleted−43
@@ -1,43 +0,0 @@
1−### `++last`
2−
3−Farther trace
4−
5−Compares two line-column pairs, called `++hair`s, `zyc` and `naz`, producing whichever
6−is further along.
7−
8−Accepts
9−-------
10−
11−`naz` is a hair.
12−
13−`zyc` is a hair.
14−
15−Produces
16−--------
17−
18−a `++hair`.
19−
20−Source
21−------
22−
23− ++ last |= {zyc/hair naz/hair} :: farther trace
24− ^- hair
25− ?: =(p.zyc p.naz)
26− ?:((gth q.zyc q.naz) zyc naz)
27− ?:((gth p.zyc p.naz) zyc naz)
28−
29−
30−Examples
31−--------
32−
33− ~zod/try=> (last [1 1] [1 2])
34− [p=1 q=2]
35− ~zod/try=> (last [2 1] [1 2])
36− [p=2 q=1]
37− ~zod/try=> (last [0 0] [99 0])
38− [p=99 q=0]
39− ~zod/try=> (last [7 7] [7 7])
40− [p=7 q=7]
41−
42−
43−***
docs/programming/advanced/library/src/4d/gate/lust.mddeleted−49
@@ -1,49 +0,0 @@
1−
2−### `++lust`
3−
4−Detect newline
5−
6−Advances the `++hair` `naz` by a row if the `++char` `weq` is a newline, or by a
7−column if `weq` is any other character.
8−
9−Accepts
10−-------
11−
12−`weq` is a char.
13−
14−`naz` is a hair.
15−
16−Produces
17−--------
18−
19−A hair.
20−
21−Source
22−------
23−
24− ++ lust |= {weq/char naz/hair} :: detect newline
25− ^- hair
26− ?:(=(`@`10 weq) [+(p.naz) 1] [p.naz +(q.naz)])
27−
28−
29−
30−Examples
31−--------
32−
33− ~zod/try=> (lust `a` [1 1])
34− [p=1 q=2]
35− ~zod/try=> (lust `@t`10 [1 1])
36− [p=2 q=1]
37− ~zod/try=> (lust '9' [10 10])
38− [p=10 q=11]
39− /~zod/try=> (roll "maze" [.(+<+ [1 1])]:lust)
40− [1 5]
41− /~zod/try=> %- roll :_ [.(+<+ [1 1])]:lust
42− """
43− Sam
44− lokes
45− """
46− [2 6]
47−
48−
49−***
docs/programming/advanced/library/src/4d/title.mddeleted−1
@@ -1 +0,0 @@
1−# 4d: parsing (tracing)
docs/programming/advanced/library/src/4e/gate/bend.mddeleted−64
@@ -1,64 +0,0 @@
1−### `++bend`
2−
3−Conditional composer
4−
5−Parsing composer: connects the `++edge` `vex` with the subsequent `++rule` `sab`
6−as an optional suffix, using gate `raq` to compose or reject its
7−result. If there is no suffix, or if the suffix fails to be composed
8−with the current result, the current result is produced. Used to map a
9−group of rules to a specified output.
10−
11−Accepts
12−-------
13−
14−`raq` is a gate.
15−
16−`sab` is a rule.
17−
18−`vex` is an edge.
19−
20−Produces
21−--------
22−
23−A `++rule`.
24−
25−Source
26−------
27−
28− ++ bend :: conditional comp
29− ~/ %bend
30− |* raq/_|*({a/* b/*} [~ u=[a b]])
31− ~/ %fun
32− |* {vex/edge sab/rule}
33− ?~ q.vex
34− vex
35− =+ yit=(sab q.u.q.vex)
36− =+ yur=(last p.vex p.yit)
37− ?~ q.yit
38− [p=yur q=q.vex]
39− =+ vux=(raq p.u.q.vex p.u.q.yit)
40− ?~ vux
41− [p=yur q=q.vex]
42− [p=yur q=[~ u=[p=u.vux q=q.u.q.yit]]]
43− ::
44−
45−Examples
46−--------
47−
48− ~zod/try=> (;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qs")
49− [p=[p=1 q=3] q=[~ u=[p=~~q q=[p=[p=1 q=2] q="s"]]]]
50− ~zod/try=> (;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qqq")
51− [p=[p=1 q=3] q=[~ u=[p=~~r q=[p=[p=1 q=3] q="q"]]]]
52− ~zod/try=> (scan "aa" ;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn))
53− ~~b
54− ~zod/try=> (scan "ba" ;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn))
55− ! {1 3}
56− ! exit
57− ~zod/try=> `(unit @tas)`(scan "" ;~((bend) (easy ~) sym))
58− ~
59− ~zod/try=> `(unit @tas)`(scan "sep" ;~((bend) (easy ~) sym))
60− [~ %sep]
61−
62−
63−
64−***
docs/programming/advanced/library/src/4e/gate/comp.mddeleted−51
@@ -1,51 +0,0 @@
1−### `++comp`
2−
3−Arbitrary compose
4−
5−Parsing composer: connects the `++edge` `vex` with a following `++rule` `sab`,
6−combining the contents of `vex` with the result of `sab` using a binary
7−gate `raq`. Used to fold over the results of several `++rules`.
8−
9−Accepts
10−-------
11−
12−`raq` is a gate that accepts a cell of two nouns, `a` and `b`, and
13−produces a cell of two nouns.
14−
15−`sab` is a rule.
16−
17−`vex` is an edge.
18−
19−Produces
20−--------
21−
22−A `++rule`.
23−
24−Source
25−------
26−
27− ++ comp
28− ~/ %comp
29− |* raq/_|*({a/* b/*} [a b]) :: arbitrary compose
30− ~/ %fun
31− |* {vex/edge sab/rule}
32− ~! +<
33− ?~ q.vex
34− vex
35− =+ yit=(sab q.u.q.vex)
36− =+ yur=(last p.vex p.yit)
37− ?~ q.yit
38− [p=yur q=q.yit]
39− [p=yur q=[~ u=[p=(raq p.u.q.vex p.u.q.yit) q=q.u.q.yit]]]
40− ::
41−
42−Examples
43−--------
44−
45− ~zod/try=> (scan "123" ;~((comp |=([a/@u b/@u] (add a b))) dit dit dit))
46− 6
47− ~zod/try=> (scan "12" ;~((comp |=([a/@u b/@u] (add a b))) dit dit dit))
48− ! {1 3}
49− ! exit
50−
51−***
docs/programming/advanced/library/src/4e/gate/fail.mddeleted−33
@@ -1,33 +0,0 @@
1−### `++fail`
2−
3−Never parse
4−
5−Produces an `++edge` at the same text position (`++hair`) with a failing
6−result (`q=~`).
7−
8−Accepts
9−-------
10−
11−`tub` is a `++nail`.
12−
13−Produces
14−--------
15−
16−An `++edge`.
17−
18−Source
19−------
20−
21− ++ fail |=(tub/nail [p=p.tub q=~]) :: never parse
22−
23−Examples
24−--------
25−
26− ~zod/try=> (fail [[1 1] "abc"])
27− [p=[p=1 q=1] q=~]
28− ~zod/try=> (fail [[p=1.337 q=70] "Parse me, please?"])
29− [p=[p=1.337 q=70] q=~]
30−
31−
32−
33−***
docs/programming/advanced/library/src/4e/gate/glue.mddeleted−48
@@ -1,48 +0,0 @@
1−### `++glue`
2−
3−Skip delimiter
4−
5−Parsing composer: connects an `++edge` `vex` with a following `++rule` `sab` by
6−parsing the `++rule` `bus` (the delimiting symbol) and throwing out the
7−result.
8−
9−Accepts
10−-------
11−
12−`bus` is a `++rule`.
13−
14−`sab` is a `++rule`.
15−
16−`vex` is an `++edge`.
17−
18−Produces
19−--------
20−
21−
22−
23−Source
24−------
25−
26− ++ glue :: add rule
27− ~/ %glue
28− |* bus/rule
29− ~/ %fun
30− |* {vex/edge sab/rule}
31− (plug vex ;~(pfix bus sab))
32− ::
33−
34−Examples
35−--------
36−
37− ~zod/try=> (scan "200|mal|bon" ;~((glue bar) dem sym sym))
38− [q=200 7.102.829 7.237.474]
39− ~zod/try=> `[@u @tas @tas]`(scan "200|mal|bon" ;~((glue bar) dem sym sym))
40− [200 %mal %bon]
41− ~zod/try=> (scan "200|;|bon" ;~((glue bar) dem sem sym))
42− [q=200 ~~~3b. 7.237.474]
43− ~zod/try=> (scan "200.;.bon" ;~((glue dot) dem sem sym))
44− [q=200 ~~~3b. 7.237.474]
45−
46−
47−
48−***
docs/programming/advanced/library/src/4e/gate/less.mddeleted−45
@@ -1,45 +0,0 @@
1−### `++less`
2−
3−Parse unless
4−
5−Parsing composer: if an `++edge` `vex` reflects a success, fail. Otherwise,
6−connect `vex` with the following `++rule`.
7−
8−Accepts
9−-------
10−
11−`sab` is a `++rule`.
12−
13−`vex` is an `++edge`.
14−
15−Produces
16−--------
17−
18−
19−
20−Source
21−------
22−
23− ++ less :: no first and second
24− |* {vex/edge sab/rule}
25− ?~ q.vex
26− =+ roq=(sab)
27− [p=(last p.vex p.roq) q=q.roq]
28− (fail +<.sab)
29− ::
30−
31−Examples
32−--------
33−
34− ~zod/try=> (scan "sas-/lo" (star ;~(less lus bar prn)))
35− "sas-/lo"
36− ~zod/try=> (scan "sas-/l+o" (star ;~(less lus bar prn)))
37− ! {1 8}
38− ! exit
39− ~zod/try=> (scan "sas|-/lo" (star ;~(less lus bar prn)))
40− ! {1 5}
41− ! exit
42−
43−
44−
45−***
docs/programming/advanced/library/src/4e/gate/pfix.mddeleted−35
@@ -1,35 +0,0 @@
1−### `++pfix`
2−
3−Discard first rule
4−
5−Parsing composer: connects an `++edge` `vex` with two subsequent `++rule`s,
6−ignoring the result of the first and producing the result of the second.
7−
8−Accepts
9−-------
10−
11−`vex` is an edge.
12−
13−Produces
14−--------
15−
16−
17−
18−Source
19−------
20−
21− ++ pfix :: discard first rule
22− ~/ %pfix
23− (comp |*({a/* b/*} b))
24−
25−Examples
26−--------
27−
28− ~zod/try=> `@t`(scan "%him" ;~(pfix cen sym))
29− 'him'
30− ~zod/try=> (scan "+++10" ;~(pfix (star lus) dem))
31− q=10
32−
33−
34−
35−***
docs/programming/advanced/library/src/4e/gate/plug.mddeleted−48
@@ -1,48 +0,0 @@
1−### `++plug`
2−
3−Parse to tuple
4−
5−Parsing composer: connects an `++edge` `vex` with a following `++rule` `sab`, producing
6−a cell of both the results. See also: the monad applicator ;\~ for a
7−more detailed explanation.
8−
9−Accepts
10−-------
11−
12−`sab` is a `++rule`.
13−
14−`vex` is an `++edge`.
15−
16−Produces
17−--------
18−
19−
20−
21−Source
22−------
23−
24− ++ plug :: first then second
25− ~/ %plug
26− |* {vex/edge sab/rule}
27− ?~ q.vex
28− vex
29− =+ yit=(sab q.u.q.vex)
30− =+ yur=(last p.vex p.yit)
31− ?~ q.yit
32− [p=yur q=q.yit]
33− [p=yur q=[~ u=[p=[p.u.q.vex p.u.q.yit] q=q.u.q.yit]]]
34− ::
35−
36−Examples
37−--------
38−
39− ~zod/try=> (scan "1..20" ;~(plug dem dot dot dem))
40− [q=1 ~~~. ~~~. q=20]
41− ~zod/try=> (scan "moke/~2014.1.1" ;~(plug sym fas nuck:so))
42− [1.701.539.693 ~~~2f. [% p=[p=~.da q=170.141.184.500.766.106.671.844.917.172.921.958.400]]]
43− ~zod/try=> ;;(,[@tas @t ~ %da @da] (scan "moke/~2014.1.1" ;~(plug sym fas nuck:so)))
44− [%moke '/' ~ %da ~2014.1.1]
45−
46−
47−
48−***
docs/programming/advanced/library/src/4e/gate/pose.mddeleted−48
@@ -1,48 +0,0 @@
1−### `++pose`
2−
3−Parse options
4−
5−Parsing composer: if `vex` reflects a failure, connect it with the
6−following rule `sab`. See also: the monad applicator ;\~
7−
8−Accepts
9−-------
10−
11−`sab` is a `++rule`.
12−
13−`vex` is an `++edge`.
14−
15−Produces
16−--------
17−
18−
19−
20−Source
21−------
22−
23− ++ pose :: first or second
24− ~/ %pose
25− |* {vex/edge sab/rule}
26− ?~ q.vex
27− =+ roq=(sab)
28− [p=(last p.vex p.roq) q=q.roq]
29− vex
30− ::
31−
32−
33−Examples
34−--------
35−
36− ~zod/try=> `@t`(scan "+" ;~(pose lus tar cen))
37− '+'
38− ~zod/try=> `@t`(scan "*" ;~(pose lus tar cen))
39− '*'
40− ~zod/try=> `@t`(scan "%" ;~(pose lus tar cen))
41− '%'
42− ~zod/try=> `@t`(scan "-" ;~(pose lus tar cen))
43− ! {1 1}
44− ! exit
45−
46−
47−
48−***
docs/programming/advanced/library/src/4e/gate/sfix.mddeleted−38
@@ -1,38 +0,0 @@
1−### `++sfix`
2−
3−Discard second rule
4−
5−Parsing composer: connects `++edge`s `vex` with two subsequent `++rule`s returning the
6−result of the first and discarding the result of the second.
7−
8−Accepts
9−-------
10−
11−`a` is the result of parsing the first `++rule`.
12−
13−`b` is the result of of parsing the second `++rule`.
14−
15−Produces
16−--------
17−
18−
19−
20−Source
21−------
22−
23− ++ sfix :: discard second rule
24− ~/ %sfix
25− (comp |*({a/* b/*} a))
26−
27−
28−Examples
29−--------
30−
31− ~zod/try=> `@t`(scan "him%" ;~(sfix sym cen))
32− 'him'
33− ~zod/try=> (scan "10+++" ;~(sfix dem (star lus)))
34− q=10
35−
36−
37−
38−***
docs/programming/advanced/library/src/4e/gate/simu.mddeleted−46
@@ -1,46 +0,0 @@
1−### `++simu`
2−
3−First and second
4−
5−Parsing composer: if an `++edge` `vex` reflects a failure, fail. Otherwise,
6−connect `vex` with the following `++rule`.
7−
8−Accepts
9−-------
10−
11−`sab` is a `++rule`.
12−
13−`vex` is an `++edge`.
14−
15−Produces
16−--------
17−
18−
19−
20−Source
21−------
22−
23− ++ simu :: first and second
24− |* {vex/edge sab/rule}
25− ?~ q.vex
26− vex
27− =+ roq=(sab)
28− roq
29− ::
30−
31−Examples
32−--------
33−
34− ~zod/try=> (scan "~zod" scat:vast)
35− [%dtzy p=%p q=0]
36− ~zod/try=> (scan "%zod" scat:vast)
37− [%dtzz p=%tas q=6.582.138]
38− ~zod/try=> (scan "%zod" ;~(simu cen scat:vast))
39− [%dtzz p=%tas q=6.582.138]
40− ~zod/try=> (scan "~zod" ;~(simu cen scat:vast))
41− ! {1 1}
42− ! exit
43−
44−
45−
46−***
docs/programming/advanced/library/src/4e/title.mddeleted−1
@@ -1 +0,0 @@
1−# 4e: parsing (combinators)
docs/programming/advanced/library/src/4f/gate/bass.mddeleted−44
@@ -1,44 +0,0 @@
1−### `++bass`
2−
3−Parser modifier: LSB
4−ordered `++list` as atom of a `++base`.
5−
6−Accepts
7−-------
8−
9−`wuc` is an atom.
10−
11−`tyd` is a `++rule`.
12−
13−Produces
14−--------
15−
16−A `++rule`.
17−
18−Source
19−------
20−
21− ++ bass
22− |* {wuc/@ tyd/rule}
23− %+ cook
24− |= waq/(list @)
25− %+ roll
26− waq
27− =|({p/@ q/@} |.((add p (mul wuc q))))
28− tyd
29− ::
30−
31−
32−Examples
33−--------
34−
35− ~zod/try=> (scan "123" (bass 10 (star dit)))
36− q=123
37− ~zod/try=> (scan "123" (bass 8 (star dit)))
38− q=83
39− ~zod/try=> `@ub`(scan "123" (bass 8 (star dit)))
40− 0b101.0011
41−
42−
43−
44−***
docs/programming/advanced/library/src/4f/gate/boss.mddeleted−44
@@ -1,44 +0,0 @@
1−
2−### `++boss`
3−
4−Parser modifier: LSB
5−
6−Ordered `++list` as atom of a `++base`.
7−
8−Accepts
9−-------
10−
11−`wuc` is an atom.
12−
13−`tyd` is a `++rule`.
14−
15−Produces
16−--------
17−
18−A `++rule`.
19−
20−Source
21−------
22−
23− ++ boss
24− |* {wuc/@ tyd/rule}
25− %+ cook
26− |= waq/(list @)
27− %+ reel
28− waq
29− =|({p/@ q/@} |.((add p (mul wuc q))))
30− tyd
31− ::
32−
33−Examples
34−--------
35−
36− ~zod/try=> (scan "123" (boss 10 (star dit)))
37− q=321
38− ~zod/try=> `@t`(scan "bam" (boss 256 (star alp)))
39− 'bam'
40− ~zod/try=> `@ux`(scan "bam" (boss 256 (star alp)))
41− 0x6d.6162
42−
43−
44−***
docs/programming/advanced/library/src/4f/gate/cold.mddeleted−43
@@ -1,43 +0,0 @@
1−### `++cold`
2−
3−Replace with constant
4−
5−Parser modifier. Accepts a `++rule` `sef` and produces a parser that
6−produces a constant `cus`, assuming `sef` is successful.
7−
8−Accepts
9−-------
10−
11−`cus` is a constant noun.
12−
13−`sef` is a `++rule`.
14−
15−Produces
16−--------
17−
18−An `++edge`.
19−
20−Source
21−------
22−
23− ++ cold :: replace w+ constant
24− ~/ %cold
25− |* {cus/* sef/rule}
26− ~/ %fun
27− |= tub/nail
28− =+ vex=(sef tub)
29− ?~ q.vex
30− vex
31− [p=p.vex q=[~ u=[p=cus q=q.u.q.vex]]]
32−
33−Examples
34−--------
35−
36− ~zod/try=> ((cold %foo (just 'a')) [[1 1] "abc"])
37− [p=[p=1 q=2] q=[~ u=[p=%foo q=[p=[p=1 q=2] q="bc"]]]]
38− ~zod/try=> ((cold %foo (just 'a')) [[1 1] "bc"])
39− [p=[p=1 q=1] q=~]
40−
41−
42−
43−***
docs/programming/advanced/library/src/4f/gate/cook.mddeleted−48
@@ -1,48 +0,0 @@
1−### `++cook`
2−
3−Apply gate
4−
5−Parser modifier. Produces a parser that takes a (successful) result of a
6−`++rule` `sef` and slams it through `poq`.
7−
8−Accepts
9−-------
10−
11−`poq` is a gate.
12−
13−`sef` is a `++rule`.
14−
15−Produces
16−--------
17−
18−An `++rule`.
19−
20−Source
21−------
22−
23− ++ cook :: apply gate
24− ~/ %cook
25− |* {poq/$-(* *) sef/rule}
26− ~/ %fun
27− |= tub/nail
28− =+ vex=(sef tub)
29− ?~ q.vex
30− vex
31− [p=p.vex q=[~ u=[p=(poq p.u.q.vex) q=q.u.q.vex]]]
32− ::
33−
34−Examples
35−--------
36−
37− ~zod/try=> ((cook ,@ud (just 'a')) [[1 1] "abc"])
38− [p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]]
39− ~zod/try=> ((cook ,@tas (just 'a')) [[1 1] "abc"])
40− [p=[p=1 q=2] q=[~ u=[p=%a q=[p=[p=1 q=2] q="bc"]]]]
41− ~zod/try=> ((cook |=(a=@ +(a)) (just 'a')) [[1 1] "abc"])
42− [p=[p=1 q=2] q=[~ u=[p=98 q=[p=[p=1 q=2] q="bc"]]]]
43− ~zod/try=> ((cook |=(a=@ `@t`+(a)) (just 'a')) [[1 1] "abc"])
44− [p=[p=1 q=2] q=[~ u=[p='b' q=[p=[p=1 q=2] q="bc"]]]]
45−
46−
47−
48−***
docs/programming/advanced/library/src/4f/gate/easy.mddeleted−42
@@ -1,42 +0,0 @@
1−### `++easy`
2−
3−Always parse
4−
5−Parser generator. Produces a parser that succeeds with given noun `huf`
6−without consuming any text.
7−
8−Accepts
9−-------
10−
11−`huf` is a noun.
12−
13−Produces
14−--------
15−
16−A `++rule`.
17−
18−Source
19−------
20−
21− ++ easy :: always parse
22− ~/ %easy
23− |* huf=*
24− ~/ %fun
25− |= tub=nail
26− ^- (like ,_huf)
27− [p=p.tub q=[~ u=[p=huf q=tub]]]
28− ::
29−
30−Examples
31−--------
32−
33− ~zod/try=> ((easy %foo) [[1 1] "abc"])
34− [p=[p=1 q=1] q=[~ [p=%foo q=[p=[p=1 q=1] q="abc"]]]]
35− ~zod/try=> ((easy %foo) [[1 1] "bc"])
36− [p=[p=1 q=1] q=[~ [p=%foo q=[p=[p=1 q=1] q="bc"]]]]
37− ~zod/try=> ((easy 'a') [[1 1] "bc"])
38− [p=[p=1 q=1] q=[~ [p='a' q=[p=[p=1 q=1] q="bc"]]]]
39−
40−
41−
42−***
docs/programming/advanced/library/src/4f/gate/full.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++full`
2−
3−Parse to end
4−
5−Parser modifier. Accepts a `++rule` `sef`, and produces a parser that succeeds only
6−when the of `tub` is fully consumed using `sef`.
7−
8−Accepts
9−-------
10−
11−`sef` is a `++rule`.
12−
13−Produces
14−--------
15−
16−A `++rule`.
17−
18−Source
19−------
20−
21− ++ full :: parse to end
22− |* sef=_rule
23− |= tub=nail
24− =+ vex=(sef tub)
25− ?~(q.vex vex ?:(=(~ q.q.u.q.vex) vex [p=p.vex q=~]))
26− ::
27−
28−Examples
29−--------
30−
31− ~zod/try=> ((full (just 'a')) [[1 1] "ab"])
32− [p=[p=1 q=2] q=~]
33− ~zod/try=> ((full (jest 'ab')) [[1 1] "ab"])
34− [p=[p=1 q=3] q=[~ u=[p='ab' q=[p=[p=1 q=3] q=""]]]]
35− ~zod/try=> ((full ;~(plug (just 'a') (just 'b'))) [[1 1] "ab"])
36− [p=[p=1 q=3] q=[~ u=[p=[~~a ~~b] q=[p=[p=1 q=3] q=""]]]]
37−
38−
39−
40−***
docs/programming/advanced/library/src/4f/gate/funk.mddeleted−37
@@ -1,37 +0,0 @@
1−### `++funk`
2−
3−Add to tape
4−
5−Parser modifier: prepend text to `++tape` before applying parser.
6−
7−Accepts
8−-------
9−
10−`pre` is a `++tape`
11−
12−`sef` is a `++rule`
13−
14−Produces
15−--------
16−
17−A `++rule`.
18−
19−Source
20−------
21−
22− ++ funk :: add to tape first
23− |* {pre/tape sef/rule}
24− |= tub/nail
25− (sef p.tub (weld pre q.tub))
26−
27−Examples
28−--------
29−
30− ~zod/try=> ((funk "abc prefix-" (jest 'abc')) [[1 1] "to be parsed"])
31− [p=[p=1 q=4] q=[~ [p='abc' q=[p=[p=1 q=4] q=" prefix-to be parsed"]]]]
32− ~zod/try=> ((funk "parse" (just 'a')) [[1 4] " me"])
33− [p=[p=1 q=4] q=~]
34−
35−
36−
37−***
docs/programming/advanced/library/src/4f/gate/here.mddeleted−47
@@ -1,47 +0,0 @@
1−### `++here`
2−
3−Place-based apply
4−
5−Parser modifier. Similar to `++cook` in that it produces a parser that takes a
6−(successful) result of `sef` and slams it through `hez`. `hez` accepts a
7−`++pint` `a` and a noun `b`, which is what the parser parsed.
8−
9−Accepts
10−-------
11−
12−`hez` is a gate.
13−
14−`sef` is a `++rule`
15−
16−Produces
17−--------
18−
19−A `++rule`.
20−
21−Source
22−------
23−
24− ++ here :: place-based apply
25− ~/ %here
26− |* {hez/_|=({a/pint b/*} [a b]) sef/rule}
27− ~/ %fun
28− |= tub/nail
29− =+ vex=(sef tub)
30− ?~ q.vex
31− vex
32− [p=p.vex q=[~ u=[p=(hez [p.tub p.q.u.q.vex] p.u.q.vex) q=q.u.q.vex]]]
33− ::
34−
35−Examples
36−--------
37−
38− ~zod/try=> (scan "abc" (star alf))
39− "abc"
40− ~zod/try=> (scan "abc" (here |*(^ +<) (star alf)))
41− [[[p=1 q=1] p=1 q=4] "abc"]
42− ~zod/try=> (scan "abc" (star (here |*(^ +<) alf)))
43− ~[[[[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]]
44−
45−
46−
47−***
docs/programming/advanced/library/src/4f/gate/ifix.mddeleted−41
@@ -1,41 +0,0 @@
1−### `++ifix`
2−
3−Infix
4−
5−Parser modifier: surround with pair of `++rule`s, the output of which is
6−discarded.
7−
8−Accepts
9−-------
10−
11−`fel` is a pair of `++rule`s.
12−
13−`hof` is a `++rule`.
14−
15−Produces
16−--------
17−
18−A `++rule`.
19−
20−Source
21−------
22−
23− ++ ifix
24− |* {fel/{rule rule} hof/rule}
25− ~! +<
26− ~! +<:-.fel
27− ~! +<:+.fel
28− ;~(pfix -.fel ;~(sfix hof +.fel))
29− ::
30−
31−Examples
32−--------
33−
34− ~zod/try=> (scan "-40-" (ifix [hep hep] dem))
35− q=40
36− ~zod/try=> (scan "4my4" (ifix [dit dit] (star alf)))
37− "my"
38−
39−
40−
41−***
docs/programming/advanced/library/src/4f/gate/jest.mddeleted−50
@@ -1,50 +0,0 @@
1−### `++jest`
2−
3−Match a cord
4−
5−Match and consume a cord.
6−
7−Accepts
8−-------
9−
10−`daf` is a `@t`.
11−
12−Produces
13−--------
14−
15−An `++edge`.
16−
17−Source
18−------
19−
20− ++ jest :: match a cord
21− |= daf/@t
22− |= tub/nail
23− =+ fad=daf
24− |- ^- (like @t)
25− ?: =(`@`0 daf)
26− [p=p.tub q=[~ u=[p=fad q=tub]]]
27− ?: |(?=($~ q.tub) !=((end 3 1 daf) i.q.tub))
28− (fail tub)
29− $(p.tub (lust i.q.tub p.tub), q.tub t.q.tub, daf (rsh 3 1 daf))
30− ::
31−
32−Examples
33−--------
34−
35− ~zod/try=> ((jest 'abc') [[1 1] "abc"])
36− [p=[p=1 q=4] q=[~ [p='abc' q=[p=[p=1 q=4] q=""]]]]
37− ~zod/try=> (scan "abc" (jest 'abc'))
38− 'abc'
39− ~zod/try=> (scan "abc" (jest 'acb'))
40− ! {1 2}
41− ! 'syntax-error'
42− ! exit
43− ~zod/try=> ((jest 'john doe') [[1 1] "john smith"])
44− [p=[p=1 q=6] q=~]
45− ~zod/try=> ((jest 'john doe') [[1 1] "john doe"])
46− [p=[p=1 q=9] q=[~ [p='john doe' q=[p=[p=1 q=9] q=""]]]]
47−
48−
49−
50−***
docs/programming/advanced/library/src/4f/gate/just.mddeleted−50
@@ -1,50 +0,0 @@
1−### `++just`
2−
3−Match a char
4−
5−Match and consume a single character.
6−
7−Accepts
8−-------
9−
10−`daf` is a `++char`
11−
12−Produces
13−--------
14−
15−A `++rule`.
16−
17−Source
18−------
19−
20− ++ just :: XX redundant, jest
21− ~/ %just :: match a char
22− |= daf/char
23− ~/ %fun
24− |= tub/nail
25− ^- (like char)
26− ?~ q.tub
27− (fail tub)
28− ?. =(daf i.q.tub)
29− (fail tub)
30− (next tub)
31− ::
32−
33−
34−Examples
35−--------
36−
37− ~zod/try=> ((just 'a') [[1 1] "abc"])
38− [p=[p=1 q=2] q=[~ [p=~~a q=[p=[p=1 q=2] q="bc"]]]]
39− ~zod/try=> (scan "abc" (just 'a'))
40− ! {1 2}
41− ! 'syntax-error'
42− ! exit
43− ~zod/try=> (scan "a" (just 'a'))
44− ~~a
45− ~zod/try=> (scan "%" (just '%'))
46− ~~~25.
47−
48−
49−
50−***
docs/programming/advanced/library/src/4f/gate/knee.mddeleted−56
@@ -1,56 +0,0 @@
1−### `++knee`
2−
3−Recursive parsers
4−
5−Used for recursive parsers, which would otherwise be infinite when
6−compiled.
7−
8−Accepts
9−-------
10−
11−`gar` is a noun.
12−
13−`sef` is a gate that accepts a `++rule`
14−
15−Produces
16−--------
17−
18−A `++rule`.
19−
20−Source
21−------
22−
23− ++ knee :: callbacks
24− |* {gar/* sef/_|.(*rule)}
25− |= tub/nail
26− ^- (like _gar)
27− ((sef) tub)
28− ::
29−
30−Examples
31−--------
32−
33− ~zod/try=> |-(;~(plug prn ;~(pose $ (easy ~))))
34− ! rest-loop
35− ! exit
36− ~zod/try=> |-(;~(plug prn ;~(pose (knee *tape |.(^$)) (easy ~))))
37− < 1.obo
38− [ c=c=tub=[p=[p=@ud q=@ud] q=""]
39− b
40− < 1.bes
41− [ c=tub=[p=[p=@ud q=@ud] q=""]
42− b=<1.tnv [tub=[p=[p=@ud q=@ud] q=""] <1.ktu [daf=@tD <414.fvk 101.jzo 1.ypj %164>]>]>
43− a=<1.fvg [tub=[p=[p=@ud q=@ud] q=""] <1.khu [[les=@ mos=@] <414.fvk 101.jzo 1.ypj %164>]>]>
44− v=<414.fvk 101.jzo 1.ypj %164>
45− ]
46− >
47− a
48− ... 450 lines omitted ...
49− ]
50− >
51− ~zod/try=> (scan "abcd" |-(;~(plug prn ;~(pose (knee *tape |.(^$)) (easy ~)))))
52− [~~a "bcd"]
53−
54−
55−
56−***
docs/programming/advanced/library/src/4f/gate/mask.mddeleted−48
@@ -1,48 +0,0 @@
1−### `++mask`
2−
3−Match char
4−
5−Parser generator. Matches the next character if it is in a list of
6−characters.
7−
8−Accepts
9−-------
10−
11−`bud` is a list of `++char`
12−
13−Produces
14−--------
15−
16−A `++rule`.
17−
18−Source
19−------
20−
21− ++ mask :: match char in set
22− ~/ %mask
23− |= bud/(list char)
24− ~/ %fun
25− |= tub/nail
26− ^- (like char)
27− ?~ q.tub
28− (fail tub)
29− ?. (lien bud |=(a/char =(i.q.tub a)))
30− (fail tub)
31− (next tub)
32− ::
33−
34−Examples
35−--------
36−
37− ~zod/try=> (scan "a" (mask "cba"))
38− ~~a
39− ~zod/try=> ((mask "abc") [[1 1] "abc"])
40− [p=[p=1 q=2] q=[~ [p=~~a q=[p=[p=1 q=2] q="bc"]]]]
41− ~zod/try=> ((mask "abc") [[1 1] "bbc"])
42− [p=[p=1 q=2] q=[~ [p=~~b q=[p=[p=1 q=2] q="bc"]]]]
43− ~zod/try=> ((mask "abc") [[1 1] "dbc"])
44− [p=[p=1 q=1] q=~]
45−
46−
47−
48−***
docs/programming/advanced/library/src/4f/gate/more.mddeleted−39
@@ -1,39 +0,0 @@
1−### `++more`
2−
3−Parse list with delimiter
4−
5−Parser modifier: Parse a list of matches using a delimiter `++rule`.
6−
7−Accepts
8−-------
9−
10−`bus` is a `++rule`.
11−
12−`fel` is a `++rule`.
13−
14−Produces
15−--------
16−
17−A `++rule`.
18−
19−Source
20−------
21−
22− ++ more
23− |* {bus/rule fel/rule}
24− ;~(pose (most bus fel) (easy ~))
25− ::
26−
27−Examples
28−--------
29−
30− ~zod/try=> (scan "" (more ace dem))
31− ~
32− ~zod/try=> (scan "40 20" (more ace dem))
33− [q=40 ~[q=20]]
34− ~zod/try=> (scan "40 20 60 1 5" (more ace dem))
35− [q=40 ~[q=20 q=60 q=1 q=5]]
36−
37−
38−
39−***
docs/programming/advanced/library/src/4f/gate/most.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++most`
2−
3−Parse list of at least one match
4−
5−Parser modifier: parse a `++list` of at least one match using a delimiter `++rule`.
6−
7−Accepts
8−-------
9−
10−`bus` is a `++rule`.
11−
12−`fel` is a `++rule`.
13−
14−Produces
15−--------
16−
17−A `++rule`.
18−
19−Source
20−------
21−
22− ++ most
23− |* {bus/rule fel/rule}
24− ;~(plug fel (star ;~(pfix bus fel)))
25− ::
26−
27−Examples
28−--------
29−
30− ~zod/try=> (scan "40 20" (most ace dem))
31− [q=40 ~[q=20]]
32− ~zod/try=> (scan "40 20 60 1 5" (most ace dem))
33− [q=40 ~[q=20 q=60 q=1 q=5]]
34− ~zod/try=> (scan "" (most ace dem))
35− ! {1 1}
36− ! exit
37−
38−
39−
40−***
docs/programming/advanced/library/src/4f/gate/next.mddeleted−39
@@ -1,39 +0,0 @@
1−### `++next`
2−
3−Consume char
4−
5−Consume any character, producing it as a result.
6−
7−Accepts
8−-------
9−
10−`tub` is a `++nail`
11−
12−Produces
13−--------
14−
15−An `++edge`.
16−
17−Source
18−------
19−
20− ++ next :: consume a char
21− |= tub/nail
22− ^- (like char)
23− ?~ q.tub
24− (fail tub)
25− =+ zac=(lust i.q.tub p.tub)
26− [zac [~ i.q.tub [zac t.q.tub]]]
27− ::
28−
29−Examples
30−--------
31−
32− ~zod/try=> (next [[1 1] "ebc"])
33− [p=[p=1 q=2] q=[~ [p=~~e q=[p=[p=1 q=2] q="bc"]]]]
34− ~zod/try=> (next [[1 1] "john jumps jones"])
35− [p=[p=1 q=2] q=[~ [p=~~j q=[p=[p=1 q=2] q="ohn jumps jones"]]]]
36−
37−
38−
39−***
docs/programming/advanced/library/src/4f/gate/plus.mddeleted−38
@@ -1,38 +0,0 @@
1−
2−### `++plus`
3−
4−List of at least one match.
5−
6−Parser modifier: parse `++list` of at least one match.
7−
8−Accepts
9−-------
10−
11−`fel` is a `++rule`.
12−
13−Produces
14−--------
15−
16−A `++rule`.
17−
18−Source
19−------
20−
21− ++ plus |*(fel/rule ;~(plug fel (star fel)))
22−
23−
24−Examples
25−--------
26−
27− ~zod/try=> (scan ">>>>" (cook lent (plus gar)))
28− 4
29− ~zod/try=> (scan "- - " (plus ;~(pose ace hep)))
30− [~~- " - "]
31− ~zod/try=> `tape`(scan "- - " (plus ;~(pose ace hep)))
32− "- - "
33− ~zod/try=> `(pole ,@t)`(scan "- - " (plus ;~(pose ace hep)))
34− ['-' [' ' [' ' ['-' [' ' ~]]]]]
35−
36−
37−
38−***
docs/programming/advanced/library/src/4f/gate/sear.mddeleted−43
@@ -1,43 +0,0 @@
1−### `++sear`
2−
3−Conditional `++cook`
4−
5−Conditional `++cook`. Slams the result through a gate that produces
6−a unit; if that unit is empty, fail.
7−
8−Accepts
9−-------
10−
11−`tub` is a `++nail`.
12−Produces
13−--------
14−
15−A `++rule`.
16−
17−Source
18−------
19−
20− ++ sear :: conditional cook
21− |* {pyq/$-(* (unit)) sef/rule}
22− |= tub/nail
23− =+ vex=(sef tub)
24− ?~ q.vex
25− vex
26− =+ gey=(pyq p.u.q.vex)
27− ?~ gey
28− [p=p.vex q=~]
29− [p=p.vex q=[~ u=[p=u.gey q=q.u.q.vex]]]
30− ::
31−
32−
33−Examples
34−--------
35−
36− ~zod/try=> ((sear |=(a/* ?@(a (some a) ~)) (just `a`)) [[1 1] "abc"])
37− [p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]]
38− ~zod/try=> ((sear |=(* ~) (just 'a')) [[1 1] "abc"])
39− [p=[p=1 q=2] q=~]
40−
41−
42−
43−***
docs/programming/advanced/library/src/4f/gate/shim.mddeleted−47
@@ -1,47 +0,0 @@
1−### `++shim`
2−
3−Char in range
4−
5−Match characters (`++char`) within a range.
6−
7−Accepts
8−-------
9−
10−`les` is an atom.
11−
12−`mos` is an atom.
13−
14−Produces
15−--------
16−
17−A `++rule`.
18−
19−Source
20−------
21−
22− ++ shim :: match char in range
23− ~/ %shim
24− |= {les/@ mos/@}
25− ~/ %fun
26− |= tub/nail
27− ^- (like char)
28− ?~ q.tub
29− (fail tub)
30− ?. ?&((gte i.q.tub les) (lte i.q.tub mos))
31− (fail tub)
32− (next tub)
33− ::
34−
35−Examples
36−--------
37−
38− ~zod/try=> ((shim 'a' 'z') [[1 1] "abc"])
39− [p=[p=1 q=2] q=[~ [p=~~a q=[p=[p=1 q=2] q="bc"]]]]
40− ~zod/try=> ((shim 'a' 'Z') [[1 1] "abc"])
41− [p=[p=1 q=1] q=~]
42− ~zod/try=> ((shim 'a' 'Z') [[1 1] "Abc"])
43− [p=[p=1 q=2] q=[~ [p=~~~41. q=[p=[p=1 q=2] q="bc"]]]]
44−
45−
46−
47−***
docs/programming/advanced/library/src/4f/gate/slug.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++slug`
2−
3−Use gate to parse delimited list
4−
5−Parser modifier: By composing with a gate, parse a delimited `++list` of
6−matches.
7−
8−Accepts
9−-------
10−
11−`bus` is a `++rule`.
12−
13−`fel` is a `++rule`.
14−
15−Produces
16−--------
17−
18−A `++rule`.
19−
20−Source
21−------
22−
23− ++ slug
24− |* raq/_|*({a/* b/*} [a b])
25− |* {bus/rule fel/rule}
26− ;~((comp raq) fel (stir +<+.raq raq ;~(pfix bus fel)))
27− ::
28−
29−
30−Examples
31−--------
32−
33− ~zod/try=> (scan "20+5+110" ((slug add) lus dem))
34− 135
35− ~zod/try=> `@t`(scan "a b c" ((slug |=(a/[@ @t] (cat 3 a))) ace alp))
36− 'abc'
37−
38−
39−
40−***
docs/programming/advanced/library/src/4f/gate/stag.mddeleted−45
@@ -1,45 +0,0 @@
1−### `++stag`
2−
3−Add label
4−
5−Add a label to an edge parsed by a rule.
6−
7−Accepts
8−-------
9−
10−`gob` is a noun.
11−
12−`sef` is a rule.
13−
14−Produces
15−--------
16−
17−A `++rule`.
18−
19−Source
20−------
21−
22− ++ stag :: add a label
23− ~/ %stag
24− |* {gob/* sef/rule}
25− ~/ %fun
26− |= tub/nail
27− =+ vex=(sef tub)
28− ?~ q.vex
29− vex
30− [p=p.vex q=[~ u=[p=[gob p.u.q.vex] q=q.u.q.vex]]]
31− ::
32−
33−Examples
34−--------
35−
36− ~zod/try=> ((stag %foo (just 'a')) [[1 1] "abc"])
37− [p=[p=1 q=2] q=[~ u=[p=[%foo ~~a] q=[p=[p=1 q=2] q="bc"]]]]
38− ~zod/try=> ((stag "xyz" (jest 'abc')) [[1 1] "abc"])
39− [p=[p=1 q=4] q=[~ u=[p=["xyz" 'abc'] q=[p=[p=1 q=4] q=""]]]]
40− ~zod/try=> ((stag 10.000 (shim 0 100)) [[1 1] "abc"])
41− [p=[p=1 q=2] q=[~ u=[p=[10.000 ~~a] q=[p=[p=1 q=2] q="bc"]]]]
42−
43−
44−
45−***
docs/programming/advanced/library/src/4f/gate/star.mddeleted−39
@@ -1,39 +0,0 @@
1−### `++star`
2−
3−List of matches
4−
5−Parser modifier: parse `++list` of matches.
6−
7−Accepts
8−-------
9−
10−`fel` is a `++rule`.
11−
12−Produces
13−--------
14−
15− ++ star :: 0 or more times
16− |* fel/rule
17− (stir `(list _(wonk *fel))`~ |*({a/* b/*} [a b]) fel)
18−
19−Examples
20−--------
21−
22− ~zod/try=> (scan "aaaaa" (just 'a'))
23− ! {1 2}
24− ! 'syntax-error'
25− ! exit
26− ~zod/try=> (scan "aaaaa" (star (just 'a')))
27− "aaaaa"
28− ~zod/try=> (scan "abcdef" (star (just 'a')))
29− ! {1 2}
30− ! 'syntax-error'
31− ! exit
32− ~zod/try=> (scan "abcabc" (star (jest 'abc')))
33− <|abc abc|>
34− ~zod/try=> (scan "john smith" (star (shim 0 200)))
35− "john smith"
36−
37−
38−
39−***
docs/programming/advanced/library/src/4f/gate/stet.mddeleted−52
@@ -1,52 +0,0 @@
1−### `++stet`
2−
3−Add faces
4−
5−Add faces `[p q]` to range-parser pairs in a list.
6−
7−Accepts
8−-------
9−
10−`leh` is a list of range-parsers.
11−
12−Produces
13−--------
14−
15−
16−
17−Source
18−------
19−
20− ++ stet
21− |* leh/(list {?(@ {@ @}) rule})
22− |-
23− ?~ leh
24− ~
25− [i=[p=-.i.leh q=+.i.leh] t=$(leh t.leh)]
26− ::
27−
28−Examples
29−--------
30−
31− ~zod/try=> (stet (limo [[5 (just 'a')] [1 (jest 'abc')] [[1 1] (shim 0 200)]
32− [[1 10] (cold %foo (just 'a'))]~]))
33− ~[
34− [p=5 q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
35− [p=1 q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
36− [p=[1 1] q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
37− [p=[1 10] q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
38− ]
39− ~zod/try=> [[[1 1] (just 'a')] [[2 1] (shim 0 200)] ~]
40− [ [[1 1] <1.tnv [tub=[p=[p=@ud q=@ud] q=""] <1.ktu [daf=@tD <414.fvk 101.jzo 1.ypj %164>]>]>]
41− [[2 1] <1.fvg [tub=[p=[p=@ud q=@ud] q=""] <1.khu [[les=@ mos=@] <414.fvk 101.jzo 1.ypj %164>]>]>]
42− ~
43− ]
44− ~zod/try=> (stet (limo [[[1 1] (just 'a')] [[2 1] (shim 0 200)] ~]))
45− ~[
46− [p=[1 1] q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
47− [p=[2 1] q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
48− ]
49−
50−
51−
52−***
docs/programming/advanced/library/src/4f/gate/stew.mddeleted−58
@@ -1,58 +0,0 @@
1−### `++stew`
2−
3−Switch by first
4−
5− ++ stew :: switch by first char
6− ~/ %stew
7− |* leh/(list {p/?(@ {@ @}) q/rule}) :: char+range keys
8− =+ ^= wor :: range complete lth
9− |= {ort/?(@ {@ @}) wan/?(@ {@ @})}
10− ?@ ort
11− ?@(wan (lth ort wan) (lth ort -.wan))
12− ?@(wan (lth +.ort wan) (lth +.ort -.wan))
13− =+ ^= hel :: build parser map
14− =+ hel=`(tree _?>(?=(^ leh) i.leh))`~
15− |- ^+ hel
16− ?~ leh
17− ~
18− =+ yal=$(leh t.leh)
19− |- ^+ hel
20− ?~ yal
21− [i.leh ~ ~]
22− ?: (wor p.i.leh p.n.yal)
23− =+ nuc=$(yal l.yal)
24− ?> ?=(^ nuc)
25− ?: (vor p.n.yal p.n.nuc)
26− [n.yal nuc r.yal]
27− [n.nuc l.nuc [n.yal r.nuc r.yal]]
28− =+ nuc=$(yal r.yal)
29− ?> ?=(^ nuc)
30− ?: (vor p.n.yal p.n.nuc)
31− [n.yal l.yal nuc]
32− [n.nuc [n.yal l.yal l.nuc] r.nuc]
33− ~% %fun ..^$ ~
34− |= tub/nail
35− ?~ q.tub
36− (fail tub)
37− |-
38− ?~ hel
39− (fail tub)
40− ?: ?@ p.n.hel
41− =(p.n.hel i.q.tub)
42− ?&((gte i.q.tub -.p.n.hel) (lte i.q.tub +.p.n.hel))
43− :: (q.n.hel [(lust i.q.tub p.tub) t.q.tub])
44− (q.n.hel tub)
45− ?: (wor i.q.tub p.n.hel)
46− $(hel l.hel)
47− $(hel r.hel)
48− ::
49−
50−
51−
52−Parser generator. From an associative `++list` of characters or character
53−ranges to `++rule`s, construct a `++map`, and parse `++tape`s only
54−with `++rules` associated with a range that the `++tape`'s first character falls in.
55−
56−
57−
58−***
docs/programming/advanced/library/src/4f/gate/stir.mddeleted−56
@@ -1,56 +0,0 @@
1−### `++stir`
2−
3−Parse repeatedly
4−
5−Parse with `++rule` as many times as possible, and fold over results with a
6−binary gate.
7−
8−Accepts
9−-------
10−
11−`rud` is a noun.
12−
13−`raq` is a gate that takes two nouns and produces a cell.
14−
15−`fel` is a rule.
16−
17−Produces
18−--------
19−
20−A rule.
21−
22−Source
23−------
24−
25− ++ stun :: parse several times
26− |* {lig/{@ @} fel/rule}
27− |= tub/nail
28− ^- (like (list _(wonk (fel))))
29− ?: =(0 +.lig)
30− [p.tub [~ ~ tub]]
31− =+ vex=(fel tub)
32− ?~ q.vex
33− ?: =(0 -.lig)
34− [p.vex [~ ~ tub]]
35− vex
36− =+ ^= wag %= $
37− -.lig ?:(=(0 -.lig) 0 (dec -.lig))
38− +.lig ?:(=(0 +.lig) 0 (dec +.lig))
39− tub q.u.q.vex
40− ==
41− ?~ q.wag
42− wag
43− [p.wag [~ [p.u.q.vex p.u.q.wag] q.u.q.wag]]
44−
45−
46−Examples
47−--------
48−
49− ~zod/try=> (scan "abc" (stir *@ add prn))
50− 294
51− ~zod/try=> (roll "abc" add)
52− b=294
53−
54−
55−
56−***
docs/programming/advanced/library/src/4f/gate/stun.mddeleted−52
@@ -1,52 +0,0 @@
1−### `++stun`
2−
3−Parse several times
4−
5−Parse bounded number of times.
6−
7−Accepts
8−-------
9−
10−`[les=@ mos=@]` is a cell of atoms indicating the bounds.
11−
12−`fel` is a `++rule`.
13−
14−Produces
15−--------
16−
17−A `++rule`.
18−
19−Source
20−------
21−
22− ++ stun :: parse several times
23− |* {lig/{@ @} fel/rule}
24− |= tub/nail
25− ^- (like (list _(wonk (fel))))
26− ?: =(0 +.lig)
27− [p.tub [~ ~ tub]]
28− =+ vex=(fel tub)
29− ?~ q.vex
30− ?: =(0 -.lig)
31− [p.vex [~ ~ tub]]
32− vex
33− =+ ^= wag %= $
34− -.lig ?:(=(0 -.lig) 0 (dec -.lig))
35− +.lig ?:(=(0 +.lig) 0 (dec +.lig))
36− tub q.u.q.vex
37− ==
38− ?~ q.wag
39− wag
40− [p.wag [~ [p.u.q.vex p.u.q.wag] q.u.q.wag]]
41−
42−Examples
43−--------
44−
45− ~zod/try=> ((stun [5 10] prn) [1 1] "aquickbrownfoxran")
46− [p=[p=1 q=11] q=[~ [p="aquickbrow" q=[p=[p=1 q=11] q="nfoxran"]]]]
47− ~zod/try=> ((stun [5 10] prn) [1 1] "aquickbro")
48− [p=[p=1 q=10] q=[~ [p="aquickbro" q=[p=[p=1 q=10] q=""]]]]
49− ~zod/try=> ((stun [5 10] prn) [1 1] "aqui")
50− [p=[p=1 q=5] q=~]
51−
52−***
docs/programming/advanced/library/src/4f/title.mddeleted−1
@@ -1 +0,0 @@
1−# 4f: parsing (rule builders)
docs/programming/advanced/library/src/4g/gate/rash.mddeleted−44
@@ -1,44 +0,0 @@
1−### `++rash`
2−
3−Parse or crash
4−
5−Parse a cord with a given `++rule` and crash if the `++cord` isn't entirely
6−parsed.
7−
8−Accepts
9−-------
10−
11−`naf` is an atom.
12−
13−`sab` is a `++rule`.
14−
15−Produces
16−--------
17−
18−The value of the parse result, or crash.
19−
20−Source
21−------
22−
23− ++ rash |*({naf/@ sab/rule} (scan (trip naf) sab)) ::
24−
25−
26−Examples
27−--------
28−
29− ~zod/try=> (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− ~zod/try=> (rash 'abc' (just 'a'))
32− ! {1 2}
33− ! 'syntax-error'
34− ! exit
35− ~zod/try=> (rash 'abc' (jest 'abc'))
36− 'abc'
37− `~zod/try=> (rash 'abc' (jest 'ab'))
38− ! {1 3}
39− ! 'syntax-error'
40− ! exit
41−
42−
43−
44−***
docs/programming/advanced/library/src/4g/gate/rush.mddeleted−42
@@ -1,42 +0,0 @@
1−### `++rush`
2−
3−Parse or null
4−
5−Parse a given with a given rule and produce null if the cord isn't
6−entirely parsed.
7−
8−Accepts
9−-------
10−
11−`naf` is an atom.
12−
13−`sab` is a rule.
14−
15−Produces
16−--------
17−
18−The value of the parse result, or null.
19−
20−Source
21−------
22−
23− ++ rush |*({naf/@ sab/rule} (rust (trip naf) sab))
24−
25−
26−Examples
27−--------
28−
29− ~zod/try=> (rush '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− ~zod/try=> (rush 'abc' (just 'a'))
32− ~
33− ~zod/try=> (rush 'abc' (jest 'abc'))
34− [~ 'abc']
35− ~zod/try=> (rush 'abc' (jest 'ac'))
36− ~
37− ~zod/try=> (rush 'abc' (jest 'ab'))
38− ~
39−
40−
41−
42−***
docs/programming/advanced/library/src/4g/gate/rust.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++rust`
2−
3−Parse tape or null
4−
5−Parse a `++tape` with a given `++rule` and produce null if the `++tape` isn't
6−entirely parsed.
7−
8−Accepts
9−-------
10−
11−`los` is a `++tape`.
12−
13−`sab` is a `++rule`.
14−
15−Produces
16−--------
17−
18−A `(unit ,@t)`
19−
20−Source
21−------
22−
23− ++ rust |* {los/tape sab/rule}
24− =+ vex=((full sab) [[1 1] los])
25− ?~(q.vex ~ [~ u=p.u.q.vex])
26−
27−
28−Examples
29−--------
30−
31− ~zod/try=> (rust "I was the world in which I walked, and what I saw" (star (shim 0 200)))
32− [~ "I was the world in which I walked, and what I saw"]
33− ~zod/try=> (rust "Or heard or felt came not but from myself;" (star (shim 0 200)))
34− [~ "Or heard or felt came not but from myself;"]
35− ~zod/try=> (rust "And there I found myself more truly and more strange." (jest 'And there I'))
36− ~
37−
38−
39−
40−***
docs/programming/advanced/library/src/4g/gate/scan.mddeleted−43
@@ -1,43 +0,0 @@
1−### `++scan`
2−
3−Parse tape or crash
4−
5−Parse a `++tape` with a given `++rule` and crash if the `++tape` isn't entirely
6−parsed.
7−
8−Accepts
9−-------
10−
11−`los` is a tape.
12−
13−`sab` is a rule.
14−
15−Produces
16−--------
17−
18−Either a `++tape` or a crash.
19−
20−Source
21−------
22−
23− ++ scan |* {los/tape sab/rule}
24− =+ vex=((full sab) [[1 1] los])
25− ?~ q.vex
26− ~_ (show [%m '{%d %d}'] p.p.vex q.p.vex ~)
27− ~|('syntax-error' !!)
28− p.u.q.vex
29−
30−Examples
31−--------
32−
33− ~zod/try=> (scan "I was the world in which I walked, and what I saw" (star (shim 0 200)))
34− "I was the world in which I walked, and what I saw"
35− ~zod/try=> (scan "Or heard or felt came not but from myself;" (star (shim 0 200)))
36− "Or heard or felt came not but from myself;"
37− ~zod/try=> (scan "And there I found myself more truly and more strange." (jest 'And there I'))
38− ! {1 12}
39− ! 'syntax-error'
40− ! exit
41−
42−
43−***
docs/programming/advanced/library/src/4g/title.mddeleted−1
@@ -1 +0,0 @@
1−# 4g: parsing (outside caller)
docs/programming/advanced/library/src/4h/gate/ace.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++ace`
2−
3−Parse space
4−
5−Parses ASCII character 32, space.
6−
7−Source
8−------
9−
10− ++ ace (just ' ')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan " " ace)
16− ~~.
17− ~zod/try=> `cord`(scan " " ace)
18− ' '
19− ~zod/try=> (ace [[1 1] " "])
20− [p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (ace [[1 1] " abc "])
22− [p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q="abc "]]]]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/bar.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++bar`
2−
3−Parse vertical bar
4−
5−Parses ASCII character 124, the vertical bar.
6−
7−Source
8−------
9−
10− ++ bar (just '|')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "|" bar)
16− ~~~7c.
17− ~zod/try=> `cord`(scan "|" bar)
18− '|'
19− ~zod/try=> (bar [[1 1] "|"])
20− [p=[p=1 q=2] q=[~ [p=~~~7c. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (bar [[1 1] "|="])
22− [p=[p=1 q=2] q=[~ [p=~~~7c. q=[p=[p=1 q=2] q="="]]]]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/bas.mddeleted−30
@@ -1,30 +0,0 @@
1−### `++bas`
2−
3−Parse backslash
4−
5−Parses ASCII character 92, the backslash. Note the extra `\` in the calling of
6−`bas` with [`++just`](/doc/hoon/library/2ec#++just) is to escape the escape
7−character, `\`.
8−
9−Source
10−------
11−
12− ++ bas (just '\\')
13−
14−Examples
15−--------
16−
17− ~zod/try=> (scan "\\" bas)
18− ~~~5c.
19− ~zod/try=> `cord`(scan "\\" bas)
20− '\'
21− ~zod/try=> (bas [[1 1] "\"])
22− ~ <syntax error at [1 18]>
23− ~zod/try=> (bas [[1 1] "\\"])
24− [p=[p=1 q=2] q=[~ [p=~~~5c. q=[p=[p=1 q=2] q=""]]]]
25− ~zod/try=> (bas [[1 1] "\""])
26− [p=[p=1 q=1] q=~]
27−
28−
29−
30−***
docs/programming/advanced/library/src/4h/gate/buc.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++buc`
2−
3−Parse dollar sign
4−
5−Parses ASCII character 36, the dollar sign.
6−
7−Source
8−------
9−
10− ++ buc (just '$')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "$" buc)
16− ~~~24.
17− ~zod/try=> `cord`(scan "$" buc)
18− '$'
19− ~zod/try=> (buc [[1 1] "$"])
20− [p=[p=1 q=2] q=[~ [p=~~~24. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (buc [[1 1] "$%"])
22− [p=[p=1 q=2] q=[~ [p=~~~24. q=[p=[p=1 q=2] q="%"]]]]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/cab.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++cab`
2−
3−Parse underscore
4−
5−Parses ASCII character 95, the underscore.
6−
7−Source
8−------
9−
10− ++ cab (just '_')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "_" cab)
16− ~~~5f.
17− ~zod/try=> `cord`(scan "_" cab)
18− '_'
19− ~zod/try=> (cab [[1 1] "_"])
20− [p=[p=1 q=2] q=[~ [p=~~~5f. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (cab [[1 1] "|_"])
22− [p=[p=1 q=1] q=~]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/cen.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++cen`
2−
3−Parses percent sign
4−
5−Parses ASCII character 37, the percent sign.
6−
7−Source
8−------
9−
10− ++ cen (just '%')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "%" cen)
16− ~~~25.
17− ~zod/try=> `cord`(scan "%" cen)
18− '%'
19− ~zod/try=> (cen [[1 1] "%"])
20− [p=[p=1 q=2] q=[~ [p=~~~25. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (cen [[1 1] "%^"])
22− [p=[p=1 q=2] q=[~ [p=~~~25. q=[p=[p=1 q=2] q="^"]]]]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/col.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++col`
2−
3−Parse colon
4−
5−Parses ASCII character 58, the colon
6−
7−Source
8−------
9−
10− ++ col (just ':')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan ":" col)
16− ~~~3a.
17− ~zod/try=> `cord`(scan ":" col)
18− ':'
19− ~zod/try=> (col [[1 1] ":"])
20− [p=[p=1 q=2] q=[~ [p=~~~3a. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (col [[1 1] ":-"])
22− [p=[p=1 q=2] q=[~ [p=~~~3a. q=[p=[p=1 q=2] q="-"]]]]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/com.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++com`
2−
3−Parse comma
4−
5−Parses ASCII character 44, the comma.
6−
7−Source
8−------
9−
10− ++ com (just ',')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "," com)
16− ~~~2c.
17− ~zod/try=> `cord`(scan "," com)
18− ','
19− ~zod/try=> (com [[1 1] ","])
20− [p=[p=1 q=2] q=[~ [p=~~~2c. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (com [[1 1] "not com"])
22− [p=[p=1 q=1] q=~]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/doq.mddeleted−30
@@ -1,30 +0,0 @@
1−### `++doq`
2−
3−Parse double quote
4−
5−Parses ASCII character 34, the double quote.
6−
7−Source
8−------
9−
10− ++ doq (just '"')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "\"" doq)
16− ~~~22.
17− ~zod/try=> `cord`(scan "\"" doq)
18− '"'
19− ~zod/try=> (doq [[1 1] "\""])
20− [p=[p=1 q=2] q=[~ [p=~~~22. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (doq [[1 1] "not successfully parsed"])
22− [p=[p=1 q=1] q=~]
23− ~zod/try=> (scan "see?" doq)
24− ! {1 1}
25− ! 'syntax-error'
26− ! exit
27−
28−
29−
30−***
docs/programming/advanced/library/src/4h/gate/dot.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++dot`
2−
3−Parse period
4−
5−Parses ASCII character 46, the period.
6−
7−Source
8−------
9−
10− ++ dot (just '.')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "." dot)
16− ~~~.
17− ~zod/try=> `cord`(scan "." dot)
18− '.'
19− ~zod/try=> (dot [[1 1] "."])
20− [p=[p=1 q=2] q=[~ [p=~~~. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (dot [[1 1] ".^"])
22− [p=[p=1 q=2] q=[~ [p=~~~. q=[p=[p=1 q=2] q="^"]]]]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/fas.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++fas`
2−
3−Parse forward slash
4−
5−Parses ASCII character 47, the forward slash.
6−
7−Source
8−------
9−
10− ++ fas (just '/')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "/" fas)
16− ~~~2f.
17− ~zod/try=> `cord`(scan "/" fas)
18− '/'
19− ~zod/try=> (fas [[1 1] "/"])
20− [p=[p=1 q=2] q=[~ [p=~~~2f. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (fas [[1 1] "|/"])
22− [p=[p=1 q=1] q=~]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/gal.mddeleted−28
@@ -1,28 +0,0 @@
1−### `++gal`
2−
3−Parse less-than sign
4−
5−Parses ASCII character 60, the less-than sign.
6−
7−Source
8−------
9−
10− ++ gal (just '<')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "<" gal)
16− ~~~3c.
17− ~zod/try=> `cord`(scan "<" gal)
18− '<'
19− ~zod/try=> (gal [[1 1] "<"])
20− [p=[p=1 q=2] q=[~ [p=~~~3c. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (gal [[1 1] "<+"])
22− [p=[p=1 q=2] q=[~ [p=~~~3c. q=[p=[p=1 q=2] q="+"]]]]
23− ~zod/try=> (gal [[1 1] "+<"])
24− [p=[p=1 q=1] q=~]
25−
26−
27−
28−***
docs/programming/advanced/library/src/4h/gate/gar.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++gar`
2−
3−Parse greater-than sign
4−
5−Parses ASCII character 62, the greater-than sign.
6−
7−Source
8−------
9−
10− ++ gar (just '>')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan ">" gar)
16− ~~~3e.
17− ~zod/try=> `cord`(scan ">" gar)
18− '>'
19− ~zod/try=> (gar [[1 1] ">"])
20− [p=[p=1 q=2] q=[~ [p=~~~3e. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (gar [[1 1] "=>"])
22− [p=[p=1 q=1] q=~]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/hax.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++hax`
2−
3−Parse number sign
4−
5−Parses ASCII character 35, the number sign.
6−
7−Source
8−------
9−
10− ++ hax (just '#')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "#" hax)
16− ~~~23.
17− ~zod/try=> `cord`(scan "#" hax)
18− '#'
19− ~zod/try=> (hax [[1 1] "#"])
20− [p=[p=1 q=2] q=[~ [p=~~~23. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (hax [[1 1] "#!"])
22− [p=[p=1 q=2] q=[~ [p=~~~23. q=[p=[p=1 q=2] q="!"]]]]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/hep.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++hep`
2−
3−Parse hyphen
4−
5−Parses ASCII character 45, the hyphen.
6−
7−Source
8−------
9−
10− ++ hep (just '-')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "-" hep)
16− ~~-
17− ~zod/try=> `cord`(scan "-" hep)
18− '-'
19− ~zod/try=> (hep [[1 1] "-"])
20− [p=[p=1 q=2] q=[~ [p=~~- q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (hep [[1 1] ":-"])
22− [p=[p=1 q=1] q=~]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/kel.mddeleted−28
@@ -1,28 +0,0 @@
1−### `++kel`
2−
3−Parse left curley bracket
4−
5−Parses ASCII character 123, the left curly bracket. Note that `{`
6−(`kel`) and `}` (`ker`) open and close a Hoon expression for Hoon string
7−interpolation. To parse either of them, they must be escaped.
8−
9−Source
10−------
11−
12− ++ kel (just '{')
13−
14−Examples
15−--------
16−
17− ~zod/try=> (scan "\{" kel)
18− ~~~7b.
19− ~zod/try=> `cord`(scan "\{" kel)
20− '{'
21− ~zod/try=> (kel [[1 1] "\{"])
22− [p=[p=1 q=2] q=[~ [p=~~~7b. q=[p=[p=1 q=2] q=""]]]]
23− ~zod/try=> (kel [[1 1] " \{"])
24− [p=[p=1 q=1] q=~]
25−
26−
27−
28−***
docs/programming/advanced/library/src/4h/gate/ker.mddeleted−28
@@ -1,28 +0,0 @@
1−### `++ker`
2−
3−Parse right curley bracket
4−
5−Parses ASCII character 125, the right curly bracket. Note that `{`
6−(`kel`) and `}` (`ker`) open and close a Hoon expression for Hoon string
7−interpolation. To parse either of them, they must be escaped.
8−
9−Source
10−------
11−
12− ++ ker (just '}')
13−
14−Examples
15−--------
16−
17− ~zod/try=> (scan "}" ker)
18− ~~~7d.
19− ~zod/try=> `cord`(scan "}" ker)
20− '}'
21− ~zod/try=> (ker [[1 1] "}"])
22− [p=[p=1 q=2] q=[~ [p=~~~7d. q=[p=[p=1 q=2] q=""]]]]
23− ~zod/try=> (ker [[1 1] "\{}"])
24− [p=[p=1 q=1] q=~]
25−
26−
27−
28−***
docs/programming/advanced/library/src/4h/gate/ket.mddeleted−25
@@ -1,25 +0,0 @@
1−### `++ket`
2−
3−Parse caret
4−
5−Parses ASCII character 94, the caret.
6−
7−Source
8−------
9−
10− ++ ket (just '^')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "^" ket)
16− ~~~5e.
17− ~zod/try=> `cord`(scan "^" ket)
18− '^'
19− ~zod/try=> (ket [[1 1] "^"])
20− [p=[p=1 q=2] q=[~ [p=~~~5e. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (ket [[1 1] ".^"])
22− [p=[p=1 q=1] q=~]
23−
24−
25−***
docs/programming/advanced/library/src/4h/gate/lus.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++lus`
2−
3−Parse plus sign
4−
5−Parses ASCII character 43, the plus sign.
6−
7−Source
8−------
9−
10− ++ lus (just '+')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "+" lus)
16− ~~~2b.
17− ~zod/try=> `cord`(scan "+" lus)
18− '+'
19− ~zod/try=> (lus [[1 1] "+"])
20− [p=[p=1 q=2] q=[~ [p=~~~2b. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (lus [[1 1] ".+"])
22− [p=[p=1 q=1] q=~]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/pam.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++pam`
2−
3−Parse ampersand
4−
5−Parses ASCII character 38, the ampersand.
6−
7−Source
8−------
9−
10− ++ pam (just '&')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "&" pam)
16− ~~~26.
17− ~zod/try=> `cord`(scan "&" pam)
18− '&'
19− ~zod/try=> (pam [[1 1] "&"])
20− [p=[p=1 q=2] q=[~ [p=~~~26. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (pam [[1 1] "?&"])
22− [p=[p=1 q=1] q=~]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/pat.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++pat`
2−
3−Parse "at" sign
4−
5−Parses ASCII character 64, the "at" sign.
6−
7−Source
8−------
9−
10− ++ pat (just '@')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "@" pat)
16− ~~~4.
17− ~zod/try=> `cord`(scan "@" pat)
18− '@'
19− ~zod/try=> (pat [[1 1] "@"])
20− [p=[p=1 q=2] q=[~ [p=~~~4. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (pat [[1 1] "?@"])
22− [p=[p=1 q=1] q=~]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/pel.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++pel`
2−
3−Parse left parenthesis
4−
5−Parses ASCII character 40, the left parenthesis.
6−
7−Source
8−------
9−
10− ++ pel (just '(')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "(" pel)
16− ~~~28.
17− ~zod/try=> `cord`(scan "(" pel)
18− '('
19− ~zod/try=> (pel [[1 1] "("])
20− [p=[p=1 q=2] q=[~ [p=~~~28. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (pel [[1 1] ";("])
22− [p=[p=1 q=1] q=~]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/per.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++per`
2−
3−Parse right parenthesis
4−
5−Parses ASCII character 41, the right parenthesis.
6−
7−Source
8−------
9−
10− ++ per (just ')')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan ")" per)
16− ~~~29.
17− ~zod/try=> `cord`(scan ")" per)
18− ')'
19− ~zod/try=> (per [[1 1] ")"])
20− [p=[p=1 q=2] q=[~ [p=~~~29. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (per [[1 1] " )"])
22− [p=[p=1 q=1] q=~]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/sel.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++sel`
2−
3−Parse left square bracket
4−
5−Parses ASCII character 91, the left square bracket.
6−
7−Source
8−------
9−
10− ++ sel (just '[')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "[" sel)
16− ~~~5b.
17− ~zod/try=> `cord`(scan "[" sel)
18− '['
19− ~zod/try=> (sel [[1 1] "["])
20− [p=[p=1 q=2] q=[~ [p=~~~5b. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (sel [[1 1] "-["])
22− [p=[p=1 q=1] q=~]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/sem.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++sem`
2−
3−Parse semicolon
4−
5−Parses ASCII character 59, the semicolon.
6−
7−Source
8−------
9−
10− ++ sem (just ';')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan ";" sem)
16− ~~~3b.
17− ~zod/try=> `cord`(scan ";" sem)
18− ';'
19− ~zod/try=> (sem [[1 1] ";"])
20− [p=[p=1 q=2] q=[~ [p=~~~3b. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (sem [[1 1] " ;"])
22− [p=[p=1 q=1] q=~]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/ser.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++ser`
2−
3−Parse right square bracket
4−
5−Parses ASCII character 93, the right square bracket.
6−
7−Source
8−------
9−
10− ++ ser (just ']')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "]" ser)
16− ~~~5d.
17− ~zod/try=> `cord`(scan "]" ser)
18− ']'
19− ~zod/try=> (ser [[1 1] "]"])
20− [p=[p=1 q=2] q=[~ [p=~~~5d. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (ser [[1 1] "[ ]"])
22− [p=[p=1 q=1] q=~]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/sig.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++sig`
2−
3−Parse tilde
4−
5−Parses ASCII character 126, the tilde.
6−
7−Source
8−------
9−
10− ++ sig (just '~')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "~" sig)
16− ~~~~
17− ~zod/try=> `cord`(scan "~" sig)
18− '~'
19− ~zod/try=> (sig [[1 1] "~"])
20− [p=[p=1 q=2] q=[~ [p=~~~~ q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (sig [[1 1] "?~"])
22− [p=[p=1 q=1] q=~]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/soq.mddeleted−27
@@ -1,27 +0,0 @@
1−### `++soq`
2−
3−Parse single quote
4−
5−Parses ASCII character 39, soq. Note the extra '' is to escape the first
6−`soq` because soq delimits a [`++cord`]().
7−
8−Source
9−------
10−
11− ++ soq (just '\'')
12−
13−Examples
14−--------
15−
16− ~zod/try=> (scan "'" soq)
17− ~~~27.
18− ~zod/try=> `cord`(scan "'" soq)
19− '''
20− ~zod/try=> (soq [[1 1] "'"])
21− [p=[p=1 q=2] q=[~ [p=~~~27. q=[p=[p=1 q=2] q=""]]]]
22− ~zod/try=> (soq [[1 1] ">'"])
23− [p=[p=1 q=1] q=~]
24−
25−
26−
27−***
docs/programming/advanced/library/src/4h/gate/tar.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++tar`
2−
3−Parse asterisk
4−
5−Parses ASCII character 42, the asterisk.
6−
7−Source
8−------
9−
10− ++ tar (just '*')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "*" tar)
16− ~~~2a.
17− ~zod/try=> `cord`(scan "*" tar)
18− '*'
19− ~zod/try=> (tar [[1 1] "*"])
20− [p=[p=1 q=2] q=[~ [p=~~~2a. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (tar [[1 1] ".*"])
22− [p=[p=1 q=1] q=~]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/tec.mddeleted−27
@@ -1,27 +0,0 @@
1−### `++tec`
2−
3−Parse backtick
4−
5−Parses ASCII character 96, the backtick (also known as the "grave
6−accent").
7−
8−Source
9−------
10−
11− ++ tec (just '`') :: backTiCk
12−
13−Examples
14−--------
15−
16− ~zod/try=> (scan "`" tec)
17− ~~~6.
18− ~zod/try=> `cord`(scan "`" tec)
19− '`'
20− ~zod/try=> (tec [[1 1] "`"])
21− [p=[p=1 q=2] q=[~ [p=~~~6. q=[p=[p=1 q=2] q=""]]]]
22− ~zod/try=> (tec [[1 1] " `"])
23− [p=[p=1 q=1] q=~]
24−
25−
26−
27−***
docs/programming/advanced/library/src/4h/gate/tis.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++tis`
2−
3−Parse equals sign
4−
5−Parses ASCII character 61, the equals sign.
6−
7−Source
8−------
9−
10− ++ tis (just '=')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "=" tis)
16− ~~~3d.
17− ~zod/try=> `cord`(scan "=" tis)
18− '='
19− ~zod/try=> (tis [[1 1] "="])
20− [p=[p=1 q=2] q=[~ [p=~~~3d. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (tis [[1 1] "|="])
22− [p=[p=1 q=1] q=~]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/wut.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++wut`
2−
3−Parses question mark
4−
5−Parses ASCII character 63, the question mark.
6−
7−Source
8−------
9−
10− ++ wut (just '?')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "?" wut)
16− ~~~3f.
17− ~zod/try=> `cord`(scan "?" wut)
18− '?'
19− ~zod/try=> (wut [[1 1] "?"])
20− [p=[p=1 q=2] q=[~ [p=~~~3f. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (wut [[1 1] ".?"])
22− [p=[p=1 q=1] q=~]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/gate/zap.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++zap`
2−
3−Exclamation point
4−
5−Parses ASCII character 33, the exclamation point zap.
6−
7−Source
8−------
9−
10− ++ zap (just '!')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "!" zap)
16− ~~~21.
17− ~zod/try=> `cord`(scan "!" zap)
18− '!'
19− ~zod/try=> (zap [[1 1] "!"])
20− [p=[p=1 q=2] q=[~ [p=~~~21. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (zap [[1 1] "?!"])
22− [p=[p=1 q=1] q=~]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4h/title.mddeleted−1
@@ -1 +0,0 @@
1−# 4h: parsing (ascii glyphs)
docs/programming/advanced/library/src/4i/title.mddeleted−1
@@ -1 +0,0 @@
1−# 4i: parsing (useful idioms)
docs/programming/advanced/library/src/4j/core/ab.mddeleted−1367
@@ -1,1367 +0,0 @@
1−### `++ab`
2−
3−Primitive parser engine
4−
5−A core containing numeric parser primitives.
6−
7−Source
8−------
9−
10− ++ ab
11− |%
12−
13−Examples
14−--------
15−
16− ~zod/try=> ab
17− <36.ecc 414.gly 100.xkc 1.ypj %164>
18−
19−------------------------------------------------------------------------
20−
21−### `++bix`
22−
23−Parse hex pair
24−
25−Parsing `++rule`. Parses a pair of base-16 digits. Used in escapes.
26−
27−Accepts
28−-------
29−
30−XX
31−
32−Produces
33−--------
34−
35−A an atom. XX
36−
37−Source
38−------
39−
40− ++ bix (bass 16 (stun [2 2] six))
41−
42−Examples
43−--------
44−
45− ~zod/try=> (scan "07" bix:ab)
46− q=7
47− ~zod/try=> (scan "51" bix:ab)
48− q=81
49− ~zod/try=> (scan "a3" bix:ab)
50− q=163
51−
52−------------------------------------------------------------------------
53−
54−### `++hif`
55−
56−Parse phonetic pair
57−
58−Parsing `++rule`. Parses an atom of odor `@pE`, a phrase of two bytes
59−encoded phonetically.
60−
61−Accepts
62−-------
63−
64−XX
65−
66−Produces
67−--------
68−
69−An atom.
70−
71−Source
72−------
73−
74− ++ hif (boss 256 ;~(plug tip tiq (easy ~)))
75−
76−Examples
77−--------
78−
79− ~zod/try=> (scan "doznec" hif:ab)
80− q=256
81− ~zod/try=> (scan "pittyp" hif:ab)
82− q=48.626
83−
84−------------------------------------------------------------------------
85−
86−### `++huf`
87−
88−Parse two phonetic pairs
89−
90−Parsing `++rule`. Parses and unscrambles an atom of odor @pF, a phrase
91−of two two-byte pairs that are encoded (and scrambled) phonetically.
92−
93−Accepts
94−-------
95−
96−XX
97−
98−Produces
99−--------
100−
101−An atom. XX
102−
103−Source
104−------
105−
106− ++ huf %+ cook
107− |=([a/@ b/@] (wred:un ~(zug mu ~(zag mu [a b]))))
108− ;~(plug hif ;~(pfix hep hif))
109−
110−Examples
111−--------
112−
113− ~zod/try=> (scan "pittyp-pittyp" huf:ab)
114− 328.203.557
115− ~zod/try=> (scan "tasfyn-partyv" huf:ab)
116− 65.792
117− ~zod/try=> `@ux`(scan "tasfyn-partyv" huf:ab)
118− 0x1.0100
119−
120−------------------------------------------------------------------------
121−
122−### `++hyf`
123−
124−Parse 8 phonetic bytes
125−
126−Parsing `++rule`. Parses an atom of odor @pG, a phrase of eight of
127−phonetic bytes.
128−
129−Accepts
130−-------
131−
132−An atom of odor `@pG`
133−
134−Produces
135−--------
136−
137−An atom. XX
138−
139−Source
140−------
141−
142− ++ hyf (bass 0x1.0000.0000 ;~(plug huf ;~(pfix hep huf) (easy ~)))
143−
144−Examples
145−--------
146−
147− ~zod/try=> (scan "sondel-forsut-tillyn-nillyt" hyf:ab)
148− q=365.637.097.828.335.095
149− ~zod/try=> `@u`~sondel-forsut-tillyn-nillyt
150− 365.637.097.828.335.095
151−
152−------------------------------------------------------------------------
153−
154−### `++pev`
155−
156−Parse \<= 5 base-32
157−
158−Parsing `++rule`. Parses up to five base-32 digits without a leading zero.
159−
160−Accepts
161−-------
162−
163−Up to five @uv (base 64) digits.
164−
165−Produces
166−--------
167−
168−An atom.
169−
170−Source
171−------
172−
173− ++ pev (bass 32 ;~(plug sev (stun [0 4] siv)))
174−
175−Examples
176−--------
177−
178− ~zod/try=> (scan "a" pev:ab)
179− q=10
180− ~zod/try=> (scan "290j" pev:ab)
181− q=74.771
182− ~zod/try=> (scan "123456" pev:ab)
183− ! {1 6}
184− ! exit
185− ~zod/try=> (scan "090j" pev:ab)
186− ~ <syntax error at [1 11]>
187−
188−------------------------------------------------------------------------
189−
190−### `++pew`
191−
192−Parse \<= 5 base-64
193−
194−Parsing `++rule`. Parses up to five base-64 digits without a leading zero.
195−
196−Accepts
197−-------
198−
199−Up to five @uw (base 64) digits.
200−
201−Produces
202−--------
203−
204−
205−
206−Source
207−------
208−
209− ++ pew (bass 64 ;~(plug sew (stun [0 4] siw)))
210−
211−Examples
212−--------
213−
214− ~zod/try=> (scan "Q" pew:ab)
215− q=52
216− ~zod/try=> (scan "aQ~9" pew:ab)
217− q=2.838.473
218− ~zod/try=> `@`0waQ~9
219− 2.838.473
220− ~zod/try=> (scan "123456" pew:ab)
221− ! {1 6}
222− ! exit
223− ~zod/try=> (scan "012345" pew:ab)
224− ! {1 1}
225− ! exit
226−
227−------------------------------------------------------------------------
228−
229−### `++piv`
230−
231−Parse 5 base-32
232−
233−Parsing `++rule`. Parses exactly five base-32 digits.
234−
235−Accepts
236−-------
237−
238−Produces
239−--------
240−
241−Source
242−------
243−
244− ++ piv (bass 32 (stun [5 5] siv))
245−
246−Examples
247−--------
248−
249− ~zod/try=> (scan "10b3l" piv:ab)
250− q=1.059.957
251− ~zod/try=> (scan "1" piv:ab)
252− ! {1 2}
253− ! exit
254−
255−------------------------------------------------------------------------
256−
257−### `++piw`
258−
259−Parse 5 base-64
260−
261−Parsing `++rule`. Parses exactly five base-64 digits.
262−
263−Accepts
264−-------
265−
266−Produces
267−--------
268−
269−Source
270−------
271−
272− ++ piw (bass 64 (stun [5 5] siw))
273−
274−Examples
275−--------
276−
277− ~zod/try=> (scan "2C-pZ" piw:ab)
278− q=43.771.517
279− ~zod/try=> (scan "2" piv:ab)
280− ! {1 2}
281− ! exit
282−
283−------------------------------------------------------------------------
284−
285−### `++qeb`
286−
287−Parse \<= 4 binary
288−
289−Parsing `++rule`. Parses a binary number of up to 4 digits in length without
290−a leading zero.
291−
292−Accepts
293−-------
294−
295−Produces
296−--------
297−
298−Source
299−------
300−
301− ++ qeb (bass 2 ;~(plug seb (stun [0 3] sib)))
302−
303−Examples
304−--------
305−
306− ~zod/try=> (scan "1" qeb:ab)
307− q=1
308− ~zod/try=> (scan "101" qeb:ab)
309− q=5
310− ~zod/try=> (scan "1111" qeb:ab)
311− q=15
312− ~zod/try=> (scan "11111" qeb:ab)
313− ! {1 5}
314− ! exit
315− ~zod/try=> (scan "01" qeb:ab)
316− ! {1 1}
317− ! exit
318−
319−------------------------------------------------------------------------
320−
321−### `++qex`
322−
323−Parse \<= 4 hex
324−
325−Parsing `++rule`. Parses a hexadecimal number of up to 4 digits in length
326−without a leading zero.
327−
328−Accepts
329−-------
330−
331−Produces
332−--------
333−
334−Source
335−------
336−
337− ++ qex (bass 16 ;~(plug sex (stun [0 3] hit)))
338−
339−Examples
340−--------
341−
342− ~zod/try=> (scan "ca" qex:ab)
343− q=202
344− ~zod/try=> (scan "18ac" qex:ab)
345− q=6.316
346− ~zod/try=> (scan "18acc" qex:ab)
347− ! {1 5}
348− ! exit
349− ~zod/try=> (scan "08ac" qex:ab)
350− ! {1 1}
351− ! exit
352−
353−------------------------------------------------------------------------
354−
355−### `++qib`
356−
357−Parse 4 binary
358−
359−Parsing `++rule`. Parses exactly four binary digits.
360−
361−Accepts
362−-------
363−
364−Produces
365−--------
366−
367−Source
368−------
369−
370− ++ qib (bass 2 (stun [4 4] sib))
371−
372−Examples
373−--------
374−
375− ~zod/try=> (scan "0001" qib:ab)
376− q=1
377− ~zod/try=> (scan "0100" qib:ab)
378− q=4
379− ~zod/try=> (scan "110" qib:ab)
380− ! {1 4}
381− ! exit
382−
383−------------------------------------------------------------------------
384−
385−### `++qix`
386−
387−Parse 4 hex
388−
389−Parsing `++rule`. Parses exactly four hexadecimal digits.
390−
391−Accepts
392−-------
393−
394−Produces
395−--------
396−
397−Source
398−------
399−
400− ++ qix (bass 16 (stun [4 4] six))
401−
402−Examples
403−--------
404−
405− ~zod/try=> (scan "0100" qix:ab)
406− q=256
407− ~zod/try=> (scan "10ff" qix:ab)
408− q=4.351
409− ~zod/try=> (scan "0" qix:ab)
410− ! {1 2}
411− ! exit
412−
413−------------------------------------------------------------------------
414−
415−### `++seb`
416−
417−Parse 1
418−
419−Parsing `++rule`. Parses the number 1.
420−
421−Accepts
422−-------
423−
424−Produces
425−--------
426−
427−Source
428−------
429−
430− ++ seb (cold 1 (just '1'))
431−
432−Examples
433−--------
434−
435− ~zod/try=> (scan "1" seb:ab)
436− 1
437− ~zod/try=> (scan "0" seb:ab)
438− ! ~zod/try/~2014.10.23..22.34.21..bfdd/:<[1 1].[1 18]>
439− ! {1 1}
440− ~zod/try=> (scan "2" seb:ab)
441− ! ~zod/try/~2014.10.23..22.34.29..d399/:<[1 1].[1 18]>
442− ! {1 1}
443−
444−------------------------------------------------------------------------
445−
446−### `++sed`
447−
448−Parse decimal
449−
450−Parsing `++rule`. Parses a nonzero decimal digit.
451−
452−Accepts
453−-------
454−
455−Produces
456−--------
457−
458−Source
459−------
460−
461− ++ sed (cook |=(a/@ (sub a '0')) (shim '1' '9'))
462−
463−Examples
464−--------
465−
466− ~zod/try=> (scan "5" sed:ab)
467− 5
468− ~zod/try=> (scan "0" sed:ab)
469− ! {1 1}
470− ! exit
471−
472−------------------------------------------------------------------------
473−
474−### `++sev`
475−
476−Parse base-32
477−
478−Parsing `++rule`. Parses a nonzero base-32 digit
479−
480−Accepts
481−-------
482−
483−Produces
484−--------
485−
486−Source
487−------
488−
489− ++ sev ;~(pose sed sov)
490−
491−Examples
492−--------
493−
494− ~zod/try=> (scan "c" sev:ab)
495− 12
496− ~zod/socialnet=> (scan "0" sev:ab)
497− ! {1 1}
498− ! exit
499−
500−------------------------------------------------------------------------
501−
502−### `++sew`
503−
504−Parse base-64
505−
506−Parsing `++rule`. Parses a nonzero base-64 digit
507−
508−Accepts
509−-------
510−
511−Produces
512−--------
513−
514−Source
515−------
516−
517− ++ sew ;~(pose sed sow)
518−
519−Examples
520−--------
521−
522− ~zod/try=> (scan "M" sew:ab)
523− 48
524− ~zod/try=> (scan "0" sew:ab)
525− ! {1 1}
526− ! exit
527−
528−------------------------------------------------------------------------
529−
530−### `++sex`
531−
532−Parse hex
533−
534−Parsing `++rule`. Parses a nonzero hexadecimal digit.
535−
536−Accepts
537−-------
538−
539−Produces
540−--------
541−
542−Source
543−------
544−
545− ++ sex ;~(pose sed sox)
546−
547−Examples
548−--------
549−
550− ~zod/try=> (scan "e" sex:ab)
551− 14
552− ~zod/try=> (scan "0" sex:ab)
553− ! {1 1}
554− ! exit
555−
556−------------------------------------------------------------------------
557−
558−### `++sib`
559−
560−Parse binary
561−
562−Parsing `++rule`. Parses a binary digit.
563−
564−Accepts
565−-------
566−
567−Produces
568−--------
569−
570−Source
571−------
572−
573− ++ sib (cook |=(a/@ (sub a '0')) (shim '0' '1'))
574−
575−Examples
576−--------
577−
578− ~zod/try=> (scan "1" sib:ab)
579− 1
580− ~zod/socialnet=> (scan "0" sib:ab)
581− 0
582−
583−------------------------------------------------------------------------
584−
585−### `++sid`
586−
587−Parse decimal
588−
589−Parsing `++rule`. Parses a decimal digit.
590−
591−Accepts
592−-------
593−
594−Produces
595−--------
596−
597−Source
598−------
599−
600− ++ sid (cook |=(a/@ (sub a '0')) (shim '0' '9'))
601−
602−Examples
603−--------
604−
605− ~zod/try=> (scan "5" sid:ab)
606− 5
607−
608−------------------------------------------------------------------------
609−
610−### `++siv`
611−
612−Parse base-32
613−
614−Parsing `++rule`. Parses a base-32 digit.
615−
616−Accepts
617−-------
618−
619−Produces
620−--------
621−
622−Source
623−------
624−
625− ++ siv ;~(pose sid sov)
626−
627−Examples
628−--------
629−
630− ~zod/try=> (scan "c" siv:ab)
631− 12
632−
633−------------------------------------------------------------------------
634−
635−### `++siw`
636−
637−Parse base-64
638−
639−Parsing `++rule`. Parses a base-64 digit.
640−
641−Accepts
642−-------
643−
644−Produces
645−--------
646−
647−Source
648−------
649−
650− ++ siw ;~(pose sid sow)
651−
652−Examples
653−--------
654−
655− ~zod/try=> (scan "M" siw:ab)
656− 48
657−
658−------------------------------------------------------------------------
659−
660−### `++six`
661−
662−Parse hex
663−
664−Parsing `++rule`. Parses a hexadecimal digit.
665−
666−Accepts
667−-------
668−
669−Produces
670−--------
671−
672−Source
673−------
674−
675− ++ six ;~(pose sid sox)
676−
677−Examples
678−--------
679−
680− ~zod/try=> (scan "e" six:ab)
681− 14
682−
683−------------------------------------------------------------------------
684−
685−### `++sov`
686−
687−Parse base-32
688−
689−Parsing `++rule`. Parses a base-32 letter.
690−
691−Accepts
692−-------
693−
694−Produces
695−--------
696−
697−Source
698−------
699−
700− ++ sov (cook |=(a/@ (sub a 87)) (shim 'a' 'v'))
701−
702−Examples
703−--------
704−
705− ~zod/try=> (scan "c" sov:ab)
706− 12
707−
708−------------------------------------------------------------------------
709−
710−### `++sow`
711−
712−Parse base-64
713−
714−Parsing `++rule`. Parses a base-64 letter/symbol.
715−
716−Accepts
717−-------
718−
719−Produces
720−--------
721−
722−Source
723−------
724−
725− ++ sow ;~ pose
726− (cook |=(a/@ (sub a 87)) (shim 'a' 'z'))
727− (cook |=(a/@ (sub a 29)) (shim 'A' 'Z'))
728− (cold 62 (just '-'))
729− (cold 63 (just '~'))
730− ==
731−
732−Examples
733−--------
734−
735− ~zod/try=> (scan "M" sow:ab)
736− 48
737−
738−------------------------------------------------------------------------
739−
740−### `++sox`
741−
742−Parse hex letter
743−
744−Parsing `++rule`. Parses a hexadecimal letter.
745−
746−Accepts
747−-------
748−
749−Produces
750−--------
751−
752−Source
753−------
754−
755− ++ sox (cook |=(a/@ (sub a 87)) (shim 'a' 'f'))
756−
757−Examples
758−--------
759−
760− ~zod/try=> (scan "e" sox:ab)
761− 14
762−
763−------------------------------------------------------------------------
764−
765−### `++ted`
766−
767−Parse \<= 3 decimal
768−
769−Parsing `++rule`. Parses a decimal number of up to 3 digits without a
770−leading zero.
771−
772−Accepts
773−-------
774−
775−Produces
776−--------
777−
778−Source
779−------
780−
781− ++ ted (bass 10 ;~(plug sed (stun [0 2] sid)))
782−
783−Examples
784−--------
785−
786− ~zod/try=> (scan "21" ted:ab)
787− q=21
788− ~zod/try=> (scan "214" ted:ab)
789− q=214
790− ~zod/try=> (scan "2140" ted:ab)
791− {1 4}
792− ~zod/try=> (scan "0" ted:ab)
793− ! {1 1}
794− ! exit
795−
796−------------------------------------------------------------------------
797−
798−### `++tip`
799−
800−Leading phonetic byte
801−
802−Parsing `++rule`. Parses the leading phonetic byte, which represents a
803−syllable.
804−
805−Accepts
806−-------
807−
808−Produces
809−--------
810−
811−Source
812−------
813−
814− ++ tip (sear |=(a/@ (ins:po a)) til)
815−
816−Examples
817−--------
818−
819− ~zod/try=> (scan "doz" tip:ab)
820− 0
821− ~zod/try=> (scan "pit" tip:ab)
822− 242
823−
824−------------------------------------------------------------------------
825−
826−### `++tiq`
827−
828−Trailing phonetic syllable
829−
830−Parsing `++rule`. Parses the trailing phonetic byte, which represents a
831−syllable.
832−
833−Accepts
834−-------
835−
836−Produces
837−--------
838−
839−Source
840−------
841−
842− ++ tiq (sear |=(a/@ (ind:po a)) til)
843−
844−Examples
845−--------
846−
847− ~zod/try=> (scan "zod" tiq:ab)
848− 0
849− ~zod/try=> (scan "nec" tiq:ab)
850− 1
851−
852−------------------------------------------------------------------------
853−
854−### `++tid`
855−
856−Parse 3 decimal digits
857−
858−Parsing `++rule`. Parses exactly three decimal digits.
859−
860−Accepts
861−-------
862−
863−Produces
864−--------
865−
866−Source
867−------
868−
869− ++ tid (bass 10 (stun [3 3] sid))
870−
871−Examples
872−--------
873−
874− ~zod/try=> (scan "013" tid:ab)
875− q=13
876− ~zod/try=> (scan "01" tid:ab)
877− ! {1 3}
878− ! exit
879−
880−------------------------------------------------------------------------
881−
882−### `++til`
883−
884−Parse 3 lowercase
885−
886−Parsing `++rule`. Parses exactly three lowercase letters.
887−
888−Accepts
889−-------
890−
891−Produces
892−--------
893−
894−Source
895−------
896−
897− ++ til (boss 256 (stun [3 3] low))
898−
899−Examples
900−--------
901−
902− ~zod/try=> (scan "mer" til:ab)
903− q=7.497.069
904− ~zod/try=> `@t`(scan "mer" til:ab)
905− 'mer'
906− ~zod/try=> (scan "me" til:ab)
907− ! {1 3}
908− ! exit
909−
910−------------------------------------------------------------------------
911−
912−### `++urs`
913−
914−Parse span characters
915−
916−Parsing rule. Parses characters from an atom of the span odor `@ta`.
917−
918−Accepts
919−-------
920−
921−Produces
922−--------
923−
924−Source
925−------
926−
927− ++ urs %+ cook
928− |=(a/tape (rap 3 ^-((list @) a)))
929− (star ;~(pose nud low hep dot sig cab))
930−
931−Examples
932−--------
933−
934− ~zod/try=> `@ta`(scan "asa-lom_tak" urs:ab)
935− ~.asa-lom_tak
936− ~zod/try=> `@t`(scan "asa-lom_tak" urs:ab)
937− 'asa-lom_tak'
938−
939−------------------------------------------------------------------------
940−
941−### `++urt`
942−
943−Parse non-`_` span
944−
945−Parsing rule. Parses all characters of the span odor `@ta` except
946−for cab, `_`.
947−
948−Accepts
949−-------
950−
951−Produces
952−--------
953−
954−Source
955−------
956−
957− ++ urt %+ cook
958− |=(a/tape (rap 3 ^-((list @) a)))
959− (star ;~(pose nud low hep dot sig))
960−
961−Examples
962−--------
963−
964− ~zod/try=> `@t`(scan "asa-lom.t0k" urt:ab)
965− 'asa-lom.t0k'
966−
967−------------------------------------------------------------------------
968−
969−### `++voy`
970−
971−Parse bas, soq, or bix
972−
973−Parsing rule. Parses an escaped backslash, single quote, or hex pair
974−byte.
975−
976−Accepts
977−-------
978−
979−Produces
980−--------
981−
982−Source
983−------
984−
985− ++ voy ;~(pfix bas ;~(pose bas soq bix))
986−
987−Examples
988−--------
989−
990− ~zod/try=> (scan "\\0a" voy:ab)
991− q=10
992− ~zod/try=> (scan "\\'" voy:ab)
993− q=39
994−
995−------------------------------------------------------------------------
996−
997−### `++ag`
998−
999−Top-level atom parser engine
1000−
1001−A core containing top-level atom parsers.
1002−
1003−Accepts
1004−-------
1005−
1006−Produces
1007−--------
1008−
1009−Source
1010−------
1011−
1012− ++ ag
1013− |%
1014−
1015−Examples
1016−--------
1017−
1018− ~zod/try=> ag
1019− <14.vpu 414.mof 100.xkc 1.ypj %164>
1020−
1021−------------------------------------------------------------------------
1022−
1023−### `++ape`
1024−
1025−Parse 0 or rule
1026−
1027−Parser modifier. Parses 0 or the sample rule `fel`.
1028−
1029−Accepts
1030−-------
1031−
1032−Produces
1033−--------
1034−
1035−`fel` is a `rule`.
1036−
1037−Source
1038−------
1039−
1040− ++ ape |*(fel/rule ;~(pose (cold 0 (just '0')) fel))
1041−
1042−
1043−Examples
1044−--------
1045−
1046− ~zod/try=> (scan "202" (star (ape:ag (cold 2 (just '2')))))
1047− ~[2 0 2]
1048−
1049−------------------------------------------------------------------------
1050−
1051−### `++bay`
1052−
1053−Parses binary number
1054−
1055−Parsing rule. Parses a binary number without a leading zero.
1056−
1057−Accepts
1058−-------
1059−
1060−Produces
1061−--------
1062−
1063−Source
1064−------
1065−
1066− ++ bay (ape (bass 16 ;~(plug qeb:ab (star ;~(pfix dog qib:ab)))))
1067−
1068−Examples
1069−--------
1070−
1071− ~zod/try=> (scan "10.0110" bay:ag)
1072− q=38
1073−
1074−------------------------------------------------------------------------
1075−
1076−### `++bip`
1077−
1078−Parse IPv6
1079−
1080−Parsing rule. Parses a `@is`, an IPv6 address.
1081−
1082−Accepts
1083−-------
1084−
1085−Produces
1086−--------
1087−
1088−Source
1089−------
1090−
1091− ++ bip =+ tod=(ape qex:ab)
1092− (bass 0x1.0000 ;~(plug tod (stun [7 7] ;~(pfix dog tod))))
1093−
1094−Examples
1095−--------
1096−
1097− ~zod/try=> (scan "0.0.ea.3e6c.0.0.0.0" bip:ag)
1098− q=283.183.420.760.121.105.516.068.864
1099− ~zod/try=> `@is`(scan "0.0.ea.3e6c.0.0.0.0" bip:ag)
1100− .0.0.ea.3e6c.0.0.0.0
1101−
1102−------------------------------------------------------------------------
1103−
1104−### `++dem`
1105−
1106−Parse decimal with dots
1107−
1108−Parsing rule. Parses a decimal number that includes dot separators.
1109−
1110−Accepts
1111−-------
1112−
1113−Produces
1114−--------
1115−
1116−Source
1117−------
1118−
1119− ++ dem (ape (bass 1.000 ;~(plug ted:ab (star ;~(pfix dog tid:ab)))))
1120−
1121−
1122−Examples
1123−--------
1124−
1125− ~zod/try=> (scan "52" dem:ag)
1126− q=52
1127− ~zod/try=> (scan "13.507" dem:ag)
1128− q=13.507
1129−
1130−------------------------------------------------------------------------
1131−
1132−### `++dim`
1133−
1134−Parse decimal number
1135−
1136−Parsing rule. Parses a decimal number without a leading zero.
1137−
1138−Accepts
1139−-------
1140−
1141−Produces
1142−--------
1143−
1144−Source
1145−------
1146−
1147− ++ dim (ape (bass 10 ;~(plug sed:ab (star sid:ab))))
1148−
1149−Examples
1150−--------
1151−
1152− ~zod/try=> (scan "52" dim:ag)
1153− q=52
1154− ~zod/try=> (scan "013507" dim:ag)
1155− ! {1 2}
1156− ! exit
1157−
1158−------------------------------------------------------------------------
1159−
1160−### `++dum`
1161−
1162−Parse decimal with leading `0`
1163−
1164−Parsing rule. Parses a decmial number with leading zeroes.
1165−
1166−Accepts
1167−-------
1168−
1169−Produces
1170−--------
1171−
1172−Source
1173−------
1174−
1175− ++ dum (bass 10 (plus sid:ab))
1176−
1177−Examples
1178−--------
1179−
1180− ~zod/try=> (scan "52" dum:ag)
1181− q=52
1182− ~zod/try=> (scan "0000052" dum:ag)
1183− q=52
1184− ~zod/try=> (scan "13507" dim:ag)
1185− q=13.507
1186−
1187−------------------------------------------------------------------------
1188−
1189−### `++fed`
1190−
1191−Parse phonetic base
1192−
1193−Parsing rule. Parses an atom of odor `@p`, the phonetic base.
1194−
1195−Accepts
1196−-------
1197−
1198−Produces
1199−--------
1200−
1201−Source
1202−------
1203−
1204− ++ fed ;~ pose
1205− (bass 0x1.0000.0000.0000.0000 (most doh hyf:ab))
1206− huf:ab
1207− hif:ab
1208− tiq:ab
1209− ==
1210−
1211−Examples
1212−--------
1213−
1214− ~zod/try=> (scan "zod" fed:ag)
1215− 0
1216− ~zod/try=> (scan "nec" fed:ag)
1217− 1
1218− ~zod/try=> (scan "sondel" fed:ag)
1219− 9.636
1220− ~zod/try=> ~tillyn-nillyt
1221− ~tillyn-nillyt
1222− ~zod/try=> (scan "tillyn-nillyt" fed:ag)
1223− 3.569.565.175
1224− ~zod/try=> (scan "tillyn-nillyt-tasfyn-partyv" fed:ag)
1225− 15.331.165.687.565.582.592
1226− ~zod/try=> (scan "tillyn-nillyt-tasfyn-partyv--novweb-talrud-talmud-sonfyr" fed:ag)
1227− 282.810.089.790.159.633.869.501.053.313.363.681.181
1228−
1229−------------------------------------------------------------------------
1230−
1231−### `++hex`
1232−
1233−Parse hex
1234−
1235−Parsing rule. Parses a hexadecimal number
1236−
1237−Accepts
1238−-------
1239−
1240−Produces
1241−--------
1242−
1243−Source
1244−------
1245−
1246− ++ hex (ape (bass 0x1.0000 ;~(plug qex:ab (star ;~(pfix dog qix:ab)))))
1247−
1248−Examples
1249−--------
1250−
1251− ~zod/try=> (scan "4" hex:ag)
1252− q=4
1253− ~zod/try=> (scan "1a" hex:ag)
1254− q=26
1255− ~zod/try=> (scan "3.ac8d" hex:ag)
1256− q=240.781
1257− ~zod/try=> `@ux`(scan "3.ac8d" hex:ag)
1258− 0x3.ac8d
1259−
1260−------------------------------------------------------------------------
1261−
1262−### `++lip`
1263−
1264−Parse IPv4 address
1265−
1266−Parsing rule. Parses an IPv4 address.
1267−
1268−Accepts
1269−-------
1270−
1271−Produces
1272−--------
1273−
1274−Source
1275−------
1276−
1277− ++ lip =+ tod=(ape ted:ab)
1278− (bass 256 ;~(plug tod (stun [3 3] ;~(pfix dog tod))))
1279−
1280−Examples
1281−--------
1282−
1283− ~zod/try=> (scan "127.0.0.1" lip:ag)
1284− q=2.130.706.433
1285− ~zod/try=> `@if`(scan "127.0.0.1" lip:ag)
1286− .127.0.0.1
1287− ~zod/try=> `@if`(scan "8.8.8.8" lip:ag)
1288− .8.8.8.8
1289−
1290−------------------------------------------------------------------------
1291−
1292−### `++viz`
1293−
1294−Parse Base-32 with dots
1295−
1296−Parsing rule. Parses a Base-32 number with dot separators.
1297−
1298−Accepts
1299−-------
1300−
1301−Produces
1302−--------
1303−
1304−Source
1305−------
1306−
1307− ++ viz (ape (bass 0x200.0000 ;~(plug pev:ab (star ;~(pfix dog piv:ab)))))
1308−
1309−Examples
1310−--------
1311−
1312− ~zod/try=> (scan "e2.ol4pm" viz:ag)
1313− q=15.125.353.270
1314−
1315−------------------------------------------------------------------------
1316−
1317−### `++vum`
1318−
1319−Parse base-32 string
1320−
1321−Parsing rule. Parses a raw base-32 string.
1322−
1323−Accepts
1324−-------
1325−
1326−Produces
1327−--------
1328−
1329−Source
1330−------
1331−
1332− ++ vum (bass 32 (plus siv:ab))
1333−
1334−Examples
1335−--------
1336−
1337− ~zod/try=> (scan "e2ol4pm" vum:ag)
1338− q=15.125.353.270
1339−
1340−------------------------------------------------------------------------
1341−
1342−### `++wiz`
1343−
1344−Parse base-64
1345−
1346−Parsing rule. Parses a base-64 number.
1347−
1348−Accepts
1349−-------
1350−
1351−Produces
1352−--------
1353−
1354−Source
1355−------
1356−
1357− ++ wiz (ape (bass 0x4000.0000 ;~(plug pew:ab (star ;~(pfix dog piw:ab)))))
1358− --
1359− ::
1360−
1361−Examples
1362−--------
1363−
1364− ~zod/try=> (scan "e2O.l4Xpm" wiz:ag)
1365− q=61.764.130.813.526
1366−
1367−***
docs/programming/advanced/library/src/4j/core/mu.mddeleted−127
@@ -1,127 +0,0 @@
1−### `++mu`
2−
3−Core used to scramble 16-bit atoms
4−
5−A door that contains arms that are used to scramble two atoms, `top`
6−and `bot`. Used especially in the phonetic base to disguise the
7−relationship between a destroyer and its cruiser.
8−
9−Accepts
10−-------
11−
12−Produces
13−--------
14−
15−`bot` is an atom.
16−
17−`top` is an atom.
18−
19−Source
20−------
21−
22− ++ mu
23− |_ [top/@ bot/@]
24−
25−Examples
26−--------
27−
28− ~zod/try=> ~(. mu 0x20e5 0x5901)
29− <3.sjm [[@ux @ux] <414.hhh 100.xkc 1.ypj %164>]>
30−
31−------------------------------------------------------------------------
32−
33−### `++zag`
34−
35−Add bottom into top
36−
37−Produces the cell of `top` and `bot` with `top` scrambled to the result
38−of adding `bot` to `top` modulo 16. Used to scramble the name of a
39−destroyer.
40−
41−Accepts
42−-------
43−
44−Produces
45−--------
46−
47−`bot` is an atom.
48−
49−`top` is an atom.
50−
51−Source
52−------
53−
54− ++ zag [p=(end 4 1 (add top bot)) q=bot]
55−
56−
57−Examples
58−--------
59−
60− ~zod/try=> `[@ux @ux]`~(zag mu 0x20e0 0x201)
61− [0x22e1 0x201]
62−
63−------------------------------------------------------------------------
64−
65−### `++zig`
66−
67−Subtract bottom from top
68−
69−The inverse of `++zag`. Produces the cell of `top` and `bot` with
70−`top` unscrambled. The unscrambled `top` is the sum of the sample `top`
71−and the 16-bit complement of `bot`. Used to unscramble the name of the
72−destroyer.
73−
74−Accepts
75−-------
76−
77−Produces
78−--------
79−
80−`bot` is an atom.
81−
82−`top` is an atom.
83−
84−Source
85−------
86−
87− ++ zig [p=(end 4 1 (add top (sub 0x1.0000 bot))) q=bot]
88−
89−Examples
90−--------
91−
92− ~zod/try=> `[@ux @ux]`~(zig mu 0x2f46 0x1042)
93− [0x1f04 0x1042]
94−
95−------------------------------------------------------------------------
96−
97−### `++zug`
98−
99−Concatenate into atom
100−
101−Produces the concatenation of `top` and `bot`. Used to assemble a
102−destroyer name.
103−
104−Accepts
105−-------
106−
107−Produces
108−--------
109−
110−`bot` is an atom.
111−
112−`top` is an atom.
113−
114−Source
115−------
116−
117− ++ zug (mix (lsh 4 1 top) bot)
118−
119−Examples
120−--------
121−
122− ~zod/try=> `@ux`~(zug mu 0x10e1 0xfa)
123− 0x10e1.00fa
124−
125−
126−
127−***
docs/programming/advanced/library/src/4j/core/ne.mddeleted−156
@@ -1,156 +0,0 @@
1−### `++ne`
2−
3−Digit rendering engine
4−
5−A door containing arms that render digits at bases 10, 16, 32, and
6−64.
7−
8−Accepts
9−-------
10−
11−Produces
12−--------
13−
14−`tig` is an `atom`.
15−
16−Source
17−------
18−
19− ++ ne
20− |_ tig/@
21−
22−Examples
23−--------
24−
25− ~zod/try=> ~(. ne 20)
26− <4.gut [@ud <414.hhh 100.xkc 1.ypj %164>]>
27−
28−------------------------------------------------------------------------
29−
30−### `++d`
31−
32−Render decimal
33−
34−Renders a decimal digit as an atom of an ACII byte value.
35−
36−Accepts
37−-------
38−
39−Produces
40−--------
41−
42−`tig` is an `atom`.
43−
44−Source
45−------
46−
47− ++ d (add tig '0')
48−
49−Examples
50−--------
51−
52− ~zod/try=> `@t`~(d ne 7)
53− '7'
54−
55−------------------------------------------------------------------------
56−
57−### `++x`
58−
59−Render hex
60−
61−Renders a hexadecimal digit as an atom of an ASCII byte value.
62−
63−Accepts
64−-------
65−
66−Produces
67−--------
68−
69−`tig` is an `atom`.
70−
71−Source
72−------
73−
74− ++ x ?:((gte tig 10) (add tig 87) d)
75−
76−Examples
77−--------
78−
79− ~zod/try=> `@t`~(x ne 7)
80− '7'
81− ~zod/try=> `@t`~(x ne 14)
82− 'e'
83−
84−------------------------------------------------------------------------
85−
86−### `++v`
87−
88−Render base-32
89−
90−Renders a base-32 digit as an atom of an ASCII byte value.
91−
92−Accepts
93−-------
94−
95−Produces
96−--------
97−
98−Source
99−------
100−
101− ++ v ?:((gte tig 10) (add tig 87) d)
102−
103−Examples
104−--------
105−
106− ~zod/try=> `@t`~(v ne 7)
107− '7'
108− ~zod/try=> `@t`~(v ne 14)
109− 'e'
110− ~zod/try=> `@t`~(v ne 25)
111− 'p'
112−
113−------------------------------------------------------------------------
114−
115−### `++w`
116−
117−Render base-64
118−
119−Renders a base-64 digit as an atom of an ASCII byte value.
120−
121−Accepts
122−-------
123−
124−Produces
125−--------
126−
127−`tig` is an `atom`.
128−
129−Source
130−------
131−
132− ++ w ?:(=(tig 63) '~' ?:(=(tig 62) '-' ?:((gte tig 36) (add tig 29) x)))
133− --
134− ::
135−
136−Examples
137−--------
138−
139− ~zod/try=> `@t`~(w ne 7)
140− '7'
141− ~zod/try=> `@t`~(w ne 14)
142− 'e'
143− ~zod/try=> `@t`~(w ne 25)
144− 'p'
145− ~zod/try=> `@t`~(w ne 52)
146− 'Q'
147− ~zod/try=> `@t`~(w ne 61)
148− 'Z'
149− ~zod/try=> `@t`~(w ne 63)
150− '~'
151− ~zod/try=> `@t`~(w ne 62)
152− '-'
153−
154−
155−
156−***
docs/programming/advanced/library/src/4j/title.mddeleted−1
@@ -1 +0,0 @@
1−# 4j: parsing (bases and base digits)
docs/programming/advanced/library/src/4k/core/co.mddeleted−263
@@ -1,263 +0,0 @@
1−### `++co`
2−
3−Literal rendering engine
4−
5−A door that contains arms that operate on the sample coin `lot`.
6−
7−Accepts
8−-------
9−
10−Produces
11−--------
12−
13−`lot` is a `++coin`.
14−
15−Source
16−------
17−
18− ++ co !.
19− ~% %co ..co ~
20− =< |_ lot/coin
21−
22−
23−Examples
24−--------
25−
26− ~zod/try=> < 3.nta
27− { lot/{$many {$~ $ta @t} {$~ $ud @ud} $~}
28− <10.cfg 4.jjn {rep/"" <402.arm 110.jyx 1.ztu $151>}>
29− }
30− >
31−
32−------------------------------------------------------------------------
33−
34−### `++rear`
35−
36−Prepend & render as tape
37−
38−Renders a coin `lot` as a tape prepended to the sample tape `rom`.
39−
40−Accepts
41−-------
42−
43−Produces
44−--------
45−
46−`rom` is a `pe`
47−
48−`lot` is a `++coin`.
49−
50−Source
51−------
52−
53− ++ rear |=(rom/tape =>(.(rex rom) rend))
54−
55−Examples
56−--------
57−
58− ~zod/try=> (~(rear co %$ %ux 200) "--ha")
59− "0xc8--ha"
60−
61−------------------------------------------------------------------------
62−
63−### `++rent`
64−
65−Render as span
66−
67−Renders a coin `lot` as a span.
68−
69−Accepts
70−-------
71−
72−Produces
73−--------
74−
75−`lot` is a `++coin`.
76−
77−Source
78−------
79−
80− ++ rent `@ta`(rap 3 rend)
81−
82−Examples
83−--------
84−
85− ~zod/try=> ~(rent co %$ %ux 200)
86− ~.0xc8
87− ~zod/try=> `@t`~(rent co %$ %ux 200)
88− '0xc8'
89−
90−------------------------------------------------------------------------
91−
92−### `++rend`
93−
94−Render as tape
95−
96−Renders a coin `lot` as a tape.
97−
98−Accepts
99−-------
100−
101−Produces
102−--------
103−
104−`lot` is a `++coin`.
105−
106−Source
107−------
108−
109− ++ rend
110− ^- tape
111− ?: ?=($blob -.lot)
112− ['~' '0' ((v-co 1) (jam p.lot))]
113− ?: ?=($many -.lot)
114− :- '.'
115− |- ^- tape
116− ?~ p.lot
117− ['_' '_' rep]
118− ['_' (weld (trip (wack rent(lot i.p.lot))) $(p.lot t.p.lot))]
119− =+ [yed=(end 3 1 p.p.lot) hay=(cut 3 [1 1] p.p.lot)]
120− |- ^- tape
121− ?+ yed (z-co q.p.lot)
122− $c ['~' '-' (weld (rip 3 (wood (tuft q.p.lot))) rep)]
123− $d
124− ?+ hay (z-co q.p.lot)
125− $a
126− =+ yod=(yore q.p.lot)
127− => ^+(. .(rep ?~(f.t.yod rep ['.' (s-co f.t.yod)])))
128− => ^+ .
129− %= .
130− rep
131− ?: &(=(~ f.t.yod) =(0 h.t.yod) =(0 m.t.yod) =(0 s.t.yod))
132− rep
133− => .(rep ['.' (y-co s.t.yod)])
134− => .(rep ['.' (y-co m.t.yod)])
135− ['.' '.' (y-co h.t.yod)]
136− ==
137− => .(rep ['.' (a-co d.t.yod)])
138− => .(rep ['.' (a-co m.yod)])
139− => .(rep ?:(a.yod rep ['-' rep]))
140− ['~' (a-co y.yod)]
141− ::
142− $r
143− =+ yug=(yell q.p.lot)
144− => ^+(. .(rep ?~(f.yug rep ['.' (s-co f.yug)])))
145− :- '~'
146− ?: &(=(0 d.yug) =(0 m.yug) =(0 h.yug) =(0 s.yug))
147− ['s' '0' rep]
148− => ^+(. ?:(=(0 s.yug) . .(rep ['.' 's' (a-co s.yug)])))
149− => ^+(. ?:(=(0 m.yug) . .(rep ['.' 'm' (a-co m.yug)])))
150− => ^+(. ?:(=(0 h.yug) . .(rep ['.' 'h' (a-co h.yug)])))
151− => ^+(. ?:(=(0 d.yug) . .(rep ['.' 'd' (a-co d.yug)])))
152− +.rep
153− ==
154− ::
155− $f
156− ?: =(& q.p.lot)
157− ['.' 'y' rep]
158− ?:(=(| q.p.lot) ['.' 'n' rep] (z-co q.p.lot))
159− ::
160− $n ['~' rep]
161− $i
162− ?+ hay (z-co q.p.lot)
163− $f ((ro-co [3 10 4] |=(a/@ ~(d ne a))) q.p.lot)
164− $s ((ro-co [4 16 8] |=(a/@ ~(x ne a))) q.p.lot)
165− ==
166− ::
167− $p
168− =+ dyx=(met 3 q.p.lot)
169− :- '~'
170− ?: (lte dyx 1)
171− (weld (trip (tod:po q.p.lot)) rep)
172− ?: =(2 dyx)
173− ;: weld
174− (trip (tos:po (end 3 1 q.p.lot)))
175− (trip (tod:po (rsh 3 1 q.p.lot)))
176− rep
177− ==
178− =+ [dyz=(met 5 q.p.lot) fin=| dub=&]
179− |- ^- tape
180− ?: =(0 dyz)
181− rep
182− %= $
183− fin &
184− dub !dub
185− dyz (dec dyz)
186− q.p.lot (rsh 5 1 q.p.lot)
187− rep
188− =+ syb=(wren:un (end 5 1 q.p.lot))
189− =+ cog=~(zig mu [(rsh 4 1 syb) (end 4 1 syb)])
190− ;: weld
191− (trip (tos:po (end 3 1 p.cog)))
192− (trip (tod:po (rsh 3 1 p.cog)))
193− `tape`['-' ~]
194− (trip (tos:po (end 3 1 q.cog)))
195− (trip (tod:po (rsh 3 1 q.cog)))
196− `tape`?.(fin ~ ['-' ?.(dub ~ ['-' ~])])
197− rep
198− ==
199− ==
200− ::
201− $r
202− ?+ hay (z-co q.p.lot)
203− $d ['.' '~' (r-co (rlyd q.p.lot))]
204− $h ['.' '~' '~' (r-co (rlyh q.p.lot))]
205− $q ['.' '~' '~' '~' (r-co (rlyq q.p.lot))]
206− $s ['.' (r-co (rlys q.p.lot))]
207− ==
208− ::
209− $u
210− ?: ?=($c hay)
211− %+ welp ['0' 'c' (reap (pad:fa q.p.lot) '1')]
212− (c-co (enc:fa q.p.lot))
213− =- (weld p.gam ?:(=(0 q.p.lot) `tape`['0' ~] q.gam))
214− ^= gam ^- {p/tape q/tape}
215− ?+ hay [~ ((ox-co [10 3] |=(a/@ ~(d ne a))) q.p.lot)]
216− $b [['0' 'b' ~] ((ox-co [2 4] |=(a/@ ~(d ne a))) q.p.lot)]
217− $i [['0' 'i' ~] ((d-co 1) q.p.lot)]
218− $x [['0' 'x' ~] ((ox-co [16 4] |=(a/@ ~(x ne a))) q.p.lot)]
219− $v [['0' 'v' ~] ((ox-co [32 5] |=(a/@ ~(x ne a))) q.p.lot)]
220− $w [['0' 'w' ~] ((ox-co [64 5] |=(a/@ ~(w ne a))) q.p.lot)]
221− ==
222− ::
223− $s
224− %+ weld
225− ?:((syn:si q.p.lot) "--" "-")
226− $(yed 'u', q.p.lot (abs:si q.p.lot))
227− ::
228− $t
229− ?: =('a' hay)
230− ?: =('s' (cut 3 [2 1] p.p.lot))
231− (weld (rip 3 q.p.lot) rep)
232− ['~' '.' (weld (rip 3 q.p.lot) rep)]
233− ['~' '~' (weld (rip 3 (wood q.p.lot)) rep)]
234− ==
235− --
236−
237−Examples
238−--------
239−
240− ~zod/try=> ~(rend co ~ %ux 200)
241− "0xc8"
242− ~zod/try=> ~(rend co %many ~[[%$ ux+200] [%$ p+40]])
243− "._0xc8_~~tem__"
244− ~zod/try=> ~(rend co ~ %p 32.819)
245− "~pillyt"
246− ~zod/try=> ~(rend co ~ %ux 18)
247− "0x12"
248− ~zod/try=> ~(rend co [~ p=[p=%if q=0x7f00.0001]])
249− ".127.0.0.1"
250− ~zod/try=> `@ux`.127.0.0.1
251− 2.130.706.433
252− ~zod/try=> ~(rend co %many ~[[~ %ud 20] [~ %uw 133] [~ %tas 'sam']])
253− "._20_0w25_sam__"
254− ~zod/try=> ~(rend co %blob [1 1])
255− "~0ph"
256− ~zod/try=> ~0ph
257− [1 1]
258− ~zod/try=> `@uv`(jam [1 1])
259− 0vph
260−
261−
262−
263−***
docs/programming/advanced/library/src/4k/gate/alf.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++alf`
2−
3−Alphabetic characters
4−
5−Parse alphabetic characters, both upper and lowercase.
6−
7−Source
8−------
9−
10− ++ alf ;~(pose low hig) :: alphabetic
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "a" alf)
16− ~~a
17− ~zod/try=> (scan "A" alf)
18− ~~~41.
19− ~zod/try=> (scan "AaBbCc" (star alf))
20− "AaBbCc"
21−
22−
23−
24−***
docs/programming/advanced/library/src/4k/gate/aln.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++aln`
2−
3−Alphanumeric characters
4−
5−Parse alphanumeric characters - both alphabetic characters and numbers.
6−
7−Source
8−------
9−
10− ++ aln ;~(pose low hig nud) :: alphanumeric
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "0" aln)
16− ~~0
17− ~zod/try=> (scan "alf42" (star aln))
18− "alf42"
19− ~zod/try=> (scan "0123456789abcdef" (star aln))
20− "0123456789abcdef"
21−
22−
23−
24−***
docs/programming/advanced/library/src/4k/gate/alp.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++alp`
2−
3−Alphanumeric and `-`
4−
5−Parse alphanumeric strings and hep, "-".
6−
7−Source
8−------
9−
10− ++ alp ;~(pose low hig nud hep) :: alphanumeric and -
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "7" alp)
16− ~~7
17− ~zod/try=> (scan "s" alp)
18− ~~s
19− ~zod/try=> (scan "123abc-" (star alp))
20− "123abc-"
21−
22−
23−
24−***
docs/programming/advanced/library/src/4k/gate/bet.mddeleted−23
@@ -1,23 +0,0 @@
1−
2−### `++bet`
3−
4−Axis syntax `-`, `+`
5−
6−Parse the hep and lus axis syntax.
7−
8−Source
9−------
10−
11− ++ bet ;~(pose (cold 2 hep) (cold 3 lus)) :: axis syntax - +
12−
13−Examples
14−--------
15−
16− ~zod/try=> (scan "-" bet)
17− 2
18− ~zod/try=> (scan "+" bet)
19− 3
20−
21−
22−
23−***
docs/programming/advanced/library/src/4k/gate/bin.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++bin`
2−
3−Binary to atom
4−
5−Parse a tape of binary (0s and 1s) and produce its atomic representation.
6−
7−Source
8−------
9−
10− ++ bin (bass 2 (most gon but)) :: binary to atom
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "0000" bin)
16− 0
17− ~zod/try=> (scan "0001" bin)
18− 1
19− ~zod/try=> (scan "0010" bin)
20− 2
21− ~zod/try=> (scan "100000001111" bin)
22− 2.063
23−
24−
25−
26−***
docs/programming/advanced/library/src/4k/gate/but.mddeleted−28
@@ -1,28 +0,0 @@
1−### `++but`
2−
3−Binary digit
4−
5−Parse a single binary digit.
6−
7−Source
8−------
9−
10− ++ but (cook |=(a=@ (sub a '0')) (shim '0' '1')) :: binary digit
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "0" but)
16− 0
17− ~zod/try=> (scan "1" but)
18− 1
19− ~zod/try=> (scan "01" but)
20− ! {1 2}
21− ! 'syntax-error'
22− ! exit
23− ~zod/try=> (scan "01" (star but))
24− ~[0 1]
25−
26−
27−
28−***
docs/programming/advanced/library/src/4k/gate/cit.mddeleted−28
@@ -1,28 +0,0 @@
1−### `++cit`
2−
3−Octal digit
4−
5−Parse a single octal digit.
6−
7−Source
8−------
9−
10− ++ cit (cook |=(a=@ (sub a '0')) (shim '0' '7')) :: octal digit
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "1" cit)
16− 1
17− ~zod/try=> (scan "7" cit)
18− 7
19− ~zod/try=> (scan "8" cit)
20− ! {1 1}
21− ! 'syntax-error'
22− ! exit
23− ~zod/try=> (scan "60" (star cit))
24− ~[6 0]
25−
26−
27−
28−***
docs/programming/advanced/library/src/4k/gate/dem.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++dem`
2−
3−Decimal to atom
4−
5−Parse a decimal number to an atom.
6−
7−Source
8−------
9−
10− ++ dem (bass 10 (most gon dit)) :: decimal to atom
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "7" dem)
16− 7
17− ~zod/try=> (scan "42" dem)
18− 42
19− ~zod/try=> (scan "150000000" dem)
20− 150.000.000
21− ~zod/try=> (scan "12456" dem)
22− 12.456
23−
24−
25−
26−***
docs/programming/advanced/library/src/4k/gate/dit.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++dit`
2−
3−Decimal digit
4−
5−Parse a single decimal digit.
6−
7−Source
8−------
9−
10− ++ dit (cook |=(a=@ (sub a '0')) (shim '0' '9')) :: decimal digit
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "7" dit)
16− 7
17− ~zod/try=> (scan "42" (star dit))
18− ~[4 2]
19− ~zod/try=> (scan "26000" (star dit))
20− ~[2 6 0 0 0]
21−
22−
23−
24−***
docs/programming/advanced/library/src/4k/gate/dog.mddeleted−23
@@ -1,23 +0,0 @@
1−### `++dog`
2−
3−`.` optional gap
4−
5−Dot followed by an optional gap, used with numbers.
6−
7−Source
8−------
9−
10− ++ dog ;~(plug dot gay) ::
11−
12−Examples
13−--------
14−
15− /~zod/try=> 1.234.
16− 703
17− 1.234.703
18− ~zod/try=> (scan "a. " ;~(pfix alf dog))
19− [~~~. ~]
20−
21−
22−
23−***
docs/programming/advanced/library/src/4k/gate/doh.mddeleted−27
@@ -1,27 +0,0 @@
1−### `++doh`
2−
3−`@p` separator
4−
5−Phonetic base phrase separator
6−
7−Source
8−------
9−
10− ++ doh ;~(plug ;~(plug hep hep) gay) ::
11−
12−Examples
13−--------
14−
15− /~zod/try=> ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
16− ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
17− /~zod/try=> ~nopfel-botduc-nilnev-dolfyn--
18− haspub-natlun-lodmur-holtyd
19− ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
20− ~zod/try=> (scan "--" doh)
21− [[~~- ~~-] ~]
22− ~zod/try=> (scan "-- " doh)
23− [[~~- ~~-] ~]
24−
25−
26−
27−***
docs/programming/advanced/library/src/4k/gate/dun.mddeleted−22
@@ -1,22 +0,0 @@
1−### `++dun`
2−
3−`--` to `~`
4−
5−Parse phep, `--`, to null, `~`.
6−
7−Source
8−------
9−
10− ++ dun (cold ~ ;~(plug hep hep)) :: -- (phep) to ~
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "--" dun)
16− ~
17− ~zod/try=> (dun [[1 1] "--"])
18− [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=""]]]]
19−
20−
21−
22−***
docs/programming/advanced/library/src/4k/gate/duz.mddeleted−23
@@ -1,23 +0,0 @@
1−
2−### `++duz`
3−
4−`==` to `~`
5−
6−Parse stet, `==`, to null `~`.
7−
8−Source
9−------
10−
11− ++ duz (cold ~ ;~(plug tis tis)) :: == (stet) to ~
12−
13−Examples
14−--------
15−
16− ~zod/try=> (scan "==" duz)
17− ~
18− ~zod/try=> (duz [[1 1] "== |=..."])
19− [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=" |=..."]]]]
20−
21−
22−
23−***
docs/programming/advanced/library/src/4k/gate/gah.mddeleted−37
@@ -1,37 +0,0 @@
1−
2−### `++gah`
3−
4−Newline or ' '
5−
6−Whitespace component, either newline or space.
7−
8−Source
9−------
10−
11− ++ gah (mask [`@`10 ' ' ~]) :: newline or ace
12−
13−Examples
14−--------
15−
16− /~zod/try=> ^- * :: show spaces
17− """
18− -
19− -
20− -
21− """
22− [32 32 32 45 10 32 45 10 32 32 45 0]
23− /~zod/try=> ^- *
24− """
25−
26− """
27− [32 32 32 10 32 10 32 32 0]
28− /~zod/try=> ^- (list ,@)
29− %- scan :_ (star gah)
30− """
31−
32− """
33− ~[32 32 32 10 32 10 32 32]
34−
35−
36−
37−***
docs/programming/advanced/library/src/4k/gate/gap.mddeleted−14
@@ -1,14 +0,0 @@
1−### `++gap`
2−
3−Plural whitespace
4−
5−Separates tall runes
6−
7−Source
8−------
9−
10− ++ gap (cold ~ ;~(plug gaq (star ;~(pose vul gah)))) :: plural whitespace
11−
12−
13−
14−***
docs/programming/advanced/library/src/4k/gate/gaq.mddeleted−19
@@ -1,19 +0,0 @@
1−### `++gaq`
2−
3−End of line
4−
5−Two spaces, a newline, or comment.
6−
7−Source
8−------
9−
10− ++ gaq ;~ pose :: end of line
11− (just `@`10)
12− ;~(plug gah ;~(pose gah vul))
13− vul
14− ==
15−
16−
17−
18−
19−***
docs/programming/advanced/library/src/4k/gate/gaw.mddeleted−14
@@ -1,14 +0,0 @@
1−### `++gaw`
2−
3−Classic whitespace
4−
5−Terran whitespace.
6−
7−Source
8−------
9−
10− ++ gaw (cold ~ (star ;~(pose vul gah))) :: classic white
11−
12−
13−
14−***
docs/programming/advanced/library/src/4k/gate/gay.mddeleted−14
@@ -1,14 +0,0 @@
1−### `++gay`
2−
3−Optional gap
4−
5−Optional gap.
6−
7−Source
8−------
9−
10− ++ gay ;~(pose gap (easy ~)) ::
11−
12−
13−
14−***
docs/programming/advanced/library/src/4k/gate/gon.mddeleted−23
@@ -1,23 +0,0 @@
1−### `++gon`
2−
3−Long numbers
4−
5−Parse long numbers - Numbers which wrap around the shell with the line
6−
7−Source
8−------
9−
10−break ++ gon ;~(pose ;~(plug bas gay fas) (easy ~)) :: long numbers \ /
11−
12−Examples
13−--------
14−characters bas and fas.
15−
16− ~zod/try=> (scan "\\/" gon)
17− [~~~5c. ~ ~~~2f.]
18− ~zod/try=> (gon [[1 1] "\\/"])
19− [p=[p=1 q=3] q=[~ u=[p=[~~~5c. ~ ~~~2f.] q=[p=[p=1 q=3] q=""]]]]
20−
21−
22−
23−***
docs/programming/advanced/library/src/4k/gate/gul.mddeleted−22
@@ -1,22 +0,0 @@
1−### `++gul`
2−
3−Axis syntax `<` or `>`
4−
5−Parse the axis gal and gar axis syntax.
6−
7−Source
8−------
9−
10− ++ gul ;~(pose (cold 2 gal) (cold 3 gar)) :: axis syntax < >
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "<" gul)
16− 2
17− ~zod/try=> (scan ">" gul)
18− 3
19−
20−
21−
22−***
docs/programming/advanced/library/src/4k/gate/hex.mddeleted−31
@@ -1,31 +0,0 @@
1−### `++hex`
2−
3−Hex to atom
4−
5−Parse any hexadecimal number to an atom.
6−
7−Source
8−------
9−
10− ++ hex (bass 16 (most gon hit)) :: hex to atom
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "a" hex)
16− 10
17− ~zod/try=> (scan "A" hex)
18− 10
19− ~zod/try=> (scan "2A" hex)
20− 42
21− ~zod/try=> (scan "1ee7" hex)
22− 7.911
23− ~zod/try=> (scan "1EE7" hex)
24− 7.911
25− ~zod/try=> (scan "1EE7F7" hex)
26− 2.025.463
27− ~zod/try=> `@ux`(scan "1EE7F7" hex)
28− 0x1e.e7f7
29−
30−
31−***
docs/programming/advanced/library/src/4k/gate/hig.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++hig`
2−
3−Uppercase
4−
5−Parse a single uppercase letter.
6−
7−Source
8−------
9−
10− ++ hig (shim 'A' 'Z') :: uppercase
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "G" hig)
16− ~~~47.
17− ~zod/try=> `cord`(scan "G" hig)
18− 'G'
19− ~zod/try=> (scan "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (star hig))
20− "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
21− ~zod/try=> (hig [[1 1] "G"])
22− [p=[p=1 q=2] q=[~ [p=~~~47. q=[p=[p=1 q=2] q=""]]]]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4k/gate/hit.mddeleted−29
@@ -1,29 +0,0 @@
1−### `++hit`
2−
3−Hex digits
4−
5−Parse a single hexadecimal digit.
6−
7−Source
8−------
9−
10− ++ hit ;~ pose :: hex digits
11− dit
12− (cook |=(a=char (sub a 87)) (shim 'a' 'f'))
13− (cook |=(a=char (sub a 55)) (shim 'A' 'F'))
14− ==
15−
16−Examples
17−--------
18−
19− ~zod/try=> (scan "a" hit)
20− 10
21− ~zod/try=> (scan "A" hit)
22− 10
23− ~zod/try=> (hit [[1 1] "a"])
24− [p=[p=1 q=2] q=[~ [p=10 q=[p=[p=1 q=2] q=""]]]]
25− ~zod/try=> (scan "2A" (star hit))
26− ~[2 10]
27−
28−
29−***
docs/programming/advanced/library/src/4k/gate/iny.mddeleted−60
@@ -1,60 +0,0 @@
1−### `++iny`
2−
3−Indentation block
4−
5−Apply `++rule` to indented block starting at current column number, omitting
6−the leading whitespace.
7−
8−Accepts
9−-------
10−
11−`sef` is a `++rule`
12−
13−Produces
14−--------
15−
16−A `++rule`.
17−
18−Source
19−------
20−
21− ++ inde |* sef/rule :: indentation block
22− |= nail ^+ (sef)
23− =+ [har tap]=[p q]:+<
24− =+ lev=(fil 3 (dec q.har) ' ')
25− =+ eol=(just `@t`10)
26− =+ =- roq=((star ;~(pose prn ;~(sfix eol (jest lev)) -)) har tap)
27− ;~(simu ;~(plug eol eol) eol)
28− ?~ q.roq roq
29− =+ vex=(sef har(q 1) p.u.q.roq)
30− =+ fur=p.vex(q (add (dec q.har) q.p.vex))
31− ?~ q.vex vex(p fur)
32− =- vex(p fur, u.q -)
33− :+ &3.vex
34− &4.vex(q.p (add (dec q.har) q.p.&4.vex))
35− =+ res=|4.vex
36− |- ?~ res |4.roq
37− ?. =(10 -.res) [-.res $(res +.res)]
38− (welp [`@t`10 (trip lev)] $(res +.res))
39− ::
40−
41−Examples
42−--------
43−
44− ~zod/try=> (scan "abc" (iny (star ;~(pose prn (just `@`10)))))
45− "abc"
46− ~zod/try=> (scan "abc" (star ;~(pose prn (just `@`10))))
47− "abc"
48− ~zod/try=> (scan " abc\0ade" ;~(pfix ace ace (star ;~(pose prn (just `@`10)))))
49− "abc
50− de"
51− ~zod/try=> (scan " abc\0ade" ;~(pfix ace ace (iny (star ;~(pose prn (just `@`10))))))
52− ! {1 6}
53− ! exit
54− ~zod/try=> (scan " abc\0a de" ;~(pfix ace ace (iny (star ;~(pose prn (just `@`10))))))
55− "abc
56− de"
57−
58−
59−
60−***
docs/programming/advanced/library/src/4k/gate/low.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++low`
2−
3−Lowercase
4−
5−Parse a single lowercase letter.
6−
7−Source
8−------
9−
10− ++ low (shim 'a' 'z') :: lowercase
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "g" low)
16− ~~g
17− ~zod/try=> `cord`(scan "g" low)
18− 'g'
19− ~zod/try=> (scan "abcdefghijklmnopqrstuvwxyz" (star low))
20− "abcdefghijklmnopqrstuvwxyz"
21− ~zod/try=> (low [[1 1] "g"])
22− [p=[p=1 q=2] q=[~ [p=~~g q=[p=[p=1 q=2] q=""]]]]
23−
24−
25−
26−***
docs/programming/advanced/library/src/4k/gate/mes.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++mes`
2−
3−Hexbyte
4−
5−Parse a hexbyte.
6−
7−Source
8−------
9−
10− ++ mes %+ cook :: hexbyte
11− |=({a/@ b/@} (add (mul 16 a) b))
12− ;~(plug hit hit)
13−
14−Examples
15−--------
16−
17− ~zod/try=> (scan "2A" mes)
18− 42
19− ~zod/try=> (mes [[1 1] "2A"])
20− [p=[p=1 q=3] q=[~ u=[p=42 q=[p=[p=1 q=3] q=""]]]]
21− ~zod/try=> (scan "42" mes)
22− 66
23−
24−
25−
26−***
docs/programming/advanced/library/src/4k/gate/nix.mddeleted−22
@@ -1,22 +0,0 @@
1−### `++nix`
2−
3−Letters and `-`
4−
5−Parse Letters and `-`.
6−
7−Source
8−------
9−
10− ++ nix (boss 256 (star ;~(pose aln cab))) ::
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "as_me" nix)
16− q=435.626.668.897
17− ~zod/try=> `@t`(scan "as_me" nix)
18− 'as_me'
19−
20−
21−
22−***
docs/programming/advanced/library/src/4k/gate/nud.mddeleted−26
@@ -1,26 +0,0 @@
1−
2−### `++nud`
3−
4−Numeric
5−
6−Parse a numeric character - A number.
7−
8−Source
9−------
10−
11− ++ nud (shim '0' '9') :: numeric
12−
13−Examples
14−--------
15−
16− ~zod/try=> (scan "0" nud)
17− ~~0
18− ~zod/try=> (scan "7" nud)
19− ~~7
20− ~zod/try=> (nud [[1 1] "1"])
21− [p=[p=1 q=2] q=[~ [p=~~1 q=[p=[p=1 q=2] q=""]]]]
22− ~zod/try=> (scan "0123456789" (star nud))
23− "0123456789"
24−
25−
26−***
docs/programming/advanced/library/src/4k/gate/prn.mddeleted−25
@@ -1,25 +0,0 @@
1−### `++prn`
2−
3−Printable character
4−
5−Parse any printable character.
6−
7−Source
8−------
9−
10− ++ prn ;~(less (just `@`127) (shim 32 256))
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "h" prn)
16− ~~h
17− ~zod/try=> (scan "!" prn)
18− ~~~21.
19− ~zod/try=> (scan "\01" prn)
20− ! {1 1}
21− ! exit
22−
23−
24−
25−***
docs/programming/advanced/library/src/4k/gate/qat.mddeleted−37
@@ -1,37 +0,0 @@
1−### `++qit`
2−
3−Chars in cord
4−
5−Parse an individual character to its cord atom representation.
6−
7−Source
8−------
9−
10− ++ qit ;~ pose :: chars in a cord
11− ;~(less bas soq prn)
12− ;~(pfix bas ;~(pose bas soq mes)) :: escape chars
13− ==
14−
15−Examples
16−--------
17−
18− ~zod/try=> (scan "%" qit)
19− 37
20− ~zod/try=> `@t`(scan "%" qit)
21− '%'
22− ~zod/try=> (scan "0" qit)
23− 48
24− ~zod/try=> (scan "E" qit)
25− 69
26− ~zod/try=> (scan "a" qit)
27− 97
28− ~zod/try=> (scan "\\0a" qit)
29− 10
30− ~zod/try=> `@ux`(scan "\\0a" qit)
31− 0xa
32− ~zod/try=> (scan "cord" (star qit))
33− ~[99 111 114 100]
34−
35−
36−
37−***
docs/programming/advanced/library/src/4k/gate/qit.mddeleted−38
@@ -1,38 +0,0 @@
1−### `++qit`
2−
3−Chars in cord
4−
5−Parse an individual character to its cord atom representation.
6−
7−Source
8−------
9−
10− ++ qit ;~ pose :: chars in a cord
11− ;~(less bas soq prn)
12− ;~(pfix bas ;~(pose bas soq mes)) :: escape chars
13− ==
14−
15−Examples
16−--------
17−
18− ~zod/try=> (scan "%" qit)
19− 37
20− ~zod/try=> `@t`(scan "%" qit)
21− '%'
22− ~zod/try=> (scan "0" qit)
23− 48
24− ~zod/try=> (scan "E" qit)
25− 69
26− ~zod/try=> (scan "a" qit)
27− 97
28− ~zod/try=> (scan "\\0a" qit)
29− 10
30− ~zod/try=> `@ux`(scan "\\0a" qit)
31− 0xa
32− ~zod/try=> (scan "cord" (star qit))
33− ~[99 111 114 100]
34−
35−
36−
37−
38−***
docs/programming/advanced/library/src/4k/gate/qut.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++qut`
2−
3−Cord
4−
5−Parse single-soq cord with `\{gap}/` anywhere in the middle, or triple-single
6−quote (aka triple-soq) cord, between which must be in an indented block.
7−
8−Source
9−------
10−
11− ++ qut ;~ pose :: cord
12− ;~ less soqs
13− (ifix [soq soq] (boss 256 (more gon qit)))
14− ==
15− %- inde %+ ifix
16− :- ;~ plug soqs
17− ;~(pose ;~(plug (plus ace) vul) (just '\0a'))
18− ==
19− ;~(plug (just '\0a') soqs)
20− (boss 256 (star qat))
21− ==
22− ::
23−
24−Examples
25−--------
26−
27− ~zod/try=> (scan "'cord'" qut)
28− q=1.685.221.219
29− ~zod/try=> 'cord'
30− 'cord'
31− ~zod/try=> `@ud`'cord'
32− 1.685.221.219
33− /~zod/try=> '''
34− Heredoc isn't prohibited from containing quotes
35− '''
36− 'Heredoc isn't prohibited from containing quotes'
37−
38−
39−
40−***
docs/programming/advanced/library/src/4k/gate/soz.mddeleted−23
@@ -1,23 +0,0 @@
1−### `++soz`
2−
3−Delimiting `'''`
4−
5−Parse a triple-single quote, used for multiline strings.
6−
7−Source
8−------
9−
10− ++ soz ;~(plug soq soq soq) :: delimiting '''
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "'''" soz)
16− [~~~27. ~~~27. ~~~27.]
17− ~zod/try=> (rash '"""' soz)
18− ! {1 1}
19− ! exit
20−
21−
22−
23−***
docs/programming/advanced/library/src/4k/gate/sym.mddeleted−28
@@ -1,28 +0,0 @@
1−### `++sym`
2−
3−Term
4−
5−A term: a letter(lowercase), followed by letters, numbers, or `-`.
6−
7−Source
8−------
9−
10− ++ sym
11− %+ cook
12− |=(a=tape (rap 3 ^-((list ,@) a)))
13− ;~(plug low (star ;~(pose nud low hep)))
14− ::
15−
16−Examples
17−--------
18−
19− ~zod/try=> (scan "sam-2" sym)
20− 215.510.507.891
21− ~zod/try=> `@t`(scan "sam-2" sym)
22− 'sam-2'
23− ~zod/try=> (scan "sym" sym)
24− 7.174.515
25−
26−
27−
28−***
docs/programming/advanced/library/src/4k/gate/ven.mddeleted−37
@@ -1,37 +0,0 @@
1−### `++ven`
2−
3−`+>-` axis syntax
4−
5−Axis syntax parser
6−
7−Source
8−------
9−
10− ++ ven ;~ (comp |=({a/@ b/@} (peg a b))) :: +>- axis syntax
11− bet
12− =+ hom=`?`|
13− |= tub/nail
14− ^- (like axis)
15− =+ vex=?:(hom (bet tub) (gul tub))
16− ?~ q.vex
17− [p.tub [~ 1 tub]]
18− =+ wag=$(p.tub p.vex, hom !hom, tub q.u.q.vex)
19− ?> ?=(^ q.wag)
20− [p.wag [~ (peg p.u.q.vex p.u.q.wag) q.u.q.wag]]
21− ==
22−
23−Examples
24−--------
25−
26− ~zod/arvo=/hoon/hoon> (scan "->+" ven)
27− 11
28− ~zod/arvo=/hoon/hoon> `@ub`(scan "->+" ven)
29− 0b1011
30− ~zod/arvo=/hoon/hoon> (peg (scan "->" ven) (scan "+" ven))
31− 11
32− ~zod/arvo=/hoon/hoon> ->+:[[1 2 [3 4]] 5]
33− [3 4]
34−
35−
36−
37−***
docs/programming/advanced/library/src/4k/gate/vit.mddeleted−32
@@ -1,32 +0,0 @@
1−### `++vit`
2−
3−Base64 digit
4−
5−Parse a standard base64 digit.
6−
7−Source
8−------
9−
10− ++ vit :: base64 digit
11− ;~ pose
12− (cook |=(a/@ (sub a 65)) (shim 'A' 'Z'))
13− (cook |=(a/@ (sub a 71)) (shim 'a' 'z'))
14− (cook |=(a/@ (add a 4)) (shim '0' '9'))
15− (cold 62 (just '-'))
16− (cold 63 (just '+'))
17− ==
18−
19−Examples
20−--------
21−
22− ~zod/arvo=/hoon/hoon> (scan "C" vit)
23− 2
24− ~zod/arvo=/hoon/hoon> (scan "c" vit)
25− 28
26− ~zod/arvo=/hoon/hoon> (scan "2" vit)
27− 54
28− ~zod/arvo=/hoon/hoon> (scan "-" vit)
29− 62
30−
31−
32−***
docs/programming/advanced/library/src/4k/gate/vul.mddeleted−28
@@ -1,28 +0,0 @@
1−### `++vul`
2−
3−Comments to null
4−
5−Source
6−------
7−
8− ++ vul %+ cold ~ :: comments
9− ;~ plug col col
10− (star prn)
11− (just `@`10)
12− ==
13−
14−Parse comments and produce a null. Note that a comment must be ended
15−with a newline character.
16−
17−Examples
18−--------
19−
20− ~zod/try=> (scan "::this is a comment \0a" vul)
21− ~
22− ~zod/try=> (scan "::this is a comment " vul)
23− ! {1 21}
24− ! exit
25−
26−
27−
28−***
docs/programming/advanced/library/src/4k/title.mddeleted−1
@@ -1 +0,0 @@
1−# 4k: atom printing
docs/programming/advanced/library/src/4l/core/so.mddeleted−597
@@ -1,597 +0,0 @@
1−### `++so`
2−
3−Coin parser engine
4−
5−Core containing arms that parse `++coin`.
6−
7−Accepts
8−-------
9−
10−Produces
11−--------
12−
13−Source
14−------
15−
16− ++ so
17− |%
18−
19−Examples
20−--------
21−
22− ~zod/try=> so
23− <10.mkn 414.hhh 100.xkc 1.ypj %164>
24−
25−------------------------------------------------------------------------
26−
27−### `++bisk`
28−
29−Parse odor-atom pair
30−
31−Parsing rule. Parses an unsigned integer of any permitted base,
32−producing a `++dime`.
33−
34−Accepts
35−-------
36−
37−Produces
38−--------
39−
40−Source
41−------
42−
43− ++ bisk
44− ;~ pose
45− ;~ pfix (just '0')
46− ;~ pose
47− (stag %ub ;~(pfix (just 'b') bay:ag))
48− (stag %ui ;~(pfix (just 'i') dim:ag))
49− (stag %ux ;~(pfix (just 'x') hex:ag))
50− (stag %uv ;~(pfix (just 'v') viz:ag))
51− (stag %uw ;~(pfix (just 'w') wiz:ag))
52− ==
53− ==
54− (stag %ud dem:ag)
55− ==
56−
57−Examples
58−--------
59−
60− ~zod/try=> (scan "25" bisk:so)
61− [%ud q=25]
62− ~zod/try=> (scan "0x12.6401" bisk:so)
63− [%ux q=1.205.249]
64−
65−------------------------------------------------------------------------
66−
67−### `++crub`
68−
69−Parse `@da`, `@dr`, `@p`, `@t`
70−
71−Parsing rule. Parses any atom of any of the following odors after a
72−leading sig, `~` into a `++dime`: `@da`, `@dr`, `@p`,
73−and `@t`, producing a `++dime`.
74−
75−Accepts
76−-------
77−
78−Produces
79−--------
80−
81−Source
82−------
83−
84− ++ crub
85− ~+
86− ;~ pose
87− %+ cook
88− |=(det/date `dime`[%da (year det)])
89− ;~ plug
90− %+ cook
91− |=({a/@ b/?} [b a])
92− ;~(plug dim:ag ;~(pose (cold | hep) (easy &)))
93− ;~(pfix dot dim:ag) :: month
94− ;~(pfix dot dim:ag) :: day
95− ;~ pose
96− ;~ pfix
97− ;~(plug dot dot)
98− ;~ plug
99− dum:ag
100− ;~(pfix dot dum:ag)
101− ;~(pfix dot dum:ag)
102− ;~(pose ;~(pfix ;~(plug dot dot) (most dot qix:ab)) (easy ~))
103− ==
104− ==
105− (easy [0 0 0 ~])
106− ==
107− ==
108− ::
109− %+ cook
110− |= {a/(list {p/?($d $h $m $s) q/@}) b/(list @)}
111− =+ rop=`tarp`[0 0 0 0 b]
112− |- ^- dime
113− ?~ a
114− [%dr (yule rop)]
115− ?- p.i.a
116− $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− $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− ==
121− ;~ plug
122− %+ most
123− dot
124− ;~ pose
125− ;~(pfix (just 'd') (stag %d dim:ag))
126− ;~(pfix (just 'h') (stag %h dim:ag))
127− ;~(pfix (just 'm') (stag %m dim:ag))
128− ;~(pfix (just 's') (stag %s dim:ag))
129− ==
130− ;~(pose ;~(pfix ;~(plug dot dot) (most dot qix:ab)) (easy ~))
131− ==
132− ::
133− (stag %p fed:ag)
134− ;~(pfix dot (stag %ta urs:ab))
135− ;~(pfix sig (stag %t urx:ab))
136− ;~(pfix hep (stag %c (cook turf urx:ab)))
137− ==
138− ++ nuck
139− ~/ %nuck |= a/nail %. a
140− %+ knee *coin |. ~+
141− %- stew
142− ^. stet ^. limo
143− :~ :- ['a' 'z'] (cook |=(a/@ta [%$ %tas a]) sym)
144− :- ['0' '9'] (stag %$ bisk)
145− :- '-' (stag %$ tash)
146− :- '.' ;~(pfix dot perd)
147− :- '~' ;~(pfix sig ;~(pose twid (easy [%$ %n 0])))
148− ==
149− ++ nusk
150− ~+
151− :(sear |=(a/@ta (rush a nuck)) wick urt:ab)
152− ++ perd
153− ~+
154− ;~ pose
155− (stag %$ zust)
156− (stag %many (ifix [cab ;~(plug cab cab)] (more cab nusk)))
157− ==
158− ++ royl
159− ~+
160− =+ ^= moo
161− |= a/tape
162− :- (lent a)
163− (scan a (bass 10 (plus sid:ab)))
164− =+ ^= voy
165− %+ cook royl-cell
166− ;~ pose
167− ;~ plug
168− (easy %d)
169− ;~ pose (cold | hep) (easy &) ==
170− ;~ plug dim:ag
171− ;~ pose
172− ;~(pfix dot (cook moo (plus (shim '0' '9'))))
173− (easy [0 0])
174− ==
175− ;~ pose
176− ;~ pfix
177− (just 'e')
178− ;~(plug ;~(pose (cold | hep) (easy &)) dim:ag)
179− ==
180− (easy [& 0])
181− ==
182− ==
183− ==
184− ;~ plug
185− (easy %i)
186− ;~ sfix
187− ;~ pose (cold | hep) (easy &) ==
188− (jest 'inf')
189− ==
190− ==
191− ;~ plug
192− (easy %n)
193− (cold ~ (jest 'nan'))
194− ==
195− ==
196− ;~ pose
197− (stag %rh (cook rylh ;~(pfix ;~(plug sig sig) voy)))
198− (stag %rq (cook rylq ;~(pfix ;~(plug sig sig sig) voy)))
199− (stag %rd (cook ryld ;~(pfix sig voy)))
200− (stag %rs (cook ryls voy))
201− ==
202− ::
203− ++ royl-cell
204− |= rn
205− ^- dn
206− ?. ?=({$d *} +<) +<
207− =+ ^= h
208− (dif:si (new:si f.b i.b) (sun:si d.b))
209− [%d a h (add (mul c.b (pow 10 d.b)) e.b)]
210− ::
211− ++ tash
212− ~+
213− =+ ^= neg
214− |= {syn/? mol/dime} ^- dime
215− ?> =('u' (end 3 1 p.mol))
216− [(cat 3 's' (rsh 3 1 p.mol)) (new:si syn q.mol)]
217− ;~ pfix hep
218− ;~ pose
219− (cook |=(a/dime (neg | a)) bisk)
220− ;~(pfix hep (cook |=(a/dime (neg & a)) bisk))
221− ==
222− ==
223− ::
224− ++ twid
225− ~+
226− ;~ pose
227− (cook |=(a/@ [%blob (cue a)]) ;~(pfix (just '0') vum:ag))
228− (stag %$ crub)
229− ==
230− ::
231− ++ zust
232− ~+
233− ;~ pose
234− (stag %is bip:ag)
235− (stag %if lip:ag)
236− (stag %f ;~(pose (cold & (just 'y')) (cold | (just 'n'))))
237− royl
238− ==
239− --
240−
241−Examples
242−--------
243−
244− ~zod/try=> (scan "1926.5.12" crub:so)
245− [p=~.da q=170.141.184.449.747.016.871.285.095.307.149.312.000]
246− ~zod/try=> ([%da @da] (scan "1926.5.12" crub:so))
247− [%da ~1926.5.12]
248− ~zod/try=> (scan "s10" crub:so)
249− [p=~.dr q=184.467.440.737.095.516.160]
250− ~zod/try=> ([%dr @dr] (scan "s10" crub:so))
251− [%dr ~s10]
252− ~zod/try=> (scan "doznec" crub:so)
253− [%p 256]
254− ~zod/try=> (scan ".mas" crub:so)
255− [%ta 7.561.581]
256−
257−------------------------------------------------------------------------
258−
259−### `++nuck`
260−
261−Top-level coin parser
262−
263−Parsing rule. Switches on the first character and applies the
264−corresponding `++coin` parser.
265−
266−Accepts
267−-------
268−
269−Produces
270−--------
271−
272−Source
273−------
274−
275− ++ nuck
276− ~/ %nuck |= a/nail %. a
277− %+ knee *coin |. ~+
278− %- stew
279− ^. stet ^. limo
280− :~ :- ['a' 'z'] (cook |=(a/@ta [%$ %tas a]) sym)
281− :- ['0' '9'] (stag %$ bisk)
282− :- '-' (stag %$ tash)
283− :- '.' ;~(pfix dot perd)
284− :- '~' ;~(pfix sig ;~(pose twid (easy [%$ %n 0])))
285− ==
286−
287−
288−
289−Examples
290−--------
291−
292− ~zod/try=> (scan "~pillyt" nuck:so)
293− [% p=[p=~.p q=32.819]]
294− ~zod/try=> (scan "0x12" nuck:so)
295− [% p=[p=~.ux q=18]]
296− ~zod/try=> (scan ".127.0.0.1" nuck:so)
297− [% p=[p=~.if q=2.130.706.433]]
298− ~zod/try=> `@ud`.127.0.0.1
299− 2.130.706.433
300− ~zod/try=> (scan "._20_0w25_sam__" nuck:so)
301− [ %many
302− p
303− ~[[% p=[p=~.ud q=20]] [% p=[p=~.uw q=133]] [% p=[p=~.tas q=7.168.371]]]
304− ]
305− ~zod/try=> `@`%sam
306− 7.168.371
307− ~zod/try=> (scan "~0ph" nuck:so)
308− [%blob p=[1 1]]
309− ~zod/try=> ~0ph
310− [1 1]
311− ~zod/try=> `@uv`(jam [1 1])
312− 0vph
313−
314−------------------------------------------------------------------------
315−
316−### `++nusk`
317−
318−Parse coin literal with escapes
319−
320−Parsing rule. Parses a coin literal with escapes. (See also: xx tuple
321−formatting).
322−
323−Accepts
324−-------
325−
326−Produces
327−--------
328−
329−Source
330−------
331−
332− ++ nusk
333− (sear |=(a/@ta (rush (wick a) nuck)) urt:ab)
334−
335−Examples
336−--------
337−
338− ~zod/try=> ~.asd_a
339− ~.asd_a
340− ~zod/try=> ._1_~~.asd~-a__
341− [1 ~.asd_a]
342− ~zod/try=> (scan "~~.asd~-a" nusk:so)
343− [% p=[p=~.ta q=418.212.246.369]]
344− ~zod/try=> ([~ %ta @ta] (scan "~~.asd~-a" nusk:so))
345− [~ %ta ~.asd_a]
346−
347−------------------------------------------------------------------------
348−
349−### `++perd`
350−
351−Parsing rule.
352−
353−Parsing rule. Parses a dime or tuple without their respective standard
354−prefixes.
355−
356−Accepts
357−-------
358−
359−Produces
360−--------
361−
362−Source
363−------
364−
365− ++ perd
366− ;~ pose
367− (stag ~ zust)
368− (stag %many (ifix [cab ;~(plug cab cab)] (more cab nusk)))
369− ==
370−
371−Examples
372−--------
373−
374− ~zod/try=> (scan "y" perd:so)
375− [~ [%f %.y]]
376− ~zod/try=> (scan "n" perd:so)
377− [~ [%f %.n]]
378− ~zod/try=> |
379− %.n
380− ~zod/try=> (scan "_20_x__" perd:so)
381− [%many [[% p=[p=~.ud q=20]] ~[[% p=[p=~.tas q=120]]]]]
382−
383−------------------------------------------------------------------------
384−
385−### `++royl`
386−
387−Parse dime float
388−
389−Parsing rule. Parses a number into a `++dime` float.
390−
391−Accepts
392−-------
393−
394−Produces
395−--------
396−
397−Source
398−------
399−
400− ++ royl
401− ~+
402− =+ ^= moo
403− |= a/tape
404− :- (lent a)
405− (scan a (bass 10 (plus sid:ab)))
406− =+ ^= voy
407− %+ cook royl-cell
408− ;~ pose
409− ;~ plug
410− (easy %d)
411− ;~ pose (cold | hep) (easy &) ==
412− ;~ plug dim:ag
413− ;~ pose
414− ;~(pfix dot (cook moo (plus (shim '0' '9'))))
415− (easy [0 0])
416− ==
417− ;~ pose
418− ;~ pfix
419− (just 'e')
420− ;~(plug ;~(pose (cold | hep) (easy &)) dim:ag)
421− ==
422− (easy [& 0])
423− ==
424− ==
425− ==
426− ;~ plug
427− (easy %i)
428− ;~ sfix
429− ;~ pose (cold | hep) (easy &) ==
430− (jest 'inf')
431− ==
432− ==
433− ;~ plug
434− (easy %n)
435− (cold ~ (jest 'nan'))
436− ==
437− ==
438− ;~ pose
439− (stag %rh (cook rylh ;~(pfix ;~(plug sig sig) voy)))
440− (stag %rq (cook rylq ;~(pfix ;~(plug sig sig sig) voy)))
441− (stag %rd (cook ryld ;~(pfix sig voy)))
442− (stag %rs (cook ryls voy))
443− ==
444− ::
445−
446−Examples
447−--------
448−
449− ~zod/try=> (scan "~3.14" royl:so)
450− [%rd .~3.13999999999999]
451− ~zod/try=> .~3.14
452− .~3.13999999999999
453−
454−------------------------------------------------------------------------
455−
456−### `++royl-cell`
457−
458−XX still not fully functional
459−
460−Intermediate parsed float convereter
461−
462− ++ royl-cell
463− |= rn
464− ^- dn
465− ?. ?=({$d *} +<) +<
466− =+ ^= h
467− (dif:si (new:si f.b i.b) (sun:si d.b))
468− [%d a h (add (mul c.b (pow 10 d.b)) e.b)]
469− ::
470−
471−------------------------------------------------------------------------
472−
473−### `++tash`
474−
475−Parse signed dime
476−
477−Accepts
478−-------
479−
480−Produces
481−--------
482−
483−Parsing rule. Parses a signed number into a `++dime`.
484−
485−Source
486−------
487−
488− ++ tash
489− ~+
490− =+ ^= neg
491− |= {syn/? mol/dime} ^- dime
492− ?> =('u' (end 3 1 p.mol))
493− [(cat 3 's' (rsh 3 1 p.mol)) (new:si syn q.mol)]
494− ;~ pfix hep
495− ;~ pose
496− (cook |=(a/dime (neg | a)) bisk)
497− ;~(pfix hep (cook |=(a/dime (neg & a)) bisk))
498− ==
499− ==
500− ::
501−
502−Examples
503−--------
504−
505− ~zod/try=> (scan "-20" tash:so)
506− [p=~.sd q=39]
507− ~zod/try=> (,[%sd @sd] (scan "-20" tash:so))
508− [%sd -20]
509− ~zod/try=> (,[%sd @sd] (scan "--20" tash:so))
510− [%sd --20]
511− ~zod/try=> (,[%sx @sx] (scan "--0x2e" tash:so))
512− [%sx --0x2e]
513−
514−------------------------------------------------------------------------
515−
516−### `++twid`
517−
518−Parse coins without `~` prefix
519−
520−Parsing rule. Parses coins after a leading sig, `~`.
521−
522−Accepts
523−-------
524−
525−Produces
526−--------
527−
528−Source
529−------
530−
531− ++ twid
532− ;~ pose
533− (cook |=(a/@ [%blob (cue a)]) ;~(pfix (just '0') vum:ag))
534− (stag ~ crub)
535− ==
536− ::
537−
538−Examples
539−--------
540−
541− ~zod/try=> (scan "zod" twid:so)
542− [~ [%p 0]]
543− ~zod/try=> (scan ".sam" twid:so)
544− [~ [%ta 7.168.371]]
545− ~zod/try=> `@ud`~.sam
546− 7.168.371
547− ~zod/try=> `@t`~.sam
548− 'sam'
549− ~zod/try=> (scan "0ph" twid:so)
550− [%blob [1 1]]
551−
552−------------------------------------------------------------------------
553−
554−### `++zust`
555−
556−Parse prefixed dimes from `@if`, `@f`, `@rd`
557−
558−Parsing rule. Parses an atom of either `@if` (IP address), `@f`
559−(loobean), or `rf`(floating point) into a `++dime`.
560−
561−Accepts
562−-------
563−
564−Produces
565−--------
566−
567−Source
568−------
569−
570− ++ zust
571− ;~ pose
572− (stag %is bip:ag)
573− (stag %if lip:ag)
574− (stag %f ;~(pose (cold & (just 'y')) (cold | (just 'n'))))
575− royl
576− ==
577− --
578−
579−Examples
580−--------
581−
582− ~zod/try=> (scan "127.0.0.1" zust:so)
583− [%if q=2.130.706.433]
584− ~zod/try=> (scan "af.0.0.0.0.e7a5.30d2.7" zust:so)
585− [%is q=908.651.950.243.594.834.993.091.554.288.205.831]
586− ~zod/try=> (,[%is @is] (scan "af.0.0.0.0.e7a5.30d2.7" zust:so))
587− [%is .af.0.0.0.0.e7a5.30d2.7]
588− ~zod/try=> (,[%is @ux] (scan "af.0.0.0.0.e7a5.30d2.7" zust:so))
589− [%is 0xaf.0000.0000.0000.0000.e7a5.30d2.0007]
590− ~zod/try=> (scan "y" zust:so)
591− [%f %.y]
592− ~zod/try=> (scan "12.09" zust:so)
593− [%rd .~12.00999999999999]
594−
595−
596−
597−***
docs/programming/advanced/library/src/4l/title.mddeleted−1
@@ -1 +0,0 @@
1−# 4l: atom parsing
docs/programming/advanced/library/src/4m/gate/scot.mddeleted−42
@@ -1,42 +0,0 @@
1−### `++scot`
2−
3−Render dime as cord
4−
5−Renders a dime `mol` as a cord.
6−
7−Accepts
8−-------
9−
10−Produces
11−--------
12−
13−`mol` is a `++dime`.
14−
15−Source
16−------
17−
18− ++ scot |=(mol/dime ~(rent co %$ mol))
19−
20−Examples
21−--------
22−
23− ~zod/try=> (scot %p ~pillyt)
24− ~.~pillyt
25− ~zod/try=> `@t`(scot %p ~pillyt)
26− '~pillyt'
27− ~zod/try=> (scot %ux 0x12)
28− ~.0x12
29− ~zod/try=> `@t`(scot %ux 0x12)
30− '0x12'
31− ~zod/try=> (scot %if .127.0.0.1)
32− ~..127.0.0.1
33− ~zod/try=> `@t`(scot %if .127.0.0.1)
34− '.127.0.0.1'
35− ~zod/try=> (scot %ta ~.asd_a)
36− ~.~.asd_a
37− ~zod/try=> `@t`(scot %ta ~.asd_a)
38− '~.asd_a'
39−
40−
41−
42−***
docs/programming/advanced/library/src/4m/gate/scow.mddeleted−34
@@ -1,34 +0,0 @@
1−### `++scow`
2−
3−Render dime as tape
4−
5−Renders `mol` as a tape.
6−
7−Accepts
8−-------
9−
10−Produces
11−--------
12−
13−`mol` is a `++dime`.
14−
15−Source
16−------
17−
18− ++ scow |=(mol/dime ~(rend co %$ mol))
19−
20−Examples
21−--------
22−
23− ~zod/try=> (scow %p ~pillyt)
24− "~pillyt"
25− ~zod/try=> (scow %ux 0x12)
26− "0x12"
27− ~zod/try=> (scow %if .127.0.0.1)
28− ".127.0.0.1"
29− ~zod/try=> (scow %ta ~.asd_a)
30− "~.asd_a"
31−
32−
33−
34−***
docs/programming/advanced/library/src/4m/gate/slat.mddeleted−37
@@ -1,37 +0,0 @@
1−### `++slat`
2−
3−Curried slaw
4−
5−Produces a `gate` that parses a `term` `txt` to an atom of the
6−odor specified by `mod`.
7−
8−Accepts
9−-------
10−
11−Produces
12−--------
13−
14−`mod` is a term, an atom of odor `@tas`.
15−
16−`txt` is a span, an atom of odor `@ta`.
17−
18−Source
19−------
20−
21− ++ slat |=(mod/@tas |=(txt/@ta (slaw mod txt)))
22−
23−Examples
24−--------
25−
26− ~zod/try=> `(unit @p)`((slat %p) '~pillyt')
27− [~ ~pillyt]
28− ~zod/try=> `(unit @ux)`((slat %ux) '0x12')
29− [~ 0x12]
30− ~zod/try=> `(unit @if)`((slat %if) '.127.0.0.1')
31− [~ .127.0.0.1]
32− ~zod/try=> `(unit @ta)`((slat %ta) '~.asd_a')
33− [~ ~.asd_a
34−
35−
36−
37−***
docs/programming/advanced/library/src/4m/gate/slav.mddeleted−45
@@ -1,45 +0,0 @@
1−### `++slav`
2−
3−Demand: parse span with input odor
4−
5−Parses a span `txt` to an atom of the odor specificed by `mod`. Crashes
6−if it failes to parse.
7−
8−Accepts
9−-------
10−
11−Produces
12−--------
13−
14−`mod` is a term, an atom of odor `@tas`.
15−
16−`txt` is a span, an atom of odor `@ta`.
17−
18−Source
19−------
20−
21− ++ slav |=([mod/@tas txt/@ta] (need (slaw mod txt)))
22−
23−Examples
24−--------
25−
26− ~zod/try=> `@p`(slav %p '~pillyt')
27− ~pillyt
28− ~zod/try=> `@p`(slav %p '~pillam')
29− ! exit
30− ~zod/try=> `@ux`(slav %ux '0x12')
31− 0x12
32− ~zod/try=> `@ux`(slav %ux '0b10')
33− ! exit
34− ~zod/try=> `@if`(slav %if '.127.0.0.1')
35− .127.0.0.1
36− ~zod/try=> `@if`(slav %if '.fe80.0.0.202')
37− ! exit
38− ~zod/try=> `@ta`(slav %ta '~.asd_a')
39− ~.asd_a
40− ~zod/try=> `@ta`(slav %ta '~~asd-a')
41− ! exit
42−
43−
44−
45−***
docs/programming/advanced/library/src/4m/gate/slaw.mddeleted−50
@@ -1,50 +0,0 @@
1−### `++slaw`
2−
3−Parse span to input odor
4−
5−Parses a span `txt` to an atom of the odor specified by `mod`.
6−
7−Accepts
8−-------
9−
10−Produces
11−--------
12−
13−`mod` is a term, an atom of odor `@tas`.
14−
15−`txt` is a span, an atom of odor `@ta`.
16−
17−Source
18−------
19−
20− ++ slaw
21− ~/ %slaw
22− |= {mod/@tas txt/@ta}
23− ^- (unit @)
24− =+ con=(slay txt)
25− ?.(&(?=({$~ $$ @ @} con) =(p.p.u.con mod)) ~ [~ q.p.u.con])
26−
27−
28−Examples
29−--------
30−
31− ~zod/try=> `(unit @p)`(slaw %p '~pillyt')
32− [~ ~pillyt]
33− ~zod/try=> `(unit @p)`(slaw %p '~pillam')
34− ~
35− ~zod/try=> `(unit @ux)`(slaw %ux '0x12')
36− [~ 0x12]
37− ~zod/try=> `(unit @ux)`(slaw %ux '0b10')
38− ~
39− ~zod/try=> `(unit @if)`(slaw %if '.127.0.0.1')
40− [~ .127.0.0.1]
41− ~zod/try=> `(unit @if)`(slaw %if '.fe80.0.0.202')
42− ~
43− ~zod/try=> `(unit @ta)`(slaw %ta '~.asd_a')
44− [~ ~.asd_a]
45− ~zod/try=> `(unit @ta)`(slaw %ta '~~asd-a')
46− ~
47−
48−
49−
50−***
docs/programming/advanced/library/src/4m/gate/slay.mddeleted−60
@@ -1,60 +0,0 @@
1−### `++slay`
2−
3−Parse span to coin
4−
5−Parses a span `txt` to the unit of a `++coin`.
6−
7−Accepts
8−-------
9−
10−Produces
11−--------
12−
13−`txt` is a `@ta`.
14−
15−Source
16−------
17−
18− ++ slay
19− |= txt/@ta ^- (unit coin)
20− =+ ^= vex
21− ?: (gth 0x7fff.ffff txt) :: XX petty cache
22− ~+ ((full nuck:so) [[1 1] (trip txt)])
23− ((full nuck:so) [[1 1] (trip txt)])
24− ?~ q.vex
25− ~
26− [~ p.u.q.vex]
27− ::
28−
29−
30−Examples
31−--------
32−
33− ~zod/try=> (slay '~pillyt')
34− [~ [% p=[p=~.p q=32.819]]]
35− ~zod/try=> (slay '0x12')
36− [~ [% p=[p=~.ux q=18]]]
37− ~zod/try=> (slay '.127.0.0.1')
38− [~ [% p=[p=~.if q=2.130.706.433]]]
39− ~zod/try=> `@ud`.127.0.0.1
40− 2.130.706.433
41− ~zod/try=> (slay '._20_0w25_sam__')
42− [ ~
43− [ %many
44− p=~[[% p=[p=~.ud q=20]] [% p=[p=~.uw q=133]] [% p=[p=~.tas q=7.168.371]]]
45− ]
46− ]
47− ~zod/try=> `@`%sam
48− 7.168.371
49− ~zod/try=> (slay '~0ph')
50− [~ [%blob p=[1 1]]]
51− ~zod/try=> 0ph
52− ~ <syntax error at [1 2]>
53− ~zod/try=> ~0ph
54− [1 1]
55− ~zod/try=> `@uv`(jam [1 1])
56− 0vph
57−
58−
59−
60−***
docs/programming/advanced/library/src/4m/gate/smyt.mddeleted−45
@@ -1,45 +0,0 @@
1−### `++smyt`
2−
3−Render path as tank
4−
5−Renders the path `bon` as a `tank`, which is used for
6−pretty-printing.
7−
8−Accepts
9−-------
10−
11−Produces
12−--------
13−
14−`bon` is a `++path`.
15−
16−Source
17−------
18−
19− ++ smyt :: pretty print path
20− |= bon/path ^- tank
21− :+ %rose [['/' ~] ['/' ~] ~]
22− (turn bon |=(a/@ [%leaf (trip a)]))
23− ::
24−
25−Examples
26−--------
27−
28− ~zod/try=> (smyt %)
29− [ %rose
30− p=[p="/" q="/" r="/"]
31− q
32− ~[ [%leaf p="~zod"]
33− [%leaf p="try"]
34− [%leaf p="~2014.10.28..18.36.58..a280"]
35− ]
36− ]
37− ~zod/try=> (smyt /as/les/top)
38− [ %rose
39− p=[p="/" q="/" r="/"]
40− q=~[[%leaf p="as"] [%leaf p="les"] [%leaf p="top"]]
41− ]
42−
43−
44−
45−***
docs/programming/advanced/library/src/4m/gate/spat.mddeleted−32
@@ -1,32 +0,0 @@
1−### `++spat`
2−
3−Render path as cord
4−
5−Renders a path `pax` as cord.
6−
7−Accepts
8−-------
9−
10−Produces
11−--------
12−
13−`pax` is a `path`.
14−
15−Source
16−------
17−
18− ++ spat |=(pax/path (crip (spud pax))) :: path to cord
19−
20−Examples
21−--------
22−
23− ~zod/try=> (spat %)
24− '~zod/try/~2014.10.28..18.40.20..4287'
25− ~zod/try=> (spat %/bin)
26− '~zod/try/~2014.10.28..18.41.12..3bcd/bin'
27− ~zod/try=> (spat /as/les/top)
28− '/as/les/top'
29−
30−
31−
32−***
docs/programming/advanced/library/src/4m/gate/spud.mddeleted−32
@@ -1,32 +0,0 @@
1−### `++spud`
2−
3−Render path as tape
4−
5−Renders a path `pax` as tape.
6−
7−Accepts
8−-------
9−
10−Produces
11−--------
12−
13−`pax` is a `path`.
14−
15−Source
16−------
17−
18− ++ spud |=(pax/path ~(ram re (smyt pax))) :: path to tape
19−
20−Examples
21−--------
22−
23− ~zod/try=> (spud %)
24− "~zod/try/~2014.10.28..18.40.46..e951"
25− ~zod/try=> (spud %/bin)
26− "~zod/try/~2014.10.28..18.41.05..16f2/bin"
27− ~zod/try=> (spud /as/les/top)
28− "/as/les/top"
29−
30−
31−
32−***
docs/programming/advanced/library/src/4m/gate/stab.mddeleted−38
@@ -1,38 +0,0 @@
1−### `++stab`
2−
3−Parse span to path
4−
5−Parsing rule. Parses a span `zep` to a static `++path`.
6−
7−Accepts
8−-------
9−
10−Produces
11−--------
12−
13−Source
14−------
15−
16− ++ stab :: parse cord to path
17− =+ fel=;~(pfix fas (more fas urs:ab))
18− |=(zep/@t `path`(rash zep fel))
19−
20−
21−Examples
22−--------
23−
24− ~zod/try=> (stab '/as/lek/tor')
25− /as/lek/tor
26− ~zod/try=> `(pole ,@ta)`(stab '/as/lek/tor')
27− [~.as [~.lek [~.tor ~]]]
28− ~zod/try=> (stab '~zod/arvo/~2014.10.28..18.48.41..335f/zuse')
29− ~zod/arvo/~2014.10.28..18.48.41..335f/zuse
30− ~zod/try=> `(pole ,@ta)`(stab '~zod/arvo/~2014.10.28..18.48.41..335f/zuse')
31− [~.~zod [~.arvo [~.~2014.10.28..18.48.41..335f [~.zuse ~]]]]
32− ~zod/try=> (stab '/a/~pillyt/pals/1')
33− /a/~pillyt/pals/1
34− ~zod/try=> `(pole ,@ta)`(stab '/a/~pillyt/pals/1')
35− [~.a [~.~pillyt [~.pals [~.1 ~]]]]
36−
37−
38−***
docs/programming/advanced/library/src/4m/title.mddeleted−1
@@ -1 +0,0 @@
1−# 4m: formatting functions
docs/programming/advanced/library/src/4n/gate/mack.mddeleted−48
@@ -1,48 +0,0 @@
1−### `++mack`
2−
3−Nock subject to unit
4−
5−Accepts a nock subject-formula cell and wraps it into a `++unit`.
6−`fol` is pure nock, meaning that nock `11` operations result in a block,
7−producing a `~`.
8−
9−Accepts
10−-------
11−
12−`sub` is a subject noun.
13−
14−`fol` is a formula noun, which is generally a `++nock`.
15−
16−Produces
17−--------
18−
19−The `++unit` of a noun.
20−
21−Source
22−------
23−
24− ++ mack
25− |= {sub/* fol/*}
26− ^- (unit)
27− =+ ton=(mink [sub fol] |=({* *} ~))
28− ?.(?=({$0 *} ton) ~ [~ p.ton])
29− ::
30−
31−
32−Examples
33−--------
34−
35− ~zod/try=> (mack [[1 2 3] [0 1]])
36− [~ [1 2 3]]
37− ~zod/try=> (mack [41 4 0 1])
38− [~ 42]
39− ~zod/try=> (mack [4 0 4])
40− ~
41− ~zod/try=> (mack [[[0 2] [1 3]] 4 4 4 4 0 5])
42− [~ 6]
43− ~zod/try=> ;;((unit @tas) (mack [[1 %yes %no] 6 [0 2] [0 6] 0 7]))
44− [~ %no]
45−
46−
47−
48−***
docs/programming/advanced/library/src/4n/gate/mink.mddeleted−126
@@ -1,126 +0,0 @@
1−### `++mink`
2−
3−Mock interpreter
4−
5−Bottom-level mock (virtual nock) interpreter. Produces a
6−`++tone`, a nock computation result. If nock 11 is invoked, `sky`
7−computes on the subject and produces a `++unit` result. An empty
8−result becomes a `%1` `++tone`, indicating a block.
9−
10−Accepts
11−-------
12−
13−`sub` is the subject as a noun.
14−
15−`fol` is the formula as a noun.
16−
17−`sky` is an `%iron` gate invoked with nock operator 11.
18−
19−Produces
20−--------
21−
22−A `++tone`.
23−
24−Source
25−------
26−
27− ++ mink
28− ~/ %mink
29− |= {{sub/* fol/*} gul/$-({* *} (unit (unit)))}
30− =+ tax=*(list {@ta *})
31− |- ^- tone
32− ?@ fol
33− [%2 tax]
34− ?: ?=(^ -.fol)
35− =+ hed=$(fol -.fol)
36− ?: ?=($2 -.hed)
37− hed
38− =+ tal=$(fol +.fol)
39− ?- -.tal
40− $0 ?-(-.hed $0 [%0 p.hed p.tal], $1 hed)
41− $1 ?-(-.hed $0 tal, $1 [%1 (weld p.hed p.tal)])
42− $2 tal
43− ==
44− ?+ fol
45− [%2 tax]
46− ::
47− {$0 b/@}
48− ?: =(0 b.fol) [%2 tax]
49− ?: =(1 b.fol) [%0 sub]
50− ?: ?=(@ sub) [%2 tax]
51− =+ [now=(cap b.fol) lat=(mas b.fol)]
52− $(b.fol lat, sub ?:(=(2 now) -.sub +.sub))
53− ::
54− {$1 b/*}
55− [%0 b.fol]
56− ::
57− {$2 b/{^ *}}
58− =+ ben=$(fol b.fol)
59− ?. ?=($0 -.ben) ben
60− ?>(?=(^ p.ben) $(sub -.p.ben, fol +.p.ben))
61− ::?>(?=(^ p.ben) $([sub fol] p.ben)
62− ::
63− {$3 b/*}
64− =+ ben=$(fol b.fol)
65− ?. ?=($0 -.ben) ben
66− [%0 .?(p.ben)]
67− ::
68− {$4 b/*}
69− =+ ben=$(fol b.fol)
70− ?. ?=($0 -.ben) ben
71− ?. ?=(@ p.ben) [%2 tax]
72− [%0 .+(p.ben)]
73− ::
74− {$5 b/*}
75− =+ ben=$(fol b.fol)
76− ?. ?=($0 -.ben) ben
77− ?. ?=(^ p.ben) [%2 tax]
78− [%0 =(-.p.ben +.p.ben)]
79− ::
80− {$6 b/* c/* d/*}
81− $(fol =>(fol [2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]))
82− ::
83− {$7 b/* c/*} $(fol =>(fol [2 b 1 c]))
84− {$8 b/* c/*} $(fol =>(fol [7 [[0 1] b] c]))
85− {$9 b/* c/*} $(fol =>(fol [7 c 0 b]))
86− {$10 @ c/*} $(fol c.fol)
87− {$10 {b/* c/*} d/*}
88− =+ ben=$(fol c.fol)
89− ?. ?=($0 -.ben) ben
90− ?: ?=(?($hunk $hand $lose $mean $spot) b.fol)
91− $(fol d.fol, tax [[b.fol p.ben] tax])
92− $(fol d.fol)
93− ::
94− {$11 b/* c/*}
95− =+ ref=$(fol b.fol)
96− =+ ben=$(fol c.fol)
97− ?. ?=($0 -.ref) ref
98− ?. ?=($0 -.ben) ben
99− =+ val=(gul p.ref p.ben)
100− ?~(val [%1 p.ben ~] ?~(u.val [%2 [[%hunk (mush p.ben)] tax]] [%0 u.u.val]))
101− ==
102− ::
103−
104−
105−Examples
106−--------
107−
108− ~zod/try=> (mink [20 [4 0 1]] $~)
109− [%0 p=21]
110− ~zod/try=> (mink [[90 5 3] [0 3]] $~)
111− [%0 p=[5 3]]
112− ~zod/try=> (mink 20^[4 0 1] $~)
113− [%0 p=21]
114− ~zod/try=> (mink [90 5 3]^[0 3] $~)
115− [%0 p=[5 3]]
116− ~zod/try=> (mink [0]^[11 1 20] $~)
117− [%1 p=~[20]]
118− ~zod/try=> (mink [0]^[11 1 20] |=(a=* `[40 a]))
119− [%0 p=[40 20]]
120− ~zod/try=> (mink [5]^[0 2] $~)
121− [%2 p=~]
122− ~zod/try=> (mink [5]^[10 yelp/[0 1] 0 0] $~)
123− [%2 p=~[[~.yelp 5]]]
124−
125−
126−***
docs/programming/advanced/library/src/4n/gate/mock.mddeleted−53
@@ -1,53 +0,0 @@
1−### `++mock`
2−
3−Compute formula on subject with hint
4−
5−Produces a `++toon`, which is either a sucessful, blocked, or
6−crashed result. If nock 11 is invoked, `sky` computes on the subject and
7−produces a `++unit` result. An empty result becomes a `%1` `++tune`,
8−indicating a block.
9−
10−Accepts
11−-------
12−
13−`sub` is the subject as a noun.
14−
15−`fol` is the formula as a noun.
16−
17−`sky` is an %iron gate invoked with nock operator 11.
18−
19−Produces
20−--------
21−
22−The `++unit` of a noun.
23−
24−Source
25−------
26−
27− ++ mock
28− |= {{sub/* fol/*} gul/$-({* *} (unit (unit)))}
29− (mook (mink [sub fol] gul))
30− ::
31−
32−
33−Examples
34−--------
35−
36− ~zod/try=> (mock [5 4 0 1] ,~)
37− [%0 p=6]
38− ~zod/try=> (mock [~ 11 1 0] |=(* `999))
39− [%0 p=999]
40− ~zod/try=> (mock [~ 0 1.337] ,~)
41− [%2 p=~]
42− ~zod/try=> (mock [~ 11 1 1.337] ,~)
43− [%1 p=~[1.337]]
44− ~zod/try=> (mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[+<]))
45− [%0 p=14]
46− ~zod/try=> (mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[<+<>]))
47− [%0 p=[49 52 0]]
48− ~zod/try=> ;;(tape +:(mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[<+<>])))
49− "14"
50−
51−
52−
53−***
docs/programming/advanced/library/src/4n/gate/mong.mddeleted−57
@@ -1,57 +0,0 @@
1−### `++mong`
2−
3−Slam gate with sample
4−
5−Produces a `++toon` computation result from slamming `gat` with
6−`sam`, using `sky` to compute or block on nock 11 when applicable.
7−
8−Accepts
9−-------
10−
11−`gat` is a noun that is generally a `gate`.
12−
13−`sam` is a `sample` noun.
14−
15−`sky` is an %iron gate invoked with nock operator 11.
16−
17−Produces
18−--------
19−
20−A `++toon`.
21−
22−Source
23−------
24−
25− ++ mong
26− |= {{gat/* sam/*} gul/$-({* *} (unit (unit)))}
27− ^- toon
28− ?. &(?=(^ gat) ?=(^ +.gat))
29− [%2 ~]
30− (mock [[-.gat [sam +>.gat]] -.gat] gul)
31− ::
32−
33−Examples
34−--------
35−
36− ~zod/try=> (mong [|=(@ 20) ~] ,~)
37− [%0 p=20]
38− ~zod/try=> (mong [|=(@ !!) ~] ,~)
39− [%2 p=~]
40− ~zod/try=> (mong [|=(a/@ (add 20 a)) ~] ,~)
41− [%0 p=20]
42− ~zod/try=> (mong [|=(a/[@ @] (add 20 -.a)) ~] ,~)
43− [%2 p=~]
44− ~zod/try=> (mong [|=(a/[@ @] (add 20 -.a)) [4 6]] ,~)
45− [%0 p=24]
46− ~zod/try=> (mong [|=(a/@ .^(a)) ~] ,~)
47− [%1 p=~[0]]
48− ~zod/try=> (mong [|=(a/@ .^(a)) ~] ,[~ %42])
49− [%0 p=42]
50− ~zod/try=> (mong [|=(a/@ .^(a)) ~] |=(a/* [~ a 6]))
51− [%0 p=[0 6]]
52− ~zod/try=> (mong [|=(a/@ .^(a)) 8] |=(a/* [~ a 6]))
53− [%0 p=[8 6]]
54−
55−
56−
57−***
docs/programming/advanced/library/src/4n/gate/mook.mddeleted−73
@@ -1,73 +0,0 @@
1−### `++mook`
2−
3−Intelligently render crash annotation
4−
5−Converts a `%2` `++tone` nock stack trace to a list of `++tank`.
6−Each may be a tank, cord, `++spot`, or trapped tank.
7−
8−Accepts
9−-------
10−
11−`ton` is a `++tone`.
12−
13−Produces
14−--------
15−
16−A `++toon`.
17−
18−Source
19−------
20−
21− ++ mook
22− |= ton/tone
23− ^- toon
24− ?. ?=({$2 *} ton) ton
25− :- %2
26− :: =. p.ton (moop p.ton)
27− =+ yel=(lent p.ton)
28− =. p.ton
29− ?. (gth yel 256) p.ton
30− %+ weld
31− (scag 128 p.ton)
32− ^- (list {@ta *})
33− :_ (slag (sub yel 128) p.ton)
34− :- %lose
35− %+ rap 3
36− "[skipped {(scow %ud (sub yel 256))} frames]"
37− |- ^- (list tank)
38− ?~ p.ton ~
39− =+ rep=$(p.ton t.p.ton)
40− ?+ -.i.p.ton rep
41− $hunk [(tank +.i.p.ton) rep]
42− $lose [[%leaf (rip 3 (@ +.i.p.ton))] rep]
43− $hand [[%leaf (scow %p (mug +.i.p.ton))] rep]
44− $mean :_ rep
45− ?@ +.i.p.ton [%leaf (rip 3 (@ +.i.p.ton))]
46− =+ mac=(mack +.i.p.ton +<.i.p.ton)
47− ?~(mac [%leaf "####"] (tank u.mac))
48− $spot :_ rep
49− =+ sot=(spot +.i.p.ton)
50− :+ %rose [":" ~ ~]
51− :~ (smyt p.sot)
52− => [ud=|=(a/@u (scow %ud a)) q.sot]
53− leaf+"<[{(ud p.p)} {(ud q.p)}].[{(ud p.q)} {(ud q.q)}]>"
54− == ==
55− ::
56−
57−Examples
58−--------
59−
60− ~zod/try=> (mook [%0 5 4 5 1])
61− [%0 p=[5 4 5 1]]
62− ~zod/try=> (mook [%2 ~[[%hunk %rose ["<" "," ">"] ~[[%leaf "err"]]]]])
63− [%2 p=~[[%rose p=[p="<" q="," r=">"] q=[i=[%leaf p="err"] t=~]]]]
64− ~zod/try=> (mook [%2 ~[[%malformed %elem] [%lose 'do print']]])
65− [%2 p=~[[%leaf p="do print"]]]
66− ~zod/try=> (mook [%2 ~[[%mean |.(>(add 5 6)<)]]])
67− [%2 p=~[[%leaf p="11"]]]
68− ~zod/try=> (mook [%2 ~[[%spot /b/repl [1 1]^[1 2]] [%mean |.(!!)]]])
69− [%2 p=~[[%leaf p="/b/repl/:<[1 1].[1 2]>"] [%leaf p="####"]]]
70−
71−
72−
73−***
docs/programming/advanced/library/src/4n/gate/mule.mddeleted−55
@@ -1,55 +0,0 @@
1−### `++mule`
2−
3−Typed virtual
4−
5−Kicks a `++trap`, producing its results or any errors that occur along
6−the way. Used to lazily compute stack traces.
7−
8−Accepts
9−-------
10−
11−`taq` is a `++trap`, generally producing a list of `++tank`s.
12−
13−Produces
14−--------
15−
16−XX
17−
18−Source
19−------
20−
21− ++ mule :: typed virtual
22− ~/ %mule
23− |* taq/_|.(**)
24− =+ mud=(mute taq)
25− ?- -.mud
26− $& [%& p=$:taq] :: XX transition
27− $| [%| p=p.mud]
28− ==
29− ::
30−
31−
32−Examples
33−--------
34−
35− ~zod/try=> (mule |.(leaf/"hello"))
36− [%.y p=[%leaf "hello"]]
37− ~zod/try=> (mule |.(!!))
38− [%.n p=~]
39− ~zod/try=> (mule |.(.^(a//=pals/1)))
40− [ %.n
41− p
42− ~[
43− [ %rose
44− p=[p="/" q="/" r="/"]
45− q
46− [ i=[%leaf p="a"]
47− t=[i=[%leaf p="~zod"] t=[i=[%leaf p="pals"] t=[i=[%leaf p="1"] t=~]]]
48− ]
49− ]
50− ]
51− ]
52−
53−
54−
55−***
docs/programming/advanced/library/src/4n/gate/mute.mddeleted−41
@@ -1,41 +0,0 @@
1−### `++mute`
2−
3−Untyped virtual
4−
5−Kicks a `++trap`, producing its result as a noun or the tanks of any
6−error that occurs. Similar to `++mule`, but preserves no type
7−information.
8−
9−Accepts
10−-------
11−
12−`taq` is a `++trap`.
13−Produces
14−--------
15−
16−Either a noun or a `++list` of `++tank`.
17−
18−Source
19−------
20−
21− ++ mute :: untyped virtual
22− |= taq/_^?(|.(**))
23− ^- (each * (list tank))
24− =+ ton=(mock [taq 9 2 0 1] |=({* *} ~))
25− ?- -.ton
26− $0 [%& p.ton]
27− $1 [%| (turn p.ton |=(a/* (smyt (path a))))]
28− $2 [%| p.ton]
29− ==
30−
31−
32−Examples
33−--------
34−
35− ~zod/try=> (mute |.(leaf/"hello"))
36− [%.y p=[1.717.658.988 104 101 108 108 111 0]]
37− ~zod/try=> (mute |.(!!))
38− [%.n p=~]
39−
40−
41−***
docs/programming/advanced/library/src/4n/title.mddeleted−1
@@ -1 +0,0 @@
1−# 4n: virtualization
docs/programming/advanced/library/src/4o/mold/abel.mddeleted−18
@@ -1,18 +0,0 @@
1−### `++abel`
2−
3−Biblical names in hoon are primarily aliases for the compiler.
4−
5−Source
6−------
7−
8− ++ abel typo :: original sin: type
9−
10−Examples
11−--------
12−
13− ~zod/try=> *abel
14− %void
15−
16−
17−
18−***
docs/programming/advanced/library/src/4o/mold/aura.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++aura`
2−
3−'type' of atom
4−
5−By convention, a short name for a category of atom. `++aura` is
6−circularly defined, with [`@ta`]() being the `++aura` of the ASCII subset
7−commonly used in urbit.
8−
9−Source
10−------
11−
12− ++ aura ,@ta :: atom format
13−
14−Examples
15−--------
16−
17−See also: [`++base`](), [aura reference]()
18−
19− ~zod/try=> `aura`%ux
20− ~.ux
21−
22−
23−
24−***
docs/programming/advanced/library/src/4o/mold/axis.mddeleted−27
@@ -1,27 +0,0 @@
1−
2−### `++axis`
3−
4−Nock axis
5−
6−A Nock axis inside a [noun](). After the leading 1, in binary, a `1` signfies
7−right and `0` left.
8−
9−Source
10−------
11−
12− ++ axis ,@ :: tree address
13−
14−Examples
15−--------
16−
17− ~zod/try=> *axis
18− 0
19−
20− ~zod/try=> :: 0 is not actually a valid axis
21− ~zod/try=> [[4 5] 6 7]
22− [[4 5] 6 7]
23− ~zod/try=> `axis`0b110
24− 6
25−
26−
27−***
docs/programming/advanced/library/src/4o/mold/base.mddeleted−29
@@ -1,29 +0,0 @@
1−
2−### `++base`
3−
4−Base type
5−
6−A base type that [noun]()s are built from. A `++base` is either a noun, cell, boolean or
7−null labelled with an [odor]().
8−
9−Source
10−------
11−
12− ++ base ?([%atom p=odor] %noun %cell %bean %null) :: axils, @ * ^ ? ~
13−
14−Examples
15−--------
16−
17− ~zod/try=> *base
18− %null
19−
20− ~zod/try=> (ream '=|(^ !!)')
21− [%tsbr p=[%axil p=%cell] q=[%zpzp ~]]
22− ~zod/try=> :: p.p is a ++base
23− ~zod/try=> (ream '=|(@t !!)')
24− [%tsbr p=[%axil p=[%atom p=~.t]] q=[%zpzp ~]]
25− ~zod/try=> (ream '=|(? !!)')
26− [%tsbr p=[%axil p=%bean] q=[%zpzp ~]]
27−
28−
29−***
docs/programming/advanced/library/src/4o/mold/bean.mddeleted−25
@@ -1,25 +0,0 @@
1−### `++bean`
2−
3−Boolean
4−
5−`0`, `&`, or `%.y` are true, and `1`, `|`, and `%.n` are false.
6−
7−Source
8−------
9−
10− ++ bean ,? :: 0=&=yes, 1=|=no
11−
12−Examples
13−--------
14−
15− ~zod/try=> *bean
16− %.y
17−
18− ~zod/try=> `bean`&
19− %.y
20− ~zod/try=> `bean`|
21− %.n
22−
23−
24−
25−***
docs/programming/advanced/library/src/4o/mold/beer.mddeleted−21
@@ -1,21 +0,0 @@
1−### `++beer`
2−
3−Tape builder
4−
5−Used to build [tape]()s internally.
6−
7−Source
8−------
9−
10− ++ beer $|(@ [~ p=twig]) :: simple embed
11−
12−Examples
13−--------
14−
15− ~zod/try=> `beer`'as'
16− 29.537
17− ~zod/try=> `beer`[~ (ream 'lan')]
18− [~ p=[%cnzz p=~[%lan]]]
19−
20−
21−***
docs/programming/advanced/library/src/4o/mold/beet.mddeleted−20
@@ -1,20 +0,0 @@
1−### `++beet`
2−
3−XML interpolation cases
4−
5−Used internally.
6−
7−Source
8−------
9−
10− ++ beet $| @ :: advanced embed
11− $% [%a p=twig] :: take tape
12− [%b p=twig] :: take manx
13− [%c p=twig] :: take marl
14− [%d p=twig] :: take $+(marl marl)
15− [%e p=twig q=(list tuna)] :: element literal
16− == ::
17−
18−
19−
20−***
docs/programming/advanced/library/src/4o/mold/chum.mddeleted−31
@@ -1,31 +0,0 @@
1−### `++chum`
2−
3−Jet hint information
4−
5−Jet hint information that must be present in the body of a `~/` or `~%`
6−rune. A `++chum` can optionally contain a kelvin version, jet vendor,
7−and "{major}.{minor}" version number.
8−
9−Source
10−------
11−
12− ++ chum $? lef=term :: jet name
13− [std=term kel=@] :: kelvin version
14− [ven=term pro=term kel=@] :: vendor and product
15− [ven=term pro=term ver=@ kel=@] :: all of the above
16− == ::
17−
18−Examples
19−--------
20−
21−XX there's a ++chum in zuse that's politely causing this not to work
22−
23− ~zod/try=> `chum`'hi'
24− lef=%hi
25−
26− ~zod/try=> (ream '~/(%lob.314 !!)')
27− [%sgfs p=[std=%lob kel=314] q=[%zpzp ~]]
28−
29−
30−
31−***
docs/programming/advanced/library/src/4o/mold/coil.mddeleted−18
@@ -1,18 +0,0 @@
1−### `++coil`
2−
3−Tuple of core information
4−
5−Variance `p`, subject type `q`, and `q`: optional compiled nock, and arms. Used as an
6−intermediate step within Section 2fB. Converted by `++core` to %core type.
7−
8−Source
9−------
10−
11− ++ coil $: p=?(%gold %iron %lead %zinc) :: core type
12− q=type ::
13− r=[p=?(~ ^) q=(map term foot)] ::
14− == ::
15−
16−
17−
18−***
docs/programming/advanced/library/src/4o/mold/foot.mddeleted−33
@@ -1,33 +0,0 @@
1−### `++foot`
2−
3−Cases of arms by variance model.
4−
5−`%ash` arms are [`dry`]() and [geometric]().
6−
7−Source
8−------
9−
10− ++ foot $% [%ash p=twig] :: dry arm, geometric
11− [%elm p=twig] :: wet arm, generic
12− [%oak ~] :: XX not used
13− [%yew p=(map term foot)] :: XX not used
14− == ::
15−
16−Examples
17−--------
18−
19−See also: [`++ap`](), [`++ut`]()
20−
21− ~zod/try=> *foot
22− [%yew p={}]
23−
24− ~zod/try=> (ream '|% ++ $ foo --')
25− [%brcn p={[p=%$ q=[%ash p=[%cnzz p=~[%foo]]]]}]
26− ~zod/try=> +<+:(ream '|% ++ $ foo --')
27− t=~[%ash %cnzz %foo]
28− ~zod/try=> (foot +<+:(ream '|% ++ $ foo --'))
29− [%ash p=[%cnzz p=~[%foo]]]
30− ~zod/try=> (foot +<+:(ream '|% +- $ foo --'))
31− [%elm p=[%cnzz p=~[%foo]]]
32−
33−***
docs/programming/advanced/library/src/4o/mold/limb.mddeleted−20
@@ -1,20 +0,0 @@
1−### `++limb`
2−
3− ++ limb $|(term $%([%& p=axis] [%| p=@ud q=term])) ::
4−
5−XX move to `++ut`
6−
7−Reference into subject by name/axis
8−
9−See also: section 2fC-2fD
10−
11− ~zod/try=> (ream '^^$')
12− [%cnzz p=~[[%.n p=2 q=%$]]]
13− ~zod/try=> (limb &2:(ream '^^$'))
14− [%.n p=2 q=%$]
15− ~zod/try=> (limb &2:(ream '^^^$'))
16− [%.n p=3 q=%$]
17−
18−
19−
20−***
docs/programming/advanced/library/src/4o/mold/line.mddeleted−30
@@ -1,30 +0,0 @@
1−### `++line`
2−
3−XX move to `++ut`
4−
5−Source
6−------
7−
8− ++ line ,[p=[%leaf p=odor q=@] q=tile] :: %kelp case
9−
10−
11−Examples
12−--------
13−
14− ~zod/try=> (ream '$%([1 a] [%2 b])')
15− [ %bccm
16− p
17− [ %kelp
18− p
19− [ i=[p=[%leaf p=~.ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
20− t=~[[p=[%leaf p=~.ud q=2] q=[%herb p=[%cnzz p=~[%b]]]]]
21− ]
22− ]
23− ]
24− ~zod/try=> &3:(ream '$%([1 a] [%2 b])')
25− p=[p=[%leaf p=%ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
26− ~zod/try=> (line &3:(ream '$%([1 a] [%2 b])'))
27− [p=[%leaf p=~.ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
28−
29−
30−***
docs/programming/advanced/library/src/4o/mold/metl.mddeleted−11
@@ -1,11 +0,0 @@
1−### `++metl`
2−
3− ++ metl ?(%gold %iron %zinc %lead) :: core variance
4−
5−XX move to `++ut`
6−
7−See also: [`++coil`]()
8−
9−
10−
11−***
docs/programming/advanced/library/src/4o/mold/nock.mddeleted−31
@@ -1,31 +0,0 @@
1−### `++nock`
2−
3−Virtual machine. See [Nock doc]().
4−
5−
6−Source
7−------
8−
9− ++ nock $& [p=nock q=nock] :: autocons
10− [%3 p=nock] :: cell test
11− [%4 p=nock] :: increment
12− [%5 p=nock q=nock] :: equality test
13− [%6 p=nock q=nock r=nock] :: if, then, else
14− [%7 p=nock q=nock] :: serial compose
15− [%8 p=nock q=nock] :: push onto subject
16− [%9 p=@ q=nock] :: select arm and fire
17− [%10 p=?(@ [p=@ q=nock]) q=nock] :: hint
18− [%11 p=nock] :: grab data from sky
19− == ::
20−
21−Examples
22−--------
23−
24− ~zod/try=> !=([+(.) 20 -<])
25− [[4 0 1] [1 20] 0 4]
26− ~zod/try=> (nock !=([+(.) 20]))
27− [p=[%4 p=[%0 p=1]] q=[%1 p=20]]
28−
29−
30−
31−***
docs/programming/advanced/library/src/4o/mold/noun.mddeleted−12
@@ -1,12 +0,0 @@
1−### `++noun`
2−
3− ++ noun ,* :: any noun
4−
5−Used nowhere XX
6−
7− ~zod/try=> `noun`~[1 2 3]
8− [1 2 3 0]
9−
10−
11−
12−***
docs/programming/advanced/library/src/4o/mold/null.mddeleted−13
@@ -1,13 +0,0 @@
1−### `++null`
2−
3− ++ null ,~ :: null, nil, etc
4−
5−Used nowhere XX
6−
7− ~zod/try=> :type; *null
8− ~
9− %~
10−
11−
12−
13−***
docs/programming/advanced/library/src/4o/mold/port.mddeleted−25
@@ -1,25 +0,0 @@
1−### `++port`
2−
3−XX move to `++ut`
4−
5−Type and location of core-shaped thing? XX Compiler Internals
6−
7−Source
8−------
9−
10− ++ port $: p=axis ::
11− $= q ::
12− $% [%& p=type] ::
13− [%| p=axis q=(list ,[p=type q=foot])] ::
14− == ::
15− == ::
16−
17−Examples
18−--------
19−
20− ~zod/try=> *port
21− [p=0 q=[%.y p=%void]]
22−
23−
24−
25−***
docs/programming/advanced/library/src/4o/mold/span.mddeleted−32
@@ -1,32 +0,0 @@
1−### `++span`
2−
3−ASCII atom
4−
5−A restricted text atom for canonical atom syntaxes. The prefix is `~.`.
6−There are no escape sequences except `~~`, which means `~`, and `~-`,
7−which means `_`. `-` and `.` encode themselves. No other characters
8−besides numbers and lowercase letters are permitted.
9−
10−Source
11−------
12−
13− ++ span ,@ta :: text-atom (ASCII)
14−Examples
15−--------
16− ~zod/try=> *span
17− ~.
18−
19− ~zod/try=> `@t`~.foo
20− 'foo'
21− ~zod/try=> `@t`~.foo.bar
22− 'foo.bar'
23− ~zod/try=> `@t`~.foo~~bar
24− 'foo~bar'
25− ~zod/try=> `@t`~.foo~-bar
26− 'foo_bar'
27− ~zod/try=> `@t`~.foo-bar
28− 'foo-bar'
29−
30−
31−
32−***
docs/programming/advanced/library/src/4o/mold/tiki.mddeleted−36
@@ -1,36 +0,0 @@
1−### `++tiki`
2−
3−XX move to `++ut`
4−
5−Source
6−------
7−
8− ++ tiki :: test case
9−
10−Examples
11−--------
12−
13−A `++wing` or `++twig`.
14−
15− ~zod/try=> (ream '=+ a=4 ?-(a @ ~)')
16− [ %tsls
17− p=[%ktts p=p=%a q=[%dtzy p=%ud q=4]]
18− q
19− [ %wthz
20− p=[%.y p=~ q=~[%a]]
21− q=~[[p=[%axil p=[%atom p=~.]] q=[%bczp p=%null]]]
22− ]
23− ]
24− ~zod/try=> (ream '=+ a=4 ?-(4 @ ~)')
25− [ %tsls
26− p=[%ktts p=p=%a q=[%dtzy p=%ud q=4]]
27− q
28− [ %wthz
29− p=[%.n p=~ q=[%dtzy p=%ud q=4]]
30− q=~[[p=[%axil p=[%atom p=~.]] q=[%bczp p=%null]]]
31− ]
32− ]
33−
34−
35−
36−***
docs/programming/advanced/library/src/4o/mold/toga.mddeleted−42
@@ -1,42 +0,0 @@
1−### `++toga`
2−
3−Tree of faces
4−
5−A [face](), or tree of faces. A `++toga` is applied to anything assigned
6−using [`^=`]().
7−
8−XX move to `++ut` and rune doc (for \^= examples)
9−
10−Source
11−------
12−
13− ++ toga :: face control
14− [2 p=toga q=toga] :: cell toga
15− == ::
16−
17−Examples
18−--------
19−
20− ~zod/try=> a=1
21− a=1
22− ~zod/try=> (ream 'a=1')
23− [%ktts p=p=%a q=[%dtzy p=%ud q=1]]
24− ~zod/try=> [a b]=[1 2 3]
25− [a=1 b=[2 3]]
26− ~zod/try=> (ream '[a b]=[1 2 3]')
27− [ %ktts
28− p=[%2 p=p=%a q=p=%b]
29− q=[%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
30− ]
31−
32− ~zod/try=> [a ~]=[1 2 3]
33− [a=1 2 3]
34− ~zod/try=> (ream '[a ~]=[1 2 3]')
35− [ %ktts
36− p=[%2 p=p=%a q=[%0 ~]]
37− q=[%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
38− ]
39−
40−
41−
42−***
docs/programming/advanced/library/src/4o/mold/tone.mddeleted−47
@@ -1,47 +0,0 @@
1−### `++tone`
2−
3−Intermediate Nock computation result
4−
5−Similar to [`++toon`](), but stack trace is not yet rendered.
6−
7−Source
8−------
9−
10− ++ tone $% [%0 p=*] :: success
11−
12−Examples
13−--------
14−
15− ~zod/try=> (mink [[20 21] 0 3] ,~)
16− [%0 p=21]
17−
18− ~zod/try=> (mink [[0] !=(.^(cy//=main/1))] ,~)
19− [%1 p=~[[31.075 1.685.027.454 1.852.399.981 49 0]]]
20− ~zod/try=> (path [31.075 1.685.027.454 1.852.399.981 49 0])
21− /cy/~zod/main/1
22−
23− ~zod/try=> (mink [[1 2] !=(~|(%hi +(.)))] ,~)
24− [%2 p=~[[~.yelp 26.984]]]
25− ~zod/try=> (mink [[1 2] !=(!:(+(.)))] ,~)
26− [ %2
27− p
28− ~[
29− [ ~.spot
30− [ [ 1.685.027.454
31− 7.959.156
32− \/159.445.990.350.374.058.574.398.238.344.143.957.205.628.479.572.65\/
33− 8.112.403.878.526
34− \/ \/
35− 0
36− ]
37− [1 20]
38− 1
39− 24
40− ]
41− ]
42− ]
43− ]
44−
45−
46−
47−***
docs/programming/advanced/library/src/4o/mold/tuna.mddeleted−27
@@ -1,27 +0,0 @@
1−### `++tuna`
2−
3−XML template tree
4−
5−An XML template tree.
6−
7−Source
8−------
9−
10− ++ tuna :: tagflow
11− [%d p=twig] :: dynamic list
12− [%e p=twig q=(list tuna)] :: element
13− [%f p=(list tuna)] :: subflow
14− == ::
15−
16−Examples
17−--------
18−
19−Leaf %a contains plain-text, %b an empty tag, %c a static list, %d a
20−dynamic list, %e a full node element containing a twig and a list of
21−tuna, and %f is a empty node.
22−
23−See also: [`++sail`]()
24−
25−
26−
27−***
docs/programming/advanced/library/src/4o/mold/tusk.mddeleted−23
@@ -1,23 +0,0 @@
1−### `++tusk`
2−
3−List of expressions
4−
5−List of [`++twig`]()s. In [`:*`](), for example, your contents is
6−a `++tusk`.
7−
8−Source
9−------
10−
11− ++ tusk (list twig) ::
12−
13−Examples
14−--------
15−
16− ~zod/try=> (ream '[1 2 3]')
17− [%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
18− ~zod/try=> (tusk +:(ream '[1 2 3]'))
19− ~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]
20−
21−
22−
23−***
docs/programming/advanced/library/src/4o/mold/twig.mddeleted−11
@@ -1,11 +0,0 @@
1−### `++twig`
2−
3−Expression
4−
5−An expression, or AST.
6−
7−See Twig section of Hoon reference
8−
9−
10−
11−***
docs/programming/advanced/library/src/4o/mold/tyke.mddeleted−25
@@ -1,25 +0,0 @@
1−### `++tyke`
2−
3−List of 'maybe' twigs
4−
5−List of [`++unit`]() [`++twig`](), or gaps left to be inferred, in [`++path`]()
6−parsing. When you use a path such as `/=main=/pub/src/doc` the path is in fact
7−a `++tyke`, where the `=` are inferred from your current path.
8−
9−
10−Source
11−------
12−
13− ++ tyke (list (unit twig)) ::
14−
15−Examples
16−--------
17−
18− ~zod/try=> (scan "/==as=" porc:vast)
19− [0 ~[~ ~ [~ [%dtzy p=%tas q=29.537]] ~]]
20− ~zod/try=> `tyke`+:(scan "/==as=" porc:vast)
21− ~[~ ~ [~ [%dtzy p=%tas q=29.537]] ~]
22−
23−
24−
25−***
docs/programming/advanced/library/src/4o/mold/typo.mddeleted−20
@@ -1,20 +0,0 @@
1−### `++typo`
2−
3−Pointer for `++type`
4−
5−Pointer for [`++type`](). `++typo` preserves the previous `++type` in your
6−context when upating.
7−
8−Source
9−------
10−
11− ++ typo type :: old type
12−
13−Examples
14−--------
15−
16−See also: `++seem`, `++vise`, `++type`
17−
18−
19−
20−***
docs/programming/advanced/library/src/4o/mold/tyre.mddeleted−14
@@ -1,14 +0,0 @@
1−### `++tyre`
2−
3−List, term to twig
4−
5−Associative list of [++term]() [`++twig`](), used in [jet]() hint processing.
6−
7−Source
8−------
9−
10− ++ tyre (list ,[p=term q=twig]) ::
11−
12−
13−
14−***
docs/programming/advanced/library/src/4o/mold/vase.mddeleted−21
@@ -1,21 +0,0 @@
1−### `++vase`
2−
3−Typed data. A `++vase` is used wherever typed data is explicitly worked
4−with.
5−
6−
7−Source
8−------
9−
10− ++ vase ,[p=type q=*] :: type-value pair
11−
12−Examples
13−--------
14−See `%arvo` doc
15−
16− ~zod/try=> `vase`!>(~)
17− [p=[%cube p=0 q=[%atom p=%n]] q=0]
18−
19−
20−
21−***
docs/programming/advanced/library/src/4o/mold/vise.mddeleted−19
@@ -1,19 +0,0 @@
1−### `++vise`
2−
3−Convert during reboot
4−
5−Used to convert from previously-typed data during reboot.
6−
7−Source
8−------
9−
10− ++ vise ,[p=typo q=*] :: old vase
11−
12−Examples
13−--------
14−
15−See also: [`++typo`](), [`++seer`]()
16−
17−
18−
19−***
docs/programming/advanced/library/src/4o/mold/wing.mddeleted−17
@@ -1,17 +0,0 @@
1−### `++wing`
2−
3− ++ wing (list limb) ::
4−
5−Address in subject. A `++wing` is a path to a value in the subject. A
6−term alone is the trivial case of a `++wing`.
7−
8−See also: `++twig`
9−
10− ~zod/try=> (ream 'a.+.c')
11− [%cnzz p=~[%a [%.y p=3] %c]]
12− ~zod/try=> (wing +:(ream 'a.+.c'))
13− ~[%a [%.y p=3] %c]
14−
15−
16−
17−***
docs/programming/advanced/library/src/4o/title.mddeleted−1
@@ -1 +0,0 @@
1−# 4o: molds and mold builders
docs/programming/advanced/library/src/5a/title.mddeleted−1
@@ -1 +0,0 @@
1−# 5a: compiler utilities
docs/programming/advanced/library/src/5b/title.mddeleted−1
@@ -1 +0,0 @@
1−# 5b: macro expansion
docs/programming/advanced/library/src/5c/title.mddeleted−1
@@ -1 +0,0 @@
1−# 5c: compiler backend and prettyprinter
docs/programming/advanced/library/src/5d/title.mddeleted−1
@@ -1 +0,0 @@
1−# 5d: parser
docs/programming/advanced/library/src/5e/title.mddeleted−1
@@ -1 +0,0 @@
1−# 5e: caching compiler
docs/programming/advanced/library/src/5f/mold/mane.mddeleted−28
@@ -1,28 +0,0 @@
1−### `++mane`
2−
3−XML name
4−
5−An XML name (tag name or attribute name) with an optional namespace. Parsed by
6−`++name` within `++poxa`, rendered by `++name` within `++poxo`.
7−
8−Source
9−------
10−
11− ++ mane $|(@tas [@tas @tas]) :: XML name/space
12−
13−Examples
14−--------
15−
16−See also: `++sail`
17−
18− ~zod/try=> *mane
19− %$
20−
21− ~zod/try=> `mane`n.g:`manx`;div:namespace;
22− %div
23− ~zod/try=> `mane`n.g:`manx`;div_namespace;
24− [%div %namespace]
25−
26−
27−
28−***
docs/programming/advanced/library/src/5f/mold/manx.mddeleted−19
@@ -1,19 +0,0 @@
1−### `++manx`
2−
3−XML node.
4−
5−Parsed by `++apex` within `++poxa`, rendered by `++poxo`.
6−
7−Source
8−------
9−
10− ++ manx {g/marx c/marl} :: XML node
11−
12−Examples
13−--------
14−
15−See also: `++sail` doc
16−
17−
18−
19−***
docs/programming/advanced/library/src/5f/mold/marl.mddeleted−18
@@ -1,18 +0,0 @@
1−### `++marl`
2−
3−List of XML nodes
4−
5−A list of [`++manx`]().
6−
7−Source
8−------
9−
10− ++ marl (list manx) :: XML node list
11−
12−Examples
13−--------
14−
15−
16−
17−
18−***
docs/programming/advanced/library/src/5f/mold/mars.mddeleted−18
@@ -1,18 +0,0 @@
1−### `++mars`
2−
3−XML CDATA
4−
5−Implicitly produced by `++chrd` within `++poxa`
6−
7−Source
8−------
9−
10− ++ mars {t/{n/$$ a/{i/{n/$$ v/tape} t/$~}} c/$~} :: XML cdata
11−
12−
13−Examples
14−--------
15−
16−
17−
18−***
docs/programming/advanced/library/src/5f/mold/mart.mddeleted−20
@@ -1,20 +0,0 @@
1−### `++mart`
2−
3−List of XML attributes
4−
5−Each `++mart` is a list of pairs of `++mane` and
6−`++tape`.
7−
8−Parsed by `++attr` within `++poxa`, rendered by `++attr` within `++poxo`
9−
10−Source
11−------
12−
13− ++ mart (list {n/mane v/tape}) :: XML attributes
14−
15−Examples
16−--------
17−
18−
19−
20−***
docs/programming/advanced/library/src/5f/mold/marx.mddeleted−18
@@ -1,18 +0,0 @@
1−### `++marx`
2−
3−XML tag
4−
5−A `++marx` is a pair of a tag name, `++mane` and a list of attributes,
6−`++mart`. Parsed by `++head` `++poxa`, rendered within `++poxo`.
7−
8−Source
9−------
10−
11− ++ marx {n/mane a/mart} :: XML tag
12−
13−Examples
14−--------
15−
16−
17−
18−***
docs/programming/advanced/library/src/5f/mold/pass.mddeleted−14
@@ -1,14 +0,0 @@
1−### `++pass`
2−
3−Atom alias
4−
5−Used primarily in crypto.
6−
7−Source
8−------
9−
10− ++ pass ,@ :: public key
11−
12−
13−
14−***
docs/programming/advanced/library/src/5f/mold/ring.mddeleted−14
@@ -1,14 +0,0 @@
1−### `++ring`
2−
3−Atom alias
4−
5−Used primarily in crypto.
6−
7−Source
8−------
9−
10− ++ ring @ :: private key
11−
12−
13−
14−***
docs/programming/advanced/library/src/5f/mold/time.mddeleted−25
@@ -1,25 +0,0 @@
1−### `++time`
2−
3−Absolute date
4−
5−The `@da` odor designates an absolute date atom.
6−
7−Source
8−------
9−
10− ++ time @da :: galactic time
11−
12−Examples
13−--------
14−
15−See also: `++date`, odor reference
16−
17− ~zod/try=> `time`-<-
18− ~2014.9.25..20.01.47..eeac
19− ~zod/try=> :: the time is always in your context at -<-
20− ~zod/try=> `time`~2014.1.1
21− ~2014.1.1
22−
23−
24−
25−***
docs/programming/advanced/library/src/5f/title.mddeleted−1
@@ -1 +0,0 @@
1−# 5f: molds and mold builders
docs/programming/advanced/nock.mddeleted−7
@@ -1,7 +0,0 @@
1−---
2−sort: 4
3−---
4−
5−# Nock, in more depth
6−
7−<list></list>
docs/programming/advanced/nock/reference.mddeleted−737
This diff is too big to show here.
docs/programming/advanced/nock/tutorial.mddeleted−1044
This diff is too big to show here.
docs/programming/arvo.mdnew file+10
This diff is too big to show here.
docs/programming/advanced/arvo/internals.md → docs/programming/arvo/internals.mdrenamed
The content is the same.
docs/programming/advanced/arvo/internals/ames.md → docs/programming/arvo/internals/ames.mdrenamed
The content is the same.
docs/programming/advanced/arvo/internals/ames/commentary.md → docs/programming/arvo/internals/ames/commentary.mdrenamed
The content is the same.
docs/programming/advanced/arvo/internals/behn.md → docs/programming/arvo/internals/behn.mdrenamed
The content is the same.
docs/programming/advanced/arvo/internals/clay.md → docs/programming/arvo/internals/clay.mdrenamed
The content is the same.
docs/programming/advanced/arvo/internals/clay/architecture.md → docs/programming/arvo/internals/clay/architecture.mdrenamed
The content is the same.
docs/programming/advanced/arvo/internals/clay/commentary.md → docs/programming/arvo/internals/clay/commentary.mdrenamed
The content is the same.
docs/programming/advanced/arvo/internals/dill.md → docs/programming/arvo/internals/dill.mdrenamed
The content is the same.
docs/programming/advanced/arvo/internals/eyre.md → docs/programming/arvo/internals/eyre.mdrenamed
The content is the same.
docs/programming/advanced/arvo/internals/eyre/commentary.md → docs/programming/arvo/internals/eyre/commentary.mdrenamed
The content is the same.
docs/programming/advanced/arvo/internals/ford.md → docs/programming/arvo/internals/ford.mdrenamed
The content is the same.
docs/programming/advanced/arvo/internals/ford/commentary.md → docs/programming/arvo/internals/ford/commentary.mdrenamed
The content is the same.
docs/programming/advanced/arvo/internals/gall.md → docs/programming/arvo/internals/gall.mdrenamed
The content is the same.
docs/programming/advanced/arvo/system.md → docs/programming/arvo/system.mdrenamed
The content is the same.
docs/programming/advanced/arvo/system/api.md → docs/programming/arvo/system/api.mdrenamed
The content is the same.
docs/programming/advanced/arvo/system/basic.md → docs/programming/arvo/system/basic.mdrenamed
The content is the same.
docs/programming/advanced/arvo/system/generators.md → docs/programming/arvo/system/generators.mdrenamed
The content is the same.
docs/programming/advanced/arvo/system/http.md → docs/programming/arvo/system/http.mdrenamed
The content is the same.
docs/programming/advanced/arvo/system/marks.md → docs/programming/arvo/system/marks.mdrenamed
The content is the same.
docs/programming/advanced/arvo/system/network.md → docs/programming/arvo/system/network.mdrenamed
The content is the same.
docs/programming/advanced/arvo/system/security-driver.md → docs/programming/arvo/system/security-driver.mdrenamed
The content is the same.
docs/programming/advanced/arvo/system/state.md → docs/programming/arvo/system/state.mdrenamed
The content is the same.
docs/programming/advanced/arvo/system/subject.md → docs/programming/arvo/system/subject.mdrenamed
The content is the same.
docs/programming/advanced/arvo/system/subscriptions.md → docs/programming/arvo/system/subscriptions.mdrenamed
The content is the same.
docs/programming/advanced/arvo/system/web-apps.md → docs/programming/arvo/system/web-apps.mdrenamed
The content is the same.
docs/programming/hoon.mdnew file+10
This diff is too big to show here.
docs/programming/advanced/catalog.md → docs/programming/hoon/catalog.mdrenamed
The content is the same.
docs/programming/advanced/catalog/bar-core.md → docs/programming/hoon/catalog/bar-core.mdrenamed
The content is the same.
docs/programming/advanced/catalog/bar-core/cab-door.md → docs/programming/hoon/catalog/bar-core/cab-door.mdrenamed
The content is the same.
docs/programming/advanced/catalog/bar-core/cen-core.md → docs/programming/hoon/catalog/bar-core/cen-core.mdrenamed
The content is the same.
docs/programming/advanced/catalog/bar-core/dot-trap.md → docs/programming/hoon/catalog/bar-core/dot-trap.mdrenamed
The content is the same.
docs/programming/advanced/catalog/bar-core/hep-loop.md → docs/programming/hoon/catalog/bar-core/hep-loop.mdrenamed
The content is the same.
docs/programming/advanced/catalog/bar-core/tar-gill.md → docs/programming/hoon/catalog/bar-core/tar-gill.mdrenamed
The content is the same.
docs/programming/advanced/catalog/bar-core/tis-gate.md → docs/programming/hoon/catalog/bar-core/tis-gate.mdrenamed
The content is the same.
docs/programming/advanced/catalog/buc-mold.md → docs/programming/hoon/catalog/buc-mold.mdrenamed
The content is the same.
docs/programming/advanced/catalog/buc-mold/cab-shoe.md → docs/programming/hoon/catalog/buc-mold/cab-shoe.mdrenamed
The content is the same.
docs/programming/advanced/catalog/buc-mold/cen-book.md → docs/programming/hoon/catalog/buc-mold/cen-book.mdrenamed
The content is the same.
docs/programming/advanced/catalog/buc-mold/col-bank.md → docs/programming/hoon/catalog/buc-mold/col-bank.mdrenamed
The content is the same.
docs/programming/advanced/catalog/buc-mold/hep-lamb.md → docs/programming/hoon/catalog/buc-mold/hep-lamb.mdrenamed
The content is the same.
docs/programming/advanced/catalog/buc-mold/ket-bush.md → docs/programming/hoon/catalog/buc-mold/ket-bush.mdrenamed
The content is the same.
docs/programming/advanced/catalog/buc-mold/pat-claw.md → docs/programming/hoon/catalog/buc-mold/pat-claw.mdrenamed
The content is the same.
docs/programming/advanced/catalog/buc-mold/tis-coat.md → docs/programming/hoon/catalog/buc-mold/tis-coat.mdrenamed
The content is the same.
docs/programming/advanced/catalog/buc-mold/wut-pick.md → docs/programming/hoon/catalog/buc-mold/wut-pick.mdrenamed
The content is the same.
docs/programming/advanced/catalog/cen-call.md → docs/programming/hoon/catalog/cen-call.mdrenamed
The content is the same.
docs/programming/advanced/catalog/cen-call/dot-lace.md → docs/programming/hoon/catalog/cen-call/dot-lace.mdrenamed
The content is the same.
docs/programming/advanced/catalog/cen-call/hep-call.md → docs/programming/hoon/catalog/cen-call/hep-call.mdrenamed
The content is the same.
docs/programming/advanced/catalog/cen-call/ket-calq.md → docs/programming/hoon/catalog/cen-call/ket-calq.mdrenamed
The content is the same.
docs/programming/advanced/catalog/cen-call/lus-calt.md → docs/programming/hoon/catalog/cen-call/lus-calt.mdrenamed
The content is the same.
docs/programming/advanced/catalog/cen-call/sig-open.md → docs/programming/hoon/catalog/cen-call/sig-open.mdrenamed
The content is the same.
docs/programming/advanced/catalog/cen-call/tis-make.md → docs/programming/hoon/catalog/cen-call/tis-make.mdrenamed
The content is the same.
docs/programming/advanced/catalog/col-cell.md → docs/programming/hoon/catalog/col-cell.mdrenamed
The content is the same.
docs/programming/advanced/catalog/col-cell/cab-scon.md → docs/programming/hoon/catalog/col-cell/cab-scon.mdrenamed
The content is the same.
docs/programming/advanced/catalog/col-cell/hep-cons.md → docs/programming/hoon/catalog/col-cell/hep-cons.mdrenamed
The content is the same.
docs/programming/advanced/catalog/col-cell/ket-conq.md → docs/programming/hoon/catalog/col-cell/ket-conq.mdrenamed
The content is the same.
docs/programming/advanced/catalog/col-cell/lus-cont.md → docs/programming/hoon/catalog/col-cell/lus-cont.mdrenamed
The content is the same.
docs/programming/advanced/catalog/col-cell/sig-conl.md → docs/programming/hoon/catalog/col-cell/sig-conl.mdrenamed
The content is the same.
docs/programming/advanced/catalog/col-cell/tar-conp.md → docs/programming/hoon/catalog/col-cell/tar-conp.mdrenamed
The content is the same.
docs/programming/advanced/catalog/dot-nock.md → docs/programming/hoon/catalog/dot-nock.mdrenamed
The content is the same.
docs/programming/advanced/catalog/dot-nock/ket-wish.md → docs/programming/hoon/catalog/dot-nock/ket-wish.mdrenamed
The content is the same.
docs/programming/advanced/catalog/dot-nock/lus-bump.md → docs/programming/hoon/catalog/dot-nock/lus-bump.mdrenamed
The content is the same.
docs/programming/advanced/catalog/dot-nock/tar-nock.md → docs/programming/hoon/catalog/dot-nock/tar-nock.mdrenamed
The content is the same.
docs/programming/advanced/catalog/dot-nock/tis-same.md → docs/programming/hoon/catalog/dot-nock/tis-same.mdrenamed
The content is the same.
docs/programming/advanced/catalog/dot-nock/wut-deep.md → docs/programming/hoon/catalog/dot-nock/wut-deep.mdrenamed
The content is the same.
docs/programming/advanced/catalog/ket-cast.md → docs/programming/hoon/catalog/ket-cast.mdrenamed
The content is the same.
docs/programming/advanced/catalog/ket-cast/bar-iron.md → docs/programming/hoon/catalog/ket-cast/bar-iron.mdrenamed
The content is the same.
docs/programming/advanced/catalog/ket-cast/hep-cast.md → docs/programming/hoon/catalog/ket-cast/hep-cast.mdrenamed
The content is the same.
docs/programming/advanced/catalog/ket-cast/lus-like.md → docs/programming/hoon/catalog/ket-cast/lus-like.mdrenamed
The content is the same.
docs/programming/advanced/catalog/ket-cast/pam-zinc.md → docs/programming/hoon/catalog/ket-cast/pam-zinc.mdrenamed
The content is the same.
docs/programming/advanced/catalog/ket-cast/sig-burn.md → docs/programming/hoon/catalog/ket-cast/sig-burn.mdrenamed
The content is the same.
docs/programming/advanced/catalog/ket-cast/tis-name.md → docs/programming/hoon/catalog/ket-cast/tis-name.mdrenamed
The content is the same.
docs/programming/advanced/catalog/ket-cast/wut-lead.md → docs/programming/hoon/catalog/ket-cast/wut-lead.mdrenamed
The content is the same.
docs/programming/advanced/catalog/misc.md → docs/programming/hoon/catalog/misc.mdrenamed
The content is the same.
docs/programming/advanced/catalog/misc/base.md → docs/programming/hoon/catalog/misc/base.mdrenamed
The content is the same.
docs/programming/advanced/catalog/misc/buc-bunt.md → docs/programming/hoon/catalog/misc/buc-bunt.mdrenamed
The content is the same.
docs/programming/advanced/catalog/misc/bust.md → docs/programming/hoon/catalog/misc/bust.mdrenamed
The content is the same.
docs/programming/advanced/catalog/misc/dbug.md → docs/programming/hoon/catalog/misc/dbug.mdrenamed
The content is the same.
docs/programming/advanced/catalog/misc/hand.md → docs/programming/hoon/catalog/misc/hand.mdrenamed
The content is the same.
docs/programming/advanced/catalog/misc/knit.md → docs/programming/hoon/catalog/misc/knit.mdrenamed
The content is the same.
docs/programming/advanced/catalog/misc/leaf.md → docs/programming/hoon/catalog/misc/leaf.mdrenamed
The content is the same.
docs/programming/advanced/catalog/misc/limb.md → docs/programming/hoon/catalog/misc/limb.mdrenamed
The content is the same.
docs/programming/advanced/catalog/misc/lost.md → docs/programming/hoon/catalog/misc/lost.mdrenamed
The content is the same.
docs/programming/advanced/catalog/misc/rock.md → docs/programming/hoon/catalog/misc/rock.mdrenamed
The content is the same.
docs/programming/advanced/catalog/misc/sand.md → docs/programming/hoon/catalog/misc/sand.mdrenamed
The content is the same.
docs/programming/advanced/catalog/misc/tell.md → docs/programming/hoon/catalog/misc/tell.mdrenamed
The content is the same.
docs/programming/advanced/catalog/misc/tune.md → docs/programming/hoon/catalog/misc/tune.mdrenamed
The content is the same.
docs/programming/advanced/catalog/misc/wing.md → docs/programming/hoon/catalog/misc/wing.mdrenamed
The content is the same.
docs/programming/advanced/catalog/misc/yell.md → docs/programming/hoon/catalog/misc/yell.mdrenamed
The content is the same.
docs/programming/advanced/catalog/sem-make.md → docs/programming/hoon/catalog/sem-make.mdrenamed
The content is the same.
docs/programming/advanced/catalog/sem-make/col-wad.md → docs/programming/hoon/catalog/sem-make/col-wad.mdrenamed
The content is the same.
docs/programming/advanced/catalog/sem-make/fas-nub.md → docs/programming/hoon/catalog/sem-make/fas-nub.mdrenamed
The content is the same.
docs/programming/advanced/catalog/sem-make/sem-fry.md → docs/programming/hoon/catalog/sem-make/sem-fry.mdrenamed
The content is the same.
docs/programming/advanced/catalog/sem-make/sig-dip.md → docs/programming/hoon/catalog/sem-make/sig-dip.mdrenamed
The content is the same.
docs/programming/advanced/catalog/sig-hint.md → docs/programming/hoon/catalog/sig-hint.mdrenamed
The content is the same.
docs/programming/advanced/catalog/sig-hint/bar-show.md → docs/programming/hoon/catalog/sig-hint/bar-show.mdrenamed
The content is the same.
docs/programming/advanced/catalog/sig-hint/buc-poll.md → docs/programming/hoon/catalog/sig-hint/buc-poll.mdrenamed
The content is the same.
docs/programming/advanced/catalog/sig-hint/cab-lurk.md → docs/programming/hoon/catalog/sig-hint/cab-lurk.mdrenamed
The content is the same.
docs/programming/advanced/catalog/sig-hint/cen-fast.md → docs/programming/hoon/catalog/sig-hint/cen-fast.mdrenamed
The content is the same.
docs/programming/advanced/catalog/sig-hint/fas-funk.md → docs/programming/hoon/catalog/sig-hint/fas-funk.mdrenamed
The content is the same.
docs/programming/advanced/catalog/sig-hint/gal-thin.md → docs/programming/hoon/catalog/sig-hint/gal-thin.mdrenamed
The content is the same.
docs/programming/advanced/catalog/sig-hint/gar-hint.md → docs/programming/hoon/catalog/sig-hint/gar-hint.mdrenamed
The content is the same.
docs/programming/advanced/catalog/sig-hint/lus-memo.md → docs/programming/hoon/catalog/sig-hint/lus-memo.mdrenamed
The content is the same.
docs/programming/advanced/catalog/sig-hint/pam-dump.md → docs/programming/hoon/catalog/sig-hint/pam-dump.mdrenamed
The content is the same.
docs/programming/advanced/catalog/sig-hint/tis-ddup.md → docs/programming/hoon/catalog/sig-hint/tis-ddup.mdrenamed
The content is the same.
docs/programming/advanced/catalog/sig-hint/wut-warn.md → docs/programming/hoon/catalog/sig-hint/wut-warn.mdrenamed
The content is the same.
docs/programming/advanced/catalog/sig-hint/zap-peep.md → docs/programming/hoon/catalog/sig-hint/zap-peep.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow.md → docs/programming/hoon/catalog/tis-flow.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/bar-new.md → docs/programming/hoon/catalog/tis-flow/bar-new.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/col-fix.md → docs/programming/hoon/catalog/tis-flow/col-fix.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/dot-set.md → docs/programming/hoon/catalog/tis-flow/dot-set.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/fas-var.md → docs/programming/hoon/catalog/tis-flow/fas-var.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/gal-rap.md → docs/programming/hoon/catalog/tis-flow/gal-rap.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/gar-per.md → docs/programming/hoon/catalog/tis-flow/gar-per.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/hep-nip.md → docs/programming/hoon/catalog/tis-flow/hep-nip.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/ket-sip.md → docs/programming/hoon/catalog/tis-flow/ket-sip.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/lus-pin.md → docs/programming/hoon/catalog/tis-flow/lus-pin.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/sem-rev.md → docs/programming/hoon/catalog/tis-flow/sem-rev.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/sig-tow.md → docs/programming/hoon/catalog/tis-flow/sig-tow.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/tar-aka.md → docs/programming/hoon/catalog/tis-flow/tar-aka.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/ts/tsbr.md → docs/programming/hoon/catalog/tis-flow/ts/tsbr.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/ts/tscl.md → docs/programming/hoon/catalog/tis-flow/ts/tscl.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/ts/tsdt.md → docs/programming/hoon/catalog/tis-flow/ts/tsdt.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/ts/tsgl.md → docs/programming/hoon/catalog/tis-flow/ts/tsgl.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/ts/tsgr.md → docs/programming/hoon/catalog/tis-flow/ts/tsgr.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/ts/tshp.md → docs/programming/hoon/catalog/tis-flow/ts/tshp.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/ts/tskt.md → docs/programming/hoon/catalog/tis-flow/ts/tskt.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/ts/tsls.md → docs/programming/hoon/catalog/tis-flow/ts/tsls.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/ts/tssg.md → docs/programming/hoon/catalog/tis-flow/ts/tssg.mdrenamed
The content is the same.
docs/programming/advanced/catalog/tis-flow/ts/tstr.md → docs/programming/hoon/catalog/tis-flow/ts/tstr.mdrenamed
The content is the same.
docs/programming/advanced/catalog/wut-test.md → docs/programming/hoon/catalog/wut-test.mdrenamed
The content is the same.
docs/programming/advanced/catalog/wut-test/bar-or.md → docs/programming/hoon/catalog/wut-test/bar-or.mdrenamed
The content is the same.
docs/programming/advanced/catalog/wut-test/col-if.md → docs/programming/hoon/catalog/wut-test/col-if.mdrenamed
The content is the same.
docs/programming/advanced/catalog/wut-test/dot-lest.md → docs/programming/hoon/catalog/wut-test/dot-lest.mdrenamed
The content is the same.
docs/programming/advanced/catalog/wut-test/gal-deny.md → docs/programming/hoon/catalog/wut-test/gal-deny.mdrenamed
The content is the same.
docs/programming/advanced/catalog/wut-test/gar-sure.md → docs/programming/hoon/catalog/wut-test/gar-sure.mdrenamed
The content is the same.
docs/programming/advanced/catalog/wut-test/hep-case.md → docs/programming/hoon/catalog/wut-test/hep-case.mdrenamed
The content is the same.
docs/programming/advanced/catalog/wut-test/ket-ifcl.md → docs/programming/hoon/catalog/wut-test/ket-ifcl.mdrenamed
The content is the same.
docs/programming/advanced/catalog/wut-test/lus-deft.md → docs/programming/hoon/catalog/wut-test/lus-deft.mdrenamed
The content is the same.
docs/programming/advanced/catalog/wut-test/pam-and.md → docs/programming/hoon/catalog/wut-test/pam-and.mdrenamed
The content is the same.
docs/programming/advanced/catalog/wut-test/pat-ifat.md → docs/programming/hoon/catalog/wut-test/pat-ifat.mdrenamed
The content is the same.
docs/programming/advanced/catalog/wut-test/sig-ifno.md → docs/programming/hoon/catalog/wut-test/sig-ifno.mdrenamed
The content is the same.
docs/programming/advanced/catalog/wut-test/tis-fits.md → docs/programming/hoon/catalog/wut-test/tis-fits.mdrenamed
The content is the same.
docs/programming/advanced/catalog/wut-test/zap-not.md → docs/programming/hoon/catalog/wut-test/zap-not.mdrenamed
The content is the same.
docs/programming/advanced/catalog/zap-wild.md → docs/programming/hoon/catalog/zap-wild.mdrenamed
The content is the same.
docs/programming/advanced/catalog/zap-wild/com-twig.md → docs/programming/hoon/catalog/zap-wild/com-twig.mdrenamed
The content is the same.
docs/programming/advanced/catalog/zap-wild/gar-wrap.md → docs/programming/hoon/catalog/zap-wild/gar-wrap.mdrenamed
The content is the same.
docs/programming/advanced/catalog/zap-wild/sem-spit.md → docs/programming/hoon/catalog/zap-wild/sem-spit.mdrenamed
The content is the same.
docs/programming/advanced/catalog/zap-wild/tis-code.md → docs/programming/hoon/catalog/zap-wild/tis-code.mdrenamed
The content is the same.
docs/programming/advanced/catalog/zap-wild/wut-need.md → docs/programming/hoon/catalog/zap-wild/wut-need.mdrenamed
The content is the same.
docs/programming/advanced/catalog/zap-wild/zap-fail.md → docs/programming/hoon/catalog/zap-wild/zap-fail.mdrenamed
The content is the same.
docs/programming/cheat-sheets.md → docs/programming/hoon/cheat-sheets.mdrenamed
The content is the same.
docs/programming/cheat-sheets/hoon.md → docs/programming/hoon/cheat-sheets/hoon.mdrenamed
The content is the same.
docs/programming/cheat-sheets/odors.md → docs/programming/hoon/cheat-sheets/odors.mdrenamed
The content is the same.
docs/programming/cheat-sheets/pronunciation.md → docs/programming/hoon/cheat-sheets/pronunciation.mdrenamed
The content is the same.
docs/programming/concepts.md → docs/programming/hoon/concepts.mdrenamed
The content is the same.
docs/programming/demo.md → docs/programming/hoon/demo.mdrenamed
The content is the same.
docs/programming/examples.md → docs/programming/hoon/examples.mdrenamed
The content is the same.
docs/programming/advanced/library.md → docs/programming/hoon/library.mdrenamed
The content is the same.
docs/programming/advanced/library/1a.md → docs/programming/hoon/library/1a.mdrenamed
The content is the same.
docs/programming/advanced/library/1b.md → docs/programming/hoon/library/1b.mdrenamed
The content is the same.
docs/programming/advanced/library/1c.md → docs/programming/hoon/library/1c.mdrenamed
The content is the same.
docs/programming/advanced/library/2a.md → docs/programming/hoon/library/2a.mdrenamed
The content is the same.
docs/programming/advanced/library/2b.md → docs/programming/hoon/library/2b.mdrenamed
The content is the same.
docs/programming/advanced/library/2c.md → docs/programming/hoon/library/2c.mdrenamed
The content is the same.
docs/programming/advanced/library/2d.md → docs/programming/hoon/library/2d.mdrenamed
The content is the same.
docs/programming/advanced/library/2e.md → docs/programming/hoon/library/2e.mdrenamed
The content is the same.
docs/programming/advanced/library/2f.md → docs/programming/hoon/library/2f.mdrenamed
The content is the same.
docs/programming/advanced/library/2g.md → docs/programming/hoon/library/2g.mdrenamed
The content is the same.
docs/programming/advanced/library/2h.md → docs/programming/hoon/library/2h.mdrenamed
The content is the same.
docs/programming/advanced/library/2i.md → docs/programming/hoon/library/2i.mdrenamed
The content is the same.
docs/programming/advanced/library/2j.md → docs/programming/hoon/library/2j.mdrenamed
The content is the same.
docs/programming/advanced/library/2k.md → docs/programming/hoon/library/2k.mdrenamed
The content is the same.
docs/programming/advanced/library/2l.md → docs/programming/hoon/library/2l.mdrenamed
The content is the same.
docs/programming/advanced/library/2m.md → docs/programming/hoon/library/2m.mdrenamed
The content is the same.
docs/programming/advanced/library/2n.md → docs/programming/hoon/library/2n.mdrenamed
The content is the same.
docs/programming/advanced/library/2o.md → docs/programming/hoon/library/2o.mdrenamed
The content is the same.
docs/programming/advanced/library/2p.md → docs/programming/hoon/library/2p.mdrenamed
The content is the same.
docs/programming/advanced/library/2q.md → docs/programming/hoon/library/2q.mdrenamed
The content is the same.
docs/programming/advanced/library/3a.md → docs/programming/hoon/library/3a.mdrenamed
The content is the same.
docs/programming/advanced/library/3b.md → docs/programming/hoon/library/3b.mdrenamed
The content is the same.
docs/programming/advanced/library/3c.md → docs/programming/hoon/library/3c.mdrenamed
The content is the same.
docs/programming/advanced/library/3d.md → docs/programming/hoon/library/3d.mdrenamed
The content is the same.
docs/programming/advanced/library/3e.md → docs/programming/hoon/library/3e.mdrenamed
The content is the same.
docs/programming/advanced/library/3f.md → docs/programming/hoon/library/3f.mdrenamed
The content is the same.
docs/programming/advanced/library/3g.md → docs/programming/hoon/library/3g.mdrenamed
The content is the same.
docs/programming/advanced/library/4a.md → docs/programming/hoon/library/4a.mdrenamed
The content is the same.
docs/programming/advanced/library/4b.md → docs/programming/hoon/library/4b.mdrenamed
The content is the same.
docs/programming/advanced/library/4c.md → docs/programming/hoon/library/4c.mdrenamed
The content is the same.
docs/programming/advanced/library/4d.md → docs/programming/hoon/library/4d.mdrenamed
The content is the same.
docs/programming/advanced/library/4e.md → docs/programming/hoon/library/4e.mdrenamed
The content is the same.
docs/programming/advanced/library/4f.md → docs/programming/hoon/library/4f.mdrenamed
The content is the same.
docs/programming/advanced/library/4g.md → docs/programming/hoon/library/4g.mdrenamed
The content is the same.
docs/programming/advanced/library/4h.md → docs/programming/hoon/library/4h.mdrenamed
The content is the same.
docs/programming/advanced/library/4i.md → docs/programming/hoon/library/4i.mdrenamed
The content is the same.
docs/programming/advanced/library/4j.md → docs/programming/hoon/library/4j.mdrenamed
The content is the same.
docs/programming/advanced/library/4k.md → docs/programming/hoon/library/4k.mdrenamed
The content is the same.
docs/programming/advanced/library/4l.md → docs/programming/hoon/library/4l.mdrenamed
The content is the same.
docs/programming/advanced/library/4m.md → docs/programming/hoon/library/4m.mdrenamed
The content is the same.
docs/programming/advanced/library/4n.md → docs/programming/hoon/library/4n.mdrenamed
The content is the same.
docs/programming/advanced/library/4o.md → docs/programming/hoon/library/4o.mdrenamed
The content is the same.
docs/programming/advanced/library/5a.md → docs/programming/hoon/library/5a.mdrenamed
The content is the same.
docs/programming/advanced/library/5b.md → docs/programming/hoon/library/5b.mdrenamed
The content is the same.
docs/programming/advanced/library/5c.md → docs/programming/hoon/library/5c.mdrenamed
The content is the same.
docs/programming/advanced/library/5d.md → docs/programming/hoon/library/5d.mdrenamed
The content is the same.
docs/programming/advanced/library/5e.md → docs/programming/hoon/library/5e.mdrenamed
The content is the same.
docs/programming/advanced/library/5f.md → docs/programming/hoon/library/5f.mdrenamed
The content is the same.
docs/programming/advanced/library/5g.md → docs/programming/hoon/library/5g.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse.md → docs/programming/hoon/library/zuse.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/core/crua.md → docs/programming/hoon/library/zuse/core/crua.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/core/epur.md → docs/programming/hoon/library/zuse/core/epur.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/core/fu.md → docs/programming/hoon/library/zuse/core/fu.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/core/jo.md → docs/programming/hoon/library/zuse/core/jo.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/core/poja.md → docs/programming/hoon/library/zuse/core/poja.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/core/poxa.md → docs/programming/hoon/library/zuse/core/poxa.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/core/poxo.md → docs/programming/hoon/library/zuse/core/poxo.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/core/yu.md → docs/programming/hoon/library/zuse/core/yu.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/diff.md → docs/programming/hoon/library/zuse/diff.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/clan.md → docs/programming/hoon/library/zuse/gate/clan.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/dawn.md → docs/programming/hoon/library/zuse/gate/dawn.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/daws.md → docs/programming/hoon/library/zuse/gate/daws.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/deal.md → docs/programming/hoon/library/zuse/gate/deal.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/deft.md → docs/programming/hoon/library/zuse/gate/deft.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/dust.md → docs/programming/hoon/library/zuse/gate/dust.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/earl.md → docs/programming/hoon/library/zuse/gate/earl.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/earn.md → docs/programming/hoon/library/zuse/gate/earn.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/fain.md → docs/programming/hoon/library/zuse/gate/fain.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/feel.md → docs/programming/hoon/library/zuse/gate/feel.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/file.md → docs/programming/hoon/library/zuse/gate/file.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/foal.md → docs/programming/hoon/library/zuse/gate/foal.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/fray.md → docs/programming/hoon/library/zuse/gate/fray.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/fuel.md → docs/programming/hoon/library/zuse/gate/fuel.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/furl.md → docs/programming/hoon/library/zuse/gate/furl.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/glam.md → docs/programming/hoon/library/zuse/gate/glam.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/glon.md → docs/programming/hoon/library/zuse/gate/glon.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/gnom.md → docs/programming/hoon/library/zuse/gate/gnom.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/jape.md → docs/programming/hoon/library/zuse/gate/jape.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/jesc.md → docs/programming/hoon/library/zuse/gate/jesc.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/joba.md → docs/programming/hoon/library/zuse/gate/joba.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/jobe.md → docs/programming/hoon/library/zuse/gate/jobe.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/jone.md → docs/programming/hoon/library/zuse/gate/jone.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/lead.md → docs/programming/hoon/library/zuse/gate/lead.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/mang.md → docs/programming/hoon/library/zuse/gate/mang.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/meat.md → docs/programming/hoon/library/zuse/gate/meat.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/moon.md → docs/programming/hoon/library/zuse/gate/moon.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/mung.md → docs/programming/hoon/library/zuse/gate/mung.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/perk.md → docs/programming/hoon/library/zuse/gate/perk.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/pojo.md → docs/programming/hoon/library/zuse/gate/pojo.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/saxo.md → docs/programming/hoon/library/zuse/gate/saxo.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/scanf.md → docs/programming/hoon/library/zuse/gate/scanf.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/sein.md → docs/programming/hoon/library/zuse/gate/sein.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/sifo.md → docs/programming/hoon/library/zuse/gate/sifo.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/stud.md → docs/programming/hoon/library/zuse/gate/stud.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/taco.md → docs/programming/hoon/library/zuse/gate/taco.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/tact.md → docs/programming/hoon/library/zuse/gate/tact.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/tame.md → docs/programming/hoon/library/zuse/gate/tame.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/tell.md → docs/programming/hoon/library/zuse/gate/tell.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/tome.md → docs/programming/hoon/library/zuse/gate/tome.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/tope.md → docs/programming/hoon/library/zuse/gate/tope.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/txml.md → docs/programming/hoon/library/zuse/gate/txml.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/unt.md → docs/programming/hoon/library/zuse/gate/unt.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/urld.md → docs/programming/hoon/library/zuse/gate/urld.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/gate/urle.md → docs/programming/hoon/library/zuse/gate/urle.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/mold/udal.md → docs/programming/hoon/library/zuse/mold/udal.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/mold/udon.md → docs/programming/hoon/library/zuse/mold/udon.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/mold/umph.md → docs/programming/hoon/library/zuse/mold/umph.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/mold/unce.md → docs/programming/hoon/library/zuse/mold/unce.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/mold/upas.md → docs/programming/hoon/library/zuse/mold/upas.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/mold/urge.md → docs/programming/hoon/library/zuse/mold/urge.mdrenamed
The content is the same.
docs/programming/advanced/arvo/zuse/rsa.md → docs/programming/hoon/library/zuse/rsa.mdrenamed
The content is the same.
docs/programming/mint.md → docs/programming/hoon/mint.mdrenamed
The content is the same.
docs/programming/noun.md → docs/programming/hoon/noun.mdrenamed
The content is the same.
docs/programming/philosophy.md → docs/programming/hoon/philosophy.mdrenamed
The content is the same.
docs/programming/span.md → docs/programming/hoon/span.mdrenamed
The content is the same.
docs/programming/troubleshooting.md → docs/programming/hoon/troubleshooting.mdrenamed
The content is the same.
docs/programming/twig.md → docs/programming/hoon/twig.mdrenamed
The content is the same.
docs/programming/twig/atom.md → docs/programming/hoon/twig/atom.mdrenamed
The content is the same.
docs/programming/twig/call.md → docs/programming/hoon/twig/call.mdrenamed
The content is the same.
docs/programming/twig/cast.md → docs/programming/hoon/twig/cast.mdrenamed
The content is the same.
docs/programming/twig/cell.md → docs/programming/hoon/twig/cell.mdrenamed
The content is the same.
docs/programming/twig/core.md → docs/programming/hoon/twig/core.mdrenamed
The content is the same.
docs/programming/twig/flow.md → docs/programming/hoon/twig/flow.mdrenamed
The content is the same.
docs/programming/twig/limb.md → docs/programming/hoon/twig/limb.mdrenamed
The content is the same.
docs/programming/twig/mold.md → docs/programming/hoon/twig/mold.mdrenamed
The content is the same.
docs/programming/twig/nock.md → docs/programming/hoon/twig/nock.mdrenamed
The content is the same.
docs/programming/twig/syntax.md → docs/programming/hoon/twig/syntax.mdrenamed
The content is the same.
docs/programming/twig/syntax/design.md → docs/programming/hoon/twig/syntax/design.mdrenamed
The content is the same.
docs/programming/twig/syntax/motivation.md → docs/programming/hoon/twig/syntax/motivation.mdrenamed
The content is the same.
docs/programming/twig/test.md → docs/programming/hoon/twig/test.mdrenamed
The content is the same.
docs/programming/nock.md+5−162
This diff is too big to show here.
docs/programming/nock/nock.mdnew file+167
This diff is too big to show here.
docs/programming/runtime.mdnew file+10
This diff is too big to show here.
docs/programming/advanced/runtime.md → docs/programming/runtime/vere.mdrenamed
The content is the same.