2title = "2j: Jar and Jug Logic"
15A container arm for `++jar` operation arms. A `++jar` is a `++map` of
16`++list`s. The contained arms inherit the sample jar.
21 > ~(. ja (mo (limo a/"ho" b/"he" ~)))
22 <2.dgz [nlr([p={%a %b} q=""]) <414.fvk 101.jzo 1.ypj %164>]>
31 +- get :: gets list by key
41`b` is a key of the same type as the keys in `a`.
45A list retrieved from jar `a` using the key `b`.
50 > =l (mo `(list ,[@t (list ,@)])`[['a' `(list ,@)`[1 2 3 ~]] ['b' `(list ,@)`[4 5 6 ~]] ~])
52 [[p='a' q=~[1 2 3]] [p='b' q=~[4 5 6]]}
72 +- add :: adds key-list pair
82`b` is a key of the same type as the keys in `a`.
84`c` is a value of the same type as the values in `a`.
89 > =l (mo `(list ,[@t (list ,@)])`[['a' `(list ,@)`[1 2 3 ~]] ['b' `(list ,@)`[4 5 6 ~]] ~])
91 {[p='a' q=~[1 2 3]] [p='b' q=~[4 5 6]]}
94 {[p='a' q=~[1 2 3]] [p='b' q=~[7 4 5 6]]}
96 > (~(add ja l) 'a' 100)
97 {[p='a' q=~[100 1 2 3]] [p='b' q=~[4 5 6]]}
100 {[p='a' q=~[1 2 3]] [p='c' q=~[7]] [p='b' q=~[4 5 6]]}
102 > (~(add ja l) 'c' `(list ,@)`[7 8 9 ~])
117Container arm for jug operation arms. A `++jug` is a `++map` of
118`++sets`. The contained arms inherit its sample jug, `a`.
123 > ~(. ju (mo (limo a=(sa "ho") b=(sa "he") ~)))
124 <2.dgz [nlr([p={%a %b} q={nlr(^$1{@tD $1}) nlr(^$3{@tD $3})}]) <414.fvk 101.jzo 1.ypj %164>]>
135 +- del :: del key-set pair
146Produces jug `a` with value `c` removed from set located at key `b`.
150`b` is a key of the same type as the keys in `a`.
152`c` is the value of the same type of the keys in `a` that is to be
157 [[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
159 > (~(del ju s) 'a' 1)
160 {[p='a' q={3 2}] [p='b' q={5 4 6}]}
162 > (~(del ju s) 'c' 7)
163 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
173 +- get :: gets set by key
180Produces a set retrieved from jar `a` using key `b`.
184`b` is a key of the same type as the keys in `a`.
188 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
203 +- has :: existence check
206 (~(has in (get b)) c)
210Computes whether a value `c` exists within the set located at key `b`
211with jar `a`. Produces a loobean.
215`b` is a key as a noun.
217`c` is a value as a noun.
221 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
222 > (~(has ju s) 'a' 3)
224 > (~(has ju s) 'b' 6)
226 > (~(has ju s) 'a' 7)
228 > (~(has jus s) 'c' 7)
232 > (~(has ju s) 'c' 7)
246 (~(put by a) b (~(put in d) c))
249Produces jar `a` with `c` added to the set value located at key `b`.
253`b` is a key as a noun.
259 [p='a' q=[1 3 2]] [p='b' q=[5 4 6]]]
261 > (~(put ju s) 'a' 7)
262 {[p='a' q={7 1 3 2}] [p='b' q={5 4 6}]}
264 > (~(put ju s) 'a' 1)
265 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
267 > (~(put ju s) 'c' 7)
268 {[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