From 8d5d2f0b32e530e5e6f37f5144219ace600a827c Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Mon, 18 May 2015 21:16:32 -0400 Subject: [PATCH 1/3] fixed :+mass --- base/ape/hood/core.hook | 4 ++ base/arvo/dill.hoon | 99 +++++++++++++++++++++++++++++++---------- base/arvo/gall.hoon | 8 ++++ base/arvo/zuse.hoon | 9 +++- base/lib/helm/core.hook | 5 +++ 5 files changed, 100 insertions(+), 25 deletions(-) diff --git a/base/ape/hood/core.hook b/base/ape/hood/core.hook index 897fb5798..f8eac35dd 100644 --- a/base/ape/hood/core.hook +++ b/base/ape/hood/core.hook @@ -74,6 +74,10 @@ |= [from hood-init] (ably (poke-init:(helm-work [hid +<-] (able %helm)) +<+)) :: +++ poke-hood-mass :: + |= [from ~] + (ably poke-mass:(helm-work [hid +<-] (able %helm))) +:: ++ poke-hood-merge :: |= [from hood-merge] (ably (poke-merge:(kiln-work [hid +<-] (able %kiln)) +<+)) diff --git a/base/arvo/dill.hoon b/base/arvo/dill.hoon index e1cc7d7f2..f14fc189d 100644 --- a/base/arvo/dill.hoon +++ b/base/arvo/dill.hoon @@ -6,11 +6,26 @@ ++ gill (pair ship term) :: general contact -- :: => |% :: console protocol -++ axle :: all dill state +++ all-axle ?(old-axle axle) :: +++ old-axle :: all dill state $: %2 :: ore=(unit ship) :: identity once set hey=(unit duct) :: default duct dug=(map duct axon) :: conversations + == :: +++ axle :: + $: %3 :: + ore=(unit ship) :: identity once set + hey=(unit duct) :: default duct + dug=(map duct axon) :: conversations + $= hef :: other weights + $: a=(unit mass) :: + c=(unit mass) :: + e=(unit mass) :: + f=(unit mass) :: + g=(unit mass) :: + t=(unit mass) :: + == :: == :: ++ axon :: dill per duct $: ram=term :: console program @@ -22,24 +37,7 @@ -- => :: |% :: protocol below ++ gift gift-dill :: out result <-$ -++ kiss :: in request ->$ - $% [%belt p=belt] :: terminal input - [%blew p=blew] :: terminal config - [%boot p=*] :: weird %dill boot - [%crud p=@tas q=(list tank)] :: error with trace - [%flog p=flog] :: wrapped error - [%flow p=@tas q=(list gill)] :: terminal config - [%hail ~] :: terminal refresh - [%hook ~] :: this term hung up - [%harm ~] :: all terms hung up - [%init p=ship] :: after gall ready - [%noop ~] :: no operation - [%talk p=tank] :: - [%text p=tape] :: - [%veer p=@ta q=path r=@t] :: install vane - [%vega p=path] :: reboot by path - [%verb ~] :: verbose mode - == :: +++ kiss kiss-dill :: in request ->$ -- => :: |% :: protocol outward ++ mess :: @@ -63,6 +61,7 @@ == :: ++ note-dill :: note to self, odd $% [%crud p=@tas q=(list tank)] :: + [%heft ~] :: [%init p=ship] :: [%text p=tape] :: [%veer p=@ta q=path r=@t] :: install vane @@ -74,11 +73,12 @@ [%deal p=sock q=cush] :: == :: ++ note :: out request $-> + $? [?(%a %c %e %f %g %t) %wegh ~] :: $% [%a note-ames] :: [%c note-clay] :: [%d note-dill] :: [%g note-gall] :: - == :: + == == :: ++ riff ,[p=desk q=(unit rave)] :: see %clay ++ sign-ames :: $% [%nice ~] :: @@ -103,12 +103,13 @@ $% [%wake ~] :: == :: ++ sign :: in result $<- + $? [?(%a %c %e %f %g %t) %mass p=mass] :: $% [%a sign-ames] :: [%c sign-clay] :: [%d sign-dill] :: [%g sign-gall] :: [%t sign-time] :: - == :: + == == :: :::::::: :: dill tiles -- =| all=axle @@ -134,6 +135,7 @@ %crud :: (send `dill-belt`[%cru p.kyz q.kyz]) (crud p.kyz q.kyz) %blew (send %rez p.p.kyz q.p.kyz) + %heft heft %veer (dump kyz) %vega (dump kyz) %verb (dump kyz) @@ -179,6 +181,19 @@ (dump %logo ~) (done %blit [bit ~]) :: + ++ heft + %_ . + moz + :* [hen %pass /heft/ames %a %wegh ~] + [hen %pass /heft/clay %c %wegh ~] + [hen %pass /heft/eyre %e %wegh ~] + [hen %pass /heft/ford %f %wegh ~] + [hen %pass /heft/gall %g %wegh ~] + [hen %pass /heft/time %t %wegh ~] + moz + == + == + :: ++ init :: initialize ~& [%dill-init our ram] =+ myt=(flop (need tem)) @@ -227,6 +242,9 @@ |= sih=sign ^+ +> ?- sih + [?(%a %c %e %f %g %t) %mass *] + (wegt -.sih p.sih) + :: [%a %nice *] :: ~& [%take-nice-ames sih] +> @@ -274,6 +292,38 @@ :: ~& %dill-wake +> == + :: + ++ wegh + ^- mass + :- %dill + :- %| + :~ all/`[ore hey dug]:all + == + :: + ++ wegt + |= [lal=?(%a %c %e %f %g %t) mas=mass] + ^+ +> + =. hef.all + ?- lal + %a ~?(?=(^ a.hef.all) %double-mass-a hef.all(a `mas)) + %c ~?(?=(^ c.hef.all) %double-mass-c hef.all(c `mas)) + %e ~?(?=(^ e.hef.all) %double-mass-e hef.all(e `mas)) + %f ~?(?=(^ f.hef.all) %double-mass-f hef.all(f `mas)) + %g ~?(?=(^ g.hef.all) %double-mass-g hef.all(g `mas)) + %t ~?(?=(^ t.hef.all) %double-mass-t hef.all(t `mas)) + == + ?. ?& ?=(^ a.hef.all) + ?=(^ c.hef.all) + ?=(^ e.hef.all) + ?=(^ f.hef.all) + ?=(^ g.hef.all) + ?=(^ t.hef.all) + == + +>.$ + %+ done(hef.all [~ ~ ~ ~ ~ ~]) + %mass + => [hef.all d=wegh] + [%vanes %| ~[u.a u.c d u.e u.f u.g u.t]] -- :: ++ ax :: make ++as @@ -317,6 +367,8 @@ ?: ?=([%crud %hax-init [%leaf *] ~] p.q.hic) =+ him=(slav %p (crip p.i.q.p.q.hic)) :_(..^$ ?~(hey.all ~ [u.hey.all %give %init him]~)) + ?: ?=([%crud %hax-heft ~] p.q.hic) + :_(..^$ ?~(hey.all ~ [u.hey.all %slip %d %heft ~]~)) :_(..^$ ?~(hey.all ~ [u.hey.all %slip %d p.q.hic]~)) =. hey.all ?^(hey.all hey.all `hen) ?: ?=(%init -.q.hic) @@ -342,7 +394,9 @@ ~ :: ++ load :: trivial - |= old=axle + |= old=all-axle + ?: ?=(%2 -.old) + $(old [%3 ore hey dug ~ ~ ~ ~ ~ ~]:old) ..^$(all old) :: |= old=* :: diable :: ..^$(ore.all `~zod) @@ -375,4 +429,3 @@ [moz ..^$] -- -:: good test diff --git a/base/arvo/gall.hoon b/base/arvo/gall.hoon index 9c1790dbd..801b89daa 100644 --- a/base/arvo/gall.hoon +++ b/base/arvo/gall.hoon @@ -1035,6 +1035,14 @@ =+ mes=((hard ,[@ud roon]) r.q.hic) =< mo-abet (mo-gawd:(mo-abed:mo our hen) him dap mes) + :: + %wegh + :_ ..^$ :_ ~ + :^ hen %give %mass + :- %gall + :- %| + :~ all/`all + == == :: ++ doze :: sleep until diff --git a/base/arvo/zuse.hoon b/base/arvo/zuse.hoon index faea73c7b..dbc7e16cc 100644 --- a/base/arvo/zuse.hoon +++ b/base/arvo/zuse.hoon @@ -2366,6 +2366,7 @@ == :: ++ flog :: sent to %dill $% [%crud p=@tas q=(list tank)] :: + [%heft ~] :: [%text p=tape] :: [%veer p=@ta q=path r=@t] :: install vane [%vega p=path] :: reboot by path @@ -2378,6 +2379,7 @@ [%blit p=(list blit)] :: terminal output [%init p=@p] :: set owner [%logo ~] :: logout + [%mass p=mass] :: memory usage [%veer p=@ta q=path r=@t] :: install vane [%vega p=path] :: reboot by path [%verb ~] :: verbose mode @@ -2390,6 +2392,7 @@ [%flog p=flog] :: wrapped error [%flow p=@tas q=(list gill)] :: terminal config [%hail ~] :: terminal refresh + [%heft ~] :: memory report [%hook ~] :: this term hung up [%harm ~] :: all terms hung up [%init p=ship] :: after gall ready @@ -2522,7 +2525,7 @@ ++ cush (pair term club) :: internal kiss ++ dude term :: server identity ++ scup (pair ship desk) :: autoupdate -++ well (pair desk term) +++ well (pair desk term) :: ++ suss (trel dude ,@tas ,@da) :: config report :::: :: ++ kiss-gall :: incoming request @@ -2531,9 +2534,11 @@ [%deal p=sock q=cush] :: full transmission [%rote p=sack q=path r=*] :: remote request [%roth p=sack q=path r=*] :: remote response + [%wegh ~] :: report memory == :: ++ gift-gall :: outgoing result - $% [%onto p=(each suss tang)] :: about agent + $% [%mass p=mass] :: memory usage + [%onto p=(each suss tang)] :: about agent [%unto p=cuft] :: within agent [%mack p=(unit tang)] :: message ack == :: diff --git a/base/lib/helm/core.hook b/base/lib/helm/core.hook index b3b9ef60d..c0af457ff 100644 --- a/base/lib/helm/core.hook +++ b/base/lib/helm/core.hook @@ -77,6 +77,10 @@ |= him=ship =< abet (emit %flog /helm %crud %hax-init leaf/(scow %p him) ~) :: + ++ poke-mass + =< abet + (emit %flog /heft %crud %hax-heft ~) + :: ++ poke-start :: start a server |= hood-start =< abet (emit %conf /helm [our dap] %load our syd) @@ -84,6 +88,7 @@ ++ poke-reload :: reload vanes |= all=(list term) =< abet %- emil + %- flop %+ turn all =+ ark=(arch .^(%cy /(scot %p our)/base/(scot %da lat)/arvo)) =+ van=(~(tap by r.ark)) From 7331650ae28e7dfa4aa95bad3eb65b0ab9894aa8 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Mon, 18 May 2015 21:27:39 -0700 Subject: [PATCH 2/3] Fixed starting an app with # *. --- base/ape/hood/core.hook | 4 ++++ base/ape/octo/core.hook | 31 +++++++++++++++---------------- base/ape/ucto/core.hook | 2 +- base/lib/drum/core.hook | 6 +++--- base/lib/sole/core.hook | 4 +++- 5 files changed, 26 insertions(+), 21 deletions(-) diff --git a/base/ape/hood/core.hook b/base/ape/hood/core.hook index f8eac35dd..f73c83de8 100644 --- a/base/ape/hood/core.hook +++ b/base/ape/hood/core.hook @@ -122,6 +122,10 @@ |= [then @uvH (each gage tang)] (ably (take-made:(kiln-work [hid ost src] (able %kiln)) way +<+)) :: +++ init-helm :: + |= [then *] + [~ +>] +:: ++ note-helm :: |= [then (pair ,@tD tank)] (ably (take-note:(helm-work [hid ost src] (able %helm)) way +<+)) diff --git a/base/ape/octo/core.hook b/base/ape/octo/core.hook index aae642bf5..3b4af5bb7 100644 --- a/base/ape/octo/core.hook +++ b/base/ape/octo/core.hook @@ -1,11 +1,11 @@ -:: ::::::::::::::: -:::: /hook/core/octo/ape :: :: :: build - :: ::::::::::::::: +:: :: :: +:::: /hook/core/acto/ape :: :: dependencies + :: :: :: /- *sole :: structures /+ sole :: libraries -:: ::::::::::::::: -:::: :: :: :: logic - !: ::::::::::::::: +:: :: :: +:::: :: :: structures + !: :: :: => |% :: board logic ++ board ,@ :: one-player bitfield ++ point ,[x=@ y=@] :: coordinate @@ -43,9 +43,9 @@ ++ tab ~["+ 1 2 3" (row 0) (row 1) (row 2)] :: print table -- :: -- :: -:: ::::::::::::::: -:::: :: :: :: agent - :: ::::::::::::::: +:: :: :: +:::: :: :: server + :: :: :: => |% :: arvo structures ++ axle ,[%1 eye=face but=tube gam=game] :: agent state ++ axon $?(axle [%0 eye=face gam=game]) :: historical state @@ -146,17 +146,16 @@ ?^ but (park %2 ~) :: [~ %& !who src] (park:(link src !who) %2 `"link by {}") :: ++ peer-sole :: console subscribe - |= [from *] =< abet :: + |= [from pax=path] =< abet :: (plow:(fret +<-) %2 ~) :: ++ poke-sole-action :: console input |= [from act=sole-action] =< abet :: (work:(flet +<-) act) :: -++ poke-octo-move - |= [from wha=point] =< abet - =^ dud gam ~(m ~(at go gam) wha) - ?> dud - =+ mus=~(res go gam) :: - (park(gam ?^(mus *game gam)) %2 mus) +++ poke-octo-move :: + |= [from wha=point] =< abet :: + =^ dud gam ~(m ~(at go gam) wha) :: + ?> dud =+ mus=~(res go gam) :: + (park(gam ?^(mus *game gam)) %2 mus) :: ++ prep |= [from old=(unit ,[(list move) axon])] :: initialize =< abet ?~ old +> :: =< (park %2 ~) :: diff --git a/base/ape/ucto/core.hook b/base/ape/ucto/core.hook index b7d04845f..a22146447 100644 --- a/base/ape/ucto/core.hook +++ b/base/ape/ucto/core.hook @@ -106,7 +106,7 @@ =+ pals |- ^+ +>.^$ ?~ +< +>.^$ :: $(+< t.+<, +>.^$ (~(plow et i.+<) lev mus)) :: :: :: :: -:::: :: :: hooks +:::: :: :: events :: :: :: ++ peer-sole :: console subscribe |= [from *] =< abet :: diff --git a/base/lib/drum/core.hook b/base/lib/drum/core.hook index 7d1f71de0..506fc4e94 100644 --- a/base/lib/drum/core.hook +++ b/base/lib/drum/core.hook @@ -199,7 +199,7 @@ ++ poke-start :: |= wel=well =< se-abet =< se-view - +>(ray (~(put in ray) wel)) + (se-born wel) :: ++ reap :: |= [way=wire saw=(unit tang)] @@ -255,7 +255,7 @@ |- ^+ +> ?~ yar +> =+ hig=(~(get by fur) q.i.yar) - ?: &(?=(^ hig) ?=(^ u.hig) =(p.i.yar syd.u.u.hig)) $(yar t.yar) + ?: &(?=(^ hig) |(?=(~ u.hig) =(p.i.yar syd.u.u.hig))) $(yar t.yar) %= $ yar t.yar +> @@ -335,7 +335,7 @@ ^+ +> ?: (~(has in ray) wel) (se-text "[already running {}/{}]") - +>(ray (~(put in ray) wel)) + +>(ray (~(put in ray) wel), eel (~(put in eel) [our q.wel])) :: ++ se-dump :: print tanks |= tac=(list tank) diff --git a/base/lib/sole/core.hook b/base/lib/sole/core.hook index 0f082cf1f..a406dda21 100644 --- a/base/lib/sole/core.hook +++ b/base/lib/sole/core.hook @@ -101,7 +101,9 @@ ++ receive :: naturalize event |= sole-change ^- [sole-edit sole-share] - ?> &(=(his.ler his.ven) (lte own.ler own.ven)) + ?. &(=(his.ler his.ven) (lte own.ler own.ven)) + ~& [%receive-sync his/[his.ler his.ven] own/[own.ler own.ven]] + !! ?> &(=(his.ler his.ven) (lte own.ler own.ven)) ?> |(!=(own.ler own.ven) =(0 haw) =(haw (sham buf))) =. leg (scag (sub own.ven own.ler) leg) From 9110f4cc3e49a23b654fb9707f2738f35b35b6d8 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Mon, 18 May 2015 21:31:30 -0700 Subject: [PATCH 3/3] Change talk prompt. --- base/ape/talk/core.hook | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/ape/talk/core.hook b/base/ape/talk/core.hook index db413874c..d7b39990a 100644 --- a/base/ape/talk/core.hook +++ b/base/ape/talk/core.hook @@ -237,8 +237,8 @@ ^- tape =+ ^= rew ^- (pair (pair ,@t ,@t) (set partner)) ?~ active.she - [['(' ')'] passive.she] - [['[' ']'] u.active.she] + [[')' '('] passive.she] + [[']' '['] u.active.she] =+ por=~(te-prom te man.she q.rew) (weld `tape`[p.p.rew por] `tape`[q.p.rew ' ' ~]) ::