3 title/'2j: Jar and Jug Logic'
18A container arm for `++jar` operation arms. A `++jar` is a `++map` of
19`++list`s. The contained arms inherit the sample jar.
24 > ~(. ja (mo (limo a/"ho" b/"he" ~)))
25 <2.dgz [nlr([p={%a %b} q=""]) <414.fvk 101.jzo 1.ypj %164>]>
34 +- get :: gets list by key
44`b` is a key of the same type as the keys in `a`.
48A list retrieved from jar `a` using the key `b`.
53 > =l (mo `(list ,[@t (list ,@)])`[['a' `(list ,@)`[1 2 3 ~]] ['b' `(list ,@)`[4 5 6 ~]] ~])
55 [[p='a' q=~[1 2 3]] [p='b' q=~[4 5 6]]}
75 +- add :: adds key-list pair
85`b` is a key of the same type as the keys in `a`.
87`c` is a value of the same type as the values in `a`.
92 > =l (mo `(list ,[@t (list ,@)])`[['a' `(list ,@)`[1 2 3 ~]] ['b' `(list ,@)`[4 5 6 ~]] ~])
94 {[p='a' q=~[1 2 3]] [p='b' q=~[4 5 6]]}
97 {[p='a' q=~[1 2 3]] [p='b' q=~[7 4 5 6]]}
99 > (~(add ja l) 'a' 100)
100 {[p='a' q=~[100 1 2 3]] [p='b' q=~[4 5 6]]}
102 > (~(add ja l) 'c' 7)
103 {[p='a' q=~[1 2 3]] [p='c' q=~[7]] [p='b' q=~[4 5 6]]}
105 > (~(add ja l) 'c' `(list ,@)`[7 8 9 ~])
120Container arm for jug operation arms. A `++jug` is a `++map` of
121`++sets`. The contained arms inherit its sample jug, `a`.
126 > ~(. ju (mo (limo a=(sa "ho") b=(sa "he") ~)))
127 <2.dgz [nlr([p={%a %b} q={nlr(^$1{@tD $1}) nlr(^$3{@tD $3})}]) <414.fvk 101.jzo 1.ypj %164>]>
138 +- del :: del key-set pair
149Produces jug `a` with value `c` removed from set located at key `b`.
153`b` is a key of the same type as the keys in `a`.
155`c` is the value of the same type of the keys in `a` that is to be
160 [[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
162 > (~(del ju s) 'a' 1)
163 {[p='a' q={3 2}] [p='b' q={5 4 6}]}
165 > (~(del ju s) 'c' 7)
166 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
176 +- get :: gets set by key
183Produces a set retrieved from jar `a` using key `b`.
187`b` is a key of the same type as the keys in `a`.
191 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
206 +- has :: existence check
209 (~(has in (get b)) c)
213Computes whether a value `c` exists within the set located at key `b`
214with jar `a`. Produces a loobean.
218`b` is a key as a noun.
220`c` is a value as a noun.
224 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
225 > (~(has ju s) 'a' 3)
227 > (~(has ju s) 'b' 6)
229 > (~(has ju s) 'a' 7)
231 > (~(has jus s) 'c' 7)
235 > (~(has ju s) 'c' 7)
249 (~(put by a) b (~(put in d) c))
252Produces jar `a` with `c` added to the set value located at key `b`.
256`b` is a key as a noun.
262 [p='a' q=[1 3 2]] [p='b' q=[5 4 6]]]
264 > (~(put ju s) 'a' 7)
265 {[p='a' q={7 1 3 2}] [p='b' q={5 4 6}]}
267 > (~(put ju s) 'a' 1)
268 {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
270 > (~(put ju s) 'c' 7)
271 {[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