diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index 22210d1f1..d84d3a35c 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -5452,6 +5452,7 @@ :::: 4k: atom printing :: ++ co + !: ~% %co ..co ~ =< |_ lot=coin ++ rear |=(rom=tape rend(rep rom)) @@ -5603,18 +5604,17 @@ |= a=dn ?: ?=([%i *] a) (weld ?:(s.a "inf" "-inf") rep) ?: ?=([%n *] a) (weld "nan" rep) - =/ f=(pair tape @) - %. a.a - %+ ed-co(rep ~) [10 1] - |=([a=? b=@ c=tape] [~(d ne b) ?.(a c ['.' c])]) - =. e.a (sum:si e.a (sun:si (dec q.f))) - =/ res - %+ weld p.f - ?~ e.a - rep - %+ weld ?:((syn:si e.a) "e" "e-") - ((d-co 1) (abs:si e.a)) - ?:(s.a res ['-' res]) + =; rep ?:(s.a rep ['-' rep]) + =/ f ((d-co 1) a.a) + =^ e e.a + =/ e=@s (sun:si (lent f)) + =/ sci :(sum:si e.a e -1) + ?: (syn:si (dif:si e.a --3)) [--1 sci] :: 12000 -> 12e3 e>+2 + ?: !(syn:si (dif:si sci -2)) [--1 sci] :: 0.001 -> 1e-3 e<-2 + [(sum:si sci --1) --0] :: 1.234e2 -> '.'@3 -> 123 .4 + =? rep !=(--0 e.a) + :(weld ?:((syn:si e.a) "e" "e-") ((d-co 1) (abs:si e.a))) + (weld (ed-co e f) rep) :: ++ s-co |= esc=(list @) ^- tape @@ -5660,20 +5660,13 @@ :: - used only for @r* floats :: ++ ed-co - |= [[bas=@ min=@] par=$-([? @ tape] tape)] - =| [fir=? cou=@ud] - |= hol=@ - ^- [tape @] - ?: &(=(0 hol) =(0 min)) - [rep cou] - =/ [dar=@ rad=@] (dvr hol bas) - %= $ - min ?:(=(0 min) 0 (dec min)) - hol dar - rep (par &(=(0 dar) !fir) rad rep) - fir | - cou +(cou) - == + |= [exp=@s int=tape] ^- tape + =/ [pos=? dig=@u] [=(--1 (cmp:si exp --0)) (abs:si exp)] + ?. pos + (into (weld (reap +(dig) '0') int) 1 '.') + =/ len (lent int) + ?: (lth dig len) (into int dig '.') + (weld int (reap (sub dig len) '0')) :: :: +ox-co: format '.'-separated digit sequences in numeric base :: @@ -6627,7 +6620,7 @@ +$ seminoun :: partial noun; blocked subtrees are ~ :: - $~ [[%full ~] ~] + $~ [[%full / ~ ~] ~] [mask=stencil data=noun] :: :: +stencil: noun knowledge map diff --git a/pkg/arvo/sys/vane/ames.hoon b/pkg/arvo/sys/vane/ames.hoon index b8b12f091..fb09a2ebe 100644 --- a/pkg/arvo/sys/vane/ames.hoon +++ b/pkg/arvo/sys/vane/ames.hoon @@ -1967,20 +1967,12 @@ ++ on-memo |= [=bone payload=* valence=?(%plea %boon)] ^+ peer-core - :: if we haven't been trying to talk to %live, reset timer - :: - =? last-contact.qos.peer-state - ?& ?=(%live -.qos.peer-state) - %- ~(all by snd.peer-state) - |= =message-pump-state - =(~ live.packet-pump-state.message-pump-state) - == - now - :: =/ =message-blob (dedup-message (jim payload)) =. peer-core (run-message-pump bone %memo message-blob) :: - ?: &(=(%boon valence) ?=(?(%dead %unborn) -.qos.peer-state)) + ?: ?& =(%boon valence) + (gte now (add ~s30 last-contact.qos.peer-state)) + == check-clog peer-core :: +dedup-message: replace with any existing copy of this message diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index 9fda52f56..168c15863 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5077,10 +5077,6 @@ ++ ordered-map on :: +on: treap with user-specified horizontal order, ordered-map :: -:: Conceptually smaller items go on the left, so the item with the -:: smallest key can be popped off the head. If $key is `@` and -:: .compare is +lte, then the numerically smallest item is the head. -:: :: WARNING: ordered-map will not work properly if two keys can be :: unequal under noun equality but equal via the compare gate :: @@ -5144,7 +5140,7 @@ :: ?~(r.a %.y &((mor key.n.a key.n.r.a) $(a r.a, r `key.n.a))) == - :: +bap: convert to list, largest to smallest + :: +bap: convert to list, right to left :: ++ bap ~/ %bap @@ -5175,10 +5171,9 @@ :: +dip: stateful partial inorder traversal :: :: Mutates .state on each run of .f. Starts at .start key, or if - :: .start is ~, starts at the head (item with smallest key). Stops - :: when .f produces .stop=%.y. Traverses from smaller to larger - :: keys. Each run of .f can replace an item's value or delete the - :: item. + :: .start is ~, starts at the head. Stops when .f produces .stop=%.y. + :: Traverses from left to right keys. + :: Each run of .f can replace an item's value or delete the item. :: ++ dip ~/ %dip @@ -5339,7 +5334,7 @@ l.a(r $(l.a r.l.a)) r.a(l $(r.a l.r.a)) :: - :: +pop: produce .head (smallest item) and .rest or crash if empty + :: +pop: produce .head (leftmost item) and .rest or crash if empty :: ++ pop ~/ %pop @@ -5354,13 +5349,14 @@ ?: |(?=(~ rest.l) (mor key.n.a key.n.rest.l)) a(l rest.l) rest.l(r a(r r.rest.l)) - :: +pry: produce head (smallest item) or null + :: +pry: produce head (leftmost item) or null :: ++ pry ~/ %pry |= a=(tree item) ^- (unit item) ?~ a ~ + |- ?~ l.a `n.a $(a l.a) :: +put: ordered item insert @@ -5390,6 +5386,16 @@ ?: (mor key.n.a key.n.r) a(r r) r(l a(r l.r)) + :: +ram: produce tail (rightmost item) or null + :: + ++ ram + ~/ %ram + |= a=(tree item) + ^- (unit item) + ?~ a ~ + |- + ?~ r.a `n.a + $(a r.a) :: +run: apply gate to transform all values in place :: ++ run @@ -5431,7 +5437,7 @@ $(a r.a) a(l $(a l.a)) -- - :: +tap: convert to list, smallest to largest + :: +tap: convert to list, left to right :: ++ tap ~/ %tap