on master help sign in
thru 2i
commit61f44a5ef2787f1ba6253e140be21c292413254a authorHenry Ault <henry@tlon.io> dateThu 17 Mar 2016, 10:53 (11 years ago) parent8568648
3 files changed+31−25
docs/system/hoon/library/src/2i/core/.by.md.swo docs/system/hoon/library/src/2i/core/.by.md.swp docs/system/hoon/library/src/2i/core/by.md+31−25
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
44
55 ++ by :: map engine
66 ~/ %by
7− |/ a=(map)
7+ |_ a/(map)
8+
89
910Container 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`.
1112
12−`a` is a [map]().
13+`a` is a map.
1314
1415 ~zod/try=> ~(. by (mo (limo [%a 1] [%b 2] ~)))
1516 <19.irb [nlr([p={%a %b} q=@ud]) <414.rvm 101.jzo 1.ypj %164>]>
@@ -22,26 +23,28 @@ Logical AND
2223
2324 +- all :: logical AND
2425 ~/ %all
25− |* b=$+(* ?)
26+ |* b/$-(* ?)
2627 |- ^- ?
2728 ?~ a
2829 &
2930 ?&((b q.n.a) $(a l.a) $(a r.a))
31+ ::
32+
3033
3134Computes the logical AND on the results of slamming every element in map
3235`a` with gate `b`. Produces a loobean.
3336
34−`a` is a [map]().
37+`a` is a map.
3538
36−`b` is a [wet gate]().
39+`b` is a wet gate.
3740
38− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
39− ~zod/try=> (~(all by b) |=(a=* ?@(a & |)))
41+ ~zod/try=> =b (mo `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
42+ ~zod/try=> (~(all by b) |=(a/* ?@(a & |)))
4043 %.n
4144 ~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)))
4346 %.y
44− ~zod/try=> (~(all by a) |=(a=@ (lte a 4)))
47+ ~zod/try=> (~(all by a) |=(a/@ (lte a 4)))
4548 %.n
4649
4750------------------------------------------------------------------------
@@ -61,14 +64,14 @@ Logical OR
6164Computes the logical OR on the results of slamming every element with
6265gate `b`. Produces a loobean.
6366
64−`a` is a [map]().
67+`a` is a map.
6568
66−`b` is a [wet gate]().
69+`b` is a wet gate.
6770
68− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
71+ ~zod/try=> =b (mo `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
6972 ~zod/try=> (~(all by b) |=(a=* ?@(a & |)))
7073 %.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] ~])
7275 ~zod/try=> (~(any by a) |=(a=@ (lte a 4)))
7376 %.y
7477
@@ -80,7 +83,7 @@ Delete
8083
8184 +- del :: delete at key b
8285 ~/ %del
83− |* b=*
86+ |* b/*
8487 |- ^+ a
8588 ?~ a
8689 ~
@@ -88,20 +91,21 @@ Delete
8891 ?: (gor b p.n.a)
8992 [n.a $(a l.a) r.a]
9093 [n.a l.a $(a r.a)]
91− |- ^- ?(~ _a)
94+ |- ^- {$?($~ _a)}
9295 ?~ l.a r.a
9396 ?~ r.a l.a
9497 ?: (vor p.n.l.a p.n.r.a)
9598 [n.l.a l.l.a $(l.a r.l.a)]
9699 [n.r.a $(r.a l.r.a) r.r.a]
100+ ::
97101
98102Produces map `a` with the element located at key `b` removed.
99103
100−`a` is a [map]().
104+`a` is a map.
101105
102−`b` is a key as a [noun]().
106+`b` is a key as a noun.
103107
104− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
108+ ~zod/try=> =b (mo `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
105109 ~zod/try=> (~(del by b) `a`)
106110 {[p=`b` q=[2 3]]}
107111
@@ -111,23 +115,25 @@ Produces map `a` with the element located at key `b` removed.
111115
112116Axis of key
113117
114− +- dig :: axis of key
115− |= b=*
118+ +- dig :: axis of b key
119+ |= b/*
116120 =+ c=1
117− |- ^- (unit ,@)
121+ |- ^- (unit @)
118122 ?~ a ~
119123 ?: =(b p.n.a) [~ u=(peg c 2)]
120124 ?: (gor b p.n.a)
121125 $(a l.a, c (peg c 6))
122126 $(a r.a, c (peg c 7))
127+ ::
128+
123129
124130Produce the axis of key `b` within map `a`.
125131
126−`a` is a [map]().
132+`a` is a map.
127133
128−`b` is a key as a [noun]().
134+`b` is a key as a noun.
129135
130− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
136+ ~zod/try=> =b (mo `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
131137 ~zod/try=> (~(dig by b) `b`)
132138 [~ 2]
133139