11Container arm for queue operation arms. The contained arms inherit its
29Vertically rebalances queue `a`.
47 ?. |(?=($~ l.a) (vor n.a n.l.a))
48 $(a [n.l.a l.l.a $(a [n.a r.l.a r.a])])
49 ?. |(?=($~ r.a) (vor n.a n.r.a))
50 $(a [n.r.a $(a [n.a l.a l.r.a]) r.r.a])
58 > `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~]
59 {"a" "b" "c" "d" "e" "f" "g"}
60 > `*`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~]
61 [[97 0] 0 [98 0] 0 [99 0] 0 [100 0] 0 [101 0] 0 [102 0] 0 [103 0] 0 0]
62 > ~(bal to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~])
63 {"a" "b" "c" "d" "e" "f" "g"}
64 > `*`~(bal to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~])
65 [[100 0] [[99 0] [[98 0] [[97 0] 0 0] 0] 0] [101 0] 0 [102 0] 0 [103 0] 0 0]
67------------------------------------------------------------------------
73Produces the maximum depth of leaves (r.a and l.a) in queue `a`.
88 +- dep :: max depth of queue
91 +((max $(a l.a) $(a r.a)))
98 > =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 7 ~])
101 > =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 ~])
104 > =a (~(gas to `(qeu @)`~) `(list @)`[1 2 ~])
107 > ~(dep to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~])
109 > ~(dep to ~(bal to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~]))
112------------------------------------------------------------------------
118Push all elements of `++list` `b` into the `++queue`.
135 +- gas :: insert list to queue
136 |= b=(list ,_?>(?=(^ a) n.a))
138 ?~(b a $(b t.b, a (put(+< a) i.b)))
144 > (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 ~])
146 > =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 ~])
147 > =b `(list ,@)`[4 5 6 ~]
151------------------------------------------------------------------------
157Produces the head and tail `++queue` of `a`.
167The last element in `a` along with the rest of queue `a`.
172 +- get :: head-tail pair
173 |- ^+ ?>(?=(^ a) [p=n.a q=*(qeu _n.a)])
180 ?: |(?=($~ q.b) (vor n.a n.q.b))
182 [n.q.b [n.a l.a l.q.b] r.q.b]
188 > =s (~(gas to *(qeu @)) `(list @)`~[1 2 3])
194------------------------------------------------------------------------
200Removes the head of `++queue` `a`, producing the resulting queue.
215 +- nap :: removes head
219 bal(a ^+(a [p.b q.b r.a]))
225 > =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 ~])
236------------------------------------------------------------------------
242Accept any noun `b` and adds to `++queue` `a` as the head, producing the
260 +- put :: insert new tail
272 > (~(gas to `(qeu @)`~) `(list @)`[3 1 2 4 5 6 ~])
276------------------------------------------------------------------------
282Produces `++queue` `a` as a `++list` from front to back.
292 +- tap :: adds list to end
293 |= b/(list _?>(?=(^ a) n.a))
294 =+ z=0 :: XX breaks jet match
298 $(a r.a, b [n.a $(a l.a)])
304 > =a (~(gas to `(qeu @)`~) `(list @)`[3 1 2 4 5 6 ~])
306 [6 0 2 [4 [5 0 0] 0] 1 0 3 0 0]
307 > (~(tap to a) `(list @)`[99 100 101 ~])
308 ~[3 1 2 4 5 6 99 100 101]
310------------------------------------------------------------------------
314Produces the head of `++queue` `a` as a `++unit` (an empty queue has no head).
329 +- top :: produces head
330 |- ^- (unit _?>(?=(^ a) n.a))
332 ?~(r.a [~ n.a] $(a r.a))
337 > =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 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