2title = "2j: Jar and Jug Logic"
14A container arm for `++jar` operation arms. A `++jar` is a `++map` of
15`++list`s. The contained arms inherit the sample jar.
20 > ~(. ja (mo (limo a/"ho" b/"he" ~)))
21 <2.dgz [nlr([p={%a %b} q=""]) <414.fvk 101.jzo 1.ypj %164>]>
30 +- get :: gets list by key
40`b` is a key of the same type as the keys in `a`.
44A list retrieved from jar `a` using the key `b`.
49 > =l (mo `(list ,[@t (list ,@)])`[['a' `(list ,@)`[1 2 3 ~]] ['b' `(list ,@)`[4 5 6 ~]] ~])
51 [[p='a' q=~[1 2 3]] [p='b' q=~[4 5 6]]}
71 +- add :: adds key-list pair
81`b` is a key of the same type as the keys in `a`.
83`c` is a value of the same type as the values in `a`.
88 > =l (mo `(list ,[@t (list ,@)])`[['a' `(list ,@)`[1 2 3 ~]] ['b' `(list ,@)`[4 5 6 ~]] ~])
90 {[p='a' q=~[1 2 3]] [p='b' q=~[4 5 6]]}
93 {[p='a' q=~[1 2 3]] [p='b' q=~[7 4 5 6]]}
95 > (~(add ja l) 'a' 100)
96 {[p='a' q=~[100 1 2 3]] [p='b' q=~[4 5 6]]}
99 {[p='a' q=~[1 2 3]] [p='c' q=~[7]] [p='b' q=~[4 5 6]]}
101 > (~(add ja l) 'c' `(list ,@)`[7 8 9 ~])
116Container arm for jug operation arms. A `++jug` is a `++map` of
117`++sets`. The contained arms inherit its sample jug, `a`.
122 > ~(. ju (mo (limo a=(sa "ho") b=(sa "he") ~)))
123 <2.dgz [nlr([p={%a %b} q={nlr(^$1{@tD $1}) nlr(^$3{@tD $3})}]) <414.fvk 101.jzo 1.ypj %164>]>
134 +- del :: del key-set pair
145Produces jug `a` with value `c` removed from set located at key `b`.
149`b` is a key of the same type as the keys in `a`.
151`c` is the value of the same type of the keys in `a` that is to be
156 [[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
158 > (~(del ju s) 'a' 1)
159 {[p='a' q={3 2}] [p='b' q={5 4 6}]}
161 > (~(del ju s) 'c' 7)
162 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
172 +- get :: gets set by key
179Produces a set retrieved from jar `a` using key `b`.
183`b` is a key of the same type as the keys in `a`.
187 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
202 +- has :: existence check
205 (~(has in (get b)) c)
209Computes whether a value `c` exists within the set located at key `b`
210with jar `a`. Produces a loobean.
214`b` is a key as a noun.
216`c` is a value as a noun.
220 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
221 > (~(has ju s) 'a' 3)
223 > (~(has ju s) 'b' 6)
225 > (~(has ju s) 'a' 7)
227 > (~(has jus s) 'c' 7)
231 > (~(has ju s) 'c' 7)
245 (~(put by a) b (~(put in d) c))
248Produces jar `a` with `c` added to the set value located at key `b`.
252`b` is a key as a noun.
258 [p='a' q=[1 3 2]] [p='b' q=[5 4 6]]]
260 > (~(put ju s) 'a' 7)
261 {[p='a' q={7 1 3 2}] [p='b' q={5 4 6}]}
263 > (~(put ju s) 'a' 1)
264 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
266 > (~(put ju s) 'c' 7)
267 {[p='a' q={1 3 2}] [p='c' q={7}] [p='b' q={5 4 6}]}
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list