on master help sign in
thru 2i
61f44a5Henry Ault
docs/system/hoon/library/src/2i/core/.by.md.swonew file

Binary file not shown.

docs/system/hoon/library/src/2i/core/.by.md.swpnew file

Binary file not shown.

docs/system/hoon/library/src/2i/core/by.md+31−25
@@ -4,12 +4,13 @@ Map operations
4
4
5 ++ by :: map engine
5 ++ by :: map engine
6 ~/ %by
6 ~/ %by
7− |/ a=(map)
7+ |_ a/(map)
8+
8
9
9Container arm for map operation arms. A map is a set of key, value
10Container arm for map operation arms. A map is a set of key, value
10−pairs. The contained arms inherit it's [sample]() [map](), `a`.
11+pairs. The contained arms inherit it's sample map, `a`.
11
12
12−`a` is a [map]().
13+`a` is a map.
13
14
14 ~zod/try=> ~(. by (mo (limo [%a 1] [%b 2] ~)))
15 ~zod/try=> ~(. by (mo (limo [%a 1] [%b 2] ~)))
15 <19.irb [nlr([p={%a %b} q=@ud]) <414.rvm 101.jzo 1.ypj %164>]>
16 <19.irb [nlr([p={%a %b} q=@ud]) <414.rvm 101.jzo 1.ypj %164>]>
@@ -22,26 +23,28 @@ Logical AND
22
23
23 +- all :: logical AND
24 +- all :: logical AND
24 ~/ %all
25 ~/ %all
25− |* b=$+(* ?)
26+ |* b/$-(* ?)
26 |- ^- ?
27 |- ^- ?
27 ?~ a
28 ?~ a
28 &
29 &
29 ?&((b q.n.a) $(a l.a) $(a r.a))
30 ?&((b q.n.a) $(a l.a) $(a r.a))
31+ ::
32+
30
33
31Computes the logical AND on the results of slamming every element in map
34Computes the logical AND on the results of slamming every element in map
32`a` with gate `b`. Produces a loobean.
35`a` with gate `b`. Produces a loobean.
33
36
34−`a` is a [map]().
37+`a` is a map.
35
38
36−`b` is a [wet gate]().
39+`b` is a wet gate.
37
40
38− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
41+ ~zod/try=> =b (mo `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
39− ~zod/try=> (~(all by b) |=(a=* ?@(a & |)))
42+ ~zod/try=> (~(all by b) |=(a/* ?@(a & |)))
40 %.n
43 %.n
41 ~zod/try=> =a (mo `(list ,[@t @u])`[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
44 ~zod/try=> =a (mo `(list ,[@t @u])`[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
42− ~zod/try=> (~(all by a) |=(a=@ (lte a 6)))
45+ ~zod/try=> (~(all by a) |=(a/@ (lte a 6)))
43 %.y
46 %.y
44− ~zod/try=> (~(all by a) |=(a=@ (lte a 4)))
47+ ~zod/try=> (~(all by a) |=(a/@ (lte a 4)))
45 %.n
48 %.n
46
49
47------------------------------------------------------------------------
50------------------------------------------------------------------------
@@ -61,14 +64,14 @@ Logical OR
61Computes the logical OR on the results of slamming every element with
64Computes the logical OR on the results of slamming every element with
62gate `b`. Produces a loobean.
65gate `b`. Produces a loobean.
63
66
64−`a` is a [map]().
67+`a` is a map.
65
68
66−`b` is a [wet gate]().
69+`b` is a wet gate.
67
70
68− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
71+ ~zod/try=> =b (mo `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
69 ~zod/try=> (~(all by b) |=(a=* ?@(a & |)))
72 ~zod/try=> (~(all by b) |=(a=* ?@(a & |)))
70 %.y
73 %.y
71− ~zod/try=> =a (mo `(list ,[@t @u])`[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
74+ ~zod/try=> =a (mo `(list [@t @u])`[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
72 ~zod/try=> (~(any by a) |=(a=@ (lte a 4)))
75 ~zod/try=> (~(any by a) |=(a=@ (lte a 4)))
73 %.y
76 %.y
74
77
@@ -80,7 +83,7 @@ Delete
80
83
81 +- del :: delete at key b
84 +- del :: delete at key b
82 ~/ %del
85 ~/ %del
83− |* b=*
86+ |* b/*
84 |- ^+ a
87 |- ^+ a
85 ?~ a
88 ?~ a
86 ~
89 ~
@@ -88,20 +91,21 @@ Delete
88 ?: (gor b p.n.a)
91 ?: (gor b p.n.a)
89 [n.a $(a l.a) r.a]
92 [n.a $(a l.a) r.a]
90 [n.a l.a $(a r.a)]
93 [n.a l.a $(a r.a)]
91− |- ^- ?(~ _a)
94+ |- ^- {$?($~ _a)}
92 ?~ l.a r.a
95 ?~ l.a r.a
93 ?~ r.a l.a
96 ?~ r.a l.a
94 ?: (vor p.n.l.a p.n.r.a)
97 ?: (vor p.n.l.a p.n.r.a)
95 [n.l.a l.l.a $(l.a r.l.a)]
98 [n.l.a l.l.a $(l.a r.l.a)]
96 [n.r.a $(r.a l.r.a) r.r.a]
99 [n.r.a $(r.a l.r.a) r.r.a]
100+ ::
97
101
98Produces map `a` with the element located at key `b` removed.
102Produces map `a` with the element located at key `b` removed.
99
103
100−`a` is a [map]().
104+`a` is a map.
101
105
102−`b` is a key as a [noun]().
106+`b` is a key as a noun.
103
107
104− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
108+ ~zod/try=> =b (mo `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
105 ~zod/try=> (~(del by b) `a`)
109 ~zod/try=> (~(del by b) `a`)
106 {[p=`b` q=[2 3]]}
110 {[p=`b` q=[2 3]]}
107
111
@@ -111,23 +115,25 @@ Produces map `a` with the element located at key `b` removed.
111
115
112Axis of key
116Axis of key
113
117
114− +- dig :: axis of key
118+ +- dig :: axis of b key
115− |= b=*
119+ |= b/*
116 =+ c=1
120 =+ c=1
117− |- ^- (unit ,@)
121+ |- ^- (unit @)
118 ?~ a ~
122 ?~ a ~
119 ?: =(b p.n.a) [~ u=(peg c 2)]
123 ?: =(b p.n.a) [~ u=(peg c 2)]
120 ?: (gor b p.n.a)
124 ?: (gor b p.n.a)
121 $(a l.a, c (peg c 6))
125 $(a l.a, c (peg c 6))
122 $(a r.a, c (peg c 7))
126 $(a r.a, c (peg c 7))
127+ ::
128+
123
129
124Produce the axis of key `b` within map `a`.
130Produce the axis of key `b` within map `a`.
125
131
126−`a` is a [map]().
132+`a` is a map.
127
133
128−`b` is a key as a [noun]().
134+`b` is a key as a noun.
129
135
130− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
136+ ~zod/try=> =b (mo `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
131 ~zod/try=> (~(dig by b) `b`)
137 ~zod/try=> (~(dig by b) `b`)
132 [~ 2]
138 [~ 2]
133
139