From ed13febe1b4149c0b0d47d667533cff40cc21767 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Mon, 20 Oct 2014 15:18:01 -0700 Subject: [PATCH 1/3] Comments --- arvo/hoon.hoon | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index d6fa98bdc..b7681a4bc 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -2779,8 +2779,8 @@ :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: section 2eG, parsing (whitespace) :: :: -++ dog ;~(plug dot gay) :: -++ doh ;~(plug ;~(plug hep hep) gay) :: +++ dog ;~(plug dot gay) :: . number separator +++ doh ;~(plug ;~(plug hep hep) gay) :: -- phon separator ++ dun (cold ~ ;~(plug hep hep)) :: -- (phep) to ~ ++ duz (cold ~ ;~(plug tis tis)) :: == (stet) to ~ ++ gah (mask [`@`10 ' ' ~]) :: newline or ace @@ -2845,13 +2845,13 @@ (boss 256 (star qat)) == :: -++ soqs ;~(plug soq soq soq) -++ sym +++ soqs ;~(plug soq soq soq) :: delimiting ''' +++ sym :: symbol %+ cook |=(a=tape (rap 3 ^-((list ,@) a))) ;~(plug low (star ;~(pose nud low hep))) :: -++ ven ;~ (comp |=([a=@ b=@] (peg a b))) +++ ven ;~ (comp |=([a=@ b=@] (peg a b))) :: +>- axis syntax bet =+ hom=`?`| |= tub=nail From e7ea40dd790930e9c029b62875bf86a7731eb63f Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Tue, 21 Oct 2014 19:04:27 -0700 Subject: [PATCH 2/3] h/h refactoring --- arvo/eyre.hoon | 2 +- arvo/hoon.hoon | 37 +++++++------------------------------ arvo/zuse.hoon | 6 +++--- main/app/shell/core.hook | 2 +- main/bin/haus.hoon | 2 +- 5 files changed, 13 insertions(+), 36 deletions(-) diff --git a/arvo/eyre.hoon b/arvo/eyre.hoon index 79be81a1a..72582f9e9 100644 --- a/arvo/eyre.hoon +++ b/arvo/eyre.hoon @@ -794,7 +794,7 @@ ~ :* ^= rob - %- roly + %- role :~ 'User-agent: *' 'Disallow: /' == diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index b7681a4bc..903648b61 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -74,7 +74,6 @@ == :: ++ gate $+(* *) :: general gate ++ hair ,[p=@ud q=@ud] :: parsing trace -++ hapt (list ,@ta) :: XX not used ++ like |* a=_,* :: generic edge |= b=_`*`[(hair) ~] :: :- p=(hair -.b) :: @@ -327,10 +326,6 @@ ++ tyre (list ,[p=term q=twig]) :: ++ tyke (list (unit twig)) :: ++ tram (list ,[p=wing q=twig]) :: -++ tone $% [%0 p=*] :: - [%1 p=(list)] :: - [%2 p=(list ,[@ta *])] :: - == :: :: :::::: virtual nock ++ nock $& [p=nock q=nock] :: autocons $% [%0 p=@] :: axis select @@ -346,6 +341,10 @@ [%10 p=?(@ [p=@ q=nock]) q=nock] :: hint [%11 p=nock] :: grab data from sky == :: +++ tone $% [%0 p=*] :: + [%1 p=(list)] :: + [%2 p=(list ,[@ta *])] :: + == :: ++ toon $% [%0 p=*] :: [%1 p=(list)] :: [%2 p=(list tank)] :: @@ -1875,22 +1874,6 @@ $(a l.a) $(a r.a) :: - +- mer :: puts b in a, sorted - ~/ %mer - |* b=_a - |- ^+ a - ?~ b - a - ?~ a - b - ?. (vor n.a n.b) - $(a b, b a) - ?: =(n.b n.a) - [n.a $(a l.a, b l.b) $(a r.a, b r.b)] - ?: (hor n.b n.a) - $(a [n.a $(a l.a, b [n.b l.b ~]) r.a], b r.b) - $(a [n.a l.a $(a r.a, b [n.b ~ r.b])], b l.b) - :: +- int :: intersection ~/ %int |* b=_a @@ -2173,12 +2156,6 @@ b $(a r.a, b [n.a $(a l.a)]) :: - +- tur :: turn - |* b=$+([* *] *) - |- - ?~ a ~ - [n=[p=p.n.a q=(b p.n.a q.n.a)] l=$(a l.a) r=$(a r.a)] - :: +- uni :: union, merge ~/ %uni |* b=_a @@ -4565,7 +4542,7 @@ !! $(lub res, tez [(end 3 meg lub) tez]) :: -++ roly :: line list to atom +++ role :: line list to atom |= tez=(list ,@t) (rap 3 (turn tez |=(a=@t (cat 3 a 10)))) :: @@ -4582,7 +4559,7 @@ :: %c =+ dst=(lore ((hard ,@) src)) - %- roly + %- role ?+ -.q.don ~|(%unsupported !!) %a ((hard (list ,@t)) q.q.don) %c (lurk dst p.q.don) @@ -4620,7 +4597,7 @@ ?+ pum ~|(%unsupported !!) %a dst %b (jam dst) - %c (roly ((hard (list ,@)) dst)) + %c (role ((hard (list ,@)) dst)) == :: ++ lurk :: apply list patch diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index 1670c24f7..33adf24c2 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -1595,7 +1595,7 @@ ?. con !! %- some :- %ins - %- roly + %- role %- annotate :- us :- th @@ -1696,7 +1696,7 @@ =. lat lut =+ ^= far ^- (map path lobe) - %- ~(tur by (forge par for s t)) + %- ~(urn by (forge par for s t)) |= [k=path v=blob] (blob-to-lobe v) =+ u=(make-yaki [r.par r.for ~] far `@da`0) :: fake yaki :- u @@ -1704,7 +1704,7 @@ =< - %- update-lat :_ ~ - %- ~(tur by q.u) + %- ~(urn by q.u) |= [path k=lobe] (lobe-to-blob k) :: diff --git a/main/app/shell/core.hook b/main/app/shell/core.hook index 3c57153fc..e3f2b3287 100644 --- a/main/app/shell/core.hook +++ b/main/app/shell/core.hook @@ -90,10 +90,10 @@ ;~ pose (stag %run ;~(plug (star ;~(sfix (task(tol %0) bar) ace)) (task col))) (stag %end ;~(pfix sem ;~(pose (stag %& dem) (stag %| sym)))) - (stag %path (full ;~(sfix loca(pax paf) (star ace)))) (stag %del ;~(pfix hep ace loca)) (stag %mut ;~(pfix col ace ;~(plug loca expg))) (stag %ins ;~(pfix lus ace ;~(plug loca (opts expg)))) + (stag %path (full ;~(sfix loca(pax paf) (star ace)))) (stag %var ;~(plug ;~(pfix tis sym) expg)) (stag %rvar ;~(pfix ;~(plug tis tis) sym)) (stag %hoon expr) diff --git a/main/bin/haus.hoon b/main/bin/haus.hoon index ce755e879..1feca4f29 100644 --- a/main/bin/haus.hoon +++ b/main/bin/haus.hoon @@ -51,7 +51,7 @@ ^- _. %= . elf.ful - %- ~(tur by elf.ful) + %- ~(urn by elf.ful) |= [r=room [d=@da n=@ud]] =+ lov=(fall (~(get by lov.par) r) *loft) [d num.lov] From 6fda6d75f1336c8ceadf510c29e564eb77b23fba Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 23 Oct 2014 03:13:10 +0000 Subject: [PATCH 3/3] have eyre convert to json --- arvo/eyre.hoon | 180 ++++++++++++++++++++++++++++--------------------- 1 file changed, 104 insertions(+), 76 deletions(-) diff --git a/arvo/eyre.hoon b/arvo/eyre.hoon index 79be81a1a..be86212c0 100644 --- a/arvo/eyre.hoon +++ b/arvo/eyre.hoon @@ -381,99 +381,72 @@ :: ?(%dumb %mean %nice %rush %rust) ?> ?=([%hoop @ @ @ ?([%mess ~] [%show @ ~])] tea) - =+ ^= ouy - %- yolk:(gale (slav %p i.t.tea) i.t.t.tea) - (slav %ud i.t.t.t.tea) + =+ our=(slav %p i.t.tea) + =* ses i.t.t.tea + =+ nap=(slav %ud i.t.t.t.tea) + =+ ouy=(yolk:(gale our ses) nap) ?~ ouy +>.$ =* mab t.t.t.t.tea =+ woy=(yule:u.ouy ?+(i.mab !! %mess %meg, %show %sub)) - =< abet =< work =< abet ?- -.+.sih %dumb - dumb:woy - %mean - =+ ^= jon - %- jobe - :- [%ok %b |] - ?~ p.+.sih ~ - :+ [%err %s p.u.p.+.sih] - :+ %res %s - %- crip - %+ slag 2 - ^- tape - %+ roll q.u.p.+.sih - |= [p=tank q=tape] - :(weld q "\\n" ~(ram re p)) - ~ - ?~ t.mab - (hear:woy ~ %& %json !>(jon)) - =+ nap=(slav %ud i.t.mab) - =+ sem=(need (~(get by can.sub.siq:beat:u.ouy) nap)) - =. jon - ?. ?=(%show i.t.t.t.t.tea) jon - %- jobe - :~ [%ship %s (rsh 3 1 (scot %p p.hap.sem))] - [%appl %s q.hap.sem] - [%path %s (crip )] - [%data `json`jon] - == - =+ huq=``[%json !>(jon)] - ?~ num.sem (hear:woy huq) - ?- -.u.num.sem - %& - =+ yoo=abet:(busk:(yule:u.ouy %nil) p.u.num.sem 0 huq) - yoo(can.sub.siq (~(put by can.sub.siq.yoo) nap sem(num ~))) - %| - =+ ^= yoo - =< abet - %^ busk:(yule:(hear:(yule:u.ouy %sub) huq) %nil) - p.u.num.sem - 0 - `[%& %json !>((joba %ok %b &))] - yoo(can.sub.siq (~(put by can.sub.siq.yoo) nap sem(num ~))) - == + abet:work:abet:dumb:woy + :: %nice + =< abet =< work =< abet ?. ?=(%mess i.mab) u.ouy (hear:woy ~ %& %json !>((joba %ok %b &))) + :: + %mean + =< abet =< work =< abet + =+ jon=(rong p.+.sih) + ?~ t.mab + (hear:woy ~ %& %json !>(jon)) + =+ can=(slav %ud i.t.mab) + =+ sem=(need (~(get by can.sub.siq:beat:u.ouy) can)) + (soon %& sem u.ouy can %show ?.(?=(%show i.mab) jon (wrap sem jon))) + :: ?(%rust %rush) ?< ?=(~ t.mab) - =+ nap=(slav %ud i.t.mab) - =+ sem=(need (~(get by can.sub.siq:beat:u.ouy) nap)) - ?: &(=(0 nap) =(~ num.sem)) - (hear:woy ~ %& %json !>((joba %reload %b %&))) - =+ ^= cay ^- cage - ?. ?=(%json p.+.sih) - [p.+.sih (slot 3 (spec (slot 3 [typ +.sih])))] - :- %json - !> ^- json - %- jobe - :~ [%ship %s (rsh 3 1 (scot %p p.hap.sem))] - [%appl %s q.hap.sem] - [%path %s (crip )] - [%data (json q.+.sih)] - == - =+ huq=`?:(?=(%rust -.+.sih) [%& cay] [%| cay]) - ?~ num.sem (hear:woy huq) - ?- -.u.num.sem - %& + =+ can=(slav %ud i.t.mab) + =+ sem=(need (~(get by can.sub.siq:beat:u.ouy) can)) + ?: =(0 can) + =< abet =< work =< abet + ?~ num.sem + (hear:woy ~ %& %json !>((joba %reload %b %&))) + ?> -.u.num.sem + =+ huq=``[p.+.sih (slot 3 (spec (slot 3 [typ +.sih])))] =+ yoo=abet:(busk:(yule:u.ouy %nil) p.u.num.sem 0 huq) - yoo(can.sub.siq (~(put by can.sub.siq.yoo) nap sem(num ~))) - %| - =+ ^= yoo - =< abet - %^ busk:(yule:(hear:(yule:u.ouy %sub) huq) %nil) - p.u.num.sem - 0 - `[%& %json !>((joba %ok %b &))] - yoo(can.sub.siq (~(put by can.sub.siq.yoo) nap sem(num ~))) - == + yoo(can.sub.siq (~(put by can.sub.siq.yoo) can sem(num ~))) + ?. ?=(%json p.+.sih) + %^ hooj our ses :^ nap can ?=(%rust -.+.sih) + :+ %cast %json + :+ %done ~ + [p.+.sih (slot 3 (spec (slot 3 [typ +.sih])))] + =< abet =< work =< abet + (soon ?=(%rust -.+.sih) sem u.ouy can %show (wrap sem (json q.+.sih))) == :: %made ?. ?=([%honk @ @ @ ~] tea) - +>.$ + ?. ?=([%hooj @ @ @ @ @ ~] tea) + +>.$ + =+ ^= ouy + %- yolk:(gale (slav %p i.t.tea) i.t.t.tea) + (slav %ud i.t.t.t.tea) + ?~ ouy + +>.$ + =+ can=(slav %ud i.t.t.t.t.tea) + =+ ful=(slav %f i.t.t.t.t.t.tea) + =+ sem=(need (~(get by can.sub.siq:beat:u.ouy) can)) + =< abet =< work =< abet + %^ soon (,? ful) sem :^ u.ouy can %show + %+ wrap sem + ?: ?=(%& -.p.+.sih) + (json q.q.q.p.p.+.sih) + (rong `[%to-json-fail p.p.+.sih]) %- galt [(slav %p i.t.tea) i.t.t.tea (slav %ud i.t.t.t.tea) p.+.sih] :: @@ -730,6 +703,16 @@ [hen %pass [%honk (scot %p our) ses (scot %ud num) ~] %f [%exec our `kas]] == :: + ++ hooj :: ford json request + |= [our=ship ses=hole nap=@ud can=@ud ful=? kas=silk] + %_ +> + mow + :_ mow + :^ hen %pass + ~[%hooj (scot %p our) ses (scot %ud nap) (scot %ud can) (scot %f ful)] + [%f [%exec our `kas]] + == + :: ++ hops :: cancel remote |= [him=ship num=@] ^+ +> @@ -1086,6 +1069,51 @@ ;+ bod == :: + ++ rong + |= are=ares + %- jobe + :- [%ok %b |] + ?~ are ~ + :+ [%err %s p.u.are] + :+ %res %s + %- crip + %+ slag 2 + ^- tape + %+ roll q.u.are + |= [p=tank q=tape] + :(weld q "\\n" ~(ram re p)) + ~ + :: + ++ soon + |= [ful=? sem=stem ouy=_yo:ya can=@ud mab=?(%mess %show) jon=json] + ^+ yo:ya + =+ huq=``[%json !>(jon)] + ?~ num.sem + =+ woy=(yule:ouy ?-(mab %mess %meg, %show %sub)) + (hear:woy huq) + ?- -.u.num.sem + %& + =+ yoo=abet:(busk:(yule:ouy %nil) p.u.num.sem 0 huq) + yoo(can.sub.siq (~(put by can.sub.siq.yoo) can sem(num ~))) + %| + =+ ^= yoo + =< abet + %^ busk:(yule:(hear:(yule:ouy %sub) huq) %nil) + p.u.num.sem + 0 + `[%& %json !>((joba %ok %b &))] + yoo(can.sub.siq (~(put by can.sub.siq.yoo) can sem(num ~))) + == + :: + ++ wrap + |= [sem=stem jon=json] + %- jobe + :~ [%ship %s (rsh 3 1 (scot %p p.hap.sem))] + [%appl %s q.hap.sem] + [%path %s (crip )] + [%data `json`jon] + == + :: ++ ya :: session engine =| [[our=ship ses=hole] serf cyst] =* sef ->-