on master help sign in
thru 2j
commita46278f6d000bed50b1f29e59d388ada6fc4645c authorHenry Ault <henry@tlon.io> dateThu 17 Mar 2016, 12:27 (11 years ago) parent61f44a5
4 files changed+109−253
docs/system/hoon/library/src/2i/core/.by.md.swo docs/system/hoon/library/src/2i/core/by.md+73−67 docs/system/hoon/library/src/2j/core/ja.md+11−166 docs/system/hoon/library/src/2j/core/ju.md+25−20
docs/system/hoon/library/src/2i/core/.by.md.swo

Binary file not shown.

docs/system/hoon/library/src/2i/core/by.md+73−67
@@ -38,10 +38,10 @@ Computes the logical AND on the results of slamming every element in map
3838
3939`b` is a wet gate.
4040
41− ~zod/try=> =b (mo `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
41+ ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
4242 ~zod/try=> (~(all by b) |=(a/* ?@(a & |)))
4343 %.n
44− ~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] ~])
4545 ~zod/try=> (~(all by a) |=(a/@ (lte a 6)))
4646 %.y
4747 ~zod/try=> (~(all by a) |=(a/@ (lte a 4)))
@@ -68,10 +68,10 @@ gate `b`. Produces a loobean.
6868
6969`b` is a wet gate.
7070
71− ~zod/try=> =b (mo `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
72− ~zod/try=> (~(all by b) |=(a=* ?@(a & |)))
71+ ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
72+ ~zod/try=> (~(all by b) |=(a/* ?@(a & |)))
7373 %.y
74− ~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] ~])
7575 ~zod/try=> (~(any by a) |=(a=@ (lte a 4)))
7676 %.y
7777
@@ -105,7 +105,7 @@ Produces map `a` with the element located at key `b` removed.
105105
106106`b` is a key as a noun.
107107
108− ~zod/try=> =b (mo `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
108+ ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
109109 ~zod/try=> (~(del by b) `a`)
110110 {[p=`b` q=[2 3]]}
111111
@@ -133,7 +133,7 @@ Produce the axis of key `b` within map `a`.
133133
134134`b` is a key as a noun.
135135
136− ~zod/try=> =b (mo `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
136+ ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
137137 ~zod/try=> (~(dig by b) `b`)
138138 [~ 2]
139139
@@ -145,21 +145,22 @@ Concatenate
145145
146146 +- gas :: concatenate
147147 ~/ %gas
148− |* b=(list ,[p=* q=*])
149− => .(b `(list ,_?>(?=(^ a) n.a))`b)
148+ |= b/(list _?>(?=(^ a) n.a))
150149 |- ^+ a
151150 ?~ b
152151 a
153− $(b t.b, a (put(+< a) p.i.b q.i.b))
152+ $(b t.b, a (put i.b))
153+ ::
154+
154155
155156Insert a list of key-value pairs `b` into map `a`.
156157
157−`a` is a [map]().
158+`a` is a map.
158159
159−`b` is a [list]() of [cells]() of key-value nouns `p` and `q`.
160+`b` is a list of cells of key-value nouns `p` and `q`.
160161
161− ~zod/try=> =a (mo `(list ,[@t *])`[[`a` 1] [`b` 2] ~])
162− ~zod/try=> =b `(list ,[@t *])`[[`c` 3] [`d` 4] ~]
162+ ~zod/try=> =a (mo `(list {@t *})`[[`a` 1] [`b` 2] ~])
163+ ~zod/try=> =b `(list {@t *})`[[`c` 3] [`d` 4] ~]
163164 ~zod/try=> (~(gas by a) b)
164165 {[p=`d` q=4] [p=`a` q=1] [p=`c` q=3] [p=`b` q=2]}
165166
@@ -183,11 +184,11 @@ Grab unit value
183184
184185Produce the unit value of the value located at key `b` within map `a`.
185186
186−`a` is a [map]()
187+`a` is a map
187188
188−`b` is a [key]() as a [noun]()
189+`b` is a key as a noun
189190
190− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
191+ ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
191192 ~zod/try=> (~(get by b) `b`)
192193 [~ [2 3]]
193194
@@ -198,18 +199,17 @@ Produce the unit value of the value located at key `b` within map `a`.
198199Assert
199200
200201 +- got
201− |* b=*
202− %- need
203− %- get(+< a) b
202+ |* b/*
203+ (need (get b))
204204
205205Produce the value located at key `b` within map `a`. Crash if key `b`
206206does not exist.
207207
208−`a` is a [map]().
208+`a` is a map.
209209
210−`b` is a [key]().
210+`b` is a key.
211211
212− ~zod/try=> =m (mo `(list ,[@t *])`[['a' 1] ['b' 2] ~])
212+ ~zod/try=> =m (mo `(list {@t *})`[['a' 1] ['b' 2] ~])
213213 ~zod/try=> m
214214 {[p='a' q=1] [p='b' q=2]}
215215 ~zod/try=> (~(get by m) 'a')
@@ -227,17 +227,18 @@ Key existence check
227227
228228 +- has :: key existence check
229229 ~/ %has
230− |* b=*
231− !=(~ (get(+< a) b))
230+ |* b/*
231+ !=(~ (get b))
232+
232233
233234Checks whether map `a` contains an element with key `b`, producing a
234235loobean.
235236
236−`a` is a [map]().
237+`a` is a map.
237238
238−`b` is a key as a [noun]().
239+`b` is a key as a noun.
239240
240− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
241+ ~zod/try=> =b (mo `(list {@t *})`[['a' 1] ['b' [2 3]] ~])
241242 ~zod/try=> (~(has by b) `b`)
242243 %.y
243244 ~zod/try=> (~(has by b) `c`)
@@ -251,7 +252,7 @@ Intersection
251252
252253 +- int :: intersection
253254 ~/ %int
254− |* b=_a
255+ |* b/_a
255256 |- ^+ a
256257 ?~ b
257258 ~
@@ -260,41 +261,42 @@ Intersection
260261 ?: (vor p.n.a p.n.b)
261262 ?: =(p.n.b p.n.a)
262263 [n.b $(a l.a, b l.b) $(a r.a, b r.b)]
263− ?: (hor p.n.b p.n.a)
264− %- uni(+< $(a l.a, b [n.b l.b ~])) $(b r.b)
265− %- uni(+< $(a r.a, b [n.b ~ r.b])) $(b l.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)
266267 ?: =(p.n.a p.n.b)
267268 [n.b $(b l.b, a l.a) $(b r.b, a r.a)]
268− ?: (hor p.n.a p.n.b)
269− %- uni(+< $(b l.b, a [n.a l.a ~])) $(a r.a)
270− %- uni(+< $(b r.b, a [n.a ~ r.a])) $(a l.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+ ::
271273
272274Produces a map of the (key) intersection between two maps of the same
273275type, `a` and `b`. If both maps have an identical key that point to
274276different values, the element from map `b` is used.
275277
276−`a` is a [map]().
278+`a` is a map.
277279
278−`b` is a [map]().
280+`b` is a map.
279281
280− ~zod/try=> =n (mo `(list ,[@t *])`[['a' 1] ['c' 3] ~])
282+ ~zod/try=> =n (mo `(list {@t *})`[['a' 1] ['c' 3] ~])
281283 ~zod/try=> n
282284 {[p='a' q=1] [p='c' q=3]}
283285 ~zod/try=> m
284286 {[p='a' q=1] [p='b' q=2]}
285287 ~zod/try=> (~(int by m) n)
286288 {[p='a' q=1]}
287− ~ravpel-holber/try=> =p (mo `(list ,[@t *])`[['a' 2] ['b' 2] ~])
289+ ~ravpel-holber/try=> =p (mo `(list {@t *})`[['a' 2] ['b' 2] ~])
288290 ~zod/try=> p
289291 {[p='a' q=2] [p='b' q=2]}
290292 ~zod/try=> (~(int by p) n)
291293 {[p='a' q=2]}
292− ~zod/try=> =q (mo `(list ,[@t *])`[['a' 2] ['c' 2] ~])
294+ ~zod/try=> =q (mo `(list {@t *})`[['a' 2] ['c' 2] ~])
293295 ~zod/try=> q
294296 {[p='a' q=2] [p='b' q=2]}
295297 ~zod/try=> (~(int by p) q)
296298 {[p='a' q=2] [p='b' q=2]}
297− ~zod/try=> =o (mo `(list ,[@t *])`[['c' 3] ['d' 4] ~])
299+ ~zod/try=> =o (mo `(list {@t *})`[['c' 3] ['d' 4] ~])
298300 ~zod/try=> (~(int by m) o)
299301 {}
300302
@@ -343,7 +345,7 @@ Add key-value pair
343345
344346 +- put :: adds key-value pair
345347 ~/ %put
346− |* [b=* c=*]
348+ |* {b/* c/*}
347349 |- ^+ a
348350 ?~ a
349351 [[b c] ~ ~]
@@ -362,10 +364,11 @@ Add key-value pair
362364 ?: (vor p.n.a p.n.d)
363365 [n.a l.a d]
364366 [n.d [n.a l.a l.d] r.d]
367+ ::
365368
366369Produces `a` with the addition of the key-value pair of `b` and `c`.
367370
368−`a` is a [map]().
371+`a` is a map.
369372
370373`b` is a key of the same type as the keys in `a`.
371374
@@ -386,10 +389,11 @@ Produces `a` with the addition of the key-value pair of `b` and `c`.
386389### `+-rep:by`
387390
388391 +- rep :: replace by product
389− |* [b=* c=_,*]
392+ |* b/_|=({* *} +<+)
390393 |-
391− ?~ a b
392− $(a r.a, b $(a l.a, b (c q.n.a b)))
394+ ?~ a +<+.b
395+ $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
396+ ::
393397
394398Accumulate using gate from values in map
395399
@@ -400,7 +404,7 @@ XX interface changing.
400404### `+-rib:by`
401405
402406 +- rib :: transform + product
403− |* [b=* c=_,*]
407+ |* {b/* c/$-(* *)}
404408 |- ^+ [b a]
405409 ?~ a [b ~]
406410 =+ d=(c n.a b)
@@ -408,6 +412,7 @@ XX interface changing.
408412 =+ e=$(a l.a, b -.d)
409413 =+ f=$(a r.a, b -.e)
410414 [-.f [n.a +.e +.f]]
415+ ::
411416
412417Replace values with accumulator
413418
@@ -419,23 +424,23 @@ XX interface changing, possibly disappearing
419424
420425Transform values
421426
422− +- run :: turns to tuples
423− |* b=_,*
424− |-
427+ +- run :: apply gate to values
428+ |* b/$-(* *)
429+ |-
425430 ?~ a a
426− a(n (b q.n.a), l $(a l.a), r $(a r.a))
431+ [n=[p=p.n.a q=(b q.n.a)] l=$(a l.a) r=$(a r.a)]
427432
428433Iterates over every value in set `a` using gate `b`. Produces a map.
429434
430−`a` is a [map]().
435+`a` is a map.
431436
432−`b` is a [wet gate]().
437+`b` is a wet gate.
433438
434439 ~zod/try=> m
435440 {[p='a' q=1] [p='b' q=2]}
436441 ~zod/try=> ^+(m (~(run by m) dec))
437442 {[p='a' q=0] [p='b' q=1]}
438− ~zod/try=> `(map ,@tas ,@t)`(~(run by m) (cury scot %ux))
443+ ~zod/try=> `(map @tas @t)`(~(run by m) (cury scot %ux))
439444 {[p=%a q='0x1'] [p=%b q='0x2']}
440445
441446------------------------------------------------------------------------
@@ -446,18 +451,19 @@ Listify pairs
446451
447452 +- tap :: listify pairs
448453 ~/ %tap
449− |= b=(list ,_?>(?=(^ a) n.a))
454+ |= b/(list _?>(?=(^ a) n.a))
450455 ^+ b
451456 ?~ a
452457 b
453458 $(a r.a, b [n.a $(a l.a)])
459+ ::
454460
455461Produces the list of all elements in map `a` that is prepended to list
456462`b`, which is empty by default.
457463
458−`a` is a [map]().
464+`a` is a map.
459465
460−`b` is a [list]().
466+`b` is a list.
461467
462468 {[p='a' q=1] [p='b' q=2]}
463469 ~zod/try=> `*`m
@@ -475,7 +481,7 @@ Union
475481
476482 +- uni :: union, merge
477483 ~/ %uni
478− |* b=_a
484+ |* b/_a
479485 |- ^+ a
480486 ?~ b
481487 a
@@ -484,21 +490,21 @@ Union
484490 ?: (vor p.n.a p.n.b)
485491 ?: =(p.n.b p.n.a)
486492 [n.b $(a l.a, b l.b) $(a r.a, b r.b)]
487− ?: (hor p.n.b p.n.a)
493+ ?: (gor p.n.b p.n.a)
488494 $(a [n.a $(a l.a, b [n.b l.b ~]) r.a], b r.b)
489495 $(a [n.a l.a $(a r.a, b [n.b ~ r.b])], b l.b)
490496 ?: =(p.n.a p.n.b)
491497 [n.b $(b l.b, a l.a) $(b r.b, a r.a)]
492− ?: (hor p.n.a p.n.b)
498+ ?: (gor p.n.a p.n.b)
493499 $(b [n.b $(b l.b, a [n.a l.a ~]) r.b], a r.a)
494500 $(b [n.b l.b $(b r.b, a [n.a ~ r.a])], a l.a)
495501
496502Produces a map of the union between the keys of `a` and `b`. If `b`
497503shares a key with `a`, the tuple from `a` is preserved.
498504
499−`a` is a [map]().
505+`a` is a map.
500506
501−`b` is a [map]().
507+`b` is a map.
502508
503509 ~zod/try=> m
504510 {[p='a' q=1] [p='b' q=2]}
@@ -524,8 +530,8 @@ shares a key with `a`, the tuple from `a` is preserved.
524530
525531Turn (with key)
526532
527− +- urn :: turn
528− |* b=$+([* *] *)
533+ +- urn :: apply gate to nodes
534+ |* b/$-({* *} *)
529535 |-
530536 ?~ a ~
531537 [n=[p=p.n.a q=(b p.n.a q.n.a)] l=$(a l.a) r=$(a r.a)]
@@ -533,9 +539,9 @@ Turn (with key)
533539Iterates over every value in map `a` using gate `b`, which accepts both
534540the key and the value of each element as its sample.
535541
536−`a` is a [map]().
542+`a` is a map.
537543
538−`b` is a [wet gate]() that accepts two nouns (a key and a value) and
544+`b` is a wet gate that accepts two nouns (a key and a value) and
539545produces a noun (the new value).
540546
541547 ~zod/try=> m
@@ -559,7 +565,7 @@ Depth
559565
560566Produce the depth of the tree map `a`.
561567
562−`a` is a [map]().
568+`a` is a map.
563569
564570 ~zod/try=> m
565571 {[p='a' q=1] [p='b' q=2]}
docs/system/hoon/library/src/2j/core/ja.md+11−166
@@ -2,13 +2,12 @@
22
33Jar engine
44
5− ++ ja :: jar engine
6− |/ a=(jar)
5+ |_ a/(jar)
76
87A container arm for `++jar` operation arms. A `++jar` is a `++map` of
9−`++list`s. The contained arms inherit the [sample]() jar.
8+`++list`s. The contained arms inherit the sample jar.
109
11−`a` is a [jar]().
10+`a` is a jar.
1211
1312 ~zod/try=> ~(. ja (mo (limo a/"ho" b/"he" ~)))
1413 <2.dgz [nlr([p={%a %b} q=""]) <414.fvk 101.jzo 1.ypj %164>]>
@@ -19,14 +18,15 @@ A container arm for `++jar` operation arms. A `++jar` is a `++map` of
1918
2019Grab value by key
2120
22− +- get :: grab value by key
23− |* b=*
21+ +- get :: gets list by key
22+ |* b/*
2423 =+ c=(~(get by a) b)
2524 ?~(c ~ u.c)
25+ ::
2626
2727Produces a list retrieved from jar `a` using the key `b`.
2828
29−`a` is a [`++jar`](/doc/hoon/library/1#++jar).
29+`a` is a `++jar`.
3030
3131`b` is a key of the same type as the keys in `a`.
3232
@@ -47,14 +47,14 @@ Produces a list retrieved from jar `a` using the key `b`.
4747Prepend to list
4848
4949 +- add :: adds key-list pair
50− |* [b=* c=*]
51− =+ d=(get(+< a) b)
50+ |* {b/* c/*}
51+ =+ d=(get b)
5252 (~(put by a) b [c d])
5353
5454Produces jar `a` with value `c` prepended to the list located at key
5555`b`.
5656
57−`a` is a [jar]().
57+`a` is a jar.
5858
5959`b` is a key of the same type as the keys in `a`.
6060
@@ -73,159 +73,4 @@ Produces jar `a` with value `c` prepended to the list located at key
7373 ! type-fail
7474 ! exit
7575
76−------------------------------------------------------------------------
77−
78−### `++ju`
79−
80−Jug operations
81−
82− ++ ju :: jug engine
83− |/ a=(jug)
84−
85−Container arm for jug operation arms. A `++jug` is a `++map` of
86−`++sets`. The contained arms inherit its [sample]() jug, `a`.
87−
88−`a` is a [jug]().
89−
90− ~zod/try=> ~(. ju (mo (limo a/(sa "ho") b/(sa "he") ~)))
91− <2.dgz [nlr([p={%a %b} q={nlr(^$1{@tD $1}) nlr(^$3{@tD $3})}]) <414.fvk 101.jzo 1.ypj %164>]>
92−
93−### `+-del:ju`
94−
95−Remove
96−
97− +- del :: delete at key b
98− |* [b=* c=*]
99− ^+ a
100− =+ d=(get(+< a) b)
101− =+ e=(~(del in d) c)
102− ?~ e
103− (~(del by a) b)
104− (~(put by a) b e)
105−
106−Produces jug `a` with value `c` removed from set located at key `b`.
107−
108−`a` is a [jug]().
109−
110−`b` is a key of the same type as the keys in `a`.
111−
112−`c` is the value of the same type of the keys in `a` that is to be
113−removed.
114−
115− ~zod/try=> s
116− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
117− ~zod/try=> (~(del ju s) 'a' 1)
118− {[p='a' q={3 2}] [p='b' q={5 4 6}]}
119− ~zod/try=> (~(del ju s) 'c' 7)
120− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
121−
122−------------------------------------------------------------------------
123−
124−### `+-get:ju`
125−
126−Retrieve set
127−
128− +- get :: gets set by key
129− |* b=*
130− =+ c=(~(get by a) b)
131− ?~(c ~ u.c)
132−
133−Produces a set retrieved from jar `a` using key `b`.
134−
135−`a` is a [jar]().
136−
137−`b` is a key of the same type as the keys in `a`.
138−
139− ~zod/try=> s
140− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
141− ~zod/try=> (~(get ju s) 'a')
142− {1 3 2}
143− ~zod/try=> (~(get ju s) 'b')
144− {5 4 6}
145− ~zod/try=> (~(get ju s) 'c')
146− ~
147−
148−------------------------------------------------------------------------
149−
150−### `+-has:ju`
151−
152−Check contents
153−
154− +- has :: existence check
155− |* [b=* c=*]
156− ^- ?
157− (~(has in (get(+< a) b)) c)
158−
159−Computes whether a value `c` exists within the set located at key `b`
160−with jar `a`. Produces a loobean.
161−
162−`a` is a [set]().
163−
164−`b` is a key as a [noun]().
165−
166−`c` is a value as a [noun]().
167−
168− ~zod/try=> s
169− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
170− ~zod/try=> (~(has ju s) 'a' 3)
171− %.y
172− ~zod/try=> (~(has ju s) 'b' 6)
173− %.y
174− ~zod/try=> (~(has ju s) 'a' 7)
175− %.n
176− ~zod/try=> (~(has jus s) 'c' 7)
177− ! -find-limb.jus
178− ! find-none
179− ! exit
180− ~zod/try=> (~(has ju s) 'c' 7)
181− %.n
182−
183−------------------------------------------------------------------------
184−
185−### `+-put:ju`
186−
187−Add key-set pair
188−
189− +- put :: adds key-element pair
190− |* [b=* c=*]
191− ^+ a
192− =+ d=(get(+< a) b)
193− (~(put by a) b (~(put in d) c))
194−
195−Produces jar `a` with `c` added to the set value located at key `b`.
196−
197−`a` is a [set]().
198−
199−`b` is a key as a [noun]().
200−
201−`c` is a [value]().
202−
203− ~zod/try=> s
204− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
205− ~zod/try=> (~(put ju s) 'a' 7)
206− {[p='a' q={7 1 3 2}] [p='b' q={5 4 6}]}
207− ~zod/try=> (~(put ju s) 'a' 1)
208− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
209− ~zod/try=> (~(put ju s) 'c' 7)
210− {[p='a' q={1 3 2}] [p='c' q={7}] [p='b' q={5 4 6}]}
211−
212−------------------------------------------------------------------------
213−
214−### `++by`
215−
216−Map operations
217−
218− ++ by :: map engine
219− ~/ %by
220− |/ a=(map)
221−
222−Container arm for map operation arms. A map is a set of key, value
223−pairs. The contained arms inherit it's [sample]() [map](), `a`.
224−
225−`a` is a [map]().
226−
227− ~zod/try=> ~(. by (mo (limo [%a 1] [%b 2] ~)))
228− <19.irb [nlr([p={%a %b} q=@ud]) <414.rvm 101.jzo 1.ypj %164>]>
229−
230−
231−***
76+**
docs/system/hoon/library/src/2j/core/ju.md+25−20
@@ -3,12 +3,12 @@
33Jug operations
44
55 ++ ju :: jug engine
6− |/ a=(jug)
6+ |/ a/(jug)
77
88Container arm for jug operation arms. A `++jug` is a `++map` of
9−`++sets`. The contained arms inherit its [sample]() jug, `a`.
9+`++sets`. The contained arms inherit its sample jug, `a`.
1010
11−`a` is a [jug]().
11+`a` is a jug.
1212
1313 ~zod/try=> ~(. ju (mo (limo a/(sa "ho") b/(sa "he") ~)))
1414 <2.dgz [nlr([p={%a %b} q={nlr(^$1{@tD $1}) nlr(^$3{@tD $3})}]) <414.fvk 101.jzo 1.ypj %164>]>
@@ -17,18 +17,20 @@ Container arm for jug operation arms. A `++jug` is a `++map` of
1717
1818Remove
1919
20− +- del :: delete at key b
21− |* [b=* c=*]
20+ +- del :: del key-set pair
21+ |* {b/* c/*}
2222 ^+ a
23− =+ d=(get(+< a) b)
23+ =+ d=(get b)
2424 =+ e=(~(del in d) c)
2525 ?~ e
2626 (~(del by a) b)
2727 (~(put by a) b e)
28+ ::
29+
2830
2931Produces jug `a` with value `c` removed from set located at key `b`.
3032
31−`a` is a [jug]().
33+`a` is a jug.
3234
3335`b` is a key of the same type as the keys in `a`.
3436
@@ -49,13 +51,14 @@ removed.
4951Retrieve set
5052
5153 +- get :: gets set by key
52− |* b=*
54+ |* b/*
5355 =+ c=(~(get by a) b)
5456 ?~(c ~ u.c)
57+ ::
5558
5659Produces a set retrieved from jar `a` using key `b`.
5760
58−`a` is a [jar]().
61+`a` is a jar.
5962
6063`b` is a key of the same type as the keys in `a`.
6164
@@ -75,18 +78,20 @@ Produces a set retrieved from jar `a` using key `b`.
7578Check contents
7679
7780 +- has :: existence check
78− |* [b=* c=*]
81+ |* {b/* c/*}
7982 ^- ?
80− (~(has in (get(+< a) b)) c)
83+ (~(has in (get b)) c)
84+ ::
85+
8186
8287Computes whether a value `c` exists within the set located at key `b`
8388with jar `a`. Produces a loobean.
8489
85−`a` is a [set]().
90+`a` is a set.
8691
87−`b` is a key as a [noun]().
92+`b` is a key as a noun.
8893
89−`c` is a value as a [noun]().
94+`c` is a value as a noun.
9095
9196 ~zod/try=> s
9297 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
@@ -109,19 +114,19 @@ with jar `a`. Produces a loobean.
109114
110115Add key-set pair
111116
112− +- put :: adds key-element pair
113− |* [b=* c=*]
117+ +- put :: add key-set pair
118+ |* {b/* c/*}
114119 ^+ a
115− =+ d=(get(+< a) b)
120+ =+ d=(get b)
116121 (~(put by a) b (~(put in d) c))
117122
118123Produces jar `a` with `c` added to the set value located at key `b`.
119124
120−`a` is a [set]().
125+`a` is a set.
121126
122−`b` is a key as a [noun]().
127+`b` is a key as a noun.
123128
124−`c` is a [value]().
129+`c` is a value.
125130
126131 ~zod/try=> s
127132 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}