From 13f5969f043a79fab05217dee01a4b63ee81c8de Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Tue, 8 Sep 2015 16:37:20 -0400 Subject: [PATCH 01/59] add counter to work subscription --- ape/work.hoon | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/ape/work.hoon b/ape/work.hoon index 7cf0b44952..4b3ccff88d 100644 --- a/ape/work.hoon +++ b/ape/work.hoon @@ -24,7 +24,8 @@ :: |_ $: bowl client - connected=_| + connected=_| :: subscribed to talk + count=@ud :: # messages from talk unordered=(map ,[@uvH @u] (pair ship flesh:work-stuff:talk)) == ++ at @@ -114,6 +115,7 @@ %- unit $: client _| + @ud (map ,[@uvH @u] (pair ship flesh:work-stuff:talk)) == ^- [(list move) _+>.$] @@ -124,7 +126,7 @@ ?: connected [~ .] :_ .(connected %&) :_ ~ - [ost %peer /peering [our %talk] /f/(main:talk our)/0] + [ost %peer /peering [our %talk] /f/(main:talk our)/(scot %ud count)] :: ++ process-duty |= [when=@da her=ship from=(set station:talk) action=duty:work-stuff:talk] @@ -309,28 +311,25 @@ abut:send-create:(at | +.cod) == :: -:: XX maybe need to check that we haven't received this message before -:: by keeping a counter of last message received -:: XX definitely do this! -:: XX handle and test the disconnection case -:: +:: XX test the disconnection case ++ diff-talk-report |= [way=wire rep=report:talk] ^- [(list move) _+>.$] ?> ?=(%grams -.rep) |- ^- [(list move) _+>.^$] ?~ q.rep [~ +>.^$] + =. count +(count) =* her p.i.q.rep =* when p.r.q.i.q.rep =* said r.r.q.i.q.rep + ?. ?=(%tax -.said) + $(p.rep +(p.rep), q.rep t.q.rep) =+ ^- from=(set station:talk) %- sa ^- (list station:talk) %+ murn (~(tap by q.q.i.q.rep)) => talk |= [par=partner *] `(unit station)`?.(?=(%& -.par) ~ `p.par) - ?. ?=(%tax -.said) - $(p.rep +(p.rep), q.rep t.q.rep) =^ mos +>.^$ (process-duty when her from +.said) =^ mof +>.^$ $(p.rep +(p.rep), q.rep t.q.rep) [(weld mos mof) +>.^$] From 1b10c2e2046bea6d63432f231ff41eb78c1cea61 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Tue, 8 Sep 2015 13:39:53 -0700 Subject: [PATCH 02/59] fixed dojo for updated ford interface --- ape/dojo.hoon | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ape/dojo.hoon b/ape/dojo.hoon index a6dfb5a946..c3c2a7d6a1 100644 --- a/ape/dojo.hoon +++ b/ape/dojo.hoon @@ -543,8 +543,7 @@ ^- silk :+ %ride gen :- [%$ dy-twig-head] - =+ sur=(turn arc |=(hoof [& +<])) - [%plan [he-beak ~] / zuse sur lib ~ ~] :: XX spur + [%plan [he-beak ~] / zuse arc lib ~ ~] :: XX spur :: ++ dy-step :: advance project |= nex=@ud From 30e1b9e9a47fa7a3de1b9bc5ee326884b223c670 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Tue, 8 Sep 2015 19:31:42 -0400 Subject: [PATCH 03/59] fix comment ownership --- ape/work.hoon | 4 ++-- lib/talk.hoon | 3 ++- sur/talk.hoon | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ape/work.hoon b/ape/work.hoon index 4b3ccff88d..b4cf031580 100644 --- a/ape/work.hoon +++ b/ape/work.hoon @@ -83,7 +83,7 @@ |= up=update ^+ +> ?- -.up - %add ?>(?=(%comment +<.up) (send-change %add-comment +>.up)) + %add ?>(?=(%comment +<.up) (send-change %add-comment our +>.up)) %doer ?- +<.up %release (send-change %set-doer ~) @@ -258,7 +258,7 @@ %set-done tax.u.tax(done ?.(don.meat.action ~ `when)) %add-comment %= tax.u.tax - discussion [[when her com.meat.action] discussion.tax.u.tax] + discussion [[when [who com]:meat.action] discussion.tax.u.tax] == == =+ ooo=(~(get by unordered) id.action +(version.action)) diff --git a/lib/talk.hoon b/lib/talk.hoon index 5bca4c30f0..44bc270338 100644 --- a/lib/talk.hoon +++ b/lib/talk.hoon @@ -52,7 +52,8 @@ %set-tags =+(feh "{(tr-term -.feh)} {}") %set-title =+(feh "{(tr-term -.feh)} {<(trip til)>}") %set-description =+(feh "{(tr-term -.feh)} {<(trip des)>}") - %add-comment =+(feh "{(tr-term -.feh)} {<(trip com)>}") + %add-comment =+ feh + "{(tr-term -.feh)} {(scow %p who)} {<(trip com)>}" == -- -- diff --git a/sur/talk.hoon b/sur/talk.hoon index 8b01ee97ce..f9af2f3142 100644 --- a/sur/talk.hoon +++ b/sur/talk.hoon @@ -93,7 +93,7 @@ [%set-title til=@t] :: set title [%set-description des=@t] :: XX (list ,@t) :: set description [%set-done don=?] :: set done - [%add-comment com=@t] :: XX (list ,@t) :: add comment + [%add-comment who=@p com=@t] :: XX (list ,@t) :: add comment == :: ++ task :: $: id=@uvH :: From 16cb3f396166ac1ce26e4c359b02bd8d38c98083 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Thu, 10 Sep 2015 17:49:22 -0400 Subject: [PATCH 04/59] pull marks from correct ships --- arvo/clay.hoon | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/arvo/clay.hoon b/arvo/clay.hoon index d571d17cbb..3b689009b8 100644 --- a/arvo/clay.hoon +++ b/arvo/clay.hoon @@ -281,7 +281,7 @@ +>.$(byn [[hen ~ [p.mun q.mun syd] r.mun p.dat] byn]) =- +>.$(tag [- tag]) :* hen %pass [%blab p.mun (scot q.mun) syd r.mun] - %f %exec our ~ [our syd q.mun] (lobe-to-silk:ze r.mun p.dat) + %f %exec our ~ [her syd q.mun] (lobe-to-silk:ze r.mun p.dat) == :: ++ bleb :: ship sequence @@ -1938,13 +1938,13 @@ == :: ++ diff-bas - |= [nam=term yak=yaki oth=(pair ship desk) yuk=yaki] + |= [nam=term yak=yaki oth=(trel ship desk case) yuk=yaki] ^+ +> =- %_(+>.$ tag [- tag]) :* hen %pass =+ (cat 3 %diff- nam) [%merge (scot %p p.bob) q.bob (scot %p p.ali) q.ali - ~] - %f %exec p.bob ~ [p.oth q.oth cas.dat] %tabl + %f %exec p.bob ~ [p.oth q.oth r.oth] %tabl ^- (list (pair silk silk)) %+ murn (~(tap by q.bas.dat)) |= [pax=path lob=lobe] @@ -1966,7 +1966,7 @@ :: ++ diff-ali ^+ . - (diff-bas(wat.dat %diff-ali) %ali ali.dat ali bob.dat) + (diff-bas(wat.dat %diff-ali) %ali ali.dat [p.ali q.ali cas.dat] bob.dat) :: ++ diffed-ali |= res=gage @@ -2006,7 +2006,7 @@ :: ++ diff-bob ^+ . - (diff-bas(wat.dat %diff-bob) %bob bob.dat bob ali.dat) + (diff-bas(wat.dat %diff-bob) %bob bob.dat [p.bob q.bob da/now] ali.dat) :: ++ diffed-bob |= res=gage @@ -2052,7 +2052,7 @@ =- %_(+.$ tag [- tag], wat.dat %merge) :* hen %pass [%merge (scot %p p.bob) q.bob (scot %p p.ali) q.ali %merge ~] - %f %exec p.bob ~ [p.bob q.bob cas.dat] %tabl + %f %exec p.bob ~ [p.bob q.bob da/now] %tabl ^- (list (pair silk silk)) %+ turn (~(tap by (~(int by can.dal.dat) can.dob.dat))) |= [pax=path *] @@ -2086,7 +2086,7 @@ =- %_(+ tag [- tag], wat.dat %build) :* hen %pass [%merge (scot %p p.bob) q.bob (scot %p p.ali) q.ali %build ~] - %f %exec p.bob ~ [p.bob q.bob cas.dat] %tabl + %f %exec p.bob ~ [p.bob q.bob da/now] %tabl ^- (list (pair silk silk)) %+ murn (~(tap by bof.dat)) |= [pax=path cay=(unit cage)] @@ -2255,10 +2255,13 @@ |= [pak=(set path) acc=(set path)] (~(uni in acc) pak) =+ zez=ze(ank.dom ank.dat) - =+ val=?:(?=(%init gem.dat) ali bob) + =+ ^- val=beak + ?: ?=(%init gem.dat) + [p.ali q.ali cas.dat] + [p.bob q.bob da/now] :* hen %pass [%merge (scot %p p.bob) q.bob (scot %p p.ali) q.ali %ergo ~] - %f %exec p.bob ~ [p.val q.val cas.dat] %tabl + %f %exec p.bob ~ val %tabl ^- (list (pair silk silk)) %+ turn (~(tap in sum)) |= a=path From f75b8a1370828c16d7d24c84cd8c9f3d34f93c59 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Thu, 10 Sep 2015 18:37:19 -0400 Subject: [PATCH 05/59] change some our's to her's --- arvo/clay.hoon | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/arvo/clay.hoon b/arvo/clay.hoon index 3b689009b8..d5a3b338ea 100644 --- a/arvo/clay.hoon +++ b/arvo/clay.hoon @@ -338,8 +338,8 @@ %_ +>.$ tag :_ tag - :* hen %pass [%ergoing (scot %p our) syd ~] %f - %exec our ~ [our syd %da now] %tabl + :* hen %pass [%ergoing (scot %p her) syd ~] %f + %exec our ~ [her syd %da now] %tabl ^- (list (pair silk silk)) %+ turn `(list path)`mus |= a=path @@ -540,8 +540,8 @@ == ^- (list move) :~ :* hen %pass - [%inserting (scot %p our) syd (scot %da wen) ~] - %f %exec our ~ [our syd %da wen] %tabl + [%inserting (scot %p her) syd (scot %da wen) ~] + %f %exec our ~ [her syd %da wen] %tabl ^- (list (pair silk silk)) %+ turn ins |= [pax=path mis=miso] @@ -551,8 +551,8 @@ [%cast - [%$ p.mis]] == :* hen %pass - [%diffing (scot %p our) syd (scot %da wen) ~] - %f %exec our ~ [our syd %da wen] %tabl + [%diffing (scot %p her) syd (scot %da wen) ~] + %f %exec our ~ [her syd %da wen] %tabl ^- (list (pair silk silk)) %+ turn dif |= [pax=path mis=miso] @@ -563,8 +563,8 @@ [%pact [%$ p.-] [%$ p.mis]] == :* hen %pass - [%castifying (scot %p our) syd (scot %da wen) ~] - %f %exec our ~ [our syd %da wen] %tabl + [%castifying (scot %p her) syd (scot %da wen) ~] + %f %exec our ~ [her syd %da wen] %tabl ^- (list (pair silk silk)) %+ turn mut |= [pax=path mis=miso] @@ -582,8 +582,8 @@ :- hen ?+ -.mis !! %mut - :- [%diffing (scot %p our) syd (scot %da wen) pax] - :^ %f %exec our :+ ~ [our syd %da wen] + :- [%diffing (scot %p her) syd (scot %da wen) pax] + :^ %f %exec our :+ ~ [her syd %da wen] ^- silk :+ %diff (lobe-to-silk:ze pax (~(got by q:(aeon-to-yaki:ze let.dom)) pax)) @@ -592,8 +592,8 @@ [%cast - [%$ p.mis]] :: %ins - :- [%casting (scot %p our) syd (scot %da wen) pax] - :^ %f %exec our :+ ~ [our syd %da wen] + :- [%casting (scot %p her) syd (scot %da wen) pax] + :^ %f %exec our :+ ~ [her syd %da wen] ^- silk =+ (slag (dec (lent pax)) pax) =+ ?~(- %$ i.-) @@ -694,8 +694,8 @@ =- %_(+>.$ tag [- tag]) ^- move :* hen %pass - [%mutating (scot %p our) syd (scot %da wen) ~] - %f %exec our ~ [our syd %da wen] %tabl + [%mutating (scot %p her) syd (scot %da wen) ~] + %f %exec our ~ [her syd %da wen] %tabl ^- (list (pair silk silk)) %+ turn cat |= [pax=path cay=cage] @@ -799,8 +799,8 @@ dok ~ tag :_ tag - :* hen %pass [%ergoing (scot %p our) syd ~] %f - %exec our ~ [our syd %da now] %tabl + :* hen %pass [%ergoing (scot %p her) syd ~] %f + %exec our ~ [her syd %da now] %tabl ^- (list (pair silk silk)) %+ turn (~(tap in sum)) |= a=path @@ -857,8 +857,8 @@ %_ +>.$ tag :_ tag - :* hen %pass [%patching (scot %p our) syd ~] %f - %exec our :^ ~ [our syd %da now] %tabl + :* hen %pass [%patching (scot %p her) syd ~] %f + %exec our :^ ~ [her syd %da now] %tabl ^- (list (pair silk silk)) %+ turn (~(tap by hat)) |= [a=path b=lobe] From 3251e471b4c75bd6e5ff6a11d0feb773b787c69e Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Thu, 10 Sep 2015 16:01:43 -0700 Subject: [PATCH 06/59] POST/PUT dojo sink --- ape/dojo.hoon | 158 +++++++++++++++++++++++++------------------------- mar/atom.hoon | 2 +- 2 files changed, 81 insertions(+), 79 deletions(-) diff --git a/ape/dojo.hoon b/ape/dojo.hoon index 1040539472..1073f7b05f 100644 --- a/ape/dojo.hoon +++ b/ape/dojo.hoon @@ -27,6 +27,7 @@ [%pill p=path q=dojo-source] :: noun to unix pill :: [%tree p=path q=dojo-source] :: noun to unix tree [%file p=beam q=dojo-source] :: save to clay + [%http p=?(%post %put) q=purl r=dojo-source] :: http outbound [%poke p=goal q=dojo-source] :: make and poke [%show p=dojo-source] :: print [%verb p=term q=(unit dojo-source)] :: store variable @@ -87,7 +88,7 @@ ++ card :: general card $% [%diff %sole-effect sole-effect] :: [%send wire [ship term] clap] :: - [%hiss wire mark [%purl purl]] :: + [%hiss wire mark [%hiss hiss]] :: [%exec wire @p (unit ,[beak silk])] :: [%deal wire sock term club] :: [%info wire @p toro] :: @@ -108,67 +109,49 @@ |_ [[ost=bone moz=(list move)] session] :: ++ dp :: dojo parser |% + ++ dp-default-app %hood + ++ dp-generator ,[?(%ge %di %sc) [@u span p=path] dojo-config] + ++ dp-specify + |= [a=goal b=dp-generator] + ^- (pair goal dojo-source) + =. p.b [q.a p.b] + [a [0 ?-(-.b %ge [%ge +.b], %di [%di +.b], %sc [%sc +.b])]] + :: ++ dp-command-line ;~(sfix dp-command (just '\0a')) ++ dp-command :: ++dojo-command %+ knee *dojo-command |. ~+ ;~ pose - ;~ pfix bar - %+ cook - |= [a=path b=dojo-config] - ^- dojo-command - [%poke [our.hid %hood] [0 %ge [0 [%cat %hood a]] b]] - ;~(plug (most fas sym) dp-config) + ;~ plug (cold %poke bar) + %+ cook dp-specify + %+ stag [our.hid dp-default-app] + (stag %ge dp-model-cat) == :: ;~ plug (cold %poke col) %+ cook - |= [a=goal b=(each dojo-source (trel term path dojo-config))] + |= [a=goal b=(each dojo-source dp-generator)] ^- (pair goal dojo-source) - :- a - ?- -.b - %& p.b - %| ?+ p.p.b !! - %di [0 %di [0 [%dog q.a q.p.b]] r.p.b] - %ge [0 %ge [0 [%cat q.a q.p.b]] r.p.b] - %sc [0 %sc [0 [%pig q.a q.p.b]] r.p.b] - == - == + ?~ -.b [a p.b] + (dp-specify a p.b) ;~ plug dp-goal - %+ pick ;~(pfix ace dp-source) - ;~ plug - ;~ pose - (cold %di wut) - (cold %ge lus) - (cold %sc pam) - == - (most fas sym) - dp-config + ;~ pose + (stag %& ;~(pfix ace dp-source)) + (stag %| ;~(plug (cold %ge bar) dp-model-cat)) + (stag %| ;~(plug (cold %di lus) dp-model-dog)) + (stag %| ;~(plug (cold %sc pam) dp-model-pig)) == == == :: - ;~ plug (cold %verb tis) - ;~(plug sym (punt ;~(pfix ace dp-source))) - == - :: - ;~ pfix fas - %+ cook - |=(a=(list twig) `dojo-command`[%verb %dir ~ [0 %ex %clsg a]]) - dp-poor - == - :: - ;~ plug (cold %file tar) - ;~((glue ace) dp-beam dp-source) - == - :: - ;~ plug (cold %flat pat) - ;~((glue ace) (most fas sym) dp-source) - == - :: - ;~ plug (cold %pill dot) - ;~((glue ace) (most fas sym) dp-source) - == + ;~(plug (cold %file tar) dp-beam ;~(pfix ace dp-source)) + ;~(plug (cold %flat pat) (most fas sym) ;~(pfix ace dp-source)) + ;~(plug (cold %pill dot) (most fas sym) ;~(pfix ace dp-source)) + ;~(plug (cold %http lus) (easy %post) auri:epur ;~(pfix ace dp-source)) + ;~(plug (cold %http hep) (easy %put) auri:epur ;~(pfix ace dp-source)) + ;~(plug (cold %verb tis) sym (punt ;~(pfix ace dp-source))) + =< ;~(plug (cold %verb fas) (cook . dp-poor)) + |=(a=(list twig) [%dir ~ [0 %ex %clsg a]]) :: (stag %show dp-source) == @@ -187,11 +170,11 @@ %+ cook |=(a=goal a) ;~ pose ;~ plug - ;~(pfix sig fed:ag) - ;~(pfix fas sym) + ;~(pfix sig fed:ag) + ;~(pose ;~(pfix fas sym) (easy dp-default-app)) == - (cook |=(a=term `goal`[our.hid a]) sym) - (easy [our.hid %hood]) + %+ stag our.hid + ;~(pose sym (easy dp-default-app)) == ++ dp-beam :: ++beam %+ sear tome @@ -238,10 +221,10 @@ (he-card(poy `+>+<(pux `way)) %exec way our.hid `[he-beak kas]) :: ++ dy-eyre :: send work to eyre - |= [way=wire req=[%purl purl]] + |= [way=wire req=hiss] ^+ +>+> ?> ?=(~ pux) - (he-card(poy `+>+<(pux `way)) %hiss way %httr req) + (he-card(poy `+>+<(pux `way)) %hiss way %httr %hiss req) :: ++ dy-stop :: stop work ^+ +> @@ -267,12 +250,16 @@ |= mad=dojo-command ^+ [mad +>] ?- -.mad - %file =^(src +>.$ (dy-init-source q.mad) [[%file p.mad src] +>.$]) - %flat =^(src +>.$ (dy-init-source q.mad) [[%flat p.mad src] +>.$]) - %pill =^(src +>.$ (dy-init-source q.mad) [[%pill p.mad src] +>.$]) - %poke =^(src +>.$ (dy-init-source q.mad) [[%poke p.mad src] +>.$]) - %show =^(src +>.$ (dy-init-source p.mad) [[%show src] +>.$]) - %verb =^(src +>.$ (dy-init-source-unit q.mad) [[%verb p.mad src] +>.$]) + %file =^(src +>.$ (dy-init-source q.mad) [mad(q src) +>.$]) + %flat =^(src +>.$ (dy-init-source q.mad) [mad(q src) +>.$]) + %pill =^(src +>.$ (dy-init-source q.mad) [mad(q src) +>.$]) + %poke =^(src +>.$ (dy-init-source q.mad) [mad(q src) +>.$]) + %show =^(src +>.$ (dy-init-source p.mad) [mad(p src) +>.$]) + %verb =^(src +>.$ (dy-init-source-unit q.mad) [mad(q src) +>.$]) + %http + =. r.mad [0 %fi %mime r.mad] + =^ src +>.$ (dy-init-source r.mad) + [mad(r src) +>.$] == :: ++ dy-init-source-unit :: (unit dojo-source) @@ -445,20 +432,30 @@ =- +(..dy (he-diff %tan - ~)) rose/[" " `~]^~[leaf/"=%" (smyt (tope he-beak s.dir))] == + :: + %http + =+ cay=(~(got by rez) p.r.mad) + ?> ?=(%mime p.cay) + =+ mim=;;(mime q.q.cay) + =+ maf=(~(add ja *math) content-type/(moon p.mim)) + (dy-eyre /show [q.mad p.mad maf ~ q.mim]) :: %show - =+ cay=(~(got by rez) p.p.mad) - %+ dy-rash %tan - ?+ p.cay [(sell q.cay)]~ - %tang ;;(tang q.q.cay) - %httr - =+ hit=;;(httr q.q.cay) - =- (flop (turn `wall`- |=(a=tape leaf/(dash:ut a '')))) - :- "HTTP {}" - %+ weld - (turn q.hit |=([a=@t b=@t] "{(trip a)}: {(trip b)}")) - (turn `wain`?~(r.hit ~ (lore q.u.r.hit)) trip) - == + (dy-show (~(got by rez) p.p.mad)) + == + :: + ++ dy-show + |= cay=cage + %+ dy-rash %tan + ?+ p.cay [(sell q.cay)]~ + %tang ;;(tang q.q.cay) + %httr + =+ hit=;;(httr q.q.cay) + =- (flop (turn `wall`- |=(a=tape leaf/(dash:ut a '')))) + :- "HTTP {}" + %+ weld + (turn q.hit |=([a=@t b=@t] "{(trip a)}: {(trip b)}")) + (turn `wain`?~(r.hit ~ (lore q.u.r.hit)) trip) == :: ++ dy-edit :: handle edit @@ -550,7 +547,7 @@ ?> ?=(^ cud) =+ bil=q.u.cud :: XX =* ?: ?=(%ur -.bil) - (dy-eyre /hand %purl p.bil) + (dy-eyre /hand [p.bil %get ~ ~]) %- dy-ford ^- (pair path silk) ?+ -.bil !! @@ -700,12 +697,17 @@ %tabl !! == :: - ++ he-sigh :: result from ford + ++ he-sigh :: result from eyre |= [way=wire hit=httr] ^+ +> ?> ?=(^ poy) - ?> ?=([%hand ~] way) :: XX options? - he-pine:(~(dy-hand dy u.poy(pux ~)) %httr !>(hit)) + =< he-pine + %. [%httr !>(hit)] + =+ dye=~(. dy u.poy(pux ~)) + ?+ way !! + [%hand ~] dy-hand:dye + [%show ~] dy-show:dye + == :: ++ he-unto :: result from behn |= [way=wire cit=cuft] @@ -789,13 +791,13 @@ -- :: ++ prep - =+ sosh==+(*session ,[_say syd=desk * (unit) _|3.-]) + =+ session-0==+(*session ,[_say syd=desk * (unit) _|3.-]) :: ,_`..prep - |= old=(unit ?(house [%0 p=(map bone sosh)])) ^+ [~ ..prep] + |= old=(unit ?(house [%0 p=(map bone session-0)])) ^+ [~ ..prep] ?~ old `..prep ?: ?=(%1 -.u.old) `..prep(+<+ u.old) =< ^$(u.old [%1 (~(run by p.u.old) .)]) - |= sos=sosh ^- session + |= sos=session-0 ^- session =- ~! [%*(. *session poy *(unit)) -] - [-.sos [[our.hid syd.sos ud/0] /] ~ |4.sos] :: diff --git a/mar/atom.hoon b/mar/atom.hoon index 562c504e10..f68149061b 100644 --- a/mar/atom.hoon +++ b/mar/atom.hoon @@ -7,7 +7,7 @@ |_ ato=@ ++ grab |% ++ noun ,@ - ++ mime |=([^ p=octs] q.p) + ++ mime |=([* p=octs] q.p) -- ++ grow |% ++ mime [/aplication/x-urb-unknown (taco ato)] From 73a5596168f15a8879c95245dc669d1b237beefb Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Thu, 10 Sep 2015 20:25:27 -0400 Subject: [PATCH 07/59] %init doesn't require new desk --- arvo/clay.hoon | 51 ++++++++++++++++++++++++-------------------------- arvo/zuse.hoon | 10 +++++++++- lib/kiln.hoon | 2 +- 3 files changed, 34 insertions(+), 29 deletions(-) diff --git a/arvo/clay.hoon b/arvo/clay.hoon index d5a3b338ea..f6c8f9bf37 100644 --- a/arvo/clay.hoon +++ b/arvo/clay.hoon @@ -1786,37 +1786,10 @@ |- ?- gem.dat %init - ?. =(let.dom 0) - (error:he %bad-init-merge ~) - :: skim hook/hoon files =. new.dat ali.dat =. hut.ran (~(put by hut.ran) r.new.dat new.dat) =. erg.dat (~(run by q.ali.dat) |=(lobe %&)) checkout - :: - %fine - ?: =(r.ali.dat r.bob.dat) - :: ~& [%fine-trivial ali= bob= r.ali.dat r.bob.dat] - done:he - ?: (~(has in (reachable-takos r.bob.dat)) r.ali.dat) - :: ~& [%fine-mostly-trivial ali= bob=] - done:he - ?. (~(has in (reachable-takos r.ali.dat)) r.bob.dat) - :: ~& [%fine-not-so-trivial ali= bob=] - (error:he %bad-fine-merge ~) - :: ~& [%fine-lets-go ali= bob=] - =. new.dat ali.dat - =. erg.dat - %- mo ^- (list ,[path ?]) - %+ murn (~(tap by (~(uni by q.bob.dat) q.ali.dat))) - |= [pax=path lob=lobe] - ^- (unit ,[path ?]) - =+ a=(~(get by q.ali.dat) pax) - =+ b=(~(get by q.bob.dat) pax) - ?: =(a b) - ~ - `[pax !=(~ a)] - checkout :: %this ?: =(r.ali.dat r.bob.dat) done:he @@ -1841,6 +1814,30 @@ ~ `[pax !=(~ a)] checkout + :: + %fine + ?: =(r.ali.dat r.bob.dat) + :: ~& [%fine-trivial ali= bob= r.ali.dat r.bob.dat] + done:he + ?: (~(has in (reachable-takos r.bob.dat)) r.ali.dat) + :: ~& [%fine-mostly-trivial ali= bob=] + done:he + ?. (~(has in (reachable-takos r.ali.dat)) r.bob.dat) + :: ~& [%fine-not-so-trivial ali= bob=] + (error:he %bad-fine-merge ~) + :: ~& [%fine-lets-go ali= bob=] + =. new.dat ali.dat + =. erg.dat + %- mo ^- (list ,[path ?]) + %+ murn (~(tap by (~(uni by q.bob.dat) q.ali.dat))) + |= [pax=path lob=lobe] + ^- (unit ,[path ?]) + =+ a=(~(get by q.ali.dat) pax) + =+ b=(~(get by q.bob.dat) pax) + ?: =(a b) + ~ + `[pax !=(~ a)] + checkout :: ?(%meet %mate %meld) ?: =(r.ali.dat r.bob.dat) diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index 6594da4161..f6d71674f9 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -1984,7 +1984,15 @@ == :: ++ gilt ,[@tas *] :: presumed gift ++ gens ,[p=lang q=gcos] :: general identity -++ germ ?(%init %fine %that %this %mate %meet %meld) :: merge style +++ germ :: merge style + $? %init :: new desk + %this :: ours with parents + %that :: hers with parents + %fine :: fast forward + %meet :: orthogonal files + %mate :: orthogonal changes + %meld :: force merge + == :: ++ gcos :: id description $% [%czar ~] :: 8-bit ship [%duke p=what] :: 32-bit ship diff --git a/lib/kiln.hoon b/lib/kiln.hoon index 1321905f39..b291940e21 100644 --- a/lib/kiln.hoon +++ b/lib/kiln.hoon @@ -419,7 +419,7 @@ => =+ :- "%mate merge failed with conflicts," "setting up scratch space at %{(trip tic)}" [tic=tic (spam leaf/-< leaf/-> q.p.are)] - (fancy-merge tic our syd %that) + (fancy-merge tic our syd %init) == :: ++ tape-to-tanks From 86a423b4d4f016a632f70277020ee3fd67ffadd5 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Fri, 11 Sep 2015 10:54:28 -0700 Subject: [PATCH 08/59] better mark type handling --- arvo/ford.hoon | 15 +++++++++------ cat/hello.hoon | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/arvo/ford.hoon b/arvo/ford.hoon index 5b35304d23..aff8b8c2d9 100644 --- a/arvo/ford.hoon +++ b/arvo/ford.hoon @@ -993,9 +993,10 @@ (fine cof [%atom %t] u.mas) %+ cope (fang cof for) |= [cof=cafe tux=vase] - =+ bob=(slot 6 tux) - ?: (~(nest ut p.bob) | p.sam) - (fine cof sam) + =+ typ=p:(slot 6 tux) + =. typ ?+(-.typ typ %face q.typ) :: XX vulcanization + ?: (~(nest ut typ) | p.sam) + (fine cof typ q.sam) ?. (slob %grab p.tux) (flaw cof [%leaf "ford: no grab: {<[for bek]>}"]~) =+ gab=(slap tux [%cnzy %grab]) @@ -1003,9 +1004,9 @@ (flaw cof [%leaf "ford: no noun: {<[for bek]>}"]~) %+ cope (maul cof (slap gab [%cnzy %noun]) [%noun q.sam]) |= [cof=cafe pro=vase] - ?> (~(nest ut p.bob) | p.pro) + ?> (~(nest ut typ) | p.pro) ?: =(q.pro q.sam) - (fine cof p.bob q.pro) + (fine cof typ q.pro) (flaw cof [%leaf "ford: invalid content: {<[for bek]>}"]~) :: ++ lamp :: normalize version @@ -1285,7 +1286,9 @@ (fine cof %& p.kas [%atom %t] '') %+ cope (fang cof p.kas) |= [cof=cafe tux=vase] - (fine cof [%& p.kas (slot 6 tux)]) + =+ [typ=p val=q]:(slot 6 tux) + =. typ ?+(-.typ typ %face q.typ) :: XX vulcanization + (fine cof [%& p.kas [typ val]]) :: %call :: %+ cool |.(leaf/"ford: call {<`@p`(mug kas)>}") diff --git a/cat/hello.hoon b/cat/hello.hoon index 9f0d990edb..2354fad43e 100644 --- a/cat/hello.hoon +++ b/cat/hello.hoon @@ -5,6 +5,6 @@ :: :::: !: -|= [* [[txt=@tas ~] ~]] +|= [^ [[txt=@tas ~] ~]] :- %noun (crip (weld "hello, " (flop (trip txt)))) From 05e37b73b67012e834becb71a9d4ae6601254cc6 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Fri, 11 Sep 2015 12:20:19 -0700 Subject: [PATCH 09/59] extensible urb.onupdate --- arvo/eyre.hoon | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arvo/eyre.hoon b/arvo/eyre.hoon index fc286b44de..8d0b4f3c16 100644 --- a/arvo/eyre.hoon +++ b/arvo/eyre.hoon @@ -355,7 +355,7 @@ if(this.status !== 205) { return urb.keep() } - document.location.reload() + urb.onupdate() }) urb.wreq.addEventListener('error', urb.keep) urb.wreq.addEventListener('abort', urb.keep) @@ -365,6 +365,7 @@ setTimeout(urb.call,1000*urb.tries) urb.tries++ } + urb.onupdate = function(){document.location.reload()} urb.call() urb.wasp = function(deh){ var old = /[^/]*$/.exec(urb.wurl)[0] From e58446f0bd8c0469fe0543e8593c5ff6306a4cd4 Mon Sep 17 00:00:00 2001 From: Raymond Pasco Date: Fri, 11 Sep 2015 16:47:53 -0400 Subject: [PATCH 10/59] Update rune doc ford page to use lib namespace --- pub/doc/hoon/runes/index.hook | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pub/doc/hoon/runes/index.hook b/pub/doc/hoon/runes/index.hook index 0ec0f598d3..a009b83ba5 100644 --- a/pub/doc/hoon/runes/index.hook +++ b/pub/doc/hoon/runes/index.hook @@ -1,8 +1,8 @@ /+ tree /: /%%/ /% /^ [tip=marl sub=(map span marl) ~] - /. /; (getall %h1 ~) /elem/ - /_ /; (getall %h1 ~) /elem/ + /. /; (getall:tree %h1 ~) /elem/ + /_ /; (getall:tree %h1 ~) /elem/ == !: :::: From 0964b3fd6d70f11e950a4e6726a9b6fedb8b9821 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Fri, 11 Sep 2015 14:15:25 -0700 Subject: [PATCH 11/59] cat/dog to gen collapse --- ape/dojo.hoon | 131 +++++++++++------------- {cat => gen}/bit/act.hoon | 0 {cat => gen}/bit/address-contact.hoon | 1 + {cat => gen}/bit/auth.hoon | 1 + {cat => gen}/bit/buy.hoon | 1 + {cat => gen}/bit/contact-address.hoon | 1 + {cat => gen}/bit/list.hoon | 1 + {cat => gen}/bit/sell.hoon | 1 + {cat => gen}/bit/send.hoon | 1 + {cat => gen}/cat.hoon | 3 +- {cat => gen}/cat/pretty.hoon | 0 {cat => gen}/coin/keys.hoon | 1 + {cat => gen}/curl/url.hoon | 1 + {cat => gen}/hello.hoon | 3 +- {dog => gen}/hood/begin.hoon | 1 + {cat => gen}/hood/breload.hoon | 3 +- {cat => gen}/hood/cp.hoon | 1 + {cat => gen}/hood/hi.hoon | 1 + {cat => gen}/hood/init.hoon | 3 +- {cat => gen}/hood/invite.hoon | 3 +- {cat => gen}/hood/label.hoon | 3 +- {cat => gen}/hood/link.hoon | 3 +- {cat => gen}/hood/mass.hoon | 3 +- {cat => gen}/hood/merge.hoon | 3 +- {cat => gen}/hood/mount.hoon | 3 +- {cat => gen}/hood/mv.hoon | 1 + {cat => gen}/hood/rc.hoon | 3 +- {cat => gen}/hood/reboot.hoon | 3 +- {cat => gen}/hood/reload-desk.hoon | 3 +- {cat => gen}/hood/reload.hoon | 3 +- {cat => gen}/hood/reset.hoon | 3 +- {cat => gen}/hood/rf.hoon | 3 +- {cat => gen}/hood/rm.hoon | 1 + {cat => gen}/hood/schedule.hoon | 1 + {cat => gen}/hood/start.hoon | 3 +- {cat => gen}/hood/sync.hoon | 3 +- {cat => gen}/hood/unix.hoon | 3 +- {cat => gen}/hood/unmount.hoon | 3 +- {cat => gen}/hood/unsync.hoon | 3 +- {cat => gen}/hood/verb.hoon | 1 + {cat => gen}/ls.hoon | 3 +- {cat => gen}/ls/subdir.hoon | 0 gen/make.hoon | 2 + gen/pope.hoon | 24 +++++ {cat => gen}/solid.hoon | 3 +- {cat => gen}/ticket.hoon | 3 +- {cat => gen}/tree.hoon | 3 +- {cat => gen}/twit/as.hoon | 1 + {dog => gen}/twit/auth.hoon | 1 + {dog => gen}/twit/auth/hoontap-keys.txt | 0 {cat => gen}/twit/tweet.hoon | 0 {cat => gen}/twit/twitter-feed.hoon | 1 + sur/sole.hoon | 103 ++++++++++++------- 53 files changed, 217 insertions(+), 137 deletions(-) rename {cat => gen}/bit/act.hoon (100%) rename {cat => gen}/bit/address-contact.hoon (93%) rename {cat => gen}/bit/auth.hoon (92%) rename {cat => gen}/bit/buy.hoon (91%) rename {cat => gen}/bit/contact-address.hoon (93%) rename {cat => gen}/bit/list.hoon (87%) rename {cat => gen}/bit/sell.hoon (91%) rename {cat => gen}/bit/send.hoon (90%) rename {cat => gen}/cat.hoon (95%) rename {cat => gen}/cat/pretty.hoon (100%) rename {cat => gen}/coin/keys.hoon (89%) rename {cat => gen}/curl/url.hoon (90%) rename {cat => gen}/hello.hoon (77%) rename {dog => gen}/hood/begin.hoon (99%) rename {cat => gen}/hood/breload.hoon (78%) rename {cat => gen}/hood/cp.hoon (86%) rename {cat => gen}/hood/hi.hoon (89%) rename {cat => gen}/hood/init.hoon (74%) rename {cat => gen}/hood/invite.hoon (77%) rename {cat => gen}/hood/label.hoon (79%) rename {cat => gen}/hood/link.hoon (84%) rename {cat => gen}/hood/mass.hoon (75%) rename {cat => gen}/hood/merge.hoon (95%) rename {cat => gen}/hood/mount.hoon (85%) rename {cat => gen}/hood/mv.hoon (86%) rename {cat => gen}/hood/rc.hoon (75%) rename {cat => gen}/hood/reboot.hoon (78%) rename {cat => gen}/hood/reload-desk.hoon (78%) rename {cat => gen}/hood/reload.hoon (76%) rename {cat => gen}/hood/reset.hoon (74%) rename {cat => gen}/hood/rf.hoon (75%) rename {cat => gen}/hood/rm.hoon (81%) rename {cat => gen}/hood/schedule.hoon (88%) rename {cat => gen}/hood/start.hoon (85%) rename {cat => gen}/hood/sync.hoon (81%) rename {cat => gen}/hood/unix.hoon (81%) rename {cat => gen}/hood/unmount.hoon (78%) rename {cat => gen}/hood/unsync.hoon (80%) rename {cat => gen}/hood/verb.hoon (94%) rename {cat => gen}/ls.hoon (85%) rename {cat => gen}/ls/subdir.hoon (100%) create mode 100644 gen/make.hoon create mode 100644 gen/pope.hoon rename {cat => gen}/solid.hoon (96%) rename {cat => gen}/ticket.hoon (84%) rename {cat => gen}/tree.hoon (92%) rename {cat => gen}/twit/as.hoon (94%) rename {dog => gen}/twit/auth.hoon (98%) rename {dog => gen}/twit/auth/hoontap-keys.txt (100%) rename {cat => gen}/twit/tweet.hoon (100%) rename {cat => gen}/twit/twitter-feed.hoon (98%) diff --git a/ape/dojo.hoon b/ape/dojo.hoon index 1073f7b05f..1cb2660aad 100644 --- a/ape/dojo.hoon +++ b/ape/dojo.hoon @@ -10,7 +10,7 @@ !: :: :: => |% :: external structures ++ house :: all state - $: %1 + $: %2 hoc=(map bone session) :: conversations == :: ++ session :: per conversation @@ -37,13 +37,10 @@ q=dojo-build :: general build == :: ++ dojo-build :: one ford step - $% [%ec p=mark q=twig] :: caged expression - [%ex p=twig] :: hoon expression - [%di p=dojo-model] :: dialog + $% [%ex p=twig] :: hoon expression [%dv p=path] :: gate from source [%fi p=dojo-filter q=dojo-source] :: filter [%ge p=dojo-model] :: generator - [%sc p=dojo-model] :: script [%tu p=(list dojo-source)] :: tuple [%ur p=purl] :: http GET request == :: @@ -110,12 +107,10 @@ ++ dp :: dojo parser |% ++ dp-default-app %hood - ++ dp-generator ,[?(%ge %di %sc) [@u span p=path] dojo-config] ++ dp-specify - |= [a=goal b=dp-generator] + |= [gol=goal mod=dojo-model] ^- (pair goal dojo-source) - =. p.b [q.a p.b] - [a [0 ?-(-.b %ge [%ge +.b], %di [%di +.b], %sc [%sc +.b])]] + [gol [0 [%ge mod(q.p [q.gol q.p.mod])]]] :: ++ dp-command-line ;~(sfix dp-command (just '\0a')) ++ dp-command :: ++dojo-command @@ -123,23 +118,20 @@ ;~ pose ;~ plug (cold %poke bar) %+ cook dp-specify - %+ stag [our.hid dp-default-app] - (stag %ge dp-model-cat) + (stag [our.hid dp-default-app] dp-model) == :: ;~ plug (cold %poke col) %+ cook - |= [a=goal b=(each dojo-source dp-generator)] + |= [a=goal b=$&(dojo-model dojo-source)] ^- (pair goal dojo-source) - ?~ -.b [a p.b] - (dp-specify a p.b) + ?@ -.b [a b] + (dp-specify a b) ;~ plug dp-goal ;~ pose - (stag %& ;~(pfix ace dp-source)) - (stag %| ;~(plug (cold %ge bar) dp-model-cat)) - (stag %| ;~(plug (cold %di lus) dp-model-dog)) - (stag %| ;~(plug (cold %sc pam) dp-model-pig)) + ;~(pfix bar dp-model) + ;~(pfix ace dp-source) == == == @@ -159,8 +151,8 @@ ++ dp-build :: ++dojo-build %+ knee *dojo-build |. ~+ ;~ pose - ;~(pfix lus ;~(pose (stag %ur auri:epur) (stag %ge dp-model-cat))) - ;~(plug (cold %di wut) dp-model-dog) + ;~(plug (cold %ge lus) dp-model) + ;~(plug (cold %ur lus) auri:epur) ;~(plug (cold %fi cab) ;~((glue ace) dp-filter dp-source)) dp-value == @@ -181,16 +173,11 @@ =+ vez=(vang & dp-path) (sear plex:vez (stag %clsg poor:vez)) :: - ++ dp-model-cat ;~(plug dp-server-cat dp-config) :: ++dojo-model - ++ dp-model-dog ;~(plug dp-server-dog dp-config) :: ++dojo-model - ++ dp-model-pig ;~(plug dp-server-pig dp-config) :: ++dojo-model - ++ dp-path (tope he-beam) :: ++path - ++ dp-server-cat (stag 0 (stag %cat dp-device)) :: ++dojo-server - ++ dp-server-dog (stag 0 (stag %dog dp-device)) :: ++dojo-server - ++ dp-server-pig (stag 0 (stag %pig dp-device)) :: ++dojo-server - ++ dp-twig tall:(vang & dp-path) :: ++twig - ++ dp-poor poor:(vang & (tope dir)) :: (list ++twig) - ++ dp-device (most fas sym) :: ++dojo-device + ++ dp-model ;~(plug dp-server dp-config) :: ++dojo-model + ++ dp-path (tope he-beam) :: ++path + ++ dp-server (stag 0 (most fas sym)) :: ++dojo-server + ++ dp-twig tall:(vang & dp-path) :: ++twig + ++ dp-poor poor:(vang & (tope dir)) :: (list ++twig) ++ dp-value :: ++dojo-source ;~ pose (stag %tu (ifix [kel ker] (most ace dp-source))) @@ -282,14 +269,11 @@ |= bul=dojo-build ^+ [bul +>] ?- -.bul - %ec [bul +>.$] %ex [bul +>.$] - %di =^(mod +>.$ (dy-init-model p.bul) [[%di mod] +>.$]) %dv [bul +>.$] %fi =^ mor +>.$ (dy-init-source q.bul) [bul(q mor) +>.$] %ge =^(mod +>.$ (dy-init-model p.bul) [[%ge mod] +>.$]) - %sc !! %ur [bul +>.$] %tu =^ dof +>.$ |- ^+ [p.bul +>.^$] @@ -310,7 +294,7 @@ ++ dy-init-server :: ++dojo-server |= srv=dojo-server =. p.srv num - [srv +>.$(num +(num), job (~(put by job) num [%dv q.srv]))] + [srv +>.$(num +(num), job (~(put by job) num [%dv [%gen q.srv]]))] :: ++ dy-init-config :: prepare config |= cig=dojo-config @@ -477,34 +461,33 @@ :: ++ dy-cage |=(num=@ud (~(got by rez) num)) :: known cage ++ dy-vase |=(num=@ud q:(dy-cage num)) :: known vase - ++ dy-silk-vase |=(vax=vase [%$ %noun vax]) :: vase to silk - ++ dy-silk-config :: configure - |= [cag=cage cig=dojo-config] - ^- silk - :+ %ride [%cnzy %$] - :+ %mute [%$ cag] - ^- (list (pair wing silk)) - :* :- [[~ 12] ~] - (dy-silk-vase !>([now=now.hid eny=eny.hid bec=he-beak])) - :: - :- [[~ 26] ~] - %- dy-silk-vase - |- ^- vase - ?~ p.cig !>(~) - (slop (dy-vase p.i.p.cig) $(p.cig t.p.cig)) - :: - %+ turn (~(tap by q.cig)) - |= [a=term b=(unit dojo-source)] - ^- (pair wing silk) - :- [a [~ 27] ~] - %- dy-silk-vase - ?~(b !>([~ ~]) (dy-vase p.u.b)) - == + ++ dy-silk-vase |=(vax=vase [%$ %noun vax]) :: vase to silk + ++ dy-silk-sources :: sources to silk + |= src=(list dojo-source) ^- silk + %- dy-silk-vase + |- + ?~ src !>(~) + (slop (dy-vase p.i.src) $(src t.src)) :: - ++ dy-silk-init-modo :: init and config - |= [cag=cage cig=dojo-config] - ^- silk - (dy-silk-config cag cig) + ++ dy-silk-config :: configure + |= [cay=cage cig=dojo-config] + ^- [wire silk] + :- ?+ -.q.q.cay ~|(%bad-gen ~_((sell (slot 2 q.cay)) !!)) + %cat /gent + %dog /dial + %pig /scar + == + =+ gat=(slot 3 q.cay) + :+ %call (dy-silk-vase gat) + :+ (dy-silk-vase !>([now=now.hid eny=eny.hid bec=he-beak])) + (dy-silk-sources p.cig) + :+ %mute (dy-silk-vase (slot 27 gat)) + %+ turn (~(tap by q.cig)) + |= [a=term b=(unit dojo-source)] + ^- (pair wing silk) + :- [a ~] + %- dy-silk-vase + ?~(b !>([~ ~]) (dy-vase p.u.b)) :: ++ dy-twig-head :: dynamic state ^- cage @@ -514,7 +497,7 @@ %- ~(rep by var) |= [[a=term @ b=vase] c=vase] ^- vase (sloop b(p face/[a p.b]) c) - !>(`[our=@p now=@da eny=@uvI]`[our now eny]:hid) + !>([our=our now=now eny=eny]:hid) :: ++ dy-made-dial :: dialog product |= cag=cage @@ -550,11 +533,9 @@ (dy-eyre /hand [p.bil %get ~ ~]) %- dy-ford ^- (pair path silk) - ?+ -.bil !! - %di [/dial (dy-silk-init-modo (dy-cage p.p.p.bil) q.p.bil)] - %ge [/gent (dy-silk-init-modo (dy-cage p.p.p.bil) q.p.bil)] + ?- -.bil + %ge (dy-silk-config (dy-cage p.p.p.bil) q.p.bil) %dv [/hand [%core he-beak (flop p.bil)]] - %ec [/hand [%cast p.bil (dy-mare q.bil)]] %ex [/hand (dy-mare p.bil)] %fi =+ dat=[%$ (dy-cage p.q.bil)] [/hand ?@(p.bil [%cast p.bil dat] [%call (dy-mare p.bil) dat])] @@ -791,15 +772,19 @@ -- :: ++ prep - =+ session-0==+(*session ,[_say syd=desk * (unit) _|3.-]) + =+ session-1==+(*session ,_-(poy *(unit))) + =+ session-0==+(*session-1 ,[_say syd=desk * _|2.-]) :: ,_`..prep - |= old=(unit ?(house [%0 p=(map bone session-0)])) ^+ [~ ..prep] + =+ hoze=$%([%0 p=(map bone session-0)] [%1 p=(map bone session-1)]) + |= old=(unit ?(house hoze)) ^+ [~ ..prep] ?~ old `..prep - ?: ?=(%1 -.u.old) `..prep(+<+ u.old) - =< ^$(u.old [%1 (~(run by p.u.old) .)]) - |= sos=session-0 ^- session - =- ~! [%*(. *session poy *(unit)) -] - - [-.sos [[our.hid syd.sos ud/0] /] ~ |4.sos] + ?- -.u.old + %2 `..prep(+<+ u.old) + %1 `..prep(+<+ [%2 (~(run by p.u.old) |=(session-0 +<(poy ~)))]) + %0 =< ^$(u.old [%1 (~(run by p.u.old) .)]) + |= sos=session-0 ^- session + [-.sos [[our.hid syd.sos ud/0] /] |3.sos] + == :: :: pattern: ++ foo |=(data he-abet:(~(he-foo he (~(got by hoc) ost)) data)) ++ arm (arm-session (~(got by hoc) ost.hid)) diff --git a/cat/bit/act.hoon b/gen/bit/act.hoon similarity index 100% rename from cat/bit/act.hoon rename to gen/bit/act.hoon diff --git a/cat/bit/address-contact.hoon b/gen/bit/address-contact.hoon similarity index 93% rename from cat/bit/address-contact.hoon rename to gen/bit/address-contact.hoon index fb9a98124f..f97e94f764 100644 --- a/cat/bit/address-contact.hoon +++ b/gen/bit/address-contact.hoon @@ -6,6 +6,7 @@ :: ::::::: !: +:- %cat |= [^ arg=[address=@t contact=@t ~] ~] :- %address-contact [address.arg contact.arg] diff --git a/cat/bit/auth.hoon b/gen/bit/auth.hoon similarity index 92% rename from cat/bit/auth.hoon rename to gen/bit/auth.hoon index 58cf449a8d..b3994bb8a7 100644 --- a/cat/bit/auth.hoon +++ b/gen/bit/auth.hoon @@ -5,6 +5,7 @@ :: ::::: !: +:- %cat |= [^ [arg1=cord arg2=cord ~] ~] ::[arg=[cord cord ~] ~]] :- %auth [arg1 arg2] diff --git a/cat/bit/buy.hoon b/gen/bit/buy.hoon similarity index 91% rename from cat/bit/buy.hoon rename to gen/bit/buy.hoon index e351b69084..a9c3a0135f 100644 --- a/cat/bit/buy.hoon +++ b/gen/bit/buy.hoon @@ -5,6 +5,7 @@ :: ::::::: !: +:- %cat |= [^ [amount=@t currency=@t ~] ~] :- %buy [amount currency] diff --git a/cat/bit/contact-address.hoon b/gen/bit/contact-address.hoon similarity index 93% rename from cat/bit/contact-address.hoon rename to gen/bit/contact-address.hoon index 31fac5b0a6..fbf799b157 100644 --- a/cat/bit/contact-address.hoon +++ b/gen/bit/contact-address.hoon @@ -6,6 +6,7 @@ :: ::::::: !: +:- %cat |= [^ arg=[contact=@t address=@t ~] ~] :- %bit-contact [contact.arg address.arg] diff --git a/cat/bit/list.hoon b/gen/bit/list.hoon similarity index 87% rename from cat/bit/list.hoon rename to gen/bit/list.hoon index 04242a2b1d..ee742c50b8 100644 --- a/cat/bit/list.hoon +++ b/gen/bit/list.hoon @@ -5,6 +5,7 @@ :: ::::::: !: +:- %cat |= [^ ~ ~] :- %list ~ diff --git a/cat/bit/sell.hoon b/gen/bit/sell.hoon similarity index 91% rename from cat/bit/sell.hoon rename to gen/bit/sell.hoon index 097cc1e7f9..8f142de9c0 100644 --- a/cat/bit/sell.hoon +++ b/gen/bit/sell.hoon @@ -5,6 +5,7 @@ :: ::::::: !: +:- %cat |= [^ [amount=@t currency=@t ~] ~] :- %sell [amount currency] diff --git a/cat/bit/send.hoon b/gen/bit/send.hoon similarity index 90% rename from cat/bit/send.hoon rename to gen/bit/send.hoon index a2f951c59a..ff80f4e400 100644 --- a/cat/bit/send.hoon +++ b/gen/bit/send.hoon @@ -5,6 +5,7 @@ :: ::::::: !: +:- %cat |= [^ [to=@uc amo=@t ~] ~] [%bit-send to amo] diff --git a/cat/cat.hoon b/gen/cat.hoon similarity index 95% rename from cat/cat.hoon rename to gen/cat.hoon index 1ea4c417df..e141821607 100644 --- a/cat/cat.hoon +++ b/gen/cat.hoon @@ -1,12 +1,13 @@ :: ConCATenate file listings :: -:::: /hoon/cat/cat +:::: /hoon/gen/cat :: // /%%/ls/subdir // /%/pretty !: :::: :: +:- %cat |= [^ [arg=(list path)] ~] =- tang/(flop `tang`(zing -)) %+ turn arg diff --git a/cat/cat/pretty.hoon b/gen/cat/pretty.hoon similarity index 100% rename from cat/cat/pretty.hoon rename to gen/cat/pretty.hoon diff --git a/cat/coin/keys.hoon b/gen/coin/keys.hoon similarity index 89% rename from cat/coin/keys.hoon rename to gen/coin/keys.hoon index f88d34c757..a2e81e3b6c 100644 --- a/cat/coin/keys.hoon +++ b/gen/coin/keys.hoon @@ -5,6 +5,7 @@ :: :::: !: +:- %cat |= [^ [arg=(list cord) ~]] :- %keys arg diff --git a/cat/curl/url.hoon b/gen/curl/url.hoon similarity index 90% rename from cat/curl/url.hoon rename to gen/curl/url.hoon index f3435f011a..51ebcd2042 100644 --- a/cat/curl/url.hoon +++ b/gen/curl/url.hoon @@ -5,5 +5,6 @@ :: ::::: !: +:- %cat |= [^ [arg=tape ~] ~] purl/(scan arg auri:epur) diff --git a/cat/hello.hoon b/gen/hello.hoon similarity index 77% rename from cat/hello.hoon rename to gen/hello.hoon index 2354fad43e..be63a0eaae 100644 --- a/cat/hello.hoon +++ b/gen/hello.hoon @@ -1,10 +1,11 @@ :: -:::: /hoon/hello/cat +:::: /hoon/hello/gen :: /? 314 :: :::: !: +:- %cat |= [^ [[txt=@tas ~] ~]] :- %noun (crip (weld "hello, " (flop (trip txt)))) diff --git a/dog/hood/begin.hoon b/gen/hood/begin.hoon similarity index 99% rename from dog/hood/begin.hoon rename to gen/hood/begin.hoon index 4a1c1f5fcc..999ff41137 100644 --- a/dog/hood/begin.hoon +++ b/gen/hood/begin.hoon @@ -11,6 +11,7 @@ ++ scug |*([a=@ b=(pole)] ?~(b ~ ?~(a ~ [-.b $(b +.b, a (dec a))]))) -- [sole .] +:- %dog |= $: [now=@da eny=@uvI bec=beak] [arg=_(scug *@ ~[his=*@p tic=*@p]) ~] == diff --git a/cat/hood/breload.hoon b/gen/hood/breload.hoon similarity index 78% rename from cat/hood/breload.hoon rename to gen/hood/breload.hoon index fe532c2364..8245270497 100644 --- a/cat/hood/breload.hoon +++ b/gen/hood/breload.hoon @@ -1,10 +1,11 @@ :: -:::: /hoon/reload/hood/cat +:::: /hoon/reload/hood/gen :: /? 314 :: :::: !: +:- %cat |= $: [now=@da eny=@uvI bec=beak] [arg=(list term) ~] == diff --git a/cat/hood/cp.hoon b/gen/hood/cp.hoon similarity index 86% rename from cat/hood/cp.hoon rename to gen/hood/cp.hoon index 4dd6cc4883..7e523c7d32 100644 --- a/cat/hood/cp.hoon +++ b/gen/hood/cp.hoon @@ -1 +1,2 @@ +:- %cat |=([^ [input=path output=path ~] ~] kiln-cp/[input output]) diff --git a/cat/hood/hi.hoon b/gen/hood/hi.hoon similarity index 89% rename from cat/hood/hi.hoon rename to gen/hood/hi.hoon index fb27f299d6..048c2756be 100644 --- a/cat/hood/hi.hoon +++ b/gen/hood/hi.hoon @@ -1 +1,2 @@ +:- %cat |=([^ [who=ship mez=$|(~ [a=tape ~])] ~] helm-send-hi/[who ?~(mez ~ `a.mez)]) diff --git a/cat/hood/init.hoon b/gen/hood/init.hoon similarity index 74% rename from cat/hood/init.hoon rename to gen/hood/init.hoon index 5fc9060c1d..23b63708c6 100644 --- a/cat/hood/init.hoon +++ b/gen/hood/init.hoon @@ -1,10 +1,11 @@ :: -:::: /hoon/reload/hood/cat +:::: /hoon/reload/hood/gen :: /? 314 :: :::: !: +:- %cat |= $: [now=@da eny=@uvI bec=beak] [~ ~] == diff --git a/cat/hood/invite.hoon b/gen/hood/invite.hoon similarity index 77% rename from cat/hood/invite.hoon rename to gen/hood/invite.hoon index 156cdab210..5c992a59c1 100644 --- a/cat/hood/invite.hoon +++ b/gen/hood/invite.hoon @@ -1,10 +1,11 @@ :: -:::: /hoon/invite/hood/cat +:::: /hoon/invite/hood/gen :: /? 314 :: :::: !: +:- %cat |= $: [now=@da eny=@uvI bec=beak] [[who=@p myl=@t ~] ~] == diff --git a/cat/hood/label.hoon b/gen/hood/label.hoon similarity index 79% rename from cat/hood/label.hoon rename to gen/hood/label.hoon index 9b41136208..ec414c06a7 100644 --- a/cat/hood/label.hoon +++ b/gen/hood/label.hoon @@ -1,10 +1,11 @@ :: -:::: /hoon/label/hood/cat +:::: /hoon/label/hood/gen :: /? 314 :: :::: !: +:- %cat |= $: [now=@da eny=@uvI bec=beak] [arg=[syd=desk lab=@tas ~] ~] == diff --git a/cat/hood/link.hoon b/gen/hood/link.hoon similarity index 84% rename from cat/hood/link.hoon rename to gen/hood/link.hoon index dc70d442ba..87cb6b9a97 100644 --- a/cat/hood/link.hoon +++ b/gen/hood/link.hoon @@ -1,10 +1,11 @@ :: -:::: /hoon/link/hood/cat +:::: /hoon/link/hood/gen :: /? 314 :: :::: !: +:- %cat |= $: [now=@da eny=@uvI byk=beak] [arg=$?([dap=term ~] [who=ship dap=term ~]) ~] == diff --git a/cat/hood/mass.hoon b/gen/hood/mass.hoon similarity index 75% rename from cat/hood/mass.hoon rename to gen/hood/mass.hoon index 30deb428d9..e2f2e5b742 100644 --- a/cat/hood/mass.hoon +++ b/gen/hood/mass.hoon @@ -1,10 +1,11 @@ :: -:::: /hoon/mass/hood/cat +:::: /hoon/mass/hood/gen :: /? 314 :: :::: !: +:- %cat |= $: [now=@da eny=@uvI bec=beak] [arg=~ ~] == diff --git a/cat/hood/merge.hoon b/gen/hood/merge.hoon similarity index 95% rename from cat/hood/merge.hoon rename to gen/hood/merge.hoon index 49fe271c82..382f7d3580 100644 --- a/cat/hood/merge.hoon +++ b/gen/hood/merge.hoon @@ -1,5 +1,5 @@ :: -:::: /hoon/merge/hood/cat +:::: /hoon/merge/hood/gen :: /? 314 !: @@ -10,6 +10,7 @@ :: :::: !: +:- %cat |= $: [now=@da eny=@uvI bek=beak] [arg=[?(sorc [syd=$|(desk beaky) sorc])] gem=?(%auto germ)] == diff --git a/cat/hood/mount.hoon b/gen/hood/mount.hoon similarity index 85% rename from cat/hood/mount.hoon rename to gen/hood/mount.hoon index 0ec2b83283..f8d5eb3a3e 100644 --- a/cat/hood/mount.hoon +++ b/gen/hood/mount.hoon @@ -1,10 +1,11 @@ :: -:::: /hoon/mount/hood/cat +:::: /hoon/mount/hood/gen :: /? 314 :: :::: !: +:- %cat |= $: [now=@da eny=@uvI bec=beak] [[pax=path pot=$|(~ [v=@tas ~])] ~] == diff --git a/cat/hood/mv.hoon b/gen/hood/mv.hoon similarity index 86% rename from cat/hood/mv.hoon rename to gen/hood/mv.hoon index 72e380578f..c0071d2465 100644 --- a/cat/hood/mv.hoon +++ b/gen/hood/mv.hoon @@ -1 +1,2 @@ +:- %cat |=([^ [input=path output=path ~] ~] kiln-mv/[input output]) diff --git a/cat/hood/rc.hoon b/gen/hood/rc.hoon similarity index 75% rename from cat/hood/rc.hoon rename to gen/hood/rc.hoon index 7116db3eb7..891eb6bf9e 100644 --- a/cat/hood/rc.hoon +++ b/gen/hood/rc.hoon @@ -1,10 +1,11 @@ :: -:::: /hoon/reload/hood/cat +:::: /hoon/reload/hood/gen :: /? 314 :: :::: !: +:- %cat |= $: [now=@da eny=@uvI bec=beak] [arg=~ ~] == diff --git a/cat/hood/reboot.hoon b/gen/hood/reboot.hoon similarity index 78% rename from cat/hood/reboot.hoon rename to gen/hood/reboot.hoon index a463f8d0c2..9373033b21 100644 --- a/cat/hood/reboot.hoon +++ b/gen/hood/reboot.hoon @@ -1,10 +1,11 @@ :: -:::: /hoon/reload/hood/cat +:::: /hoon/reload/hood/gen :: /? 314 :: :::: !: +:- %cat |= $: [now=@da eny=@uvI bec=beak] [arg=~ ~] == diff --git a/cat/hood/reload-desk.hoon b/gen/hood/reload-desk.hoon similarity index 78% rename from cat/hood/reload-desk.hoon rename to gen/hood/reload-desk.hoon index 71e60de30d..8ead150990 100644 --- a/cat/hood/reload-desk.hoon +++ b/gen/hood/reload-desk.hoon @@ -1,10 +1,11 @@ :: -:::: /hoon/reload/hood/cat +:::: /hoon/reload/hood/gen :: /? 314 :: :::: !: +:- %cat |= $: [now=@da eny=@uvI bec=beak] [arg=[desk (list term)] ~] == diff --git a/cat/hood/reload.hoon b/gen/hood/reload.hoon similarity index 76% rename from cat/hood/reload.hoon rename to gen/hood/reload.hoon index 99d74a06ef..d619bad32e 100644 --- a/cat/hood/reload.hoon +++ b/gen/hood/reload.hoon @@ -1,10 +1,11 @@ :: -:::: /hoon/reload/hood/cat +:::: /hoon/reload/hood/gen :: /? 314 :: :::: !: +:- %cat |= $: [now=@da eny=@uvI bec=beak] [arg=(list term) ~] == diff --git a/cat/hood/reset.hoon b/gen/hood/reset.hoon similarity index 74% rename from cat/hood/reset.hoon rename to gen/hood/reset.hoon index 6974c7ae6b..31415365d3 100644 --- a/cat/hood/reset.hoon +++ b/gen/hood/reset.hoon @@ -1,10 +1,11 @@ :: -:::: /hoon/reset/hood/cat +:::: /hoon/reset/hood/gen :: /? 314 :: :::: !: +:- %cat |= $: [now=@da eny=@uvI bec=beak] [arg=~ ~] == diff --git a/cat/hood/rf.hoon b/gen/hood/rf.hoon similarity index 75% rename from cat/hood/rf.hoon rename to gen/hood/rf.hoon index a431114798..c7d2f581a7 100644 --- a/cat/hood/rf.hoon +++ b/gen/hood/rf.hoon @@ -1,10 +1,11 @@ :: -:::: /hoon/reload/hood/cat +:::: /hoon/reload/hood/gen :: /? 314 :: :::: !: +:- %cat |= $: [now=@da eny=@uvI bec=beak] [arg=~ ~] == diff --git a/cat/hood/rm.hoon b/gen/hood/rm.hoon similarity index 81% rename from cat/hood/rm.hoon rename to gen/hood/rm.hoon index 04af9e0246..9360dbd17e 100644 --- a/cat/hood/rm.hoon +++ b/gen/hood/rm.hoon @@ -1 +1,2 @@ +:- %cat |=([^ [input=path ~] ~] kiln-rm/input) diff --git a/cat/hood/schedule.hoon b/gen/hood/schedule.hoon similarity index 88% rename from cat/hood/schedule.hoon rename to gen/hood/schedule.hoon index 8e94d034ca..bd33a2d4fc 100644 --- a/cat/hood/schedule.hoon +++ b/gen/hood/schedule.hoon @@ -1 +1,2 @@ +:- %cat |=([^ [where=path tym=@da eve=@t ~] ~] kiln-schedule/[where tym eve]) diff --git a/cat/hood/start.hoon b/gen/hood/start.hoon similarity index 85% rename from cat/hood/start.hoon rename to gen/hood/start.hoon index 077c92e92d..ee55494645 100644 --- a/cat/hood/start.hoon +++ b/gen/hood/start.hoon @@ -1,10 +1,11 @@ :: -:::: /hoon/start/hood/cat +:::: /hoon/start/hood/gen :: /? 314 :: :::: !: +:- %cat |= $: [now=@da eny=@uvI bec=beak] [arg=[@ $|(~ [@ ~])] ~] == diff --git a/cat/hood/sync.hoon b/gen/hood/sync.hoon similarity index 81% rename from cat/hood/sync.hoon rename to gen/hood/sync.hoon index 97ac1bbc4e..368d1f7293 100644 --- a/cat/hood/sync.hoon +++ b/gen/hood/sync.hoon @@ -1,10 +1,11 @@ :: -:::: /hoon/sync/hood/cat +:::: /hoon/sync/hood/gen :: /? 314 :: :::: !: +:- %cat |= $: [now=@da eny=@uvI bec=beak] [arg=[syd=@tas her=@p sud=@tas ~] ~] == diff --git a/cat/hood/unix.hoon b/gen/hood/unix.hoon similarity index 81% rename from cat/hood/unix.hoon rename to gen/hood/unix.hoon index 421d85617e..7d119e885e 100644 --- a/cat/hood/unix.hoon +++ b/gen/hood/unix.hoon @@ -1,10 +1,11 @@ :: -:::: /hoon/unix/hood/cat +:::: /hoon/unix/hood/gen :: /? 314 :: :::: !: +:- %cat |= $: [now=@da eny=@uvI bec=beak] [[syd=@tas syn=?(~ [? ~])] ~] == diff --git a/cat/hood/unmount.hoon b/gen/hood/unmount.hoon similarity index 78% rename from cat/hood/unmount.hoon rename to gen/hood/unmount.hoon index 73806b55c7..f6a382c0b8 100644 --- a/cat/hood/unmount.hoon +++ b/gen/hood/unmount.hoon @@ -1,10 +1,11 @@ :: -:::: /hoon/mount/hood/cat +:::: /hoon/mount/hood/gen :: /? 314 :: :::: !: +:- %cat |= $: [now=@da eny=@uvI bec=beak] [[mon=$|(term [span path]) ~] ~] == diff --git a/cat/hood/unsync.hoon b/gen/hood/unsync.hoon similarity index 80% rename from cat/hood/unsync.hoon rename to gen/hood/unsync.hoon index 655ba2828c..540f94e5b3 100644 --- a/cat/hood/unsync.hoon +++ b/gen/hood/unsync.hoon @@ -1,10 +1,11 @@ :: -:::: /hoon/unsync/hood/cat +:::: /hoon/unsync/hood/gen :: /? 314 :: :::: !: +:- %cat |= $: [now=@da eny=@uvI bec=beak] [arg=[syd=@tas her=@p sud=@tas ~] ~] == diff --git a/cat/hood/verb.hoon b/gen/hood/verb.hoon similarity index 94% rename from cat/hood/verb.hoon rename to gen/hood/verb.hoon index 68f941efed..2d0c6894a6 100644 --- a/cat/hood/verb.hoon +++ b/gen/hood/verb.hoon @@ -7,6 +7,7 @@ :::: !: [sole .] +:- %cat |= $: [now=@da eny=@ bec=beak] [~ ~] == diff --git a/cat/ls.hoon b/gen/ls.hoon similarity index 85% rename from cat/ls.hoon rename to gen/ls.hoon index 1846bf6a87..f2d29e7d44 100644 --- a/cat/ls.hoon +++ b/gen/ls.hoon @@ -1,11 +1,12 @@ :: LiSt directory subnodes :: -:::: /hoon/ls/cat +:::: /hoon/ls/gen :: // /%/subdir !: :::: :: +:- %cat |= [^ [arg=path ~] ~] =+ lon=((hard arch) .^(%cy arg)) tang/[?~(dir.lon leaf/"~" (subdir arg dir.lon))]~ diff --git a/cat/ls/subdir.hoon b/gen/ls/subdir.hoon similarity index 100% rename from cat/ls/subdir.hoon rename to gen/ls/subdir.hoon diff --git a/gen/make.hoon b/gen/make.hoon new file mode 100644 index 0000000000..944ac08e0b --- /dev/null +++ b/gen/make.hoon @@ -0,0 +1,2 @@ +:- %cat +|=([^ arg=(list ,@) foo=_`@`1 bar=_`@`2] noun/[arg foo bar]) \ No newline at end of file diff --git a/gen/pope.hoon b/gen/pope.hoon new file mode 100644 index 0000000000..be64c3d64d --- /dev/null +++ b/gen/pope.hoon @@ -0,0 +1,24 @@ +:: Input twitter keys +/- sole +!: +=+ cryp=bruw :: XX change to ec2 ++brew eventually +=+ [sole] +:- %dog +|= $: [now=@da eny=@uvI bec=beak] + [[who=ship ~] ~] + == +^- (sole-result (cask tang)) +%+ sole-yo leaf/"generating carrier {(scow %p who)} (#{(scow %ud who)})" +%+ sole-lo [%| %pope-pass "passphrase: "] +%+ sole-go (boss 256 (star prn)) +|= fra=@t +%+ sole-lo [%| %pope-none "[press enter to compute]"] :: XX oy +%+ sole-go (easy ~) +|= ~ +=+ bur=(shax (add who (shax fra))) +~& %computing-fingerprint +=+ arc=(cryp 2.048 bur) +%+ sole-so %tang +:~ leaf/"generator: {(scow %uw bur)}" + leaf/"fingerprint: {(scow %uw fig:ex:arc)}" +== diff --git a/cat/solid.hoon b/gen/solid.hoon similarity index 96% rename from cat/solid.hoon rename to gen/solid.hoon index bfc6413858..a5b9e0e0b4 100644 --- a/cat/solid.hoon +++ b/gen/solid.hoon @@ -1,10 +1,11 @@ :: -:::: /hoon/solid/cat +:::: /hoon/solid/gen :: /? 314 :: :::: !: +:- %cat |= $: [now=@da eny=@uvI bec=beak] [~ ~] == diff --git a/cat/ticket.hoon b/gen/ticket.hoon similarity index 84% rename from cat/ticket.hoon rename to gen/ticket.hoon index a871153212..c49161948d 100644 --- a/cat/ticket.hoon +++ b/gen/ticket.hoon @@ -1,10 +1,11 @@ :: -:::: /hoon/ticket/cat +:::: /hoon/ticket/gen :: /? 314 :: :::: !: +:- %cat |= $: [now=@da eny=@uvI bec=beak] [[her=@p ~] ~] == diff --git a/cat/tree.hoon b/gen/tree.hoon similarity index 92% rename from cat/tree.hoon rename to gen/tree.hoon index 0a9bc91021..3feee2847d 100644 --- a/cat/tree.hoon +++ b/gen/tree.hoon @@ -1,10 +1,11 @@ :: Tree view recursive directory contents :: -:::: /hoon/tree/cat +:::: /hoon/tree/gen :: !: :::: :: +:- %cat |= [^ [pax=path fla=$|(~ [%full ~])] ~] =+ len=(lent pax) =+ rend=?^(fla dank:ut |=(a=path (dank:ut (slag len a)))) diff --git a/cat/twit/as.hoon b/gen/twit/as.hoon similarity index 94% rename from cat/twit/as.hoon rename to gen/twit/as.hoon index e08db6b12b..5bcd603b68 100644 --- a/cat/twit/as.hoon +++ b/gen/twit/as.hoon @@ -3,6 +3,7 @@ :::: :: [twitter .] +:- %cat |= $: [now=@da eny=@uvI bec=beak] [[who=span msg=cord ~] ~] == diff --git a/dog/twit/auth.hoon b/gen/twit/auth.hoon similarity index 98% rename from dog/twit/auth.hoon rename to gen/twit/auth.hoon index 8fe5ab5e9a..e25f48724d 100644 --- a/dog/twit/auth.hoon +++ b/gen/twit/auth.hoon @@ -6,6 +6,7 @@ ++ baz64 (cook crip (star alp)) -- !: +:- %dog |= $: [now=@da eny=@uvI bec=beak] [~ ~] == diff --git a/dog/twit/auth/hoontap-keys.txt b/gen/twit/auth/hoontap-keys.txt similarity index 100% rename from dog/twit/auth/hoontap-keys.txt rename to gen/twit/auth/hoontap-keys.txt diff --git a/cat/twit/tweet.hoon b/gen/twit/tweet.hoon similarity index 100% rename from cat/twit/tweet.hoon rename to gen/twit/tweet.hoon diff --git a/cat/twit/twitter-feed.hoon b/gen/twit/twitter-feed.hoon similarity index 98% rename from cat/twit/twitter-feed.hoon rename to gen/twit/twitter-feed.hoon index 85d72c16f0..9712e76aa7 100644 --- a/cat/twit/twitter-feed.hoon +++ b/gen/twit/twitter-feed.hoon @@ -10,6 +10,7 @@ |_ [hide ~] ++ stat ,[id=@u who=@ta now=@da txt=@t] ++ rens +:- %cat |=(stat rose/[": " `~]^~[leaf/"{} @{(trip who)}" leaf/(trip txt)]) ++ peer ,_`. ++ poke--args diff --git a/sur/sole.hoon b/sur/sole.hoon index a377083f7b..075e8ce589 100644 --- a/sur/sole.hoon +++ b/sur/sole.hoon @@ -13,44 +13,6 @@ haw=@uvH :: source hash ted=sole-edit :: state change == :: -++ sole-dialog :: standard dialog - |* out=$+(* *) :: output structure - $+(sole-input (sole-result out)) :: output function -:: :: -++ sole-result :: conditional result - |* out=$+(* *) :: output structure - $|(@ud (sole-product out)) :: error position -:: :: -++ sole-product :: success result - |* out=$+(* *) :: - %+ pair (list tank) :: - %+ each (unit out) :: ~ is abort - (pair sole-prompt (sole-dialog out)) :: ask and continue -:: :: -++ sole-so :: construct result - |* pro=* :: - [p=*(list tank) q=[%& p=[~ u=pro]]] :: -:: :: -++ sole-yo :: add output tank - |* [tan=tank res=(sole-result)] :: - ?@ res res :: - [p=[i=tan t=p.res] q=q.res] :: -:: :: -++ sole-lo :: construct prompt - |* [pom=sole-prompt mor=(sole-dialog)] :: - [p=*(list tank) q=[%| p=pom q=mor]] :: -:: :: -++ sole-no :: empty result - [p=*(list tank) q=~] :: -:: :: -++ sole-go :: parse by rule - |* [sef=_rule fun=$+(* *)] :: - |= txt=sole-input :: - =+ vex=(sef [0 0] txt) :: - ?: |(!=((lent txt) q.p.vex) ?=(~ q.vex)) :: - q.p.vex :: - (fun p.u.q.vex) :: -:: :: ++ sole-clock ,[own=@ud his=@ud] :: vector clock ++ sole-edit :: shared state change $% [%del p=@ud] :: delete one at @@ -83,10 +45,73 @@ tag=term :: history mode cad=tape :: caption == :: -++ sole-input tape :: prompt input ++ sole-share :: symmetric state $: ven=sole-clock :: our vector clock leg=(list sole-edit) :: unmerged edits buf=sole-buffer :: sole state == :: +:: :: +:: :: +++ sole-dialog :: standard dialog + |* out=$+(* *) :: output structure + $+(sole-input (sole-result out)) :: output function +:: :: +++ sole-input tape :: prompt input +++ sole-result :: conditional result + |* out=$+(* *) :: output structure + $|(@ud (sole-product out)) :: error position +:: :: +++ sole-product :: success result + |* out=$+(* *) :: + %+ pair (list tank) :: + %+ each (unit out) :: ~ is abort + (pair sole-prompt (sole-dialog out)) :: ask and continue +:: :: +++ sole-request :: scraper result + |* out=$+(* *) :: output structure + %+ pair (list tank) :: + %+ each (unit out) :: ~ is abort + %+ pair (list hiss) :: ask + $+((list httr) (sole-request out)) :: and continue +:: :: +++ sole-gen :: XX virtual type + $% [%cat $+((sole-args) (cask))] :: direct noun + [%dog $+((sole-args) (sole-product (cask)))] :: dialog + [%pig $+((sole-args) (sole-request (cask)))] :: scraper + == :: +++ sole-args :: generator arguments + |* _[lit=,* opt=,*] :: + ,[[now=@da eny=@uvI bek=beak] [lit opt]] :: +:: :: +:: :: +++ sole-so :: construct result + |* pro=* :: + [p=*(list tank) q=[%& p=[~ u=pro]]] :: +:: :: +++ sole-yo :: add output tank + |* [tan=tank res=(sole-result)] :: + ?@ res res :: + [p=[i=tan t=p.res] q=q.res] :: +:: :: +++ sole-lo :: construct prompt + |* [pom=sole-prompt mor=(sole-dialog)] :: + [p=*(list tank) q=[%| p=pom q=mor]] :: +:: :: +++ sole-at :: fetch url + |* [pul=_purl fun=$+(httr *)] :: + =< [p=*(list tank) q=[%| p=[pul %get ~ ~] q=.]] :: + |= rez=(list httr) :: + ?> ?=([^ ~] rez) :: + (fun i.rez) :: +:: :: +++ sole-no :: empty result + [p=*(list tank) q=~] :: +:: :: +++ sole-go :: parse by rule + |* [sef=_rule fun=$+(* *)] :: + |= txt=sole-input :: + =+ vex=(sef [0 0] txt) :: + ?: |(!=((lent txt) q.p.vex) ?=(~ q.vex)) :: + q.p.vex :: + (fun p.u.q.vex) :: -- From d291d0b59e1bddce1f675f3911c92e33a0cd1d85 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Fri, 11 Sep 2015 14:36:16 -0700 Subject: [PATCH 12/59] separate mark `%as` and gate-application `%do` --- ape/dojo.hoon | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/ape/dojo.hoon b/ape/dojo.hoon index 1cb2660aad..608d4ae653 100644 --- a/ape/dojo.hoon +++ b/ape/dojo.hoon @@ -37,17 +37,14 @@ q=dojo-build :: general build == :: ++ dojo-build :: one ford step - $% [%ex p=twig] :: hoon expression - [%dv p=path] :: gate from source - [%fi p=dojo-filter q=dojo-source] :: filter + $% [%ur p=purl] :: http GET request [%ge p=dojo-model] :: generator + [%dv p=path] :: core from source + [%ex p=twig] :: hoon expression + [%as p=mark q=dojo-source] :: simple transmute + [%do p=twig q=dojo-source] :: gate apply [%tu p=(list dojo-source)] :: tuple - [%ur p=purl] :: http GET request == :: - ++ dojo-filter :: pipeline filter - $| mark :: simple transmute - twig :: function gate - :: ++ dojo-model :: data construction $: p=dojo-server :: core source q=dojo-config :: configuration @@ -153,11 +150,11 @@ ;~ pose ;~(plug (cold %ge lus) dp-model) ;~(plug (cold %ur lus) auri:epur) - ;~(plug (cold %fi cab) ;~((glue ace) dp-filter dp-source)) + ;~(plug (cold %as pam) sym ;~(pfix ace dp-source)) + ;~(plug (cold %do cab) dp-twig ;~(pfix ace dp-source)) dp-value == :: - ++ dp-filter ;~(pose ;~(sfix sym cab) dp-twig) :: ++dojo-filter ++ dp-goal :: ++goal %+ cook |=(a=goal a) ;~ pose @@ -244,7 +241,7 @@ %show =^(src +>.$ (dy-init-source p.mad) [mad(p src) +>.$]) %verb =^(src +>.$ (dy-init-source-unit q.mad) [mad(q src) +>.$]) %http - =. r.mad [0 %fi %mime r.mad] + =. r.mad [0 %as %mime r.mad] =^ src +>.$ (dy-init-source r.mad) [mad(r src) +>.$] == @@ -271,8 +268,8 @@ ?- -.bul %ex [bul +>.$] %dv [bul +>.$] - %fi =^ mor +>.$ (dy-init-source q.bul) - [bul(q mor) +>.$] + %as =^(mor +>.$ (dy-init-source q.bul) [bul(q mor) +>.$]) + %do =^(mor +>.$ (dy-init-source q.bul) [bul(q mor) +>.$]) %ge =^(mod +>.$ (dy-init-model p.bul) [[%ge mod] +>.$]) %ur [bul +>.$] %tu =^ dof +>.$ @@ -537,8 +534,8 @@ %ge (dy-silk-config (dy-cage p.p.p.bil) q.p.bil) %dv [/hand [%core he-beak (flop p.bil)]] %ex [/hand (dy-mare p.bil)] - %fi =+ dat=[%$ (dy-cage p.q.bil)] - [/hand ?@(p.bil [%cast p.bil dat] [%call (dy-mare p.bil) dat])] + %as [/hand [%cast p.bil [%$ (dy-cage p.q.bil)]]] + %do [/hand [%call (dy-mare p.bil) [%$ (dy-cage p.q.bil)]]] %tu :- /hand :- %$ :- %noun @@ -780,9 +777,9 @@ ?~ old `..prep ?- -.u.old %2 `..prep(+<+ u.old) - %1 `..prep(+<+ [%2 (~(run by p.u.old) |=(session-0 +<(poy ~)))]) + %1 `..prep(+<+ [%2 (~(run by p.u.old) |=(session-1 +<(poy ~)))]) %0 =< ^$(u.old [%1 (~(run by p.u.old) .)]) - |= sos=session-0 ^- session + |= sos=session-0 ^- session-1 [-.sos [[our.hid syd.sos ud/0] /] |3.sos] == :: From 56bbfa7eea0030cde0393fbbff7cd1de6fd79de7 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Fri, 11 Sep 2015 15:46:16 -0700 Subject: [PATCH 13/59] support %pig scrapers --- ape/dojo.hoon | 31 +++++++++++++++++++++++++++++++ sur/sole.hoon | 8 ++------ 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/ape/dojo.hoon b/ape/dojo.hoon index 608d4ae653..0130422c12 100644 --- a/ape/dojo.hoon +++ b/ape/dojo.hoon @@ -518,6 +518,35 @@ [%pro pom(cad [':' ' ' cad.pom])] == :: + ++ dy-made-scar :: scraper product + |= cag=cage + ^+ +>+> + ?. ?=(^ q.q.cag) + (dy-diff %err q.q.cag) + =+ tan=((list tank) +2.q.q.cag) + =. +>+>.$ (he-diff %tan tan) + =+ vax=(spec (slot 3 q.cag)) + ~_ (sell q.cag) + ?+ -.q.vax !! + %& + ?~ +.q.vax + ~& %dy-made-scar-abort + (dy-rash %bel ~) + (dy-meal (slot 7 vax)) + :: + %| + =+ hiz=;;(hiss +<.q.vax) + %- (slog leaf/"< {(earn p.hiz)}" ~) + (dy-eyre(pro `(slap (slot 7 vax) cnzy/%q)) /scar hiz) + == + :: + ++ dy-sigh-scar :: scraper result + |= dat=cage + ?~ pro + ~& %dy-no-scraper + (dy-show dat) + (dy-slam(pux ~) /scar u.pro q.dat) + :: ++ dy-made-gent :: generator product |= cag=cage (dy-meal q.cag) @@ -669,6 +698,7 @@ [%hand ~] dy-hand:dye [%dial ~] dy-made-dial:dye [%gent ~] dy-made-gent:dye + [%scar ~] dy-made-scar:dye [%edit ~] dy-made-edit:dye == %| (he-diff(poy ~) %tan p.reg) @@ -685,6 +715,7 @@ ?+ way !! [%hand ~] dy-hand:dye [%show ~] dy-show:dye + [%scar ~] dy-sigh-scar:dye == :: ++ he-unto :: result from behn diff --git a/sur/sole.hoon b/sur/sole.hoon index 075e8ce589..a3bbd86b4f 100644 --- a/sur/sole.hoon +++ b/sur/sole.hoon @@ -71,8 +71,7 @@ |* out=$+(* *) :: output structure %+ pair (list tank) :: %+ each (unit out) :: ~ is abort - %+ pair (list hiss) :: ask - $+((list httr) (sole-request out)) :: and continue + (pair hiss $+(httr (sole-request out))) :: fetch and continue :: :: ++ sole-gen :: XX virtual type $% [%cat $+((sole-args) (cask))] :: direct noun @@ -99,10 +98,7 @@ :: :: ++ sole-at :: fetch url |* [pul=_purl fun=$+(httr *)] :: - =< [p=*(list tank) q=[%| p=[pul %get ~ ~] q=.]] :: - |= rez=(list httr) :: - ?> ?=([^ ~] rez) :: - (fun i.rez) :: + [p=*(list tank) q=[%| p=[pul %get ~ ~] q=fun]] :: :: :: ++ sole-no :: empty result [p=*(list tank) q=~] :: From ecfefc1a9a1cc4a364e513312a6cef53273f657d Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Fri, 11 Sep 2015 15:52:37 -0700 Subject: [PATCH 14/59] more conservative dy-no-prompt --- ape/dojo.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ape/dojo.hoon b/ape/dojo.hoon index 0130422c12..5f5df8a697 100644 --- a/ape/dojo.hoon +++ b/ape/dojo.hoon @@ -348,7 +348,7 @@ :: ++ dy-done :: dialog submit |= txt=tape - ?. ?=(^ pro) + ?: |(?=(^ per) ?=(^ pux) ?=(~ pro)) ~& %dy-no-prompt (dy-diff %bel ~) (dy-slam /dial u.pro !>(txt)) From 81eeb6714e88781185bfdfb3a75f3f1314120200 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Fri, 11 Sep 2015 17:07:50 -0700 Subject: [PATCH 15/59] fix url grab --- ape/dojo.hoon | 4 ++-- ape/hood.hoon | 1 + lib/drum.hoon | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ape/dojo.hoon b/ape/dojo.hoon index 5f5df8a697..b84586a06a 100644 --- a/ape/dojo.hoon +++ b/ape/dojo.hoon @@ -71,7 +71,7 @@ ++ goal ,[p=ship q=term] :: flat application ++ clap :: action, user $% [%peer p=path] :: subscribe - [%poke p=term q=*] :: apply + [%poke p=(cask)] :: apply [%pull ~] :: unsubscribe == :: ++ club :: action, system @@ -148,8 +148,8 @@ ++ dp-build :: ++dojo-build %+ knee *dojo-build |. ~+ ;~ pose - ;~(plug (cold %ge lus) dp-model) ;~(plug (cold %ur lus) auri:epur) + ;~(plug (cold %ge lus) dp-model) ;~(plug (cold %as pam) sym ;~(pfix ace dp-source)) ;~(plug (cold %do cab) dp-twig ;~(pfix ace dp-source)) dp-value diff --git a/ape/hood.hoon b/ape/hood.hoon index 794fea6036..89e218f942 100644 --- a/ape/hood.hoon +++ b/ape/hood.hoon @@ -81,6 +81,7 @@ ++ peer-drum (wrap peer):from-drum ++ poke-dill-belt (wrap poke-dill-belt):from-drum ++ poke-drum-link (wrap poke-link):from-drum +::++ poke-drum-exit (wrap poke-exit):from-drum ++ poke-drum-start (wrap poke-start):from-drum ++ poke-helm-hi (wrap poke-hi):from-helm ++ poke-helm-init (wrap poke-init):from-helm diff --git a/lib/drum.hoon b/lib/drum.hoon index aeb36f9b8c..0b54238033 100644 --- a/lib/drum.hoon +++ b/lib/drum.hoon @@ -215,6 +215,9 @@ =< se-abet =< se-view (se-link gyl) :: +:: ++ poke-exit :: +:: |=(~ se-abet:(se-blit `dill-blit`[%qit ~])) :: XX find bone +:: :: ++ reap-phat :: |= [way=wire saw=(unit tang)] =< se-abet =< se-view From 1755179ce3accf74737f9049e9adf29a0e1c8ff7 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Fri, 11 Sep 2015 17:24:51 -0700 Subject: [PATCH 16/59] rename generators to %say, %ask, %get --- ape/dojo.hoon | 10 +++++----- gen/bit/address-contact.hoon | 2 +- gen/bit/auth.hoon | 2 +- gen/bit/buy.hoon | 2 +- gen/bit/contact-address.hoon | 2 +- gen/bit/list.hoon | 2 +- gen/bit/sell.hoon | 2 +- gen/bit/send.hoon | 2 +- gen/cat.hoon | 2 +- gen/coin/keys.hoon | 2 +- gen/curl/url.hoon | 2 +- gen/hello.hoon | 2 +- gen/hood/begin.hoon | 2 +- gen/hood/breload.hoon | 2 +- gen/hood/cp.hoon | 2 +- gen/hood/hi.hoon | 2 +- gen/hood/init.hoon | 2 +- gen/hood/invite.hoon | 2 +- gen/hood/label.hoon | 2 +- gen/hood/link.hoon | 2 +- gen/hood/mass.hoon | 2 +- gen/hood/merge.hoon | 2 +- gen/hood/mount.hoon | 2 +- gen/hood/mv.hoon | 2 +- gen/hood/rc.hoon | 2 +- gen/hood/reboot.hoon | 2 +- gen/hood/reload-desk.hoon | 2 +- gen/hood/reload.hoon | 2 +- gen/hood/reset.hoon | 2 +- gen/hood/rf.hoon | 2 +- gen/hood/rm.hoon | 2 +- gen/hood/schedule.hoon | 2 +- gen/hood/start.hoon | 2 +- gen/hood/sync.hoon | 2 +- gen/hood/unix.hoon | 2 +- gen/hood/unmount.hoon | 2 +- gen/hood/unsync.hoon | 2 +- gen/hood/verb.hoon | 2 +- gen/ls.hoon | 2 +- gen/make.hoon | 2 +- gen/pope.hoon | 2 +- gen/solid.hoon | 2 +- gen/ticket.hoon | 2 +- gen/tree.hoon | 2 +- gen/twit/as.hoon | 2 +- gen/twit/auth.hoon | 2 +- gen/twit/twitter-feed.hoon | 2 +- sur/sole.hoon | 6 +++--- 48 files changed, 54 insertions(+), 54 deletions(-) diff --git a/ape/dojo.hoon b/ape/dojo.hoon index b84586a06a..beba41db44 100644 --- a/ape/dojo.hoon +++ b/ape/dojo.hoon @@ -470,15 +470,15 @@ |= [cay=cage cig=dojo-config] ^- [wire silk] :- ?+ -.q.q.cay ~|(%bad-gen ~_((sell (slot 2 q.cay)) !!)) - %cat /gent - %dog /dial - %pig /scar + %say /gent + %ask /dial + %get /scar == =+ gat=(slot 3 q.cay) :+ %call (dy-silk-vase gat) :+ (dy-silk-vase !>([now=now.hid eny=eny.hid bec=he-beak])) (dy-silk-sources p.cig) - :+ %mute (dy-silk-vase (slot 27 gat)) + :+ %mute (dy-silk-vase (fall (slew 27 gat) !>(~))) %+ turn (~(tap by q.cig)) |= [a=term b=(unit dojo-source)] ^- (pair wing silk) @@ -536,7 +536,7 @@ :: %| =+ hiz=;;(hiss +<.q.vax) - %- (slog leaf/"< {(earn p.hiz)}" ~) + =. ..dy (he-diff %tan leaf/"< {(earn p.hiz)}" ~) (dy-eyre(pro `(slap (slot 7 vax) cnzy/%q)) /scar hiz) == :: diff --git a/gen/bit/address-contact.hoon b/gen/bit/address-contact.hoon index f97e94f764..c468b96a80 100644 --- a/gen/bit/address-contact.hoon +++ b/gen/bit/address-contact.hoon @@ -6,7 +6,7 @@ :: ::::::: !: -:- %cat +:- %say |= [^ arg=[address=@t contact=@t ~] ~] :- %address-contact [address.arg contact.arg] diff --git a/gen/bit/auth.hoon b/gen/bit/auth.hoon index b3994bb8a7..56f2674046 100644 --- a/gen/bit/auth.hoon +++ b/gen/bit/auth.hoon @@ -5,7 +5,7 @@ :: ::::: !: -:- %cat +:- %say |= [^ [arg1=cord arg2=cord ~] ~] ::[arg=[cord cord ~] ~]] :- %auth [arg1 arg2] diff --git a/gen/bit/buy.hoon b/gen/bit/buy.hoon index a9c3a0135f..4b1423c9d7 100644 --- a/gen/bit/buy.hoon +++ b/gen/bit/buy.hoon @@ -5,7 +5,7 @@ :: ::::::: !: -:- %cat +:- %say |= [^ [amount=@t currency=@t ~] ~] :- %buy [amount currency] diff --git a/gen/bit/contact-address.hoon b/gen/bit/contact-address.hoon index fbf799b157..16770fb846 100644 --- a/gen/bit/contact-address.hoon +++ b/gen/bit/contact-address.hoon @@ -6,7 +6,7 @@ :: ::::::: !: -:- %cat +:- %say |= [^ arg=[contact=@t address=@t ~] ~] :- %bit-contact [contact.arg address.arg] diff --git a/gen/bit/list.hoon b/gen/bit/list.hoon index ee742c50b8..9393e2bb54 100644 --- a/gen/bit/list.hoon +++ b/gen/bit/list.hoon @@ -5,7 +5,7 @@ :: ::::::: !: -:- %cat +:- %say |= [^ ~ ~] :- %list ~ diff --git a/gen/bit/sell.hoon b/gen/bit/sell.hoon index 8f142de9c0..deb4fde69e 100644 --- a/gen/bit/sell.hoon +++ b/gen/bit/sell.hoon @@ -5,7 +5,7 @@ :: ::::::: !: -:- %cat +:- %say |= [^ [amount=@t currency=@t ~] ~] :- %sell [amount currency] diff --git a/gen/bit/send.hoon b/gen/bit/send.hoon index ff80f4e400..c7dcb06edb 100644 --- a/gen/bit/send.hoon +++ b/gen/bit/send.hoon @@ -5,7 +5,7 @@ :: ::::::: !: -:- %cat +:- %say |= [^ [to=@uc amo=@t ~] ~] [%bit-send to amo] diff --git a/gen/cat.hoon b/gen/cat.hoon index e141821607..b59e13c516 100644 --- a/gen/cat.hoon +++ b/gen/cat.hoon @@ -7,7 +7,7 @@ !: :::: :: -:- %cat +:- %say |= [^ [arg=(list path)] ~] =- tang/(flop `tang`(zing -)) %+ turn arg diff --git a/gen/coin/keys.hoon b/gen/coin/keys.hoon index a2e81e3b6c..7cdbd39356 100644 --- a/gen/coin/keys.hoon +++ b/gen/coin/keys.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= [^ [arg=(list cord) ~]] :- %keys arg diff --git a/gen/curl/url.hoon b/gen/curl/url.hoon index 51ebcd2042..5fc8ec3392 100644 --- a/gen/curl/url.hoon +++ b/gen/curl/url.hoon @@ -5,6 +5,6 @@ :: ::::: !: -:- %cat +:- %say |= [^ [arg=tape ~] ~] purl/(scan arg auri:epur) diff --git a/gen/hello.hoon b/gen/hello.hoon index be63a0eaae..2fd84bf2c1 100644 --- a/gen/hello.hoon +++ b/gen/hello.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= [^ [[txt=@tas ~] ~]] :- %noun (crip (weld "hello, " (flop (trip txt)))) diff --git a/gen/hood/begin.hoon b/gen/hood/begin.hoon index 999ff41137..efc0ae5fb6 100644 --- a/gen/hood/begin.hoon +++ b/gen/hood/begin.hoon @@ -11,7 +11,7 @@ ++ scug |*([a=@ b=(pole)] ?~(b ~ ?~(a ~ [-.b $(b +.b, a (dec a))]))) -- [sole .] -:- %dog +:- %ask |= $: [now=@da eny=@uvI bec=beak] [arg=_(scug *@ ~[his=*@p tic=*@p]) ~] == diff --git a/gen/hood/breload.hoon b/gen/hood/breload.hoon index 8245270497..5bf49573e1 100644 --- a/gen/hood/breload.hoon +++ b/gen/hood/breload.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= $: [now=@da eny=@uvI bec=beak] [arg=(list term) ~] == diff --git a/gen/hood/cp.hoon b/gen/hood/cp.hoon index 7e523c7d32..a4dfce141f 100644 --- a/gen/hood/cp.hoon +++ b/gen/hood/cp.hoon @@ -1,2 +1,2 @@ -:- %cat +:- %say |=([^ [input=path output=path ~] ~] kiln-cp/[input output]) diff --git a/gen/hood/hi.hoon b/gen/hood/hi.hoon index 048c2756be..fd4e96142e 100644 --- a/gen/hood/hi.hoon +++ b/gen/hood/hi.hoon @@ -1,2 +1,2 @@ -:- %cat +:- %say |=([^ [who=ship mez=$|(~ [a=tape ~])] ~] helm-send-hi/[who ?~(mez ~ `a.mez)]) diff --git a/gen/hood/init.hoon b/gen/hood/init.hoon index 23b63708c6..cf0beacc9f 100644 --- a/gen/hood/init.hoon +++ b/gen/hood/init.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= $: [now=@da eny=@uvI bec=beak] [~ ~] == diff --git a/gen/hood/invite.hoon b/gen/hood/invite.hoon index 5c992a59c1..3792629d27 100644 --- a/gen/hood/invite.hoon +++ b/gen/hood/invite.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= $: [now=@da eny=@uvI bec=beak] [[who=@p myl=@t ~] ~] == diff --git a/gen/hood/label.hoon b/gen/hood/label.hoon index ec414c06a7..6f81d1bd37 100644 --- a/gen/hood/label.hoon +++ b/gen/hood/label.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= $: [now=@da eny=@uvI bec=beak] [arg=[syd=desk lab=@tas ~] ~] == diff --git a/gen/hood/link.hoon b/gen/hood/link.hoon index 87cb6b9a97..0437ff949d 100644 --- a/gen/hood/link.hoon +++ b/gen/hood/link.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= $: [now=@da eny=@uvI byk=beak] [arg=$?([dap=term ~] [who=ship dap=term ~]) ~] == diff --git a/gen/hood/mass.hoon b/gen/hood/mass.hoon index e2f2e5b742..70bba8c896 100644 --- a/gen/hood/mass.hoon +++ b/gen/hood/mass.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= $: [now=@da eny=@uvI bec=beak] [arg=~ ~] == diff --git a/gen/hood/merge.hoon b/gen/hood/merge.hoon index 382f7d3580..a7620ba641 100644 --- a/gen/hood/merge.hoon +++ b/gen/hood/merge.hoon @@ -10,7 +10,7 @@ :: :::: !: -:- %cat +:- %say |= $: [now=@da eny=@uvI bek=beak] [arg=[?(sorc [syd=$|(desk beaky) sorc])] gem=?(%auto germ)] == diff --git a/gen/hood/mount.hoon b/gen/hood/mount.hoon index f8d5eb3a3e..f060ca71d8 100644 --- a/gen/hood/mount.hoon +++ b/gen/hood/mount.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= $: [now=@da eny=@uvI bec=beak] [[pax=path pot=$|(~ [v=@tas ~])] ~] == diff --git a/gen/hood/mv.hoon b/gen/hood/mv.hoon index c0071d2465..84ca6ad66c 100644 --- a/gen/hood/mv.hoon +++ b/gen/hood/mv.hoon @@ -1,2 +1,2 @@ -:- %cat +:- %say |=([^ [input=path output=path ~] ~] kiln-mv/[input output]) diff --git a/gen/hood/rc.hoon b/gen/hood/rc.hoon index 891eb6bf9e..109d587dc9 100644 --- a/gen/hood/rc.hoon +++ b/gen/hood/rc.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= $: [now=@da eny=@uvI bec=beak] [arg=~ ~] == diff --git a/gen/hood/reboot.hoon b/gen/hood/reboot.hoon index 9373033b21..15eb0d6608 100644 --- a/gen/hood/reboot.hoon +++ b/gen/hood/reboot.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= $: [now=@da eny=@uvI bec=beak] [arg=~ ~] == diff --git a/gen/hood/reload-desk.hoon b/gen/hood/reload-desk.hoon index 8ead150990..bac2b41958 100644 --- a/gen/hood/reload-desk.hoon +++ b/gen/hood/reload-desk.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= $: [now=@da eny=@uvI bec=beak] [arg=[desk (list term)] ~] == diff --git a/gen/hood/reload.hoon b/gen/hood/reload.hoon index d619bad32e..aadec03c12 100644 --- a/gen/hood/reload.hoon +++ b/gen/hood/reload.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= $: [now=@da eny=@uvI bec=beak] [arg=(list term) ~] == diff --git a/gen/hood/reset.hoon b/gen/hood/reset.hoon index 31415365d3..77115e8ad8 100644 --- a/gen/hood/reset.hoon +++ b/gen/hood/reset.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= $: [now=@da eny=@uvI bec=beak] [arg=~ ~] == diff --git a/gen/hood/rf.hoon b/gen/hood/rf.hoon index c7d2f581a7..0bdfef13bc 100644 --- a/gen/hood/rf.hoon +++ b/gen/hood/rf.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= $: [now=@da eny=@uvI bec=beak] [arg=~ ~] == diff --git a/gen/hood/rm.hoon b/gen/hood/rm.hoon index 9360dbd17e..7b7d3b4491 100644 --- a/gen/hood/rm.hoon +++ b/gen/hood/rm.hoon @@ -1,2 +1,2 @@ -:- %cat +:- %say |=([^ [input=path ~] ~] kiln-rm/input) diff --git a/gen/hood/schedule.hoon b/gen/hood/schedule.hoon index bd33a2d4fc..9cc6750850 100644 --- a/gen/hood/schedule.hoon +++ b/gen/hood/schedule.hoon @@ -1,2 +1,2 @@ -:- %cat +:- %say |=([^ [where=path tym=@da eve=@t ~] ~] kiln-schedule/[where tym eve]) diff --git a/gen/hood/start.hoon b/gen/hood/start.hoon index ee55494645..8bc6aa8fbb 100644 --- a/gen/hood/start.hoon +++ b/gen/hood/start.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= $: [now=@da eny=@uvI bec=beak] [arg=[@ $|(~ [@ ~])] ~] == diff --git a/gen/hood/sync.hoon b/gen/hood/sync.hoon index 368d1f7293..492a25a9df 100644 --- a/gen/hood/sync.hoon +++ b/gen/hood/sync.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= $: [now=@da eny=@uvI bec=beak] [arg=[syd=@tas her=@p sud=@tas ~] ~] == diff --git a/gen/hood/unix.hoon b/gen/hood/unix.hoon index 7d119e885e..b564ae7bc0 100644 --- a/gen/hood/unix.hoon +++ b/gen/hood/unix.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= $: [now=@da eny=@uvI bec=beak] [[syd=@tas syn=?(~ [? ~])] ~] == diff --git a/gen/hood/unmount.hoon b/gen/hood/unmount.hoon index f6a382c0b8..63f77ce7f5 100644 --- a/gen/hood/unmount.hoon +++ b/gen/hood/unmount.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= $: [now=@da eny=@uvI bec=beak] [[mon=$|(term [span path]) ~] ~] == diff --git a/gen/hood/unsync.hoon b/gen/hood/unsync.hoon index 540f94e5b3..873821bd10 100644 --- a/gen/hood/unsync.hoon +++ b/gen/hood/unsync.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= $: [now=@da eny=@uvI bec=beak] [arg=[syd=@tas her=@p sud=@tas ~] ~] == diff --git a/gen/hood/verb.hoon b/gen/hood/verb.hoon index 2d0c6894a6..2752ee691d 100644 --- a/gen/hood/verb.hoon +++ b/gen/hood/verb.hoon @@ -7,7 +7,7 @@ :::: !: [sole .] -:- %cat +:- %say |= $: [now=@da eny=@ bec=beak] [~ ~] == diff --git a/gen/ls.hoon b/gen/ls.hoon index f2d29e7d44..f5e57f2b12 100644 --- a/gen/ls.hoon +++ b/gen/ls.hoon @@ -6,7 +6,7 @@ !: :::: :: -:- %cat +:- %say |= [^ [arg=path ~] ~] =+ lon=((hard arch) .^(%cy arg)) tang/[?~(dir.lon leaf/"~" (subdir arg dir.lon))]~ diff --git a/gen/make.hoon b/gen/make.hoon index 944ac08e0b..0c7da0f690 100644 --- a/gen/make.hoon +++ b/gen/make.hoon @@ -1,2 +1,2 @@ -:- %cat +:- %say |=([^ arg=(list ,@) foo=_`@`1 bar=_`@`2] noun/[arg foo bar]) \ No newline at end of file diff --git a/gen/pope.hoon b/gen/pope.hoon index be64c3d64d..073802899e 100644 --- a/gen/pope.hoon +++ b/gen/pope.hoon @@ -3,7 +3,7 @@ !: =+ cryp=bruw :: XX change to ec2 ++brew eventually =+ [sole] -:- %dog +:- %ask |= $: [now=@da eny=@uvI bec=beak] [[who=ship ~] ~] == diff --git a/gen/solid.hoon b/gen/solid.hoon index a5b9e0e0b4..382958b2c5 100644 --- a/gen/solid.hoon +++ b/gen/solid.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= $: [now=@da eny=@uvI bec=beak] [~ ~] == diff --git a/gen/ticket.hoon b/gen/ticket.hoon index c49161948d..3358a916a6 100644 --- a/gen/ticket.hoon +++ b/gen/ticket.hoon @@ -5,7 +5,7 @@ :: :::: !: -:- %cat +:- %say |= $: [now=@da eny=@uvI bec=beak] [[her=@p ~] ~] == diff --git a/gen/tree.hoon b/gen/tree.hoon index 3feee2847d..5dadf46b06 100644 --- a/gen/tree.hoon +++ b/gen/tree.hoon @@ -5,7 +5,7 @@ !: :::: :: -:- %cat +:- %say |= [^ [pax=path fla=$|(~ [%full ~])] ~] =+ len=(lent pax) =+ rend=?^(fla dank:ut |=(a=path (dank:ut (slag len a)))) diff --git a/gen/twit/as.hoon b/gen/twit/as.hoon index 5bcd603b68..c61f56d642 100644 --- a/gen/twit/as.hoon +++ b/gen/twit/as.hoon @@ -3,7 +3,7 @@ :::: :: [twitter .] -:- %cat +:- %say |= $: [now=@da eny=@uvI bec=beak] [[who=span msg=cord ~] ~] == diff --git a/gen/twit/auth.hoon b/gen/twit/auth.hoon index e25f48724d..dee562fe0f 100644 --- a/gen/twit/auth.hoon +++ b/gen/twit/auth.hoon @@ -6,7 +6,7 @@ ++ baz64 (cook crip (star alp)) -- !: -:- %dog +:- %ask |= $: [now=@da eny=@uvI bec=beak] [~ ~] == diff --git a/gen/twit/twitter-feed.hoon b/gen/twit/twitter-feed.hoon index 9712e76aa7..3b7de89703 100644 --- a/gen/twit/twitter-feed.hoon +++ b/gen/twit/twitter-feed.hoon @@ -10,7 +10,7 @@ |_ [hide ~] ++ stat ,[id=@u who=@ta now=@da txt=@t] ++ rens -:- %cat +:- %say |=(stat rose/[": " `~]^~[leaf/"{} @{(trip who)}" leaf/(trip txt)]) ++ peer ,_`. ++ poke--args diff --git a/sur/sole.hoon b/sur/sole.hoon index a3bbd86b4f..1ebeb960c6 100644 --- a/sur/sole.hoon +++ b/sur/sole.hoon @@ -74,9 +74,9 @@ (pair hiss $+(httr (sole-request out))) :: fetch and continue :: :: ++ sole-gen :: XX virtual type - $% [%cat $+((sole-args) (cask))] :: direct noun - [%dog $+((sole-args) (sole-product (cask)))] :: dialog - [%pig $+((sole-args) (sole-request (cask)))] :: scraper + $% [%say $+((sole-args) (cask))] :: direct noun + [%ask $+((sole-args) (sole-product (cask)))] :: dialog + [%get $+((sole-args) (sole-request (cask)))] :: scraper == :: ++ sole-args :: generator arguments |* _[lit=,* opt=,*] :: From 77eb638240dcc75bbf0a367e2230e9e5256d4bc5 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Fri, 11 Sep 2015 17:06:02 -0400 Subject: [PATCH 17/59] merge clay card-sending pathways --- arvo/clay.hoon | 445 +++++++++++++++++++++++-------------------------- 1 file changed, 208 insertions(+), 237 deletions(-) diff --git a/arvo/clay.hoon b/arvo/clay.hoon index f6c8f9bf37..ea54763739 100644 --- a/arvo/clay.hoon +++ b/arvo/clay.hoon @@ -162,11 +162,7 @@ mer=mer.jod == =* red -> - =| yel=(list ,[p=duct q=gift]) - =| byn=(list ,[p=duct q=riot]) - =| reg=(list ,[p=duct q=gift]) - =| say=(list ,[p=duct q=path r=ship s=[p=@ud q=riff]]) - =| tag=(list move) + =| mow=(list move) |% ++ abet ^- [(list move) raft] @@ -176,23 +172,7 @@ ruf(hoy (~(put by hoy.ruf) her rug)) =+ dos=(~(put by dos.u.rom) syd [qyx dom dok mer]) ruf(fat (~(put by fat.ruf) her [(need hun) dos])) - ;: weld - %+ turn (flop yel) - |=([a=duct b=gift] [(need hun) %give b]) - :: - %+ turn (flop reg) - |=([a=duct b=gift] [a %give b]) - :: - %+ turn (flop byn) - |=([a=duct b=riot] [a %give [%writ b]]) - :: - %+ turn (flop say) - |= [a=duct b=path c=ship d=[p=@ud q=riff]] - :- a - [%pass b %a %wont [our c] [%c %question p.q.d (scot %ud p.d) ~] q.d] - :: - tag - == + (flop mow) :: ++ aver :: read |= mun=mood @@ -260,6 +240,14 @@ (mule |.(`~`~|([%expected-path got=p.pax] !!))) $(tay t.tay, can (~(put by can) ((hard path) q.q.pax) q.i.tay)) :: + ++ emit + |= mof=move + %_(+> mow [mof mow]) + :: + ++ emil + |= mof=(list move) + %_(+> mow (welp mof mow)) + :: ++ balk :: read and send |= [hen=duct cay=(unit (each cage lobe)) mun=mood] ^+ +> @@ -268,18 +256,18 @@ :: ++ bait |= [hen=duct tym=@da] - %_(+> tag :_(tag [hen %pass /tyme %t %wait tym])) + (emit hen %pass /tyme %t %wait tym) :: ++ best |= [hen=duct tym=@da] - %_(+> tag :_(tag [hen %pass /tyme %t %rest tym])) + (emit hen %pass /tyme %t %rest tym) :: ++ blab :: ship result |= [hen=duct mun=mood dat=(each cage lobe)] ^+ +> ?: ?=(%& -.dat) - +>.$(byn [[hen ~ [p.mun q.mun syd] r.mun p.dat] byn]) - =- +>.$(tag [- tag]) + (emit hen %give %writ ~ [p.mun q.mun syd] r.mun p.dat) + %- emit :* hen %pass [%blab p.mun (scot q.mun) syd r.mun] %f %exec our ~ [her syd q.mun] (lobe-to-silk:ze r.mun p.dat) == @@ -295,7 +283,15 @@ :: ++ blub :: ship stop |= hen=duct - %_(+> byn [[hen ~] byn]) + (emit hen %give %writ ~) + :: + ++ print-to-dill + |= [car=@tD tan=tank] + (emit (need hun) %give %note car tan) + :: + ++ send-over-ames + |= [a=duct b=path c=ship d=[p=@ud q=riff]] + (emit a %pass b %a %wont [our c] [%c %question p.q.d (scot %ud p.d) ~] q.d) :: ++ duce :: produce request |= rov=rove @@ -309,8 +305,10 @@ ?. ?=([%sing %v *] rav) rav [%many %| [%ud let.dom] `case`q.p.rav r.p.rav] =+ inx=nix.u.ref + =. +>+.$ + =< ?>(?=(^ ref) .) + (send-over-ames hen [(scot %ud inx) ~] her inx syd ~ vaw) %= +>+.$ - say [[hen [(scot %ud inx) ~] her [inx syd ~ vaw]] say] nix.u.ref +(nix.u.ref) bom.u.ref (~(put by bom.u.ref) inx [hen vaw]) fod.u.ref (~(put by fod.u.ref) hen inx) @@ -335,22 +333,19 @@ =+ mus=(skim can |=(paf=path =(pax (scag (lent pax) paf)))) ?~ mus +>.$ - %_ +>.$ - tag - :_ tag - :* hen %pass [%ergoing (scot %p her) syd ~] %f - %exec our ~ [her syd %da now] %tabl - ^- (list (pair silk silk)) - %+ turn `(list path)`mus - |= a=path - ^- (pair silk silk) - :- [%$ %path !>(a)] - :+ %cast %mime - =+ (need (need (read-x:ze let.dom a))) - ?: ?=(%& -<) - [%$ p.-] - (lobe-to-silk:ze a p.-) - == + %- emit + :* hen %pass [%ergoing (scot %p her) syd ~] %f + %exec our ~ [her syd %da now] %tabl + ^- (list (pair silk silk)) + %+ turn `(list path)`mus + |= a=path + ^- (pair silk silk) + :- [%$ %path !>(a)] + :+ %cast %mime + =+ (need (need (read-x:ze let.dom a))) + ?: ?=(%& -<) + [%$ p.-] + (lobe-to-silk:ze a p.-) == :: ++ ease :: release request @@ -364,8 +359,10 @@ |- ^+ +.$ =+ nux=(~(get by fod.u.ref) hen) ?~ nux +.$ + =. +.$ + =< ?>(?=(^ ref) .) + (send-over-ames hen [(scot %ud u.nux) ~] her u.nux syd ~) %= +.$ - say [[hen [(scot %ud u.nux) ~] her [u.nux syd ~]] say] fod.u.ref (~(del by fod.u.ref) hen) bom.u.ref (~(del by bom.u.ref) u.nux) == @@ -422,31 +419,19 @@ (duce `rove`[%many p.rav ptr q.q.rav r.q.rav ear]) == :: - ++ echa :: announce raw - |= [wen=@da mer=mizu] - ^+ +> - %= +> - reg ~& %merge-announce reg - :: yel [[hen %note '=' %leaf ~] yel] :: XX do better - == - :: ++ echo :: announce changes |= [wen=@da lem=nuri] ^+ +> - %_ +>.$ - yel - =+ pre=`path`~[(scot %p her) syd (scot %ud let.dom)] - ?- -.lem - | :_ yel - [hen %note '=' %leaf :(weld (trip p.lem) " " (spud pre))] - & |- ^+ yel - ?~ p.lem yel - :_ $(p.lem t.p.lem) - :- hen - :+ %note - ?-(-.q.i.p.lem %del '-', %ins '+', %dif ':') - [%leaf (spud (weld pre p.i.p.lem))] - == + =+ pre=`path`~[(scot %p her) syd (scot %ud let.dom)] + ?- -.lem + | (print-to-dill '=' %leaf :(weld (trip p.lem) " " (spud pre))) + & |- ^+ +>.^$ + ?~ p.lem +>.^$ + =. +>.^$ + %+ print-to-dill + ?-(-.q.i.p.lem %del '-', %ins '+', %dif ':') + [%leaf (spud (weld pre p.i.p.lem))] + $(p.lem t.p.lem) == :: ++ edit :: apply changes @@ -472,107 +457,97 @@ ?& ?=([?(%hoon %hook) *] (flop pax)) ?=(%mime p.p.mis) == - =- %_ +>.$ - tag (welp - tag) - dok - :- ~ - :* %+ turn del + =. +>.$ + %- emil + ^- (list move) + :~ :* hen %pass + [%inserting (scot %p her) syd (scot %da wen) ~] + %f %exec our ~ [her syd %da wen] %tabl + ^- (list (pair silk silk)) + %+ turn ins |= [pax=path mis=miso] - ?> ?=(%del -.mis) - pax - :: - %+ turn ink - |= [pax=path mis=miso] - ^- (pair path cage) ?> ?=(%ins -.mis) + :- [%$ %path -:!>(*path) pax] =+ =>((flop pax) ?~(. %$ i)) - [pax - [%atom %t] ((hard ,@t) +>.q.q.p.mis)] - :: - ~ - :: - %- mo + [%cast - [%$ p.mis]] + == + :* hen %pass + [%diffing (scot %p her) syd (scot %da wen) ~] + %f %exec our ~ [her syd %da wen] %tabl + ^- (list (pair silk silk)) %+ turn dif |= [pax=path mis=miso] ?> ?=(%dif -.mis) - [pax p.mis] - :: - ~ - :: - %- mo + =+ (need (need (read-x:ze let.dom pax))) + ?> ?=(%& -<) + :- [%$ %path -:!>(*path) pax] + [%pact [%$ p.-] [%$ p.mis]] + == + :* hen %pass + [%castifying (scot %p her) syd (scot %da wen) ~] + %f %exec our ~ [her syd %da wen] %tabl + ^- (list (pair silk silk)) %+ turn mut |= [pax=path mis=miso] ?> ?=(%mut -.mis) - [pax p.mis] - :: - ~ - :: - ~ - :: - %- mo ^- (list (pair path mime)) - ;: welp - ^- (list (pair path mime)) - %+ murn ins - |= [pax=path mis=miso] - ^- (unit (pair path mime)) - ?> ?=(%ins -.mis) - ?. ?=(%mime p.p.mis) - ~ - `[pax ((hard mime) q.q.p.mis)] - :: - ^- (list (pair path mime)) - %+ murn ink - |= [pax=path mis=miso] - ^- (unit (pair path mime)) - ?> ?=(%ins -.mis) - ?> ?=(%mime p.p.mis) - `[pax ((hard mime) q.q.p.mis)] - :: - ^- (list (pair path mime)) - %+ murn mut - |= [pax=path mis=miso] - ^- (unit (pair path mime)) - ?> ?=(%mut -.mis) - ?. ?=(%mime p.p.mis) - ~ - `[pax ((hard mime) q.q.p.mis)] - == + :- [%$ %path -:!>(*path) pax] + =+ (lobe-to-mark:ze (~(got by q:(aeon-to-yaki:ze let.dom)) pax)) + [%cast - [%$ p.mis]] == - == - ^- (list move) - :~ :* hen %pass - [%inserting (scot %p her) syd (scot %da wen) ~] - %f %exec our ~ [her syd %da wen] %tabl - ^- (list (pair silk silk)) - %+ turn ins + == + %_ +>.$ + dok + :- ~ + :* (turn del |=([pax=path mis=miso] ?>(?=(%del -.mis) pax))) + :: + %+ turn ink + |= [pax=path mis=miso] + ^- (pair path cage) + ?> ?=(%ins -.mis) + =+ =>((flop pax) ?~(. %$ i)) + [pax - [%atom %t] ((hard ,@t) +>.q.q.p.mis)] + :: + ~ + :: + (mo (turn dif |=([pax=path mis=miso] ?>(?=(%dif -.mis) [pax p.mis])))) + :: + ~ + :: + (mo (turn mut |=([pax=path mis=miso] ?>(?=(%mut -.mis) [pax p.mis])))) + :: + ~ + :: + ~ + :: + %- mo ^- (list (pair path mime)) + ;: welp + ^- (list (pair path mime)) + %+ murn ins |= [pax=path mis=miso] + ^- (unit (pair path mime)) ?> ?=(%ins -.mis) - :- [%$ %path -:!>(*path) pax] - =+ =>((flop pax) ?~(. %$ i)) - [%cast - [%$ p.mis]] - == - :* hen %pass - [%diffing (scot %p her) syd (scot %da wen) ~] - %f %exec our ~ [her syd %da wen] %tabl - ^- (list (pair silk silk)) - %+ turn dif + ?. ?=(%mime p.p.mis) + ~ + `[pax ((hard mime) q.q.p.mis)] + :: + ^- (list (pair path mime)) + %+ murn ink |= [pax=path mis=miso] - ?> ?=(%dif -.mis) - =+ (need (need (read-x:ze let.dom pax))) - ?> ?=(%& -<) - :- [%$ %path -:!>(*path) pax] - [%pact [%$ p.-] [%$ p.mis]] - == - :* hen %pass - [%castifying (scot %p her) syd (scot %da wen) ~] - %f %exec our ~ [her syd %da wen] %tabl - ^- (list (pair silk silk)) - %+ turn mut + ^- (unit (pair path mime)) + ?> ?=(%ins -.mis) + ?> ?=(%mime p.p.mis) + `[pax ((hard mime) q.q.p.mis)] + :: + ^- (list (pair path mime)) + %+ murn mut |= [pax=path mis=miso] + ^- (unit (pair path mime)) ?> ?=(%mut -.mis) - :- [%$ %path -:!>(*path) pax] - =+ (lobe-to-mark:ze (~(got by q:(aeon-to-yaki:ze let.dom)) pax)) - [%cast - [%$ p.mis]] - == + ?. ?=(%mime p.p.mis) + ~ + `[pax ((hard mime) q.q.p.mis)] + == + == == :: ++ silkify @@ -691,8 +666,7 @@ %+ turn cat |= [pax=path cay=cage] [pax (page-to-lobe:ze [p q.q]:cay)] - =- %_(+>.$ tag [- tag]) - ^- move + %- emit :* hen %pass [%mutating (scot %p her) syd (scot %da wen) ~] %f %exec our ~ [her syd %da wen] %tabl @@ -733,11 +707,8 @@ ^+ +> :: ~& %taking-patch ?: ?=(%| -.res) - %_ +>.$ - dok ~ - yel - [[hen %note '!' %rose [" " "" ""] leaf/"clay patch failed" p.res] yel] - == + =. dok ~ + (print-to-dill '!' %rose [" " "" ""] leaf/"clay patch failed" p.res) :: ~& %editing =+ ^- sim=(list (pair path misu)) ?~ dok @@ -795,38 +766,31 @@ =+ can=(mo sim) :: ~& %forming-ergo :: =- ~& %formed-ergo - - %_ +>.$ - dok ~ - tag - :_ tag - :* hen %pass [%ergoing (scot %p her) syd ~] %f - %exec our ~ [her syd %da now] %tabl - ^- (list (pair silk silk)) - %+ turn (~(tap in sum)) - |= a=path - ^- (pair silk silk) - :- [%$ %path !>(a)] - =+ b=(~(got by can) a) - ?: ?=(%del -.b) - [%$ %null !>(~)] - =+ (~(get by mim.u.dok) a) - ?^ - [%$ %mime !>(u.-)] - :+ %cast %mime - =+ (need (need (read-x:ze let.dom a))) - ?: ?=(%& -<) - [%$ p.-] - (lobe-to-silk:ze a p.-) - == + %- emit(dok ~) + :* hen %pass [%ergoing (scot %p her) syd ~] %f + %exec our ~ [her syd %da now] %tabl + ^- (list (pair silk silk)) + %+ turn (~(tap in sum)) + |= a=path + ^- (pair silk silk) + :- [%$ %path !>(a)] + =+ b=(~(got by can) a) + ?: ?=(%del -.b) + [%$ %null !>(~)] + =+ (~(get by mim.u.dok) a) + ?^ - [%$ %mime !>(u.-)] + :+ %cast %mime + =+ (need (need (read-x:ze let.dom a))) + ?: ?=(%& -<) + [%$ p.-] + (lobe-to-silk:ze a p.-) == :: ++ take-ergo |= res=gage ^+ +> ?: ?=(%| -.res) - %_ +>.$ - yel - [[hen %note '!' %rose [" " "" ""] leaf/"clay ergo failed" p.res] yel] - == + (print-to-dill '!' %rose [" " "" ""] leaf/"clay ergo failed" p.res) ?~ hez ~|(%no-sync-duct !!) =+ ^- can=(map path (unit mime)) %- mo ^- mode @@ -839,33 +803,27 @@ ~ `((hard mime) q.q.mim) =+ mus=(must-ergo (turn (~(tap by can)) head)) - %= +>.$ - reg - %- welp :_ reg - %+ turn (~(tap by mus)) - |= [pot=term len=@ud pak=(set path)] - :* u.hez %ergo pot - %+ turn (~(tap in pak)) - |= pax=path - [(slag len pax) (~(got by can) pax)] - == + %- emil + %+ turn (~(tap by mus)) + |= [pot=term len=@ud pak=(set path)] + :* u.hez %give %ergo pot + %+ turn (~(tap in pak)) + |= pax=path + [(slag len pax) (~(got by can) pax)] == :: ++ checkout-ankh |= hat=(map path lobe) ^+ +> - %_ +>.$ - tag - :_ tag - :* hen %pass [%patching (scot %p her) syd ~] %f - %exec our :^ ~ [her syd %da now] %tabl - ^- (list (pair silk silk)) - %+ turn (~(tap by hat)) - |= [a=path b=lobe] - ^- (pair silk silk) - :- [%$ %path-hash !>([a b])] - (lobe-to-silk:ze a b) - == + %- emit + :* hen %pass [%patching (scot %p her) syd ~] %f + %exec our :^ ~ [her syd %da now] %tabl + ^- (list (pair silk silk)) + %+ turn (~(tap by hat)) + |= [a=path b=lobe] + ^- (pair silk silk) + :- [%$ %path-hash !>([a b])] + (lobe-to-silk:ze a b) == :: ++ apply-foreign-update :: apply subscription @@ -1020,7 +978,7 @@ |= rut=rand ^+ +> ~| [%x-over-network-not-implemented [p q -.r]:rut hen] !! - :: =- %_(+>.$ tag [- tag]) + :: %- emit :: :* hen :: [%foreign-plops (scot %p our) (scot %p her) syd ~] :: %f %exec our ~ %tabl @@ -1043,7 +1001,7 @@ ++ validate-x |= [car=care cas=case pax=path peg=page] ^+ +> - =- %_(+>.$ tag [- tag]) + %- emit :* hen %pass [%foreign-x (scot %p our) (scot %p her) syd car (scot cas) pax] %f %exec our ~ [her syd cas] @@ -1065,8 +1023,8 @@ ++ validate-plops |= [cas=case lem=(unit ,@da) pop=(set plop)] ^+ +> - =- %_(+>.$ tag [- tag]) =+ lum=(scot %da (fall lem *@da)) + %- emit :* hen %pass [%foreign-plops (scot %p our) (scot %p her) syd lum ~] %f %exec our ~ [her syd cas] %tabl @@ -1074,14 +1032,8 @@ %+ turn (~(tap in pop)) |= a=plop ?- -.a - %delta - :- [%$ %blob !>([%delta p.a q.a *page])] - [%vale p.r.a q.r.a] - :: - %direct - :- [%$ %blob !>([%direct p.a *page])] - [%vale p.q.a q.q.a] - :: + %delta [[%$ %blob !>([%delta p.a q.a *page])] [%vale p.r.a q.r.a]] + %direct [[%$ %blob !>([%direct p.a *page])] [%vale p.q.a q.q.a]] %indirect ~| %foreign-indirect-not-implemented !! == == @@ -1530,6 +1482,15 @@ ~ ```[%null [%atom %n] ~] :: + ++ read-v + |= [yon=aeon pax=path] + ^- (unit (unit ,[%dome (hypo dome)])) + ?: (lth yon let.dom) + ~ + ?: (gth yon let.dom) + `~ + ``[%dome -:!>(*dome) dom] + :: ++ read-x |= [yon=aeon pax=path] ^- (unit (unit (each cage lobe))) @@ -1611,6 +1572,8 @@ ?^(r.mun [~ ~] [~ ~ %& %aeon !>(yon)]) ?: ?=(%u p.mun) (read-u yon r.mun) + ?: ?=(%v p.mun) + (bind (read-v yon r.mun) (curr bind (cury same %&))) ?: ?=(%x p.mun) (read-x yon r.mun) ?: ?=(%y p.mun) @@ -1716,7 +1679,17 @@ ^+ ..me ?: don ..me(mer `dat) - ..me(mer ~, reg :_(reg [hen %mere gon.dat])) + =. mer ~ + => (emit hen %give %mere gon.dat) + ..me + :: + ++ emit + |= move + %_(+> ..ze (^emit +<)) + :: + ++ emil + |= (list move) + %_(+> ..ze (^emil +<)) :: ++ route |= [sat=term res=(each riot gage)] @@ -1759,7 +1732,7 @@ :: ++ fetch-ali ^+ . - =- %_(+ tag [- tag], wat.dat %ali) + %- emit(wat.dat %ali) :* hen %pass [%merge (scot %p p.bob) q.bob (scot %p p.ali) q.ali %ali ~] %c %warp [p.bob p.ali] q.ali @@ -1937,7 +1910,7 @@ ++ diff-bas |= [nam=term yak=yaki oth=(trel ship desk case) yuk=yaki] ^+ +> - =- %_(+>.$ tag [- tag]) + %- emit :* hen %pass =+ (cat 3 %diff- nam) [%merge (scot %p p.bob) q.bob (scot %p p.ali) q.ali - ~] @@ -2046,7 +2019,7 @@ |- ^+ +.$ ?+ gem.dat ~| [%merge-weird-gem gem.dat] !! ?(%mate %meld) - =- %_(+.$ tag [- tag], wat.dat %merge) + %- emit(wat.dat %merge) :* hen %pass [%merge (scot %p p.bob) q.bob (scot %p p.ali) q.ali %merge ~] %f %exec p.bob ~ [p.bob q.bob da/now] %tabl @@ -2080,7 +2053,7 @@ :: ++ build ^+ . - =- %_(+ tag [- tag], wat.dat %build) + %- emit(wat.dat %build) :* hen %pass [%merge (scot %p p.bob) q.bob (scot %p p.ali) q.ali %build ~] %f %exec p.bob ~ [p.bob q.bob da/now] %tabl @@ -2201,11 +2174,11 @@ :: ++ checkout ^+ . - =- %_(+ tag [- tag], wat.dat %checkout) =+ ^- val=beak ?: ?=(%init gem.dat) [p.ali q.ali cas.dat] [p.bob q.bob da/now] + %- emit(wat.dat %checkout) :* hen %pass [%merge (scot %p p.bob) q.bob (scot %p p.ali) q.ali %checkout ~] %f %exec p.bob ~ val %tabl @@ -2244,7 +2217,6 @@ :: ++ ergo ^+ . - =- %_(+ tag [- tag], wat.dat %ergo) =+ ^- sum=(set path) =+ (must-ergo (turn (~(tap by erg.dat)) head)) =+ (turn (~(tap by -)) (corl tail tail)) @@ -2256,6 +2228,7 @@ ?: ?=(%init gem.dat) [p.ali q.ali cas.dat] [p.bob q.bob da/now] + %- emit(wat.dat %ergo) :* hen %pass [%merge (scot %p p.bob) q.bob (scot %p p.ali) q.ali %ergo ~] %f %exec p.bob ~ val %tabl @@ -2292,17 +2265,15 @@ (error:he %ergo-no-hez ~) ?: ?=(%| -.gon.dat) +>.$ - %* done he - reg - =+ mus=(must-ergo (turn (~(tap by erg.dat)) head)) - %- welp :_ reg - %+ turn (~(tap by mus)) - |= [pot=term len=@ud pak=(set path)] - :* u.hez %ergo pot - %+ turn (~(tap in pak)) - |= pax=path - [(slag len pax) (~(got by can) pax)] - == + =+ mus=(must-ergo (turn (~(tap by erg.dat)) head)) + =< done:he + %- emil + %+ turn (~(tap by mus)) + |= [pot=term len=@ud pak=(set path)] + :* u.hez %give %ergo pot + %+ turn (~(tap in pak)) + |= pax=path + [(slag len pax) (~(got by can) pax)] == :: ++ he From e22d13c6a6b6678aa4aca9a17253ed64bce90bbf Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Fri, 11 Sep 2015 17:36:52 -0700 Subject: [PATCH 18/59] curl generator example --- gen/curl.hoon | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 gen/curl.hoon diff --git a/gen/curl.hoon b/gen/curl.hoon new file mode 100644 index 0000000000..8c446c3079 --- /dev/null +++ b/gen/curl.hoon @@ -0,0 +1,6 @@ +/- sole +[sole] +:- %get |= [^ [a=tape ~] ~] +%+ sole-at (scan a auri:epur) +|= hit=httr +(sole-so %httr hit) From 4d2d972539d5afe15cf30559e77d84862347c943 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Mon, 14 Sep 2015 19:07:47 -0400 Subject: [PATCH 19/59] unlog --- ape/talk.hoon | 6 ++++++ mar/unlog.hoon | 11 +++++++++++ 2 files changed, 17 insertions(+) create mode 100644 mar/unlog.hoon diff --git a/ape/talk.hoon b/ape/talk.hoon index ae984f8bab..9a27e9e08a 100644 --- a/ape/talk.hoon +++ b/ape/talk.hoon @@ -1816,6 +1816,12 @@ :- [(log-to-file man) ~] +>.$(log (~(put by log) man count:(~(got by stories) man))) :: +++ poke-unlog + |= man=span + ^- (quip move +>) + :- ~ + +>.$(log (~(del by log) man)) +:: ++ prep |= [old=(unit house-any)] ^- (quip move +>) diff --git a/mar/unlog.hoon b/mar/unlog.hoon new file mode 100644 index 0000000000..f368207e45 --- /dev/null +++ b/mar/unlog.hoon @@ -0,0 +1,11 @@ +:: +:::: /hoon/core/unlog/mar + :: +!: +|_ man=span +++ grab + |% :: convert from + ++ noun span :: clam from %noun + -- +-- + From e0b3f6b2b1d7d038d4ea37ea3cec7394d39a8b5f Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Mon, 14 Sep 2015 18:03:40 -0700 Subject: [PATCH 20/59] fixed telegrams serialization --- mar/helm/reload.hoon | 1 + mar/talk/telegrams.hoon | 200 ++++++++++++++++++++++++++++++++++------ 2 files changed, 171 insertions(+), 30 deletions(-) create mode 100644 mar/helm/reload.hoon diff --git a/mar/helm/reload.hoon b/mar/helm/reload.hoon new file mode 100644 index 0000000000..32c7d046a8 --- /dev/null +++ b/mar/helm/reload.hoon @@ -0,0 +1 @@ +|*(* ~) \ No newline at end of file diff --git a/mar/talk/telegrams.hoon b/mar/talk/telegrams.hoon index 1c2d7c53a8..60dc3d56dd 100644 --- a/mar/talk/telegrams.hoon +++ b/mar/talk/telegrams.hoon @@ -7,15 +7,148 @@ =+ talk |_ gam=(list telegram) :: +++ grab-work-duty => [jo work-stuff] + |^ dute + ++ as + :: |*(a=fist (cu sa (ar a))) :: XX types + |* a=fist + %- cu :_ (ar a) + ~(gas in *(set ,_(need *a))) + ++ ot + |* a=(pole ,[@tas fist]) + |= b=json + %. ((^ot a) b) + %- slog + ?+ b ~ + [%o *] + %+ murn `(list ,[@tas fist])`a + |= [c=term d=fist] ^- (unit tank) + =+ (~(get by p.b) c) + ?~ - (some >[c (turn (~(tap by p.b)) head)]<) + =+ (d u) + ?~ - (some >[c u]<) + ~ + == + ++ of + |* a=(pole ,[@tas fist]) + |= b=json + %. ((of:jo a) b) + %- slog + ?+ b ~ + [%o *] + %+ murn `(list ,[@tas fist])`a + |= [c=term d=fist] ^- (unit tank) + =+ (~(get by p.b) c) + ?~ - ~ + =+ (d u) + ?~ - (some >[c u]<) + ~ + == + ++ id (ci (slat %uv) so) + ++ ship (su fed:ag) + ++ dute + %- of :~ + create/task change/(ot id/id meat/uppd ~) + archive/id update/(ot id/id version/ni her/(su fed:ag) meat/uppd ~) + == + ++ task + %- ot :~ + id/id 'date_created'^di + version/ni 'date_modified'^di + creator/ship doer/(mu ship) + tags/(as so) 'date_due'^(mu di) + done/(mu di) title/so + description/so discussion/(ar (ot date/di ship/ship body/so ~)) + == + ++ audi (as stan) + ++ stan (su ;~((glue fas) ;~(pfix sig fed:ag) urs:ab)) + ++ uppd + %- of :~ + set-doer/(mu (su fed:ag)) + set-date-due/(mu di) + set-tags/(as so) + set-title/so + set-description/so + set-done/bo + add-comment/so + == + -- +++ grow-work-duty + => work-stuff + =+ jope=|=(a=ship [%s (rsh 3 1 (scot %p a))]) + =+ jove=|=(a=@uvI [%s (scot %uv a)]) + =< |= duty + %+ joba +<- + ?- +<- + %create (task tax) + %archive (jove id) + %change (jobe id/(jove id) meat/(flesh meat) ~) + %update + %- jobe :~ + id/(jove id) + version/(jone version) + her/(jope her) + meat/(flesh meat) + == + == + |% + ++ tags + |= a=(set ,@t) + [%a (turn (sort (~(tap in a)) aor) |=(b=cord s/b))] + :: + ++ task + |= ^task + %- jobe :~ id/[%s (scot %uv id)] + tags/(^tags tags) + doer/?~(doer ~ (jope u.doer)) + title/[%s title] + creator/(jope creator) + version/(jone version) + 'date_created'^(jode date-created) + 'date_modified'^(jode date-modified) + description/[%s description] + =< discussion/[%a (turn discussion .)] + |=(comment (jobe date/(jode date) ship/(jope ship) body/[%s body] ~)) + 'date_due'^?~(date-due ~ (jode u.date-due)) + done/?~(done ~ (jode u.done)) + == + ++ flesh + |= ^flesh + %+ joba +<- + ?- +<- + %set-doer ?~(her ~ (jope u.her)) + %set-date-due ?~(wen ~ (jode u.wen)) + %set-tags (tags tag) + %set-title [%s til] + %set-description [%s des] + %set-done [%b don] + %add-comment [%s com] + == + -- ++ grab |% ++ noun (list telegram) ++ mime |=(^mime (json (rash q.q apex:poja))) ++ json - => [jo ..telegram] + => [jo ..telegram dute=grab-work-duty] |= a=json ^- (list telegram) =- (need ((ar (ot ship/(su fed:ag) thought/thot ~)) a)) |% + ++ of + |* a=(pole ,[@tas fist]) + |= b=json + %. ((of:jo a) b) + %- slog + ?+ b ~ + [%o *] + %+ murn `(list ,[@tas fist])`a + |= [c=term d=fist] ^- (unit tank) + =+ (~(get by p.b) c) + ?~ - ~ + =+ (d u) + ?~ - (some >[c u]<) + ~ + == ++ op :: parse keys of map |* [fel=_rule wit=fist] %+ cu mo @@ -30,14 +163,14 @@ %- cu :_ (ar a) ~(gas in *(set ,_(need *a))) :: - ++ lake |*(a=_,* $+(json (unit a))) - ++ peach - |* a=_[rule rule] - |= tub=nail - ^- (like (each ,_(wonk (-.a)) ,_(wonk (+.a)))) - %. tub - ;~(pose (stag %& -.a) (stag %| +.a)) + ++ ke :: callbacks + |* [gar=* sef=_|.(fist)] + |= jon=json + ^- (unit ,_gar) + =- ~! gar ~! (need -) - + ((sef) jon) :: + ++ lake |*(a=_,* $+(json (unit a))) ++ head-rush |* a=_rule |* [b=cord c=*] @@ -61,28 +194,34 @@ :: ++ parn ^- $+(nail (like partner)) - %+ peach + %+ pick ;~((glue fas) ;~(pfix sig fed:ag) urs:ab) %+ sear (soft passport) ;~((glue fas) sym urs:ab) :: XX [a-z0-9_]{1,15} :: - ++ eval - |= a=(trel ,@da bouquet ?(speech [%eval p=@t])) ^- statement - ?. ?=(%eval -.r.a) a - =+ pax=[&1:% &2:% (scot %da p.a) |3:%] - =- a(r [%fat tank/- %exp p.r.a]) - p:(mule |.([(sell (slap !>(..zuse) (rain pax p.r.a)))]~)) - :: - ++ stam - ^- $+(json (unit statement)) - %+ cu eval - =- (ot date/di bouquet/(as (ar so)) speech/(of -) ~) - :~ lin/(ot say/bo txt/so ~) - url/(su aurf:urlp) - eval/so - :: exp/(cu |=(a=cord [a ~]) so) - :: inv/(ot ship/(su fed:ag) party/(su urs:ab) ~) + ++ stam (ot date/di bouquet/(as (ar so)) speech/spec ~) + ++ spec + %+ ke *speech |. ~+ + %- of :~ + lin/(ot say/bo txt/so ~) + url/(su aurf:urlp) + exp/so + tax/dute + app/(ot txt/so src/so ~) + fat/(ot tor/tors taf/spec ~) + ext/(ot nom/so txe/blob ~) + non/ul + :: inv/(ot ship/(su fed:ag) party/(su urs:ab) ~) == + ++ tors + %+ ke *torso |. ~+ + %- of :~ + name/(ot nom/so mon/tors ~) + text/(cu lore so) + tank/(cu (hard (list tank)) blob) + == + :: + ++ blob (cu cue (su fel:ofis)) -- -- :: @@ -105,7 +244,6 @@ == :: ++ jope |=(a=ship (jape +:)) ::[%s (crip +:(scow %p a))]) - ++ joke |=(a=tank [%s (role (turn (wash 0^80 a) crip))]) ++ jode |=(a=time (jone (div (mul (sub a ~1970.1.1) 1.000) ~s1))) ++ jome :: stringify keys |* [a=_cord b=_json] @@ -148,11 +286,13 @@ %+ joba -.a ?+ -.a ~|(stub/-.a !!) %lin (jobe txt/[%s q.a] say/[%b p.a] ~) - %url (joba txt/[%s (crip (earf p.a))]) - %exp (joba txt/[%s p.a]) - %tax (joba txt/(jape )) + %url (jape (earf p.a)) + %exp [%s p.a] + %tax (grow-work-duty p.a) %app (jobe txt/[%s q.a] src/[%s p.a] ~) %fat (jobe tor/(tors p.a) taf/$(a q.a) ~) + %ext (jobe nom/[%s p.a] txe/(jape (sifo (jam +.a))) ~) + %non ~ :: %inv (jobe ship/(jope p.a) party/[%s q.a] ~) == :: @@ -161,7 +301,7 @@ %+ joba -.a ?- -.a %text [%s (role +.a)] - %tank [%a (turn +.a joke)] + %tank (jape (sifo (jam +.a))) %name (jobe nom/s/p.a mon/$(a q.a) ~) == :: From 4c14bd845ab7a717c7adbdba0e6cdf5c32b9ca91 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Tue, 15 Sep 2015 10:45:04 -0700 Subject: [PATCH 21/59] better task rendering for frontend --- mar/talk/telegrams.hoon | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mar/talk/telegrams.hoon b/mar/talk/telegrams.hoon index 60dc3d56dd..8f65092e1c 100644 --- a/mar/talk/telegrams.hoon +++ b/mar/talk/telegrams.hoon @@ -3,6 +3,7 @@ :: /? 314 /- talk +/+ talk !: =+ talk |_ gam=(list telegram) @@ -204,9 +205,9 @@ %+ ke *speech |. ~+ %- of :~ lin/(ot say/bo txt/so ~) - url/(su aurf:urlp) - exp/so - tax/dute + url/(ot txt/(su aurf:urlp) ~) + exp/(ot txt/so ~) + tax/(ot xat/dute ~) app/(ot txt/so src/so ~) fat/(ot tor/tors taf/spec ~) ext/(ot nom/so txe/blob ~) @@ -286,9 +287,9 @@ %+ joba -.a ?+ -.a ~|(stub/-.a !!) %lin (jobe txt/[%s q.a] say/[%b p.a] ~) - %url (jape (earf p.a)) - %exp [%s p.a] - %tax (grow-work-duty p.a) + %url (joba txt/(jape (earf p.a))) + %exp (joba txt/[%s p.a]) + %tax (jobe txt/(jape (rend-work-duty p.a)) xat/(grow-work-duty p.a) ~) %app (jobe txt/[%s q.a] src/[%s p.a] ~) %fat (jobe tor/(tors p.a) taf/$(a q.a) ~) %ext (jobe nom/[%s p.a] txe/(jape (sifo (jam +.a))) ~) From 1b6723071354779bed3d924e1650d57b6f54d25e Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Tue, 15 Sep 2015 10:50:30 -0700 Subject: [PATCH 22/59] tank handling --- mar/talk/telegrams.hoon | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mar/talk/telegrams.hoon b/mar/talk/telegrams.hoon index 8f65092e1c..d8f3247cfb 100644 --- a/mar/talk/telegrams.hoon +++ b/mar/talk/telegrams.hoon @@ -218,7 +218,7 @@ %+ ke *torso |. ~+ %- of :~ name/(ot nom/so mon/tors ~) - text/(cu lore so) + text/(ot dat/(cu lore so) ~) tank/(cu (hard (list tank)) blob) == :: @@ -245,6 +245,7 @@ == :: ++ jope |=(a=ship (jape +:)) ::[%s (crip +:(scow %p a))]) + ++ joke |=(a=tank [%s (role (turn (wash 0^80 a) crip))]) ++ jode |=(a=time (jone (div (mul (sub a ~1970.1.1) 1.000) ~s1))) ++ jome :: stringify keys |* [a=_cord b=_json] @@ -302,7 +303,7 @@ %+ joba -.a ?- -.a %text [%s (role +.a)] - %tank (jape (sifo (jam +.a))) + %tank (jobe txt/[%a (turn +.a joke)] dat/(jape (sifo (jam +.a))) ~) %name (jobe nom/s/p.a mon/$(a q.a) ~) == :: From 76991344701fb15ffa46297b45ebef116721178f Mon Sep 17 00:00:00 2001 From: Joan Torres Date: Mon, 14 Sep 2015 11:31:02 -0700 Subject: [PATCH 23/59] Add ++murn jet --- arvo/hoon.hoon | 1 + 1 file changed, 1 insertion(+) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 208bbb7ad4..2a92816dbd 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -696,6 +696,7 @@ $(a t.a) :: ++ murn :: maybe transform + ~/ %murn |* [a=(list) b=$+(* (unit))] |- ?~ a ~ From 93a8121a7195b7a38c20fd5a95da892c61f67bcf Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Tue, 15 Sep 2015 11:41:01 -0700 Subject: [PATCH 24/59] talk log frontend v0.1 --- pub/talklog/hymn.hook | 32 +++++++++ pub/talklog/src/MessagesComponent.coffee | 82 +++++++++++++++++++++++ pub/talklog/src/main.coffee | 3 + pub/talklog/src/util.coffee | 85 ++++++++++++++++++++++++ 4 files changed, 202 insertions(+) create mode 100644 pub/talklog/hymn.hook create mode 100644 pub/talklog/src/MessagesComponent.coffee create mode 100644 pub/talklog/src/main.coffee create mode 100644 pub/talklog/src/util.coffee diff --git a/pub/talklog/hymn.hook b/pub/talklog/hymn.hook new file mode 100644 index 0000000000..7067130d2d --- /dev/null +++ b/pub/talklog/hymn.hook @@ -0,0 +1,32 @@ +:: Talk log front-end +:: +:::: /hook/hymn/talklog/pub + :: +/? 310 +/= mez /: /===/talk /% /; pojo /json/ +|% +++ cdnj |=(a=tape ;script(src "//cdnjs.cloudflare.com/ajax/libs/{a}");) +-- +:: +:::: + :: +^- manx +;html + ;head + ;title: Talk Log + ;* %- turn :_ cdnj ^- wall + :~ "jquery/2.1.1/jquery.min.js" + "lodash.js/2.4.1/lodash.min.js" + "react/0.13.0/react.js" + == == + ;body + ;div#cont; + ;script(type "text/javascript", src "/~/at/home/lib/urb.js"); + ;link/"/home/pub/talk/src/css/main.css"(type "text/css", rel "stylesheet"); + ;script: window.MessageData = {mez} + ;script@"src/MessagesComponent.coffee"(type "text/coffeescript"); + ;script@"src/util.coffee"(type "text/coffeescript"); + ;script@"src/main.coffee"(type "text/coffeescript"); + ;+ (cdnj "coffee-script/1.7.1/coffee-script.min.js") + == +== diff --git a/pub/talklog/src/MessagesComponent.coffee b/pub/talklog/src/MessagesComponent.coffee new file mode 100644 index 0000000000..3851ac251b --- /dev/null +++ b/pub/talklog/src/MessagesComponent.coffee @@ -0,0 +1,82 @@ +recl = React.createClass +{div,pre,br,input,textarea,a} = React.DOM + + +Message = recl + lz: (n) -> if n<10 then "0#{n}" else "#{n}" + + convTime: (time) -> + d = new Date time + h = @lz d.getHours() + m = @lz d.getMinutes() + s = @lz d.getSeconds() + "~#{h}.#{m}.#{s}" + + render: -> + # pendingClass = if @props.pending isnt "received" then "pending" else "" + delivery = _.uniq _.pluck @props.thought.audience, "delivery" + klass = if delivery.indexOf("received") isnt -1 then " received" else " pending" + speech = @props.thought.statement.speech + attachments = [] + while speech.fat? + attachments.push pre {}, speech.fat.tor.tank.txt.join("\n") + speech = speech.fat.taf # XX + if !speech? then return; + if speech.lin?.say is false then klass += " say" + if speech.url then klass += " url" + + name = if @props.name then @props.name else "" + aude = _.keys @props.thought.audience + audi = window.util.clipAudi(aude).map (_audi) -> (div {}, _audi.slice(1)) + + type = ['private','public'] + type = type[Number(aude.indexOf(window.util.mainStationPath(window.urb.ship)) is -1)] + + mess = switch + when (con = speech.lin) or (con = speech.app) or + (con = speech.exp) or (con = speech.tax) + con.txt + when (con = speech.url) + (a {href:con.txt,target:"_blank"}, con.txt) + else "Unknown speech type:" + (" %"+x for x of speech).join '' + + klass += switch + when speech.app? then " say" + when speech.exp? then " exp" + else "" + + {ship} = @props + if ship[0] is "~" then ship = ship.slice(1) + + div {className:"message#{klass}"}, [ + (div {className:"attr"}, [ + div {className:"type #{type}"}, "" + div {className:"iden"}, div {className:"ship"}, ship + div {className:"audi"}, audi + div {className:"time"}, @convTime @props.thought.statement.date + ]) + div {className:"mess"}, mess, + if attachments.length + div {className:"fat"}, attachments + ] + +window.MessagesComponent = recl + pageSize: 50 + paddingTop: 100 + + getInitialState: -> {station:window.location.pathname.split("/").reverse()[0]} + + sortedMessages: (messages) -> + _.sortBy messages, (_message) -> + _message.pending = false + _message.thought.statement.date + + render: -> + _messages = @sortedMessages @props.messages + + messages = _messages.map (_message,k) => + if _message.thought.statement.speech?.app + _message.ship = "system" + _message.station = @state.station + React.createElement Message,_message + div {id: "messages"}, messages diff --git a/pub/talklog/src/main.coffee b/pub/talklog/src/main.coffee new file mode 100644 index 0000000000..e73f1ca279 --- /dev/null +++ b/pub/talklog/src/main.coffee @@ -0,0 +1,3 @@ +$ -> + rend = React.render; rele = React.createElement + rend (rele window.MessagesComponent, messages: window.MessageData), ($ '#cont')[0] diff --git a/pub/talklog/src/util.coffee b/pub/talklog/src/util.coffee new file mode 100644 index 0000000000..984a63e53c --- /dev/null +++ b/pub/talklog/src/util.coffee @@ -0,0 +1,85 @@ +if not window.util then window.util = {} +_.merge window.util, + mainStations: ["court","floor","porch"] + + mainStationPath: (user) -> "~#{user}/#{window.util.mainStation(user)}" + + mainStation: (user) -> + if not user then user = window.urb.ship + switch user.length + when 3 + return "court" + when 6 + return "floor" + when 13 + return "porch" + + clipAudi: (audi) -> + audi = audi.join " " + ms = window.util.mainStationPath window.urb.ship + regx = new RegExp "/#{ms}","g" + audi = audi.replace regx,"" + audi.split " " + + expandAudi: (audi) -> + audi = audi.join " " + ms = window.util.mainStationPath window.urb.ship + if audi.indexOf(ms) is -1 + if audi.length > 0 + audi += " " + audi += "#{ms}" + audi.split " " + + create: (name) -> + window.talk.StationPersistence.createStation name, (err,res) -> + + subscribe: (name) -> + window.talk.StationPersistence.addSource "main",window.urb.ship,["~zod/#{name}"] + + uuid32: -> + str = "0v" + str += Math.ceil(Math.random()*8)+"." + for i in [0..5] + _str = Math.ceil(Math.random()*10000000).toString(32) + _str = ("00000"+_str).substr(-5,5) + str += _str+"." + str.slice(0,-1) + + populate: (station,number) -> + c = 0 + send = -> + if c < number + c++ + else + console.log 'done' + return true + _audi = {} + _audi[station] = "pending" + _message = + serial:window.util.uuid32() + audience:_audi + statement: + speech: + say:"Message "+c + time: Date.now() + now: Date.now() + window.talk.MessagePersistence.sendMessage _message,send + send() + + getScroll: -> + @writingPosition = $('#c').outerHeight(true)+$('#c').offset().top-$(window).height() + + setScroll: -> + window.util.getScroll() + $(window).scrollTop($("#c").height()) + + isScrolling: -> + if not window.util.writingPosition + window.util.getScroll() + return ($(window).scrollTop()+$('#writing').outerHeight() < window.util.writingPosition) + + checkScroll: -> + if window.util.isScrolling() + $('body').addClass 'scrolling' + else + $('body').removeClass 'scrolling' From 6f4e65167bf7e842ae22953dd9ceb445f6b79e36 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Tue, 15 Sep 2015 18:13:43 -0400 Subject: [PATCH 25/59] timestamped talk logfiles --- ape/talk.hoon | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ape/talk.hoon b/ape/talk.hoon index 9a27e9e08a..38eca466c2 100644 --- a/ape/talk.hoon +++ b/ape/talk.hoon @@ -1791,21 +1791,29 @@ ++ log-to-file |= man=span ^- move - =+ paf=/(scot %p our.hid)/home/(scot %da now.hid)/talk/[man]/talk-telegrams + =+ =+ =+ (yore now.hid) + %^ cat 3 man + `@t`(rsh 3 2 (scot %ui :(add d.t (mul 100 m) (mul 10.000 y)))) + paf=/(scot %p our.hid)/home/(scot %da now.hid)/talk/[-]/talk-telegrams =+ grams:(~(got by stories) man) [ost.hid %info /jamfile our.hid (foal paf [%talk-telegrams !>(-)])] :: ++ poke-save |= man=span ^- (quip move +>) - [[(log-to-file man) ~] +>.$] + =+ paf=/(scot %p our.hid)/home/(scot %da now.hid)/talk/[man]/talk-telegrams + =+ grams:(~(got by stories) man) + [[ost.hid %info /jamfile our.hid (foal paf [%talk-telegrams !>(-)])]~ +>.$] :: ++ poke-load |= man=span =+ ^= grams %- (hard (list telegram)) .^ %cx - /(scot %p our.hid)/home/(scot %da now.hid)/talk/[man]/talk-telegrams + =+ =+ (yore now.hid) + %^ cat 3 man + `@t`(rsh 3 2 (scot %ui :(add d.t (mul 100 m) (mul 10.000 y)))) + /(scot %p our.hid)/home/(scot %da now.hid)/talk/[-]/talk-telegrams == =+ toy=(~(got by stories) man) [~ +>.$(stories (~(put by stories) man toy(grams grams, count (lent grams))))] From 8d10ee10d91cbdd3024bcfc888d12b029e84cedf Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Tue, 15 Sep 2015 16:26:22 -0700 Subject: [PATCH 26/59] fixed json tank reading --- mar/talk/telegrams.hoon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mar/talk/telegrams.hoon b/mar/talk/telegrams.hoon index d8f3247cfb..94142098d8 100644 --- a/mar/talk/telegrams.hoon +++ b/mar/talk/telegrams.hoon @@ -218,8 +218,8 @@ %+ ke *torso |. ~+ %- of :~ name/(ot nom/so mon/tors ~) - text/(ot dat/(cu lore so) ~) - tank/(cu (hard (list tank)) blob) + text/(cu lore so) + tank/(ot dat/(cu (hard (list tank)) blob) ~) == :: ++ blob (cu cue (su fel:ofis)) From fe05f3080c4fd10f08a0cf1daab66520839af88f Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Tue, 15 Sep 2015 16:27:19 -0700 Subject: [PATCH 27/59] /- /+ dojo syntax --- ape/dojo.hoon | 35 ++++++++++++++++++++++++++++++++--- arvo/hoon.hoon | 1 + 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/ape/dojo.hoon b/ape/dojo.hoon index beba41db44..dcc30ba4a6 100644 --- a/ape/dojo.hoon +++ b/ape/dojo.hoon @@ -139,11 +139,40 @@ ;~(plug (cold %http lus) (easy %post) auri:epur ;~(pfix ace dp-source)) ;~(plug (cold %http hep) (easy %put) auri:epur ;~(pfix ace dp-source)) ;~(plug (cold %verb tis) sym (punt ;~(pfix ace dp-source))) - =< ;~(plug (cold %verb fas) (cook . dp-poor)) - |=(a=(list twig) [%dir ~ [0 %ex %clsg a]]) + ;~ plug (cold %verb fas) + ;~ pose + ;~(plug (cold %arc hep) (punt ;~(pfix gap dp-hooves))) + ;~(plug (cold %lib lus) (punt ;~(pfix gap dp-hooves))) + (stag %dir :(stag ~ 0 %ex %clsg dp-poor)) + == + == :: (stag %show dp-source) == + ++ dp-hooves :: hoof list + :(stag 0 %ex %clsg (cook |=(a=tusk a) (most ;~(plug com gaw) dp-hoof))) + :: + ++ dp-hoof :: ++ford-hoof twig + %+ cook |*(a=* ~!(+.a `twig`a)) + ;~ plug + :(stag %dtzy %tas sym) + %- dp-twig-punt + ;~ (glue fas) + ;~(pfix fas (sear dp-case-twig nuck:so)) + (stag %dtzy ;~(plug (cold %p sig) fed:ag)) + == + == + :: + ++ dp-twig-punt :: twig of unit + |*(a=_rule ;~(pose (stag [%bczp %null] a) (easy [%bczp %null]))) + :: + ++ dp-case-twig + |= a=coin ^- (unit twig) + ?. ?=([~ case] a) ~ + %+ some + [%dtzz %tas p.p.a] + [%dtzy p.a] + :: ++ dp-source (stag 0 dp-build) :: ++dojo-source ++ dp-build :: ++dojo-build %+ knee *dojo-build |. ~+ @@ -166,7 +195,7 @@ ;~(pose sym (easy dp-default-app)) == ++ dp-beam :: ++beam - %+ sear tome + %+ cook |=(a=path =+((tome a) ?^(- u [he-beak (flop a)]))) =+ vez=(vang & dp-path) (sear plex:vez (stag %clsg poor:vez)) :: diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 208bbb7ad4..daa11a05b2 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -6585,6 +6585,7 @@ ^- (list term) ?+ typ ~ [%hold *] $(typ ~(repo ut typ)) + [%bull *] $(typ ~(repo ut typ)) [%core *] (turn (~(tap by q.r.q.typ) ~) |=([a=term *] a)) == From 3bfe641b1c09149df516c835bcc1e8fcef4b85f3 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Tue, 15 Sep 2015 20:24:44 -0400 Subject: [PATCH 28/59] added |cancel --- ape/hood.hoon | 1 + arvo/clay.hoon | 33 ++++++++++++++++++++++++--------- arvo/gall.hoon | 1 + arvo/zuse.hoon | 1 + lib/kiln.hoon | 5 +++++ 5 files changed, 32 insertions(+), 9 deletions(-) diff --git a/ape/hood.hoon b/ape/hood.hoon index 89e218f942..b9149f7d28 100644 --- a/ape/hood.hoon +++ b/ape/hood.hoon @@ -97,6 +97,7 @@ ++ poke-kiln-cp (wrap poke-cp):from-kiln ++ poke-kiln-label (wrap poke-label):from-kiln ++ poke-kiln-merge (wrap poke-merge):from-kiln +++ poke-kiln-cancel (wrap poke-cancel):from-kiln ++ poke-kiln-mount (wrap poke-mount):from-kiln ++ poke-kiln-mv (wrap poke-mv):from-kiln ++ poke-kiln-rm (wrap poke-rm):from-kiln diff --git a/arvo/clay.hoon b/arvo/clay.hoon index ea54763739..fa844b5e2f 100644 --- a/arvo/clay.hoon +++ b/arvo/clay.hoon @@ -1171,6 +1171,15 @@ (bleb p.i.xiq +(u.nab) ?:(p.q.i.xiq ~ `[u.nab u.huy])) == == + ++ drop-me + ^+ . + ?~ mer + . + %- emit(mer ~) ^- move :* + hen.u.mer %give %mere %| %user-interrupt + >sor.u.mer< >our< >cas.u.mer< >gem.u.mer< ~ + == + :: ++ ze |% ++ aeon-to-tako ~(got by hit.dom) @@ -1680,7 +1689,7 @@ ?: don ..me(mer `dat) =. mer ~ - => (emit hen %give %mere gon.dat) + => (emit hen.dat %give %mere gon.dat) ..me :: ++ emit @@ -2379,6 +2388,20 @@ %boat :_ ..^$ [hen %give %hill (turn (~(tap by mon.ruf)) head)]~ + :: + %drop + =^ mos ruf + =+ den=((de now hen ruf) [. .]:p.q.hic q.q.hic) + abet:drop-me:den + [mos ..^$] + :: + %info + ?: =(%$ q.q.hic) + [~ ..^$] + =^ mos ruf + =+ den=((de now hen ruf) [. .]:p.q.hic q.q.hic) + abet:(exec:den now r.q.hic) + [mos ..^$] :: %init :_ %_ ..^$ @@ -2393,14 +2416,6 @@ :: ~ == - :: - %info - ?: =(%$ q.q.hic) - [~ ..^$] - =^ mos ruf - =+ den=((de now hen ruf) [. .]:p.q.hic q.q.hic) - abet:(exec:den now r.q.hic) - [mos ..^$] :: %into =. hez.ruf `hen diff --git a/arvo/gall.hoon b/arvo/gall.hoon index 05664dd45e..645ec68be1 100644 --- a/arvo/gall.hoon +++ b/arvo/gall.hoon @@ -1122,6 +1122,7 @@ %deal `%g %exec `%f %flog `%d + %drop `%c %info `%c %merg `%c %mont `%c diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index f6d71674f9..cdd591eff7 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -2360,6 +2360,7 @@ == :: ++ kiss-clay :: in request ->$ $% [%boat ~] :: pier rebooted + [%drop p=@p q=@tas] :: cancel pending merge [%info p=@p q=@tas r=nori] :: internal edit [%init p=@p] :: report install [%into p=@tas q=? r=mode] :: external edit diff --git a/lib/kiln.hoon b/lib/kiln.hoon index b291940e21..169569ec02 100644 --- a/lib/kiln.hoon +++ b/lib/kiln.hoon @@ -54,6 +54,7 @@ => |% :: arvo structures ++ card :: $% [%exec wire @p ~ [beak silk]] :: + [%drop wire @p @tas] :: [%info wire @p @tas nori] :: [%mont wire @tas @p @tas path] :: [%ogre wire $|(@tas beam)] :: @@ -118,6 +119,10 @@ |= kiln-merge abet:abet:(merge:(work syd) ali sud gim) :: +++ poke-cancel + |= syd=desk + abet:(emit %drop /cancel our syd) +:: ++ do-info |= [mez=tape tor=toro] abet:(emit:(spam leaf/mez ~) %info /kiln our tor) From 3b99a6083e3605ceff45b21dca8d231141d09d19 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Wed, 16 Sep 2015 13:47:26 -0700 Subject: [PATCH 29/59] more compact rend-work-duty --- ape/talk.hoon | 4 ++-- lib/talk.hoon | 21 ++++++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ape/talk.hoon b/ape/talk.hoon index 38eca466c2..ccb897ca38 100644 --- a/ape/talk.hoon +++ b/ape/talk.hoon @@ -1686,10 +1686,10 @@ (weld " " txt) :: %app - "[{(trip p.sep)}]: {(trip q.sep)}" + (trim 62 "[{(trip p.sep)}]: {(trip q.sep)}") :: %tax - " {(rend-work-duty p.sep)}" + (trim 62 " {(rend-work-duty p.sep)}") == -- :: diff --git a/lib/talk.hoon b/lib/talk.hoon index 5bca4c30f0..6962aeea62 100644 --- a/lib/talk.hoon +++ b/lib/talk.hoon @@ -34,15 +34,26 @@ =+ work-stuff |^ |= due=duty ^- tape ?- -.due - %archive =+(due " -{(tr-id id)} {(trip -.due)}.") - %create =+(due " -{(tr-id id.tax)} {(trip -.due)}: {}") - %change =+(due " -{(tr-id id)} {(trip -.due)}: {(tr-meat meat)}") + %archive =+(due " -{(tr-id id)} fin.") + %create =+(due " -{(tr-id id.tax)} new: {}") + %change =+(due " -{(tr-id id)} mod {(tr-meat meat)}") %update =+ due - " -{(tr-id id)} {(trip -.due)} {} by {}: {(tr-meat meat.due)}" + " -{(tr-id id)} v{} by {} {(tr-meat meat.due)}" == ++ tr-id |=(a=@uv (scow %uv (rsh 2 25 a))) - ++ tr-term |=(a=term (rash a (star ;~(pose (cold ' ' hep) next)))) + ++ tr-term + |= a=term + =+ ^- [typ=tape key=tape] + %+ rash a + ;~ (glue hep) + (plus aln) + (plus ;~(pose (cold ' ' hep) next)) + == + ?+ (crip typ) "{typ} {key}" + %set ":{key}" + %add "+{key}" + == ++ tr-meat |= feh=flesh ^- tape ?- -.feh From 58ddbe73fab7174e80adbe70cf2aa4c803ed48d7 Mon Sep 17 00:00:00 2001 From: Joan Torres Date: Wed, 16 Sep 2015 13:29:39 -0700 Subject: [PATCH 30/59] Add ++reap jet --- arvo/hoon.hoon | 1 + 1 file changed, 1 insertion(+) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 2a92816dbd..00abc708d9 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -706,6 +706,7 @@ [i=u.c t=$(a t.a)] :: ++ reap :: replicate + ~/ %reap |* [a=@ b=*] |- ^- (list ,_b) ?~ a ~ From 610cf1b95fc0d6718ab3a8dc2379e0c4d898d02c Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Wed, 16 Sep 2015 13:57:24 -0700 Subject: [PATCH 31/59] clean up pre-ford-refactor shims --- lib/down-jet.hoon | 1 - lib/drum.hoon | 1 - lib/helm.hoon | 1 - lib/http.hoon | 1 - lib/kiln.hoon | 1 - lib/oct1.hoon | 1 - lib/oct2.hoon | 1 - lib/oct3.hoon | 1 - lib/oct4.hoon | 1 - lib/react.hoon | 1 - lib/sh-utils.hoon | 1 - lib/sole.hoon | 1 - lib/talk.hoon | 1 - lib/tree.hoon | 1 - lib/twitter.hoon | 1 - 15 files changed, 15 deletions(-) diff --git a/lib/down-jet.hoon b/lib/down-jet.hoon index 215890de48..d51f9f51be 100644 --- a/lib/down-jet.hoon +++ b/lib/down-jet.hoon @@ -17,4 +17,3 @@ :: ++ print sing -- -=*(down-jet . .) diff --git a/lib/drum.hoon b/lib/drum.hoon index 0b54238033..e3121ac426 100644 --- a/lib/drum.hoon +++ b/lib/drum.hoon @@ -844,4 +844,3 @@ ?:(=(0 len) ~ [`@c`'*' $(len (dec len))]) -- -- -=*(drum . .) diff --git a/lib/helm.hoon b/lib/helm.hoon index 9510074285..488176e753 100644 --- a/lib/helm.hoon +++ b/lib/helm.hoon @@ -174,4 +174,3 @@ |= [way=wire her=ship cop=coop] =< abet (emit %flog ~ %text "woot: {<[way cop]>}") -- -=*(helm . .) diff --git a/lib/http.hoon b/lib/http.hoon index 9b7fd12c68..deb8fa71c2 100644 --- a/lib/http.hoon +++ b/lib/http.hoon @@ -29,4 +29,3 @@ [%get headers ~] [%post headers ~ (tact (pojo p.req-type))] -- -=*(http . .) diff --git a/lib/kiln.hoon b/lib/kiln.hoon index b291940e21..44c022ded8 100644 --- a/lib/kiln.hoon +++ b/lib/kiln.hoon @@ -483,4 +483,3 @@ == -- -- -=*(kiln . .) diff --git a/lib/oct1.hoon b/lib/oct1.hoon index 061b202a33..01852ab253 100644 --- a/lib/oct1.hoon +++ b/lib/oct1.hoon @@ -41,4 +41,3 @@ ++ voy ": {<~[(icon who)]>} (row/col): " :: print prompt -- -- -=*(oct1 . .) diff --git a/lib/oct2.hoon b/lib/oct2.hoon index 80061b2bb0..b1c543f547 100644 --- a/lib/oct2.hoon +++ b/lib/oct2.hoon @@ -57,4 +57,3 @@ ?.(ept " ({-}'s turn) " ": {-} (row/col): "):: -- -- -=*(oct2 . .) diff --git a/lib/oct3.hoon b/lib/oct3.hoon index d2ea6a9290..4fcd49cd89 100644 --- a/lib/oct3.hoon +++ b/lib/oct3.hoon @@ -58,4 +58,3 @@ ?.(ept " ({-}'s turn) " ": {-} (row/col): "):: -- -- -=*(oct3 . .) diff --git a/lib/oct4.hoon b/lib/oct4.hoon index c50ff291ec..e7efb507d1 100644 --- a/lib/oct4.hoon +++ b/lib/oct4.hoon @@ -58,4 +58,3 @@ ?.(ept " ({-}'s turn) " ": {-} (row/col): "):: -- -- -=*(oct4 . .) diff --git a/lib/react.hoon b/lib/react.hoon index 06988f74e2..6a67531c2c 100644 --- a/lib/react.hoon +++ b/lib/react.hoon @@ -129,4 +129,3 @@ ")" == -- -=*(react . .) diff --git a/lib/sh-utils.hoon b/lib/sh-utils.hoon index 05a0f17314..0b4f09a58b 100644 --- a/lib/sh-utils.hoon +++ b/lib/sh-utils.hoon @@ -105,4 +105,3 @@ ^- [(list ,_mof) _con] (ref +<) -- -=*(sh-utils . .) diff --git a/lib/sole.hoon b/lib/sole.hoon index f5f81aa9b4..21324f410e 100644 --- a/lib/sole.hoon +++ b/lib/sole.hoon @@ -139,4 +139,3 @@ ?> ?=(%ins -.dat) p.dat -- -=*(sole . .) diff --git a/lib/talk.hoon b/lib/talk.hoon index 6962aeea62..c3e8e17001 100644 --- a/lib/talk.hoon +++ b/lib/talk.hoon @@ -67,4 +67,3 @@ == -- -- -=*(talk . .) diff --git a/lib/tree.hoon b/lib/tree.hoon index a841133c5b..4f4a676832 100644 --- a/lib/tree.hoon +++ b/lib/tree.hoon @@ -62,4 +62,3 @@ acc(r $(acc r.acc)) -- -- -=*(tree . .) diff --git a/lib/twitter.hoon b/lib/twitter.hoon index 1f2a1bd170..95d6f1d633 100644 --- a/lib/twitter.hoon +++ b/lib/twitter.hoon @@ -542,4 +542,3 @@ (mold %get /statuses/lookup ,[us ~]) -- -- -=*(twitter . .) From aaa9022a4815fc70830130c9af189449a883a496 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Wed, 16 Sep 2015 18:39:11 -0400 Subject: [PATCH 32/59] autoreload and autoreset --- ape/hood.hoon | 9 ++++++++- arvo/dill.hoon | 14 +++++++++++++- lib/kiln.hoon | 32 +++++++++++++++++++++++++++++++- 3 files changed, 52 insertions(+), 3 deletions(-) diff --git a/ape/hood.hoon b/ape/hood.hoon index b9149f7d28..6550386207 100644 --- a/ape/hood.hoon +++ b/ape/hood.hoon @@ -56,6 +56,11 @@ ~? ?=(^ saw) [%kiln-spam-lame u.saw] [~ +>] :: +++ coup-kiln-reload :: + |= [way=wire saw=(unit tang)] + ~? ?=(^ saw) [%kiln-reload-lame u.saw] + [~ +>] +:: ++ coup-drum-phat (wrap take-coup-phat):from-drum ++ coup-helm-hi (wrap coup-hi):from-helm ++ diff-sole-effect-drum-phat (wrap diff-sole-effect-phat):from-drum @@ -103,11 +108,13 @@ ++ poke-kiln-rm (wrap poke-rm):from-kiln ++ poke-kiln-schedule (wrap poke-schedule):from-kiln ++ poke-kiln-sync (wrap poke-sync):from-kiln +++ poke-kiln-autoload (wrap poke-autoload):from-kiln ++ poke-kiln-unmount (wrap poke-unmount):from-kiln ++ poke-kiln-unsync (wrap poke-unsync):from-kiln ++ poke-will (wrap poke-will):from-helm ++ quit-drum-phat (wrap quit-phat):from-drum ++ reap-drum-phat (wrap reap-phat):from-drum ++ woot-helm (wrap take-woot):from-helm -++ writ-kiln-sync (wrap take-writ):from-kiln +++ writ-kiln-autoload (wrap take-writ-autoload):from-kiln +++ writ-kiln-sync (wrap take-writ-sync):from-kiln -- diff --git a/arvo/dill.hoon b/arvo/dill.hoon index 42c21e7644..8898280ed7 100644 --- a/arvo/dill.hoon +++ b/arvo/dill.hoon @@ -216,6 +216,7 @@ =. +> (sync %home our %base) =. +> ?. ?=(?(%king %czar) can) +> (sync %kids our %base) + =. +> autoload =. +> peer |- ^+ +>+ ?~ myt +>+ @@ -255,7 +256,18 @@ %_ +>.$ moz :_ moz - [hen %pass ~ %g %deal [our our] ram %poke %hood-sync -:!>(syn) syn] + :* hen %pass /sync %g %deal [our our] + ram %poke %hood-sync -:!>(syn) syn + == + == + :: + ++ autoload + %_ . + moz + :_ moz + :* hen %pass /autoload %g %deal [our our] + ram %poke %kiln-autoload [%cube ~ [%atom %n]] ~ + == == :: ++ pump :: send diff ack diff --git a/lib/kiln.hoon b/lib/kiln.hoon index 169569ec02..a625a73626 100644 --- a/lib/kiln.hoon +++ b/lib/kiln.hoon @@ -65,6 +65,8 @@ ++ pear :: poke fruit $% [%talk-command command:talk] :: [%kiln-merge kiln-merge] :: + [%helm-reload (list term)] :: + [%helm-reset ~] :: == :: ++ move (pair bone card) :: user-level move -- @@ -153,6 +155,18 @@ =+ old=;;((map ,@da cord) (fall (file where) ~)) (foal where %sched !>((~(put by old) tym eve))) :: +++ poke-autoload + |= ~ + =< abet + %- emil + %+ turn + `(list term)`~[%ames %behn %clay %dill %eyre %ford %gall %zuse %hoon] + |= syd=term + ^- card + :* %warp /kiln/autoload/[syd] [our our] %home ~ + %next %y da/now /arvo/[syd]/hoon + == +:: ++ take |=(way=wire ?>(?=([@ ~] way) (work i.way))) :: general handler ++ take-mere :: |= [way=wire are=(each (set path) (pair term tang))] @@ -176,7 +190,7 @@ == abet:abet:(mere:(auto hos) mes) :: -++ take-writ :: +++ take-writ-sync :: |= [way=wire rot=riot] ?> ?=([@ @ @ ~] way) =+ ^- hos=kiln-sync @@ -186,6 +200,22 @@ == abet:abet:(writ:(auto hos) rot) :: +++ take-writ-autoload + |= [way=wire rot=riot] + ?> ?=([@ ~] way) + ?> ?=(^ rot) + =+ syd=(slav %tas i.way) + =. +>.$ + ?: ?=(%hoon syd) + (emit %poke /kiln/reload/[syd] [our %hood] %helm-reset ~) + (emit %poke /kiln/reload/[syd] [our %hood] %helm-reload ~[syd]) + =. +>.$ + %- emit :* + %warp /kiln/autoload/[syd] [our our] %home ~ + %next %y da/now /arvo/[syd]/hoon + == + abet +:: ++ spam |= mes=(list tank) ((slog mes) ..spam) From cf5a8c79c2ec66aa127c737c3a76b647f5590386 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Wed, 16 Sep 2015 15:51:31 -0700 Subject: [PATCH 33/59] fix tree, per-day talk output format, rendering --- ape/talk.hoon | 13 +++++-------- arvo/ford.hoon | 10 +++++----- gen/tree.hoon | 4 ++-- pub/talklog/hymn.hook | 7 ++++++- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/ape/talk.hoon b/ape/talk.hoon index ccb897ca38..1fd6efed43 100644 --- a/ape/talk.hoon +++ b/ape/talk.hoon @@ -1791,10 +1791,10 @@ ++ log-to-file |= man=span ^- move - =+ =+ =+ (yore now.hid) - %^ cat 3 man - `@t`(rsh 3 2 (scot %ui :(add d.t (mul 100 m) (mul 10.000 y)))) - paf=/(scot %p our.hid)/home/(scot %da now.hid)/talk/[-]/talk-telegrams + =+ ^- paf=path + =+ day=(year %*(. (yore now.hid) +.t +:*tarp)) + %+ tope [our.hid %home da/now.hid] + /talk-telegrams/(scot %da day)/[man]/talk =+ grams:(~(got by stories) man) [ost.hid %info /jamfile our.hid (foal paf [%talk-telegrams !>(-)])] :: @@ -1810,10 +1810,7 @@ =+ ^= grams %- (hard (list telegram)) .^ %cx - =+ =+ (yore now.hid) - %^ cat 3 man - `@t`(rsh 3 2 (scot %ui :(add d.t (mul 100 m) (mul 10.000 y)))) - /(scot %p our.hid)/home/(scot %da now.hid)/talk/[-]/talk-telegrams + /(scot %p our.hid)/home/(scot %da now.hid)/talk/[man]/talk-telegrams == =+ toy=(~(got by stories) man) [~ +>.$(stories (~(put by stories) man toy(grams grams, count (lent grams))))] diff --git a/arvo/ford.hoon b/arvo/ford.hoon index aff8b8c2d9..75a622e5e1 100644 --- a/arvo/ford.hoon +++ b/arvo/ford.hoon @@ -1495,17 +1495,17 @@ |= [cof=cafe bax=vase doe=term hon=horn] ^- (bolt vase) %+ cope (lash cof how (flux (slat doe))) - |= [cof=cafe yep=(map ,@ span)] - =+ ^= poy ^- (list (pair ,@ span)) + |= [cof=cafe yep=(map span ,@)] + =+ ^= poy ^- (list (pair span ,@)) %+ sort (~(tap by yep) ~) - |=([a=[@ *] b=[@ *]] (lth -.a -.b)) + |=([[* a=@] [* b=@]] (lth a b)) %+ cope |- ^- (bolt (list (pair ,@ vase))) ?~ poy (flue cof) %+ cope $(poy t.poy) |= [cof=cafe nex=(list (pair ,@ vase))] - %+ cope (chap(s.how [q.i.poy s.how]) cof bax hon) - (flux |=(elt=vase [[p.i.poy elt] nex])) + %+ cope (chap(s.how [p.i.poy s.how]) cof bax hon) + (flux |=(elt=vase [[q.i.poy elt] nex])) %- flux |= yal=(list (pair ,@ vase)) ^- vase ?~ yal [[%cube 0 [%atom %n]] 0] diff --git a/gen/tree.hoon b/gen/tree.hoon index 5dadf46b06..94cfc6c6b4 100644 --- a/gen/tree.hoon +++ b/gen/tree.hoon @@ -12,10 +12,10 @@ :- %tang %- flop |- ^- tang =+ ark=;;(arch .^(cy/pax)) -=- ?~ q.ark - +=- ?~ fil.ark - [(rend pax) -] %- zing %+ turn - (sort (~(tap by r.ark)) aor) + (sort (~(tap by dir.ark)) aor) |= [a=@t ~] ^$(pax (welp pax /[a])) diff --git a/pub/talklog/hymn.hook b/pub/talklog/hymn.hook index 7067130d2d..e8648aca9c 100644 --- a/pub/talklog/hymn.hook +++ b/pub/talklog/hymn.hook @@ -3,7 +3,12 @@ :::: /hook/hymn/talklog/pub :: /? 310 -/= mez /: /===/talk /% /; pojo /json/ +/= mez + /: /===/talk + /% 2 + /; pojo + /; |=(a=(list ,[@ p=json]) =.(a (flop a) ?~(a [%a ~] p.i.a))) + /& /json/ |% ++ cdnj |=(a=tape ;script(src "//cdnjs.cloudflare.com/ajax/libs/{a}");) -- From a84fb403f6e7370104b2dce81a3a8a77506c5229 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Wed, 16 Sep 2015 19:40:53 -0400 Subject: [PATCH 34/59] turn off autoload with |autoload --- ape/hood.hoon | 81 +++++++++++++++++++++--------------------- arvo/dill.hoon | 2 +- gen/hood/autoload.hoon | 13 +++++++ lib/kiln.hoon | 10 ++++++ 4 files changed, 65 insertions(+), 41 deletions(-) create mode 100644 gen/hood/autoload.hoon diff --git a/ape/hood.hoon b/ape/hood.hoon index 6550386207..a14cf7d4ee 100644 --- a/ape/hood.hoon +++ b/ape/hood.hoon @@ -77,44 +77,45 @@ ++ from-helm (from-lib %helm [..$ ,_abet]:(helm)) ++ from-kiln (from-lib %kiln [..$ ,_abet]:(kiln)) :: -++ init-helm |=([way=wire *] [~ +>]) -++ made-kiln (wrap take-made):from-kiln -++ mere-kiln (wrap take-mere):from-kiln -++ mere-kiln-sync (wrap take-mere-sync):from-kiln -++ note-helm (wrap take-note):from-helm -++ onto-drum (wrap take-onto):from-drum -++ peer-drum (wrap peer):from-drum -++ poke-dill-belt (wrap poke-dill-belt):from-drum -++ poke-drum-link (wrap poke-link):from-drum -::++ poke-drum-exit (wrap poke-exit):from-drum -++ poke-drum-start (wrap poke-start):from-drum -++ poke-helm-hi (wrap poke-hi):from-helm -++ poke-helm-init (wrap poke-init):from-helm -++ poke-helm-invite (wrap poke-invite):from-helm -++ poke-helm-mass (wrap poke-mass):from-helm -++ poke-helm-reload (wrap poke-reload):from-helm -++ poke-helm-reload-desk (wrap poke-reload-desk):from-helm -++ poke-helm-reset (wrap poke-reset):from-helm -++ poke-helm-send-hi (wrap poke-send-hi):from-helm -++ poke-helm-verb (wrap poke-verb):from-helm -++ poke-helm-begin (wrap poke-begin):from-helm -++ poke-hood-sync (wrap poke-sync):from-kiln -++ poke-kiln-cp (wrap poke-cp):from-kiln -++ poke-kiln-label (wrap poke-label):from-kiln -++ poke-kiln-merge (wrap poke-merge):from-kiln -++ poke-kiln-cancel (wrap poke-cancel):from-kiln -++ poke-kiln-mount (wrap poke-mount):from-kiln -++ poke-kiln-mv (wrap poke-mv):from-kiln -++ poke-kiln-rm (wrap poke-rm):from-kiln -++ poke-kiln-schedule (wrap poke-schedule):from-kiln -++ poke-kiln-sync (wrap poke-sync):from-kiln -++ poke-kiln-autoload (wrap poke-autoload):from-kiln -++ poke-kiln-unmount (wrap poke-unmount):from-kiln -++ poke-kiln-unsync (wrap poke-unsync):from-kiln -++ poke-will (wrap poke-will):from-helm -++ quit-drum-phat (wrap quit-phat):from-drum -++ reap-drum-phat (wrap reap-phat):from-drum -++ woot-helm (wrap take-woot):from-helm -++ writ-kiln-autoload (wrap take-writ-autoload):from-kiln -++ writ-kiln-sync (wrap take-writ-sync):from-kiln +++ init-helm |=([way=wire *] [~ +>]) +++ made-kiln (wrap take-made):from-kiln +++ mere-kiln (wrap take-mere):from-kiln +++ mere-kiln-sync (wrap take-mere-sync):from-kiln +++ note-helm (wrap take-note):from-helm +++ onto-drum (wrap take-onto):from-drum +++ peer-drum (wrap peer):from-drum +++ poke-dill-belt (wrap poke-dill-belt):from-drum +++ poke-drum-link (wrap poke-link):from-drum +::++ poke-drum-exit (wrap poke-exit):from-drum +++ poke-drum-start (wrap poke-start):from-drum +++ poke-helm-hi (wrap poke-hi):from-helm +++ poke-helm-init (wrap poke-init):from-helm +++ poke-helm-invite (wrap poke-invite):from-helm +++ poke-helm-mass (wrap poke-mass):from-helm +++ poke-helm-reload (wrap poke-reload):from-helm +++ poke-helm-reload-desk (wrap poke-reload-desk):from-helm +++ poke-helm-reset (wrap poke-reset):from-helm +++ poke-helm-send-hi (wrap poke-send-hi):from-helm +++ poke-helm-verb (wrap poke-verb):from-helm +++ poke-helm-begin (wrap poke-begin):from-helm +++ poke-hood-sync (wrap poke-sync):from-kiln +++ poke-kiln-cp (wrap poke-cp):from-kiln +++ poke-kiln-label (wrap poke-label):from-kiln +++ poke-kiln-merge (wrap poke-merge):from-kiln +++ poke-kiln-cancel (wrap poke-cancel):from-kiln +++ poke-kiln-mount (wrap poke-mount):from-kiln +++ poke-kiln-mv (wrap poke-mv):from-kiln +++ poke-kiln-rm (wrap poke-rm):from-kiln +++ poke-kiln-schedule (wrap poke-schedule):from-kiln +++ poke-kiln-sync (wrap poke-sync):from-kiln +++ poke-kiln-start-autoload (wrap poke-start-autoload):from-kiln +++ poke-kiln-autoload (wrap poke-autoload):from-kiln +++ poke-kiln-unmount (wrap poke-unmount):from-kiln +++ poke-kiln-unsync (wrap poke-unsync):from-kiln +++ poke-will (wrap poke-will):from-helm +++ quit-drum-phat (wrap quit-phat):from-drum +++ reap-drum-phat (wrap reap-phat):from-drum +++ woot-helm (wrap take-woot):from-helm +++ writ-kiln-autoload (wrap take-writ-autoload):from-kiln +++ writ-kiln-sync (wrap take-writ-sync):from-kiln -- diff --git a/arvo/dill.hoon b/arvo/dill.hoon index 8898280ed7..e5ce331270 100644 --- a/arvo/dill.hoon +++ b/arvo/dill.hoon @@ -266,7 +266,7 @@ moz :_ moz :* hen %pass /autoload %g %deal [our our] - ram %poke %kiln-autoload [%cube ~ [%atom %n]] ~ + ram %poke %kiln-start-autoload [%cube ~ [%atom %n]] ~ == == :: diff --git a/gen/hood/autoload.hoon b/gen/hood/autoload.hoon new file mode 100644 index 0000000000..5476276a15 --- /dev/null +++ b/gen/hood/autoload.hoon @@ -0,0 +1,13 @@ +:: +:::: /hoon/autoload/hood/gen + :: +/? 314 +:: +:::: + !: +:- %say +|= $: [now=@da eny=@uvI bec=beak] + [arg=?(~ [? ~]) ~] + == +:- %kiln-autoload +`(unit ,?)`?~(arg ~ `-.arg) diff --git a/lib/kiln.hoon b/lib/kiln.hoon index a625a73626..f04328bf2e 100644 --- a/lib/kiln.hoon +++ b/lib/kiln.hoon @@ -10,6 +10,7 @@ ++ kiln-pith :: $: rem=(map desk kiln-desk) :: syn=(map kiln-sync ,[let=@ud ust=bone]) :: + autoload=? :: == :: ++ kiln-desk :: per-desk state $: auto=? :: escalate on failure @@ -156,6 +157,13 @@ (foal where %sched !>((~(put by old) tym eve))) :: ++ poke-autoload + |= lod=(unit ,?) + ?^ lod + abet(autoload u.lod) + =< abet(autoload !autoload) + (spam leaf/"turning autoload o{?:(autoload "ff" "n")}" ~) +:: +++ poke-start-autoload |= ~ =< abet %- emil @@ -206,6 +214,8 @@ ?> ?=(^ rot) =+ syd=(slav %tas i.way) =. +>.$ + ?. autoload + +>.$ ?: ?=(%hoon syd) (emit %poke /kiln/reload/[syd] [our %hood] %helm-reset ~) (emit %poke /kiln/reload/[syd] [our %hood] %helm-reload ~[syd]) From 5de171f23d75f832d3e3ea808045c970ecf4ec49 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Wed, 16 Sep 2015 19:45:54 -0400 Subject: [PATCH 35/59] RIP %indirect --- arvo/clay.hoon | 34 +--------------------------------- arvo/zuse.hoon | 1 - 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/arvo/clay.hoon b/arvo/clay.hoon index fa844b5e2f..0d8178fc97 100644 --- a/arvo/clay.hoon +++ b/arvo/clay.hoon @@ -974,30 +974,6 @@ !! == :: - ++ rand-to-rant - |= rut=rand - ^+ +> - ~| [%x-over-network-not-implemented [p q -.r]:rut hen] !! - :: %- emit - :: :* hen - :: [%foreign-plops (scot %p our) (scot %p her) syd ~] - :: %f %exec our ~ %tabl - :: ^- (list (pair silk silk)) - :: %+ turn (~(tap in pop)) - :: |= a=plop - :: ?- -.a - :: %delta - :: :- [%$ %blob !>([%delta p.a q.a *cage])] - :: [%vale p.r.a q.r.a] - :: :: - :: %direct - :: :- [%$ %blob !>([%direct p.a *cage])] - :: [%vale p.q.a q.q.a] - :: :: - :: %indirect ~| %foreign-indirect-not-implemented !! - :: == - :: == - :: ++ validate-x |= [car=care cas=case pax=path peg=page] ^+ +> @@ -1034,7 +1010,6 @@ ?- -.a %delta [[%$ %blob !>([%delta p.a q.a *page])] [%vale p.r.a q.r.a]] %direct [[%$ %blob !>([%direct p.a *page])] [%vale p.q.a q.q.a]] - %indirect ~| %foreign-indirect-not-implemented !! == == :: @@ -1053,7 +1028,6 @@ ?- -.bol %delta [-.bol p.bol q.bol p.cay q.q.cay] %direct [-.bol p.bol p.cay q.q.cay] - %indirect ~| %plop-indirect-not-implemented !! == %^ apply-foreign-update lem @@ -1192,7 +1166,6 @@ ?- - %delta p.q %direct p.q - %indirect p.q == ++ lobe-to-silk :: XX maybe move hoo{n,k} stuff here |= [pax=path lob=lobe] @@ -1210,7 +1183,6 @@ =+ bol=(~(got by lat.ran) lob) ?- -.bol %direct [%volt q.bol] - %indirect [%volt q.bol] %delta ~| delta/q.q.bol [%pact $(lob q.q.bol) [%volt r.bol]] == @@ -1443,7 +1415,6 @@ ?- -.gar %direct (~(put in far) lob) %delta (~(put in $(lob q.q.gar)) lob) - %indirect (~(put in $(lob r.gar)) lob) == :: ++ data-twixt-takos @@ -1526,8 +1497,6 @@ =+ bol=(lobe-to-blob u.lob) ?: ?=(%direct -.bol) ((hard ,@t) q.q.bol) - ?: ?=(%indirect -.bol) - ((hard ,@t) q.q.bol) ?> ?=(%delta -.bol) =+ txt=$(u.lob q.q.bol) ?> ?=(%txt-diff p.r.bol) @@ -1617,7 +1586,7 @@ :: %- ~(run by hat) :: |= a=lobe :: =+ (lobe-to-blob a) - :: ?-(-.- %direct q.-, %indirect q.-, %delta !!) + :: ?-(-.- %direct q.-, %delta !!) ::`+>.$(ank.dom (checkout-ankh -), let.dom yon) :: ++ update-lat :: update-lat:ze @@ -2330,7 +2299,6 @@ =+ bol=(~(got by lat.ran) lob) ?- -.bol %direct [%volt q.bol] - %indirect [%volt q.bol] %delta [%pact $(lob q.q.bol) [%volt r.bol]] == :: diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index cdd591eff7..08b2e31ae9 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -1836,7 +1836,6 @@ ++ blob :: fs blob $% [%delta p=lobe q=[p=mark q=lobe] r=page] :: delta on q [%direct p=lobe q=page] :: immediate - [%indirect p=lobe q=page r=lobe s=page] :: both == :: ++ boat (map (pair bone wire) (trel bean ship path)) :: outgoing subs ++ boon :: fort output From 7c5860412ae2e9f14f5ea371b85810bc32d694b1 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Thu, 17 Sep 2015 15:10:01 -0400 Subject: [PATCH 36/59] fix %talk-telegrams --- mar/talk/telegrams.hoon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mar/talk/telegrams.hoon b/mar/talk/telegrams.hoon index 94142098d8..eacff085a0 100644 --- a/mar/talk/telegrams.hoon +++ b/mar/talk/telegrams.hoon @@ -71,7 +71,7 @@ set-title/so set-description/so set-done/bo - add-comment/so + add-comment/(ot ship/(su fed:ag) com/so ~) == -- ++ grow-work-duty @@ -123,7 +123,7 @@ %set-title [%s til] %set-description [%s des] %set-done [%b don] - %add-comment [%s com] + %add-comment (jobe ship/(jope who) com/[%s com] ~) == -- ++ grab From fc9c0181ff1a2703e102ce0d318c19a9c277618e Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Thu, 17 Sep 2015 13:50:10 -0700 Subject: [PATCH 37/59] FIxed '_'.repeat bug --- pub/tree/src/js/main.js | 18 +++++++++++++++++- .../src/js/persistence/TreePersistence.coffee | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/pub/tree/src/js/main.js b/pub/tree/src/js/main.js index 126996dad2..3af4647c48 100644 --- a/pub/tree/src/js/main.js +++ b/pub/tree/src/js/main.js @@ -35,6 +35,7 @@ module.exports = { }; + },{"../dispatcher/Dispatcher.coffee":13,"../persistence/TreePersistence.coffee":19}],2:[function(require,module,exports){ var BodyComponent, CLICK, Links, TreeActions, TreeStore, a, clas, div, query, reactify, recl, ref; @@ -288,6 +289,7 @@ module.exports = query({ })); + },{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":20,"./Async.coffee":3,"./BodyComponent.coffee":4,"./Reactify.coffee":10,"classnames":15}],3:[function(require,module,exports){ var TreeActions, TreeStore, _load, code, div, recl, ref, span; @@ -389,6 +391,7 @@ module.exports = function(queries, Child, load) { }; + },{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":20,"./LoadComponent.coffee":9}],4:[function(require,module,exports){ var div, query, reactify, recl; @@ -414,6 +417,7 @@ module.exports = query({ })); + },{"./Async.coffee":3,"./Reactify.coffee":10}],5:[function(require,module,exports){ var div, recl, ref, textarea; @@ -437,6 +441,7 @@ module.exports = recl({ }); + },{}],6:[function(require,module,exports){ var div, recl; @@ -458,6 +463,7 @@ module.exports = { }; + },{"./CodeMirror.coffee":5,"./KidsComponent.coffee":7,"./ListComponent.coffee":8,"./SearchComponent.coffee":11,"./TocComponent.coffee":12}],7:[function(require,module,exports){ var a, div, hr, li, query, reactify, recl, ref, ul; @@ -497,6 +503,7 @@ module.exports = query({ })); + },{"./Async.coffee":3,"./Reactify.coffee":10}],8:[function(require,module,exports){ var a, clas, div, h1, li, query, reactify, recl, ref, ul; @@ -592,6 +599,7 @@ module.exports = query({ })); + },{"./Async.coffee":3,"./Reactify.coffee":10,"classnames":15}],9:[function(require,module,exports){ var div, input, recl, ref, textarea; @@ -632,6 +640,7 @@ module.exports = recl({ }); + },{}],10:[function(require,module,exports){ var Virtual, div, load, reactify, recl, ref, rele, span, walk; @@ -699,6 +708,7 @@ module.exports = _.extend(reactify, { }); + },{"./LoadComponent.coffee":9}],11:[function(require,module,exports){ var a, div, input, query, reactify, recl, ref, slice = [].slice; @@ -837,6 +847,7 @@ module.exports = query({ })); + },{"./Async.coffee":3,"./Reactify.coffee":10}],12:[function(require,module,exports){ var div, query, reactify, recl; @@ -967,6 +978,7 @@ module.exports = query({ })); + },{"./Async.coffee":3,"./Reactify.coffee":10}],13:[function(require,module,exports){ var Dispatcher; @@ -988,6 +1000,7 @@ module.exports = _.extend(new Dispatcher(), { }); + },{"flux":16}],14:[function(require,module,exports){ var rend; @@ -1134,6 +1147,7 @@ $(function() { }); + },{"./actions/TreeActions.coffee":1,"./components/AnchorComponent.coffee":2,"./components/BodyComponent.coffee":4,"./components/Components.coffee":6,"./persistence/TreePersistence.coffee":19}],15:[function(require,module,exports){ /*! Copyright (c) 2015 Jed Watson. @@ -1521,7 +1535,7 @@ module.exports = { encode: function(obj) { var _encode, delim; delim = function(n) { - return ('_'.repeat(n)) || '.'; + return Array(n + 1).join('_') || '.'; }; _encode = function(obj) { var _dep, dep, k, res, sub, v; @@ -1554,6 +1568,7 @@ module.exports = { }; + },{}],20:[function(require,module,exports){ var EventEmitter, MessageDispatcher, QUERIES, TreeStore, _curr, _data, _tree, clog; @@ -1789,6 +1804,7 @@ TreeStore.dispatchToken = MessageDispatcher.register(function(payload) { module.exports = TreeStore; + },{"../dispatcher/Dispatcher.coffee":13,"events":21}],21:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // diff --git a/pub/tree/src/js/persistence/TreePersistence.coffee b/pub/tree/src/js/persistence/TreePersistence.coffee index 7f6f17f19d..becce7bea5 100644 --- a/pub/tree/src/js/persistence/TreePersistence.coffee +++ b/pub/tree/src/js/persistence/TreePersistence.coffee @@ -3,7 +3,7 @@ module.exports = url = "#{window.tree.basepath(path)}.json?q=#{@encode query}" $.get url, {}, (data) -> if cb then cb null,data encode: (obj)-> - delim = (n)-> ('_'.repeat n) || '.' + delim = (n)-> Array(n+1).join('_') || '.' _encode = (obj)-> if typeof obj isnt 'object' return [0,obj] From 646fa7cf1424688887f119e6710c62670efdef20 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Thu, 17 Sep 2015 19:20:07 -0400 Subject: [PATCH 38/59] :+merge -> |merge --- lib/kiln.hoon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/kiln.hoon b/lib/kiln.hoon index f04328bf2e..b79972e0ff 100644 --- a/lib/kiln.hoon +++ b/lib/kiln.hoon @@ -289,7 +289,7 @@ ?+ p.p.mes :* (render "sync failed" sud her syd) leaf/"please manually merge the desks with" - leaf/":+merge %{(trip syd)} {(scow %p her)} %{(trip sud)}" + leaf/"|merge %{(trip syd)} {(scow %p her)} %{(trip sud)}" leaf/"" leaf/"error code: {}" q.p.mes @@ -502,7 +502,7 @@ """ done setting up scratch space in {<[-]>} please resolve the following conflicts and run - :+merge {} our {<[-]>} + |merge {} our {<[-]>} """ %^ tanks-if-any "annotated conflicts in:" annotated From 0bfa034edb6e67f3d4a2264bbc01f88dfc691a77 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Fri, 18 Sep 2015 16:45:09 -0400 Subject: [PATCH 39/59] added clay architecture doc --- pub/doc/arvo/clay/architecture.md | 415 ++++++++++++++++++++++++++++++ 1 file changed, 415 insertions(+) create mode 100644 pub/doc/arvo/clay/architecture.md diff --git a/pub/doc/arvo/clay/architecture.md b/pub/doc/arvo/clay/architecture.md new file mode 100644 index 0000000000..ed65ccd264 --- /dev/null +++ b/pub/doc/arvo/clay/architecture.md @@ -0,0 +1,415 @@ +# clay + +## high-level + +clay is the primary filesystem for the arvo operating system, +which is the core of an urbit. The architecture of clay is +intrinsically connected with arvo, but we assume no knowledge of +either arvo or urbit. We will point out only those features of +arvo that are necessary for an understanding of clay, and we will +do so only when they arise. + +The first relevant feature of arvo is that it is a deterministic +system where input and output are defined as a series of events +and effects. The state of arvo is simply a function of its event +log. None of the effects from an event are emitted until the +event is entered in the log and persisted, either to disk or +another trusted source of persistence, such as a Kafka cluster. +Consequently, arvo is a single-level store: everything in its +state is persistent. + +In a more traditional OS, everything in RAM can be erased at any +time by power failure, and is always erased on reboot. Thus, a +primary purpose of a filesystem is to ensure files persist across +power failures and reboots. In arvo, both power failures and +reboots are special cases of suspending computation, which is +done safely since our event log is already persistent. Therefore, +clay is not needed in arvo for persistence. Why, then, do we have a +filesystem? There are two answers to this question. + +First, clay provides a filesystem tree, which is a convenient +user interface for some applications. Unix has the useful concept +of virtual filesystems, which are used for everything from direct +access to devices, to random number generators, to the /proc +tree. It is easy and intuitive to read from and write to a +filesystem tree. + +Second, clay has a distributed revision control system baked into +it. Traditional filesystems are not revision controlled, so +userspace software -- such as git -- is written on top of them to +do so. clay natively provides the same functionality as modern +DVCSes, and more. + +clay has two other unique properties that we'll cover later on: +it supports typed data and is referentially transparent. + +### Revision Control + +Every urbit has one or more "desks", which are independently +revision-controlled branches. Each desk contains its own mark +definitions, apps, doc, and so forth. + +Traditionally, an urbit has at least a base and a home desk. The +base desk has all the system software from the distribution. the +home desk is a fork of base with all the stuff specific to the +user of the urbit. + +A desk is a series of numbered commits, the most recent of which +represents the current state of the desk. A commit is composed of +(1) an absolute time when it was created, (2) a list of zero or +more parents, and (3) a map from paths to data. + +Most commits have exactly one parent, but the initial commit on a +desk may have zero parents, and merge commits have more than one +parent. + +The non-meta data is stored in the map of paths to data. It's +worth noting that no constraints are put on this map, so, for +example, both /a/b and /a/b/c could have data. This is impossible +in a traditional Unix filesystem since it means that /a/b is both +a file and a directory. Conventionally, the final element in the +path is its mark -- much like a filename extension in Unix. Thus, +/doc/readme.md in Unix is stored as /doc/readme/md in urbit. + +The data is not stored directly in the map; rather, a hash of the +data is stored, and we maintain a master blob store. Thus, if the +same data is referred to in multiple commits (as, for example, +when a file doesn't change between commits), only the hash is +duplicated. + +In the master blob store, we either store the data directly, or +else we store a diff against another blob. The hash is dependent +only on the data within and not on whether or not it's stored +directly, so we may on occasion rearrange the contents of the +blob store for performance reasons. + +Recall that a desk is a series of numbered commits. Not every +commit in a desk must be numbered. For example, if the base desk +has had 50 commits since home was forked from it, then a merge +from base to home will only add a single revision number to home, +although the full commit history will be accessible by traversing +the parentage of the individual commits. + +We do guarantee that the first commit is numbered 1, commits are +numbered consecutively after that (i.e. there are no "holes"), +the topmost commit is always numbered, and every numbered commit +is an ancestor of every later numbered commit. + +There are three ways to refer to particular commits in the +revision history. Firstly, one can use the revision number. +Secondly, one can use any absolute time between the one numbered +commit and the next (inclusive of the first, exclusive of the +second). Thirdly, every desk has a map of labels to revision +numbers. These labels may be used to refer to specific commits. + +Additionally, clay is a global filesystem, so data on other urbit +is easily accessible the same way as data on our local urbit. In +general, the path to a particular revision of a desk is +/~urbit-name/desk-name/revision. Thus, to get /try/readme/md +from revision 5 of the home desk on ~sampel-sipnym, we refer to +/~sampel-sipnym/home/5/try/readme/md. Clay's namespace is thus +global and referentially transparent. + +XXX reactivity here? + +### A Typed Filesystem + +Since clay is a general filesystem for storing data of arbitrary +types, in order to revision control correctly it needs to be +aware of types all the way through. Traditional revision control +does an excellent job of handling source code, so for source code +we act very similar to traditional revision control. The +challenge is to handle other data similarly well. + +For example, modern VCSs generally support "binary files", which +are files for which the standard textual diffing, patching, and +merging algorithms are not helpful. A "diff" of two binary files +is just a pair of the files, "patching" this diff is just +replacing the old file with the new one, and "merging" +non-identical diffs is always a conflict, which can't even be +helpfully annotated. Without knowing anything about the structure +of a blob of data, this is the best we can do. + +Often, though, "binary" files have some internal structure, and +it is possible to create diff, patch, and merge algorithms that +take advantage of this structure. An image may be the result of a +base image with some set of operations applied. With algorithms +aware of this set of operations, not only can revision control +software save space by not having to save every revision of the +image individually, these transformations can be made on parallel +branches and merged at will. + +Suppose Alice is tasked with touching up a picture, improving the +color balance, adjusting the contrast, and so forth, while Bob +has the job of cropping the picture to fit where it's needed and +adding textual overlay. Without type-aware revision control, +these changes must be made serially, requiring Alice and Bob to +explicitly coordinate their efforts. With type-aware revision +control, these operations may be performed in parallel, and then +the two changesets can be merged programmatically. + +Of course, even some kinds of text files may be better served by +diff, patch, and merge algorithms aware of the structure of the +files. Consider a file containing a pretty-printed JSON object. +Small changes in the JSON object may result in rather significant +changes in how the object is pretty-printed (for example, by +addding an indentation level, splitting a single line into +multiple lines). + +A text file wrapped at 80 columns also reacts suboptimally with +unadorned Hunt-McIlroy diffs. A single word inserted in a +paragraph may push the final word or two of the line onto the +next line, and the entire rest of the paragraph may be flagged as +a change. Two diffs consisting of a single added word to +different sentences may be flagged as a conflict. In general, +prose should be diffed by sentence, not by line. + +As far as the author is aware, clay is the first generalized, +type-aware revision control system. We'll go into the workings +of this system in some detail. + +### Marks + +Central to a typed filesystem is the idea of types. In clay, we +call these "marks". A mark is a file that defines a type, +conversion routines to and from the mark, and diff, patch, and +merge routines. + +For example, a `%txt` mark may be a list of lines of text, and it +may include conversions to `%mime` to allow it to be serialized +and sent to a browswer or to the unix filesystem. It will also +include Hunt-McIlroy diff, patch, and merge algorithms. + +A `%json` mark would be defined as a json object in the code, and +it would have a parser to convert from `%txt` and a printer to +convert back to `%txt`. The diff, patch, and merge algorithms are +fairly straightforward for json, though they're very different +from the text ones. + +More formally, a mark is a core with three arms, `++grab`, +`++grow`, and `++grad`. In `++grab` is a series of functions to +convert from other marks to the given mark. In `++grow` is a +series of functions to convert from the given mark to other +marks. In `++grad` is `++diff`, `++pact`, `++join`, and `++mash`. + +The types are as follows, in an informal pseudocode: + + ++ grab: + ++ mime: -> + ++ txt: -> + ... + ++ grow: + ++ mime: -> + ++ txt: -> + ... + ++ grad + ++ diff: (, ) -> + ++ pact: (, ) -> + ++ join: (, ) -> or NULL + ++ mash: (, ) -> + +These types are basically what you would expect. Not every mark +has each of these functions defined -- all of them are optional +in the general case. + +In general, for a particular mark, the `++grab` and `++grow` entries +(if they exist) should be inverses of each other. + +In `++grad`, `++diff` takes two instances of a mark and produces +a diff of them. `++pact` takes an instance of a mark and patches +it with the given diff. `++join` takes two diffs and attempts to +merge them into a single diff. If there are conflicts, it +produces null. `++mash` takes two diffs and forces a merge, +annotating any conflicts. + +In general, if `++diff` called with A and B produces diff D, then +`++pact` called with A and D should produce B. Also, if `++join` +of two diffs does not produce null, then `++mash` of the same +diffs should produce the same result. + +Alternately, instead of `++diff`, `++pact`, `++join`, and +`++mash`, a mark can provide the same functionality by defining +`++sted` to be the name of another mark to which we wish to +delegate the revision control responsibilities. Then, before +running any of those functions, clay will convert to the other +mark, and convert back afterward. For example, the `%hoon` mark +is revision-controlled in the same way as `%txt`, so its `++grad` +is simply `++sted %txt`. Of course, `++txt` must be defined in +`++grow` and `++grab` as well. + +Every file in clay has a mark, and that mark must have a +fully-functioning `++grad`. Marks are used for more than just +clay, and other marks don't need a `++grad`, but if a piece of +data is to be saved to clay, we must know how to revision-control +it. + +Additionally, if a file is to be synced out to unix, then it must +have conversion routines to and from the `%mime` mark. + +##Using clay + +### Reading and Subscribing + +When reading from Clay, there are three types of requests. A +`%sing` request asks for data at single revsion. A `%next` +request asks to be notified the next time there's a change to +given file. A `%many` request asks to be notified on every +change in a desk for a range of changes. + +For `%sing` and `%next`, there are generally three things to be +queried. A `%u` request simply checks for the existence of a +file at a path. A `%x` request gets the data in the file at a +path. A `%y` request gets a hash of the data in the file at the +path combined with all its children and their data. Thus, `%y` +of a node changes if it or any of its children change. + +A `%sing` request is fulfilled immediately if possible. If the +requested revision is in the future, or is on another ship for +which we don't have the result cached, we don't respond +immediately. If the requested revision is in the future, we wait +until the revision happens before we respond to the request. If +the request is for data on another ship, we pass on the request +to the other ship. In general, Clay subscriptions, like most +things in Urbit, aren't guaranteed to return immediately. +They'll return when they can, and they'll do so in a +referentially transparent manner. + +A `%next` request checks query at the given revision, and it +produces the result of the query the next time it changes, along +with the revsion number when it changes. Thus, a `%next` of a +`%u` is triggered when a file is added or deleted, a `%next of a +`%x` is triggered when a file is added, deleted, or changed, and +a `%next` of a `%y` is triggered when a file or any of its +children is added, deleted, or changed. + +A `%many` request is triggered every time the given desk has a +new revision. Unlike a `%next`, a `%many` has both a start and +an end revsion, after which it stops returning. For `%next`, a +single change is reported, and if the caller wishes to hear of +the next change, it must resubscribe. For `%many`, every revsion +from the start to the end triggers a response. Since a `%many` +request doesn't ask for any particular data, there aren't `%u`, +`%x`, and `%y` versions for it. + +### Unix sync + +One of the primary functions of clay is as a convenient user +interface. While tools exist to use clay from within urbit, it's +often useful to be able to treat clay like any other filesystem +from the Unix perspective -- to "mount" it, as it were. + +From urbit, you can run `|mount /path/to/directory %mount-point`, +and this will mount the given clay directory to the mount-point +directory in Unix. Every file is converted to `%mime` before it's +written to Unix, and converted back when read from Unix. The +entire directory is watched (a la Dropbox), and every change is +auto-committed to clay. + +### Merging + +Merging is a fundamental operation for a distributed revision +control system. At their root, clay's merges are similar to +git's, but with some additions to accomodate typed data. There +are seven different merge strategies. + +Throughout our discussion, we'll say that the merge is from +Alice's desk to Bob's. Recall that a commit is a date (for all +new commits this will be the current date), a list of parents, +and the data itself. + +A `%init` merge should be used iff it's the first commit to a +desk. The head of Alice's desk is used as the number 1 commit to +Bob's desk. Obviously, the ancestry remains intact through +traversing the parentage of the commit even though previous +commits are not numbered for Bob's desk. + +A `%this` merge means to keep what's in Bob's desk, but join the +ancestry. Thus, the new commit has the head of each desk as +parents, but the data is exactly what's in Bob's desk. For those +following along in git, this is the 'ours' merge strategy, not +the '--ours' option to the 'recursive' merge strategy. In other +words, even if Alice makes a change that does not conflict with +Bob, we throw it away. It's Bob's way or the highway. + +A `%that` merge means to take what's in Alice's desk, but join +the ancestry. This is the reverse of `%this`. + +A `%fine` merge is a "fast-forward" merge. This succeeds iff one +head is in the ancestry of the other. In this case, we use the +descendant as our new head. + +For `%meet`, `%mate`, and `%meld` merges, we first find the most +recent common ancestor to use as our merge base. If we have no +common ancestors, then we fail. If we have more than one most +recent common ancestor, then we have a criss-cross situation, +which should be handled delicately. At present, we delicately +throw up our hands and give up, but something akin to git's +'recursive' strategy should be implemented in the future. + +There's a functional inclusion ordering on `%fine`, `%meet`, +`%mate`, and `%meld` such that if an earlier strategy would have +succeeded, then every later strategy will produce the same +result. Put another way, every earlier strategy is the same as +every later strategy except with a restricted domain. + +A `%meet` merge only succeeds if the changes from the merge base +to Alice's head (hereafter, "Alice's changes") are in different +files than Bob's changes. In this case, the parents are both +Alice's and Bob's heads, and the data is the merge base plus +Alice's changed files plus Bob's changed files. + +A `%mate` merge attempts to merge changes to the same file when +both Alice and bob change it. If the merge is clean, we use it; +otherwise, we fail. A merge between different types of changes -- +for example, deleting a file vs changing it -- is always a +conflict. If we succeed, the parents are both Alice's and Bob's +heads, and the data is the merge base plus Alice's changed files +plus Bob's changed files plus the merged files. + +A `%meld` merge will succeed even if there are conflicts. If +there are conflicts in a file, then we use the merge base's +version of that file, and we produce a set of files with +conflicts. The parents are both Alice's and Bob's heads, and the +data is the merge base plus Alice's changed files plus Bob's +changed files plus the successfully merged files plus the merge +base's version of the conflicting files. + +That's the extent of the merge options in clay proper. In +userspace there's a final option `%auto`, which is the most +common. `%auto` checks to see if Bob's desk exists, and if it +doesn't we use a `%init` merge. Otherwise, we progressively try +`%fine`, `%meet`, and `%mate` until one succeeds. + +If none succeed, we merge Bob's desk into a scratch desk. Then, +we merge Alice's desk into the scratch desk with the `%meld` +option to force the merge. For each file in the produced set of +conflicting files, we call the `++mash` function for the +appropriate mark, which annotates the conflicts if we know how. + +Finally, we display a message to the user informing them of the +scratch desk's existence, which files have annotated conflicts, +and which files have unannotated conflicts. When the user has +resolved the conflicts, they can merge the scratch desk back into +Bob's desk. This will be a `%fine` merge since Bob's head is in +the ancestry of the scratch desk. + +### Autosync + +Tracking and staying in sync with another desk is another +fundamental operation. We call this "autosync". This doesn't mean +simply mirroring a desk, since that wouldn't allow local changes. +We simply want to apply changes as they are made upstream, as +long as there are no conflicts with local changes. + +This is implemented by watching the other desk, and, when it has +changes, merging these changes into our desk with the usual merge +strategies. + +Note that it's quite reasonable for two desks to be autosynced to +each other. This results in any change on one desk being mirrored +to the other and vice versa. + +Additionally, it's fine to set up an autosync even if one desk, +the other desk, or both desks do not exist. The sync will be +activated when the upstream desk comes into existence and will +create the downstream desk if needed. From 28370ba193322b443407f1b8c9055519e2b63c18 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Fri, 18 Sep 2015 15:10:18 -0700 Subject: [PATCH 40/59] sessions were being replaced without being stopped. Fixes #406 --- ape/dojo.hoon | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/ape/dojo.hoon b/ape/dojo.hoon index dcc30ba4a6..54acf9a8ee 100644 --- a/ape/dojo.hoon +++ b/ape/dojo.hoon @@ -100,7 +100,7 @@ house :: program state == :: ++ he :: per session - |_ [[ost=bone moz=(list move)] session] :: + |_ [moz=(list move) session] :: ++ dp :: dojo parser |% ++ dp-default-app %hood @@ -670,7 +670,11 @@ == :: ++ he-abet :: resolve - [(flop moz) %_(+> hoc (~(put by hoc) ost +<+))] + [(flop moz) %_(+> hoc (~(put by hoc) ost.hid +<+))] + :: + ++ he-abut :: discard + => he-stop + [(flop moz) %_(+> hoc (~(del by hoc) ost.hid))] :: ++ he-beak -:he-beam ++ he-beam :: logical beam @@ -681,7 +685,7 @@ ++ he-card :: emit gift |= cad=card ^+ +> - %_(+> moz [[ost cad] moz]) + %_(+> moz [[ost.hid cad] moz]) :: ++ he-send |= [way=wire him=ship dap=term cop=clap] @@ -844,10 +848,10 @@ == :: :: pattern: ++ foo |=(data he-abet:(~(he-foo he (~(got by hoc) ost)) data)) -++ arm (arm-session (~(got by hoc) ost.hid)) +++ arm (arm-session ~ (~(got by hoc) ost.hid)) ++ arm-session - |= ses=session - => ~(. he [ost.hid ~] ses) + |= [moz=(list move) ses=session] + => ~(. he moz ses) =- [wrap=- +] |* he-arm=_he-type |= _+<.he-arm ^- (quip move ..he) @@ -856,9 +860,12 @@ ++ peer-sole ~? !=(src.hid our.hid) [%dojo-peer-stranger ost.hid src.hid] :: ?> =(src.hid our.hid) - ~? (~(has by hoc) ost.hid) [%dojo-peer-replaced ost.hid] + =^ moz . + ?. (~(has by hoc) ost.hid) [~ .] + ~& [%dojo-peer-replaced ost.hid] + ~(he-abut he ~ (~(got by hoc) ost.hid)) =+ ses=%*(. *session -.dir [our.hid %home ud/0]) - (wrap he-peer):(arm-session ses) + (wrap he-peer):(arm-session moz ses) :: ++ poke-sole-action |= act=sole-action ~| poke/act %. act @@ -872,7 +879,6 @@ ++ pull |= [pax=path] ^- (quip move +>) - =^ moz +> - he-abet:~(he-stop he [[ost.hid ~] (~(got by hoc) ost.hid)]) + =^ moz +> ~(he-abut he ~ (~(got by hoc) ost.hid)) [moz +>.$(hoc (~(del by hoc) ost.hid))] -- From 06bda9cd8c17731f02246672441bf8acd45d22e9 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Fri, 18 Sep 2015 20:15:36 -0400 Subject: [PATCH 41/59] fixed lose-changes-when-unrelated-conflict bug --- arvo/clay.hoon | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/arvo/clay.hoon b/arvo/clay.hoon index 0d8178fc97..e43c090fe7 100644 --- a/arvo/clay.hoon +++ b/arvo/clay.hoon @@ -1933,15 +1933,18 @@ |= [pax=path lob=lobe] (~(has by q.bas.dat) pax) =. cal.dal.dat - %- mo - %+ skim (~(tap by q.bas.dat)) + %- mo ^- (list (pair path lobe)) + %+ murn (~(tap by q.bas.dat)) |= [pax=path lob=lobe] + ^- (unit (pair path lobe)) =+ a=(~(get by q.ali.dat) pax) =+ b=(~(get by q.bob.dat) pax) - ?& ?=(^ a) - !=([~ lob] a) - =([~ lob] b) - == + ?. ?& ?=(^ a) + !=([~ lob] a) + =([~ lob] b) + == + ~ + `[pax +.a] =. can.dal.dat p.can =. old.dal.dat %- mo ^- (list ,[path ~]) @@ -1973,15 +1976,18 @@ |= [pax=path lob=lobe] (~(has by q.bas.dat) pax) =. cal.dob.dat - %- mo - %+ skim (~(tap by q.bas.dat)) + %- mo ^- (list (pair path lobe)) + %+ murn (~(tap by q.bas.dat)) |= [pax=path lob=lobe] + ^- (unit (pair path lobe)) =+ a=(~(get by q.ali.dat) pax) =+ b=(~(get by q.bob.dat) pax) - ?& ?=(^ b) - !=([~ lob] b) - =([~ lob] a) - == + ?. ?& ?=(^ b) + !=([~ lob] b) + =([~ lob] a) + == + ~ + `[pax +.b] =. can.dob.dat p.can =. old.dob.dat %- mo ^- (list ,[path ~]) @@ -2070,7 +2076,7 @@ %- ~(urn by con) |= [pax=path *] (~(got by q.bas.dat) pax) - =. con :: add/del conflict + =. con :: change/del conflict %- ~(uni by con) %- mo ^- (list ,[path *]) %+ skim (~(tap by old.dal.dat)) @@ -2079,7 +2085,7 @@ ~| %strange-add-and-del !! (~(has by can.dob.dat) pax) - =. con :: add/del conflict + =. con :: change/del conflict %- ~(uni by con) %- mo ^- (list ,[path *]) %+ skim (~(tap by old.dob.dat)) @@ -2126,6 +2132,13 @@ [(lobe-to-mark u.-) u.-] [p q.q]:cay [(~(put by hat) pax p.bol) (~(put by lat) p.bol bol)] + :: ~& old=(~(run by old) mug) + :: ~& newdal=(~(run by new.dal.dat) mug) + :: ~& newdob=(~(run by new.dob.dat) mug) + :: ~& caldal=(~(run by cal.dal.dat) mug) + :: ~& caldob=(~(run by cal.dob.dat) mug) + :: ~& hot=(~(run by hot) mug) + :: ~& cas=(~(run by cas) mug) =+ ^- hat=(map path lobe) :: all the content %- ~(uni by old) %- ~(uni by new.dal.dat) @@ -2134,6 +2147,7 @@ %- ~(uni by cal.dob.dat) %- ~(uni by hot) cas + :: ~& > hat=(~(run by hat) mug) =+ ^- del=(map path ,?) (~(run by (~(uni by old.dal.dat) old.dob.dat)) |=(~ %|)) =. gon.dat [%& (sa (turn (~(tap by con)) head))] From cb8e5f41df98920d46c21e5ede924fcd0c572d0f Mon Sep 17 00:00:00 2001 From: Joan Torres Date: Sat, 19 Sep 2015 09:50:39 -0700 Subject: [PATCH 42/59] Add ++skid jet --- arvo/hoon.hoon | 1 + 1 file changed, 1 insertion(+) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 554a305b1b..fbdaf7cda5 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -729,6 +729,7 @@ $(a t.a, b b(+<+ (b i.a +<+.b))) :: ++ skid :: separate + ~/ %skid |* [a=(list) b=$+(* ?)] |- ^+ [p=a q=a] ?~ a [~ ~] From 09c6d28d6b9320451780e6344147eeb485af8b68 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Mon, 21 Sep 2015 15:06:24 -0400 Subject: [PATCH 43/59] bump protocol to 5 --- arvo/ames.hoon | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arvo/ames.hoon b/arvo/ames.hoon index 908d592e56..20346d17d0 100644 --- a/arvo/ames.hoon +++ b/arvo/ames.hoon @@ -413,7 +413,7 @@ vix=(bex +((cut 0 [25 2] mag))) :: width of sender tay=(cut 0 [27 5] mag) :: message type == - ?> =(4 vez) + ?> =(5 vez) ?> =(chk (end 0 20 (mug bod))) :+ [(end 3 wix bod) (cut 3 [wix vix] bod)] (kins tay) @@ -433,7 +433,7 @@ =+ tay=(ksin q.kec) %+ mix %+ can 0 - :~ [3 4] + :~ [3 5] [20 (mug bod)] [2 yax] [2 qax] @@ -1018,7 +1018,7 @@ ++ gnaw :: gnaw:am |= [kay=cape ryn=lane pac=rock] :: process packet ^- [p=(list boon) q=fort] - ?. =(4 (end 0 3 pac)) [~ fox] + ?. =(5 (end 0 3 pac)) [~ fox] =+ kec=(bite pac) ?: (goop p.p.kec) [~ fox] ?. (~(has by urb.ton.fox) q.p.kec) From c61293fb443a72227635e63a94b397377f07c65e Mon Sep 17 00:00:00 2001 From: Galen Wolfe-Pauly Date: Mon, 21 Sep 2015 13:00:58 -0700 Subject: [PATCH 44/59] fixed anchor bug --- .../src/js/components/TocComponent.coffee | 6 +- pub/tree/src/js/main.js | 86 ++++++++----------- 2 files changed, 39 insertions(+), 53 deletions(-) diff --git a/pub/tree/src/js/components/TocComponent.coffee b/pub/tree/src/js/components/TocComponent.coffee index 7f41bf37d5..403d30ab80 100644 --- a/pub/tree/src/js/components/TocComponent.coffee +++ b/pub/tree/src/js/components/TocComponent.coffee @@ -52,13 +52,13 @@ module.exports = query {body:'r'}, recl componentWillUnmount: -> clearInterval @int - - collectHeaders: (e) -> hs = [{gn:"h1", ga:{className:"t"}, c:["Table of contents"]}] for k,v of e if not v.gn then continue if v.gn[0] is 'h' and parseInt(v.gn[1]) isnt NaN + _v = _.clone v + delete _v.ga.id hs.push v return hs @@ -68,4 +68,4 @@ module.exports = query {body:'r'}, recl if v.gn is 'div' and v.ga?.id is "toc" return {gn:"div", ga:{className:"toc",onClick:@_click}, c:@collectHeaders(v.c)} - render: -> reactify @parseHeaders() + render: -> reactify @parseHeaders() \ No newline at end of file diff --git a/pub/tree/src/js/main.js b/pub/tree/src/js/main.js index 3af4647c48..2fefc2a5ad 100644 --- a/pub/tree/src/js/main.js +++ b/pub/tree/src/js/main.js @@ -35,7 +35,6 @@ module.exports = { }; - },{"../dispatcher/Dispatcher.coffee":13,"../persistence/TreePersistence.coffee":19}],2:[function(require,module,exports){ var BodyComponent, CLICK, Links, TreeActions, TreeStore, a, clas, div, query, reactify, recl, ref; @@ -289,7 +288,6 @@ module.exports = query({ })); - },{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":20,"./Async.coffee":3,"./BodyComponent.coffee":4,"./Reactify.coffee":10,"classnames":15}],3:[function(require,module,exports){ var TreeActions, TreeStore, _load, code, div, recl, ref, span; @@ -391,7 +389,6 @@ module.exports = function(queries, Child, load) { }; - },{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":20,"./LoadComponent.coffee":9}],4:[function(require,module,exports){ var div, query, reactify, recl; @@ -417,7 +414,6 @@ module.exports = query({ })); - },{"./Async.coffee":3,"./Reactify.coffee":10}],5:[function(require,module,exports){ var div, recl, ref, textarea; @@ -441,7 +437,6 @@ module.exports = recl({ }); - },{}],6:[function(require,module,exports){ var div, recl; @@ -463,7 +458,6 @@ module.exports = { }; - },{"./CodeMirror.coffee":5,"./KidsComponent.coffee":7,"./ListComponent.coffee":8,"./SearchComponent.coffee":11,"./TocComponent.coffee":12}],7:[function(require,module,exports){ var a, div, hr, li, query, reactify, recl, ref, ul; @@ -503,7 +497,6 @@ module.exports = query({ })); - },{"./Async.coffee":3,"./Reactify.coffee":10}],8:[function(require,module,exports){ var a, clas, div, h1, li, query, reactify, recl, ref, ul; @@ -599,7 +592,6 @@ module.exports = query({ })); - },{"./Async.coffee":3,"./Reactify.coffee":10,"classnames":15}],9:[function(require,module,exports){ var div, input, recl, ref, textarea; @@ -640,7 +632,6 @@ module.exports = recl({ }); - },{}],10:[function(require,module,exports){ var Virtual, div, load, reactify, recl, ref, rele, span, walk; @@ -708,7 +699,6 @@ module.exports = _.extend(reactify, { }); - },{"./LoadComponent.coffee":9}],11:[function(require,module,exports){ var a, div, input, query, reactify, recl, ref, slice = [].slice; @@ -847,7 +837,6 @@ module.exports = query({ })); - },{"./Async.coffee":3,"./Reactify.coffee":10}],12:[function(require,module,exports){ var div, query, reactify, recl; @@ -932,7 +921,7 @@ module.exports = query({ return clearInterval(this.int); }, collectHeaders: function(e) { - var hs, k, v; + var _v, hs, k, v; hs = [ { gn: "h1", @@ -948,6 +937,8 @@ module.exports = query({ continue; } if (v.gn[0] === 'h' && parseInt(v.gn[1]) !== NaN) { + _v = _.clone(v); + delete _v.ga.id; hs.push(v); } } @@ -978,7 +969,6 @@ module.exports = query({ })); - },{"./Async.coffee":3,"./Reactify.coffee":10}],13:[function(require,module,exports){ var Dispatcher; @@ -1000,7 +990,6 @@ module.exports = _.extend(new Dispatcher(), { }); - },{"flux":16}],14:[function(require,module,exports){ var rend; @@ -1147,7 +1136,6 @@ $(function() { }); - },{"./actions/TreeActions.coffee":1,"./components/AnchorComponent.coffee":2,"./components/BodyComponent.coffee":4,"./components/Components.coffee":6,"./persistence/TreePersistence.coffee":19}],15:[function(require,module,exports){ /*! Copyright (c) 2015 Jed Watson. @@ -1156,46 +1144,46 @@ $(function() { */ (function () { - 'use strict'; + 'use strict'; - function classNames () { + function classNames () { - var classes = ''; + var classes = ''; - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - if (!arg) continue; + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) continue; - var argType = typeof arg; + var argType = typeof arg; - if ('string' === argType || 'number' === argType) { - classes += ' ' + arg; + if ('string' === argType || 'number' === argType) { + classes += ' ' + arg; - } else if (Array.isArray(arg)) { - classes += ' ' + classNames.apply(null, arg); + } else if (Array.isArray(arg)) { + classes += ' ' + classNames.apply(null, arg); - } else if ('object' === argType) { - for (var key in arg) { - if (arg.hasOwnProperty(key) && arg[key]) { - classes += ' ' + key; - } - } - } - } + } else if ('object' === argType) { + for (var key in arg) { + if (arg.hasOwnProperty(key) && arg[key]) { + classes += ' ' + key; + } + } + } + } - return classes.substr(1); - } + return classes.substr(1); + } - if (typeof module !== 'undefined' && module.exports) { - module.exports = classNames; - } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd){ - // AMD. Register as an anonymous module. - define(function () { - return classNames; - }); - } else { - window.classNames = classNames; - } + if (typeof module !== 'undefined' && module.exports) { + module.exports = classNames; + } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd){ + // AMD. Register as an anonymous module. + define(function () { + return classNames; + }); + } else { + window.classNames = classNames; + } }()); @@ -1535,7 +1523,7 @@ module.exports = { encode: function(obj) { var _encode, delim; delim = function(n) { - return Array(n + 1).join('_') || '.'; + return ('_'.repeat(n)) || '.'; }; _encode = function(obj) { var _dep, dep, k, res, sub, v; @@ -1568,7 +1556,6 @@ module.exports = { }; - },{}],20:[function(require,module,exports){ var EventEmitter, MessageDispatcher, QUERIES, TreeStore, _curr, _data, _tree, clog; @@ -1804,7 +1791,6 @@ TreeStore.dispatchToken = MessageDispatcher.register(function(payload) { module.exports = TreeStore; - },{"../dispatcher/Dispatcher.coffee":13,"events":21}],21:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // @@ -2108,4 +2094,4 @@ function isUndefined(arg) { return arg === void 0; } -},{}]},{},[14]); +},{}]},{},[14]); \ No newline at end of file From c44084be4090c9b1e39a9a4b67fb751d86fb98d9 Mon Sep 17 00:00:00 2001 From: Galen Wolfe-Pauly Date: Wed, 23 Sep 2015 09:56:58 -0700 Subject: [PATCH 45/59] email component --- pub/tree/src/js/components/Components.coffee | 1 + .../src/js/components/EmailComponent.coffee | 28 +++ pub/tree/src/js/main.js | 167 ++++++++++++------ 3 files changed, 144 insertions(+), 52 deletions(-) create mode 100644 pub/tree/src/js/components/EmailComponent.coffee diff --git a/pub/tree/src/js/components/Components.coffee b/pub/tree/src/js/components/Components.coffee index 052f46c7bd..13671ac75c 100644 --- a/pub/tree/src/js/components/Components.coffee +++ b/pub/tree/src/js/components/Components.coffee @@ -7,4 +7,5 @@ module.exports = list: require './ListComponent.coffee' kids: require './KidsComponent.coffee' toc: require './TocComponent.coffee' + email: require './EmailComponent.coffee' lost: recl render: -> (div {}, "") diff --git a/pub/tree/src/js/components/EmailComponent.coffee b/pub/tree/src/js/components/EmailComponent.coffee new file mode 100644 index 0000000000..b5838f0bf8 --- /dev/null +++ b/pub/tree/src/js/components/EmailComponent.coffee @@ -0,0 +1,28 @@ +reactify = require './Reactify.coffee' + +recl = React.createClass +{div,p,button,input} = React.DOM + +module.exports = recl + displayName: "email" + + getInitialState: -> {submit:false,email:""} + + onClick: -> @submit() + onKeyUp: (e) -> + $('div.email').text($('div.email').text()) + if e.keyCode is 13 then @submit() + + submit: -> + email = $('div.email').text() + @setState {submit:true} + + render: -> + if @state.submit is false + cont = [ + (input {key:"field",className:"email",placeholder:"your@email.com",@onKeyUp}, @state.email) + (button {key:"submit",className:"submit",@onClick}, "Submit") + ] + else + cont = [(div {className:"submitted"},"Got it. Thanks!")] + (p {className:"email"}, cont) \ No newline at end of file diff --git a/pub/tree/src/js/main.js b/pub/tree/src/js/main.js index 2fefc2a5ad..6ebf299b60 100644 --- a/pub/tree/src/js/main.js +++ b/pub/tree/src/js/main.js @@ -35,7 +35,7 @@ module.exports = { }; -},{"../dispatcher/Dispatcher.coffee":13,"../persistence/TreePersistence.coffee":19}],2:[function(require,module,exports){ +},{"../dispatcher/Dispatcher.coffee":14,"../persistence/TreePersistence.coffee":20}],2:[function(require,module,exports){ var BodyComponent, CLICK, Links, TreeActions, TreeStore, a, clas, div, query, reactify, recl, ref; clas = require('classnames'); @@ -288,7 +288,7 @@ module.exports = query({ })); -},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":20,"./Async.coffee":3,"./BodyComponent.coffee":4,"./Reactify.coffee":10,"classnames":15}],3:[function(require,module,exports){ +},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":21,"./Async.coffee":3,"./BodyComponent.coffee":4,"./Reactify.coffee":11,"classnames":16}],3:[function(require,module,exports){ var TreeActions, TreeStore, _load, code, div, recl, ref, span; _load = require('./LoadComponent.coffee'); @@ -389,7 +389,7 @@ module.exports = function(queries, Child, load) { }; -},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":20,"./LoadComponent.coffee":9}],4:[function(require,module,exports){ +},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":21,"./LoadComponent.coffee":10}],4:[function(require,module,exports){ var div, query, reactify, recl; query = require('./Async.coffee'); @@ -414,7 +414,7 @@ module.exports = query({ })); -},{"./Async.coffee":3,"./Reactify.coffee":10}],5:[function(require,module,exports){ +},{"./Async.coffee":3,"./Reactify.coffee":11}],5:[function(require,module,exports){ var div, recl, ref, textarea; recl = React.createClass; @@ -450,6 +450,7 @@ module.exports = { list: require('./ListComponent.coffee'), kids: require('./KidsComponent.coffee'), toc: require('./TocComponent.coffee'), + email: require('./EmailComponent.coffee'), lost: recl({ render: function() { return div({}, ""); @@ -458,7 +459,69 @@ module.exports = { }; -},{"./CodeMirror.coffee":5,"./KidsComponent.coffee":7,"./ListComponent.coffee":8,"./SearchComponent.coffee":11,"./TocComponent.coffee":12}],7:[function(require,module,exports){ +},{"./CodeMirror.coffee":5,"./EmailComponent.coffee":7,"./KidsComponent.coffee":8,"./ListComponent.coffee":9,"./SearchComponent.coffee":12,"./TocComponent.coffee":13}],7:[function(require,module,exports){ +var button, div, input, p, reactify, recl, ref; + +reactify = require('./Reactify.coffee'); + +recl = React.createClass; + +ref = React.DOM, div = ref.div, p = ref.p, button = ref.button, input = ref.input; + +module.exports = recl({ + displayName: "email", + getInitialState: function() { + return { + submit: false, + email: "" + }; + }, + onClick: function() { + return this.submit(); + }, + onKeyUp: function(e) { + $('div.email').text($('div.email').text()); + if (e.keyCode === 13) { + return this.submit(); + } + }, + submit: function() { + var email; + email = $('div.email').text(); + return this.setState({ + submit: true + }); + }, + render: function() { + var cont; + if (this.state.submit === false) { + cont = [ + input({ + key: "field", + className: "email", + placeholder: "your@email.com", + onKeyUp: this.onKeyUp + }, this.state.email), button({ + key: "submit", + className: "submit", + onClick: this.onClick + }, "Submit") + ]; + } else { + cont = [ + div({ + className: "submitted" + }, "Got it. Thanks!") + ]; + } + return p({ + className: "email" + }, cont); + } +}); + + +},{"./Reactify.coffee":11}],8:[function(require,module,exports){ var a, div, hr, li, query, reactify, recl, ref, ul; reactify = require('./Reactify.coffee'); @@ -497,7 +560,7 @@ module.exports = query({ })); -},{"./Async.coffee":3,"./Reactify.coffee":10}],8:[function(require,module,exports){ +},{"./Async.coffee":3,"./Reactify.coffee":11}],9:[function(require,module,exports){ var a, clas, div, h1, li, query, reactify, recl, ref, ul; clas = require('classnames'); @@ -592,7 +655,7 @@ module.exports = query({ })); -},{"./Async.coffee":3,"./Reactify.coffee":10,"classnames":15}],9:[function(require,module,exports){ +},{"./Async.coffee":3,"./Reactify.coffee":11,"classnames":16}],10:[function(require,module,exports){ var div, input, recl, ref, textarea; recl = React.createClass; @@ -632,7 +695,7 @@ module.exports = recl({ }); -},{}],10:[function(require,module,exports){ +},{}],11:[function(require,module,exports){ var Virtual, div, load, reactify, recl, ref, rele, span, walk; recl = React.createClass; @@ -699,7 +762,7 @@ module.exports = _.extend(reactify, { }); -},{"./LoadComponent.coffee":9}],11:[function(require,module,exports){ +},{"./LoadComponent.coffee":10}],12:[function(require,module,exports){ var a, div, input, query, reactify, recl, ref, slice = [].slice; @@ -837,7 +900,7 @@ module.exports = query({ })); -},{"./Async.coffee":3,"./Reactify.coffee":10}],12:[function(require,module,exports){ +},{"./Async.coffee":3,"./Reactify.coffee":11}],13:[function(require,module,exports){ var div, query, reactify, recl; query = require('./Async.coffee'); @@ -969,7 +1032,7 @@ module.exports = query({ })); -},{"./Async.coffee":3,"./Reactify.coffee":10}],13:[function(require,module,exports){ +},{"./Async.coffee":3,"./Reactify.coffee":11}],14:[function(require,module,exports){ var Dispatcher; Dispatcher = require('flux').Dispatcher; @@ -990,7 +1053,7 @@ module.exports = _.extend(new Dispatcher(), { }); -},{"flux":16}],14:[function(require,module,exports){ +},{"flux":17}],15:[function(require,module,exports){ var rend; rend = React.render; @@ -1136,7 +1199,7 @@ $(function() { }); -},{"./actions/TreeActions.coffee":1,"./components/AnchorComponent.coffee":2,"./components/BodyComponent.coffee":4,"./components/Components.coffee":6,"./persistence/TreePersistence.coffee":19}],15:[function(require,module,exports){ +},{"./actions/TreeActions.coffee":1,"./components/AnchorComponent.coffee":2,"./components/BodyComponent.coffee":4,"./components/Components.coffee":6,"./persistence/TreePersistence.coffee":20}],16:[function(require,module,exports){ /*! Copyright (c) 2015 Jed Watson. Licensed under the MIT License (MIT), see @@ -1144,50 +1207,50 @@ $(function() { */ (function () { - 'use strict'; + 'use strict'; - function classNames () { + function classNames () { - var classes = ''; + var classes = ''; - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - if (!arg) continue; + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) continue; - var argType = typeof arg; + var argType = typeof arg; - if ('string' === argType || 'number' === argType) { - classes += ' ' + arg; + if ('string' === argType || 'number' === argType) { + classes += ' ' + arg; - } else if (Array.isArray(arg)) { - classes += ' ' + classNames.apply(null, arg); + } else if (Array.isArray(arg)) { + classes += ' ' + classNames.apply(null, arg); - } else if ('object' === argType) { - for (var key in arg) { - if (arg.hasOwnProperty(key) && arg[key]) { - classes += ' ' + key; - } - } - } - } + } else if ('object' === argType) { + for (var key in arg) { + if (arg.hasOwnProperty(key) && arg[key]) { + classes += ' ' + key; + } + } + } + } - return classes.substr(1); - } + return classes.substr(1); + } - if (typeof module !== 'undefined' && module.exports) { - module.exports = classNames; - } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd){ - // AMD. Register as an anonymous module. - define(function () { - return classNames; - }); - } else { - window.classNames = classNames; - } + if (typeof module !== 'undefined' && module.exports) { + module.exports = classNames; + } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd){ + // AMD. Register as an anonymous module. + define(function () { + return classNames; + }); + } else { + window.classNames = classNames; + } }()); -},{}],16:[function(require,module,exports){ +},{}],17:[function(require,module,exports){ /** * Copyright (c) 2014-2015, Facebook, Inc. * All rights reserved. @@ -1199,7 +1262,7 @@ $(function() { module.exports.Dispatcher = require('./lib/Dispatcher') -},{"./lib/Dispatcher":17}],17:[function(require,module,exports){ +},{"./lib/Dispatcher":18}],18:[function(require,module,exports){ /* * Copyright (c) 2014, Facebook, Inc. * All rights reserved. @@ -1451,7 +1514,7 @@ var _prefix = 'ID_'; module.exports = Dispatcher; -},{"./invariant":18}],18:[function(require,module,exports){ +},{"./invariant":19}],19:[function(require,module,exports){ /** * Copyright (c) 2014, Facebook, Inc. * All rights reserved. @@ -1506,7 +1569,7 @@ var invariant = function(condition, format, a, b, c, d, e, f) { module.exports = invariant; -},{}],19:[function(require,module,exports){ +},{}],20:[function(require,module,exports){ module.exports = { get: function(path, query, cb) { var url; @@ -1523,7 +1586,7 @@ module.exports = { encode: function(obj) { var _encode, delim; delim = function(n) { - return ('_'.repeat(n)) || '.'; + return Array(n + 1).join('_') || '.'; }; _encode = function(obj) { var _dep, dep, k, res, sub, v; @@ -1556,7 +1619,7 @@ module.exports = { }; -},{}],20:[function(require,module,exports){ +},{}],21:[function(require,module,exports){ var EventEmitter, MessageDispatcher, QUERIES, TreeStore, _curr, _data, _tree, clog; EventEmitter = require('events').EventEmitter; @@ -1791,7 +1854,7 @@ TreeStore.dispatchToken = MessageDispatcher.register(function(payload) { module.exports = TreeStore; -},{"../dispatcher/Dispatcher.coffee":13,"events":21}],21:[function(require,module,exports){ +},{"../dispatcher/Dispatcher.coffee":14,"events":22}],22:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -2094,4 +2157,4 @@ function isUndefined(arg) { return arg === void 0; } -},{}]},{},[14]); \ No newline at end of file +},{}]},{},[15]); From 13dc738ac1d49f2433a1382244d62c28de2d2298 Mon Sep 17 00:00:00 2001 From: Galen Wolfe-Pauly Date: Wed, 23 Sep 2015 10:27:02 -0700 Subject: [PATCH 46/59] email component with validation and submit --- .../src/js/components/EmailComponent.coffee | 25 ++++++++++++++--- pub/tree/src/js/main.js | 28 +++++++++++++++---- 2 files changed, 43 insertions(+), 10 deletions(-) diff --git a/pub/tree/src/js/components/EmailComponent.coffee b/pub/tree/src/js/components/EmailComponent.coffee index b5838f0bf8..6b3842ec6b 100644 --- a/pub/tree/src/js/components/EmailComponent.coffee +++ b/pub/tree/src/js/components/EmailComponent.coffee @@ -10,12 +10,29 @@ module.exports = recl onClick: -> @submit() onKeyUp: (e) -> - $('div.email').text($('div.email').text()) - if e.keyCode is 13 then @submit() + email = @$email.val() + valid = (email.indexOf('@') != -1 && + email.indexOf('.') != -1 && + email.length > 7 && + email.split(".")[1].length > 1 && + email.split("@")[0].length > 0 && + email.split("@")[1].length > 4) + @$email.toggleClass 'valid',valid + @$email.removeClass 'error' + if e.keyCode is 13 + if valid is true + @submit() + e.stopPropagation() + e.preventDefault() + return false + else + @$email.addClass 'error' submit: -> - email = $('div.email').text() - @setState {submit:true} + $.post @props.dataPath,{email:@$email.text()},() -> + @setState {submit:true} + + componentDidMount: -> @$email = $('input.email') render: -> if @state.submit is false diff --git a/pub/tree/src/js/main.js b/pub/tree/src/js/main.js index 6ebf299b60..d7ae996c2f 100644 --- a/pub/tree/src/js/main.js +++ b/pub/tree/src/js/main.js @@ -480,18 +480,34 @@ module.exports = recl({ return this.submit(); }, onKeyUp: function(e) { - $('div.email').text($('div.email').text()); + var email, valid; + email = this.$email.val(); + valid = email.indexOf('@') !== -1 && email.indexOf('.') !== -1 && email.length > 7 && email.split(".")[1].length > 1 && email.split("@")[0].length > 0 && email.split("@")[1].length > 4; + this.$email.toggleClass('valid', valid); + this.$email.removeClass('error'); if (e.keyCode === 13) { - return this.submit(); + if (valid === true) { + this.submit(); + e.stopPropagation(); + e.preventDefault(); + return false; + } else { + return this.$email.addClass('error'); + } } }, submit: function() { - var email; - email = $('div.email').text(); - return this.setState({ - submit: true + return $.post(this.props.dataPath, { + email: this.$email.text() + }, function() { + return this.setState({ + submit: true + }); }); }, + componentDidMount: function() { + return this.$email = $('input.email'); + }, render: function() { var cont; if (this.state.submit === false) { From c76ee92346ab027cde1d91d5be0498ce2b747638 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Wed, 23 Sep 2015 13:50:31 -0700 Subject: [PATCH 47/59] transitioned eyre to use weak etags --- arvo/eyre.hoon | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arvo/eyre.hoon b/arvo/eyre.hoon index 8d0b4f3c16..badb821226 100644 --- a/arvo/eyre.hoon +++ b/arvo/eyre.hoon @@ -431,13 +431,14 @@ urb.waspFrom = function(sel,attr){ Array.prototype.map.call(document.querySelectorAll(sel), function(ele){ - if(!ele[attr] || (new URL(ele[attr])).host != document.location.host) return; + if(!ele[attr] || (new URL(ele[attr])).host != document.location.host) + return; var xhr = new XMLHttpRequest() xhr.open("HEAD", ele[attr]) xhr.send() xhr.onload = function(){ - var tag = JSON.parse(this.getResponseHeader("etag")) - if(tag) urb.wasp(tag) + var dep = this.getResponseHeader("etag") + if(dep) urb.wasp(JSON.parse(dep.substr(2))) }})} if(urb.wasp){urb.waspFrom('script','src'); urb.waspFrom('link','href')} ''' @@ -771,7 +772,7 @@ == ~| q.q.cay =+ ((hard ,[mit=mite rez=octs]) q.q.cay) - =+ dep=(crip (pojo %s (scot %uv p.sih))) + =+ dep=(crip "W/{(pojo %s (scot %uv p.sih))}") (give-thou 200 ~[etag/dep content-type/(moon mit)] ~ rez) == == From 107ea396905fea54da72995165921a1a1f8e2630 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Wed, 23 Sep 2015 16:10:30 -0700 Subject: [PATCH 48/59] fix invalid-path spin --- pub/tree/src/js/components/Async.coffee | 2 +- pub/tree/src/js/main.js | 26 ++++++++++++++++++++++--- pub/tree/src/js/stores/TreeStore.coffee | 3 ++- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/pub/tree/src/js/components/Async.coffee b/pub/tree/src/js/components/Async.coffee index 8ac25c9a82..4eb41a21c5 100644 --- a/pub/tree/src/js/components/Async.coffee +++ b/pub/tree/src/js/components/Async.coffee @@ -34,7 +34,7 @@ module.exports = (queries, Child, load=_load)-> recl filterWith: (have,_queries)-> return _queries unless have? request = {} - for k of _queries + for k of _queries when k isnt 'kids' request[k] = _queries[k] unless have[k] isnt undefined if _queries.kids? and have.kids? if _.isEmpty have.kids diff --git a/pub/tree/src/js/main.js b/pub/tree/src/js/main.js index d7ae996c2f..01394d57cb 100644 --- a/pub/tree/src/js/main.js +++ b/pub/tree/src/js/main.js @@ -35,6 +35,7 @@ module.exports = { }; + },{"../dispatcher/Dispatcher.coffee":14,"../persistence/TreePersistence.coffee":20}],2:[function(require,module,exports){ var BodyComponent, CLICK, Links, TreeActions, TreeStore, a, clas, div, query, reactify, recl, ref; @@ -288,6 +289,7 @@ module.exports = query({ })); + },{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":21,"./Async.coffee":3,"./BodyComponent.coffee":4,"./Reactify.coffee":11,"classnames":16}],3:[function(require,module,exports){ var TreeActions, TreeStore, _load, code, div, recl, ref, span; @@ -348,8 +350,10 @@ module.exports = function(queries, Child, load) { } request = {}; for (k in _queries) { - if (have[k] === void 0) { - request[k] = _queries[k]; + if (k !== 'kids') { + if (have[k] === void 0) { + request[k] = _queries[k]; + } } } if ((_queries.kids != null) && (have.kids != null)) { @@ -389,6 +393,7 @@ module.exports = function(queries, Child, load) { }; + },{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":21,"./LoadComponent.coffee":10}],4:[function(require,module,exports){ var div, query, reactify, recl; @@ -414,6 +419,7 @@ module.exports = query({ })); + },{"./Async.coffee":3,"./Reactify.coffee":11}],5:[function(require,module,exports){ var div, recl, ref, textarea; @@ -437,6 +443,7 @@ module.exports = recl({ }); + },{}],6:[function(require,module,exports){ var div, recl; @@ -459,6 +466,7 @@ module.exports = { }; + },{"./CodeMirror.coffee":5,"./EmailComponent.coffee":7,"./KidsComponent.coffee":8,"./ListComponent.coffee":9,"./SearchComponent.coffee":12,"./TocComponent.coffee":13}],7:[function(require,module,exports){ var button, div, input, p, reactify, recl, ref; @@ -537,6 +545,7 @@ module.exports = recl({ }); + },{"./Reactify.coffee":11}],8:[function(require,module,exports){ var a, div, hr, li, query, reactify, recl, ref, ul; @@ -576,6 +585,7 @@ module.exports = query({ })); + },{"./Async.coffee":3,"./Reactify.coffee":11}],9:[function(require,module,exports){ var a, clas, div, h1, li, query, reactify, recl, ref, ul; @@ -671,6 +681,7 @@ module.exports = query({ })); + },{"./Async.coffee":3,"./Reactify.coffee":11,"classnames":16}],10:[function(require,module,exports){ var div, input, recl, ref, textarea; @@ -711,6 +722,7 @@ module.exports = recl({ }); + },{}],11:[function(require,module,exports){ var Virtual, div, load, reactify, recl, ref, rele, span, walk; @@ -778,6 +790,7 @@ module.exports = _.extend(reactify, { }); + },{"./LoadComponent.coffee":10}],12:[function(require,module,exports){ var a, div, input, query, reactify, recl, ref, slice = [].slice; @@ -916,6 +929,7 @@ module.exports = query({ })); + },{"./Async.coffee":3,"./Reactify.coffee":11}],13:[function(require,module,exports){ var div, query, reactify, recl; @@ -1048,6 +1062,7 @@ module.exports = query({ })); + },{"./Async.coffee":3,"./Reactify.coffee":11}],14:[function(require,module,exports){ var Dispatcher; @@ -1069,6 +1084,7 @@ module.exports = _.extend(new Dispatcher(), { }); + },{"flux":17}],15:[function(require,module,exports){ var rend; @@ -1215,6 +1231,7 @@ $(function() { }); + },{"./actions/TreeActions.coffee":1,"./components/AnchorComponent.coffee":2,"./components/BodyComponent.coffee":4,"./components/Components.coffee":6,"./persistence/TreePersistence.coffee":20}],16:[function(require,module,exports){ /*! Copyright (c) 2015 Jed Watson. @@ -1635,6 +1652,7 @@ module.exports = { }; + },{}],21:[function(require,module,exports){ var EventEmitter, MessageDispatcher, QUERIES, TreeStore, _curr, _data, _tree, clog; @@ -1687,7 +1705,7 @@ TreeStore = _.extend(EventEmitter.prototype, { } data[k] = (ref = _data[path]) != null ? ref[k] : void 0; } - if (query.kids) { + if (query.kids && !_data.EMPTY) { data.kids = {}; for (k in tree) { sub = tree[k]; @@ -1744,6 +1762,7 @@ TreeStore = _.extend(EventEmitter.prototype, { this.loadValues(tree[k], path + "/" + k, v); } if (data.kids && _.isEmpty(data.kids)) { + _data.EMPTY = true; old.body = { gn: 'div', c: [ @@ -1870,6 +1889,7 @@ TreeStore.dispatchToken = MessageDispatcher.register(function(payload) { module.exports = TreeStore; + },{"../dispatcher/Dispatcher.coffee":14,"events":22}],22:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // diff --git a/pub/tree/src/js/stores/TreeStore.coffee b/pub/tree/src/js/stores/TreeStore.coffee index 36bdaeaebd..fab973dfee 100644 --- a/pub/tree/src/js/stores/TreeStore.coffee +++ b/pub/tree/src/js/stores/TreeStore.coffee @@ -24,7 +24,7 @@ TreeStore = _.extend EventEmitter.prototype, { for k,t of query when QUERIES[k] if t isnt QUERIES[k] then throw TypeError "Wrong query type: #{k}, '#{t}'" data[k] = _data[path]?[k] - if query.kids + if query.kids and not _data.EMPTY data.kids = {} for k,sub of tree data.kids[k] = @fulfillAt sub, path+"/"+k, query.kids @@ -54,6 +54,7 @@ TreeStore = _.extend EventEmitter.prototype, { @loadValues tree[k], path+"/"+k, v if data.kids && _.isEmpty data.kids + _data.EMPTY = true old.body = gn: 'div' c: [ {gn:'h1', ga:{className:'error'}, c:['Error: Empty path']} From aaba53d2fad7e8cbcdd43574dd78f784aba6d3ef Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Wed, 23 Sep 2015 16:29:20 -0700 Subject: [PATCH 49/59] better emptiness handling take 2 --- pub/tree/src/js/main.js | 4 ++-- pub/tree/src/js/stores/TreeStore.coffee | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pub/tree/src/js/main.js b/pub/tree/src/js/main.js index 01394d57cb..8777afb830 100644 --- a/pub/tree/src/js/main.js +++ b/pub/tree/src/js/main.js @@ -1705,7 +1705,7 @@ TreeStore = _.extend(EventEmitter.prototype, { } data[k] = (ref = _data[path]) != null ? ref[k] : void 0; } - if (query.kids && !_data.EMPTY) { + if (query.kids && !_data[path].EMPTY) { data.kids = {}; for (k in tree) { sub = tree[k]; @@ -1762,7 +1762,7 @@ TreeStore = _.extend(EventEmitter.prototype, { this.loadValues(tree[k], path + "/" + k, v); } if (data.kids && _.isEmpty(data.kids)) { - _data.EMPTY = true; + old.EMPTY = true; old.body = { gn: 'div', c: [ diff --git a/pub/tree/src/js/stores/TreeStore.coffee b/pub/tree/src/js/stores/TreeStore.coffee index fab973dfee..ee24ea092e 100644 --- a/pub/tree/src/js/stores/TreeStore.coffee +++ b/pub/tree/src/js/stores/TreeStore.coffee @@ -24,7 +24,7 @@ TreeStore = _.extend EventEmitter.prototype, { for k,t of query when QUERIES[k] if t isnt QUERIES[k] then throw TypeError "Wrong query type: #{k}, '#{t}'" data[k] = _data[path]?[k] - if query.kids and not _data.EMPTY + if query.kids and not _data[path].EMPTY data.kids = {} for k,sub of tree data.kids[k] = @fulfillAt sub, path+"/"+k, query.kids @@ -54,7 +54,7 @@ TreeStore = _.extend EventEmitter.prototype, { @loadValues tree[k], path+"/"+k, v if data.kids && _.isEmpty data.kids - _data.EMPTY = true + old.EMPTY = true old.body = gn: 'div' c: [ {gn:'h1', ga:{className:'error'}, c:['Error: Empty path']} From b07f6fab024c5213a2b566ad8f0f73347324207c Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Wed, 23 Sep 2015 16:40:30 -0700 Subject: [PATCH 50/59] null check --- pub/tree/src/js/stores/TreeStore.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pub/tree/src/js/stores/TreeStore.coffee b/pub/tree/src/js/stores/TreeStore.coffee index ee24ea092e..ae67258c7d 100644 --- a/pub/tree/src/js/stores/TreeStore.coffee +++ b/pub/tree/src/js/stores/TreeStore.coffee @@ -24,7 +24,7 @@ TreeStore = _.extend EventEmitter.prototype, { for k,t of query when QUERIES[k] if t isnt QUERIES[k] then throw TypeError "Wrong query type: #{k}, '#{t}'" data[k] = _data[path]?[k] - if query.kids and not _data[path].EMPTY + if query.kids and not _data[path]?.EMPTY data.kids = {} for k,sub of tree data.kids[k] = @fulfillAt sub, path+"/"+k, query.kids From cdad444127314153898d7aa7414eeed4d69449b1 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Wed, 23 Sep 2015 16:53:48 -0700 Subject: [PATCH 51/59] actually fix EMPTY usage --- pub/tree/src/js/main.js | 33 ++++++++++++++----------- pub/tree/src/js/stores/TreeStore.coffee | 16 ++++++------ 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/pub/tree/src/js/main.js b/pub/tree/src/js/main.js index 8777afb830..44b20710b0 100644 --- a/pub/tree/src/js/main.js +++ b/pub/tree/src/js/main.js @@ -1693,23 +1693,26 @@ TreeStore = _.extend(EventEmitter.prototype, { return this.fulfillAt(this.getTree(path.split('/')), path, query); }, fulfillAt: function(tree, path, query) { - var data, k, ref, sub, t; + var data, have, k, sub, t; data = this.fulfillLocal(path, query); - for (k in query) { - t = query[k]; - if (!QUERIES[k]) { - continue; + have = _data[path]; + if (have != null) { + for (k in query) { + t = query[k]; + if (!QUERIES[k]) { + continue; + } + if (t !== QUERIES[k]) { + throw TypeError("Wrong query type: " + k + ", '" + t + "'"); + } + data[k] = have[k]; } - if (t !== QUERIES[k]) { - throw TypeError("Wrong query type: " + k + ", '" + t + "'"); - } - data[k] = (ref = _data[path]) != null ? ref[k] : void 0; - } - if (query.kids && !_data[path].EMPTY) { - data.kids = {}; - for (k in tree) { - sub = tree[k]; - data.kids[k] = this.fulfillAt(sub, path + "/" + k, query.kids); + if (query.kids && !have.EMPTY) { + data.kids = {}; + for (k in tree) { + sub = tree[k]; + data.kids[k] = this.fulfillAt(sub, path + "/" + k, query.kids); + } } } if (!_.isEmpty(data)) { diff --git a/pub/tree/src/js/stores/TreeStore.coffee b/pub/tree/src/js/stores/TreeStore.coffee index ae67258c7d..105f0fa0a9 100644 --- a/pub/tree/src/js/stores/TreeStore.coffee +++ b/pub/tree/src/js/stores/TreeStore.coffee @@ -21,13 +21,15 @@ TreeStore = _.extend EventEmitter.prototype, { fulfill: (path,query) -> @fulfillAt (@getTree path.split '/'),path,query fulfillAt: (tree,path,query)-> data = @fulfillLocal path, query - for k,t of query when QUERIES[k] - if t isnt QUERIES[k] then throw TypeError "Wrong query type: #{k}, '#{t}'" - data[k] = _data[path]?[k] - if query.kids and not _data[path]?.EMPTY - data.kids = {} - for k,sub of tree - data.kids[k] = @fulfillAt sub, path+"/"+k, query.kids + have = _data[path] + if have? + for k,t of query when QUERIES[k] + if t isnt QUERIES[k] then throw TypeError "Wrong query type: #{k}, '#{t}'" + data[k] = have[k] + if query.kids and not have.EMPTY + data.kids = {} + for k,sub of tree + data.kids[k] = @fulfillAt sub, path+"/"+k, query.kids data unless _.isEmpty data fulfillLocal: (path, query)-> From f77ffac57cbb99119385d030dc61b53c4c24ab00 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Wed, 23 Sep 2015 17:17:09 -0700 Subject: [PATCH 52/59] actually fix async maybe? --- pub/tree/src/js/components/Async.coffee | 4 ++-- pub/tree/src/js/main.js | 20 +++++++++++++------- pub/tree/src/js/stores/TreeStore.coffee | 8 +++++--- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/pub/tree/src/js/components/Async.coffee b/pub/tree/src/js/components/Async.coffee index 4eb41a21c5..83593d7e1b 100644 --- a/pub/tree/src/js/components/Async.coffee +++ b/pub/tree/src/js/components/Async.coffee @@ -36,8 +36,8 @@ module.exports = (queries, Child, load=_load)-> recl request = {} for k of _queries when k isnt 'kids' request[k] = _queries[k] unless have[k] isnt undefined - if _queries.kids? and have.kids? - if _.isEmpty have.kids + if _queries.kids? + if not have.kids? request.kids = _queries.kids else request.kids = {} diff --git a/pub/tree/src/js/main.js b/pub/tree/src/js/main.js index 44b20710b0..ed112028a6 100644 --- a/pub/tree/src/js/main.js +++ b/pub/tree/src/js/main.js @@ -356,8 +356,8 @@ module.exports = function(queries, Child, load) { } } } - if ((_queries.kids != null) && (have.kids != null)) { - if (_.isEmpty(have.kids)) { + if (_queries.kids != null) { + if (have.kids == null) { request.kids = _queries.kids; } else { request.kids = {}; @@ -1707,11 +1707,17 @@ TreeStore = _.extend(EventEmitter.prototype, { } data[k] = have[k]; } - if (query.kids && !have.EMPTY) { - data.kids = {}; - for (k in tree) { - sub = tree[k]; - data.kids[k] = this.fulfillAt(sub, path + "/" + k, query.kids); + if (query.kids) { + if (have.EMPTY) { + data.kids = {}; + } else { + for (k in tree) { + sub = tree[k]; + if (data.kids == null) { + data.kids = {}; + } + data.kids[k] = this.fulfillAt(sub, path + "/" + k, query.kids); + } } } } diff --git a/pub/tree/src/js/stores/TreeStore.coffee b/pub/tree/src/js/stores/TreeStore.coffee index 105f0fa0a9..a3205e8281 100644 --- a/pub/tree/src/js/stores/TreeStore.coffee +++ b/pub/tree/src/js/stores/TreeStore.coffee @@ -26,9 +26,11 @@ TreeStore = _.extend EventEmitter.prototype, { for k,t of query when QUERIES[k] if t isnt QUERIES[k] then throw TypeError "Wrong query type: #{k}, '#{t}'" data[k] = have[k] - if query.kids and not have.EMPTY - data.kids = {} - for k,sub of tree + if query.kids + if have.EMPTY + data.kids = {} + else for k,sub of tree + data.kids ?= {} data.kids[k] = @fulfillAt sub, path+"/"+k, query.kids data unless _.isEmpty data From 993bcd3ddb721ccdb0a4d3978d81d2b33377ac68 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Wed, 23 Sep 2015 17:22:28 -0700 Subject: [PATCH 53/59] sigh --- pub/tree/src/js/main.js | 8 ++++++++ pub/tree/src/js/persistence/TreePersistence.coffee | 3 +++ 2 files changed, 11 insertions(+) diff --git a/pub/tree/src/js/main.js b/pub/tree/src/js/main.js index ed112028a6..b698b8cd69 100644 --- a/pub/tree/src/js/main.js +++ b/pub/tree/src/js/main.js @@ -1603,6 +1603,10 @@ var invariant = function(condition, format, a, b, c, d, e, f) { module.exports = invariant; },{}],20:[function(require,module,exports){ +var dedup; + +dedup = {}; + module.exports = { get: function(path, query, cb) { var url; @@ -1610,6 +1614,10 @@ module.exports = { query = "no-query"; } url = (window.tree.basepath(path)) + ".json?q=" + (this.encode(query)); + if (dedup[url]) { + return; + } + dedup[url] = true; return $.get(url, {}, function(data) { if (cb) { return cb(null, data); diff --git a/pub/tree/src/js/persistence/TreePersistence.coffee b/pub/tree/src/js/persistence/TreePersistence.coffee index becce7bea5..bd0ad21221 100644 --- a/pub/tree/src/js/persistence/TreePersistence.coffee +++ b/pub/tree/src/js/persistence/TreePersistence.coffee @@ -1,6 +1,9 @@ +dedup = {} # XX wrong layer module.exports = get: (path,query="no-query",cb) -> url = "#{window.tree.basepath(path)}.json?q=#{@encode query}" + return if dedup[url] + dedup[url] = true $.get url, {}, (data) -> if cb then cb null,data encode: (obj)-> delim = (n)-> Array(n+1).join('_') || '.' From a54d776d0ad67834a9fb6442df3d35111c2b5cfd Mon Sep 17 00:00:00 2001 From: bvschwartz Date: Wed, 23 Sep 2015 17:34:10 -0700 Subject: [PATCH 54/59] Update architecture.md formatting fix --- pub/doc/arvo/clay/architecture.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pub/doc/arvo/clay/architecture.md b/pub/doc/arvo/clay/architecture.md index ed65ccd264..d27ab0f34a 100644 --- a/pub/doc/arvo/clay/architecture.md +++ b/pub/doc/arvo/clay/architecture.md @@ -277,7 +277,7 @@ referentially transparent manner. A `%next` request checks query at the given revision, and it produces the result of the query the next time it changes, along with the revsion number when it changes. Thus, a `%next` of a -`%u` is triggered when a file is added or deleted, a `%next of a +`%u` is triggered when a file is added or deleted, a `%next` of a `%x` is triggered when a file is added, deleted, or changed, and a `%next` of a `%y` is triggered when a file or any of its children is added, deleted, or changed. From e21a202fbf22183e783b0384d650e3a18176848a Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Thu, 24 Sep 2015 11:07:34 -0700 Subject: [PATCH 55/59] fixed email component --- pub/tree/src/js/components/EmailComponent.coffee | 4 ++-- pub/tree/src/js/main.js | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/pub/tree/src/js/components/EmailComponent.coffee b/pub/tree/src/js/components/EmailComponent.coffee index 6b3842ec6b..f212fb10bb 100644 --- a/pub/tree/src/js/components/EmailComponent.coffee +++ b/pub/tree/src/js/components/EmailComponent.coffee @@ -29,7 +29,7 @@ module.exports = recl @$email.addClass 'error' submit: -> - $.post @props.dataPath,{email:@$email.text()},() -> + $.post @props.dataPath,{email:@$email.val()},() => @setState {submit:true} componentDidMount: -> @$email = $('input.email') @@ -42,4 +42,4 @@ module.exports = recl ] else cont = [(div {className:"submitted"},"Got it. Thanks!")] - (p {className:"email"}, cont) \ No newline at end of file + (p {className:"email"}, cont) diff --git a/pub/tree/src/js/main.js b/pub/tree/src/js/main.js index b698b8cd69..7524145d0a 100644 --- a/pub/tree/src/js/main.js +++ b/pub/tree/src/js/main.js @@ -506,12 +506,14 @@ module.exports = recl({ }, submit: function() { return $.post(this.props.dataPath, { - email: this.$email.text() - }, function() { - return this.setState({ - submit: true - }); - }); + email: this.$email.val() + }, (function(_this) { + return function() { + return _this.setState({ + submit: true + }); + }; + })(this)); }, componentDidMount: function() { return this.$email = $('input.email'); From 006b8050445a39854bc3acdd2b127488037c8d9d Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Thu, 24 Sep 2015 11:15:24 -0700 Subject: [PATCH 56/59] diabled header onclick handling --- pub/tree/src/js/components/AnchorComponent.coffee | 2 +- pub/tree/src/js/main.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pub/tree/src/js/components/AnchorComponent.coffee b/pub/tree/src/js/components/AnchorComponent.coffee index ad152932e1..454066f530 100644 --- a/pub/tree/src/js/components/AnchorComponent.coffee +++ b/pub/tree/src/js/components/AnchorComponent.coffee @@ -47,7 +47,7 @@ Links = React.createFactory query { render: -> div {className:'links'}, @props.children, @_render() _render: -> div {id:"sibs"}, div {className:"active"}, a {}, @props.curr -CLICK = 'a,h1,h2,h3,h4,h5,h6' +CLICK = 'a' # 'a,h1,h2,h3,h4,h5,h6' module.exports = query {sein:'t',path:'t',name:'t',next:'t',prev:'t'},recl displayName: "Anchor" getInitialState: -> url: window.location.pathname diff --git a/pub/tree/src/js/main.js b/pub/tree/src/js/main.js index 7524145d0a..d4b83913e1 100644 --- a/pub/tree/src/js/main.js +++ b/pub/tree/src/js/main.js @@ -142,7 +142,7 @@ Links = React.createFactory(query({ } }))); -CLICK = 'a,h1,h2,h3,h4,h5,h6'; +CLICK = 'a'; module.exports = query({ sein: 't', From 14d7407e04f496969316cd709eede812acf91a30 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Thu, 24 Sep 2015 12:05:19 -0700 Subject: [PATCH 57/59] fixed jquery object property iteration --- pub/tree/src/js/components/TocComponent.coffee | 6 +++--- pub/tree/src/js/main.js | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pub/tree/src/js/components/TocComponent.coffee b/pub/tree/src/js/components/TocComponent.coffee index 403d30ab80..d255fbe6a1 100644 --- a/pub/tree/src/js/components/TocComponent.coffee +++ b/pub/tree/src/js/components/TocComponent.coffee @@ -26,7 +26,7 @@ module.exports = query {body:'r'}, recl if Math.abs(@st-st) > 10 hash = null @st = st - for k,v of @$headers + for v in @$headers continue if v.tagName is undefined $h = $ v hst = $h.offset().top-$h.outerHeight(true)+10 @@ -40,7 +40,7 @@ module.exports = query {body:'r'}, recl checkHash: -> if document.location.hash?.length > 0 and document.location.hash isnt @hash hash = document.location.hash.slice(1) - for k,v of @$headers + for v in @$headers $h = $ v if hash is @urlsafe $h.text() @hash = document.location.hash @@ -68,4 +68,4 @@ module.exports = query {body:'r'}, recl if v.gn is 'div' and v.ga?.id is "toc" return {gn:"div", ga:{className:"toc",onClick:@_click}, c:@collectHeaders(v.c)} - render: -> reactify @parseHeaders() \ No newline at end of file + render: -> reactify @parseHeaders() diff --git a/pub/tree/src/js/main.js b/pub/tree/src/js/main.js index d4b83913e1..7d2af5e6e3 100644 --- a/pub/tree/src/js/main.js +++ b/pub/tree/src/js/main.js @@ -961,15 +961,15 @@ module.exports = query({ return this.$headers = $('#toc h1, #toc h2, #toc h3, #toc h4'); }, checkScroll: function() { - var $h, hash, hst, k, ref, results, st, v; + var $h, hash, hst, i, len, ref, results, st, v; st = $(window).scrollTop(); if (Math.abs(this.st - st) > 10) { hash = null; this.st = st; ref = this.$headers; results = []; - for (k in ref) { - v = ref[k]; + for (i = 0, len = ref.length; i < len; i++) { + v = ref[i]; if (v.tagName === void 0) { continue; } @@ -990,13 +990,13 @@ module.exports = query({ } }, checkHash: function() { - var $h, hash, k, offset, ref, ref1, results, v; + var $h, hash, i, len, offset, ref, ref1, results, v; if (((ref = document.location.hash) != null ? ref.length : void 0) > 0 && document.location.hash !== this.hash) { hash = document.location.hash.slice(1); ref1 = this.$headers; results = []; - for (k in ref1) { - v = ref1[k]; + for (i = 0, len = ref1.length; i < len; i++) { + v = ref1[i]; $h = $(v); if (hash === this.urlsafe($h.text())) { this.hash = document.location.hash; From a2d9922d9c8b6f65a843bcf2fbaf3db495fa1f6d Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Thu, 24 Sep 2015 13:14:23 -0700 Subject: [PATCH 58/59] simplified Table of Contents js --- .../src/js/components/TocComponent.coffee | 40 +++++------ pub/tree/src/js/main.js | 72 +++++++++---------- 2 files changed, 54 insertions(+), 58 deletions(-) diff --git a/pub/tree/src/js/components/TocComponent.coffee b/pub/tree/src/js/components/TocComponent.coffee index d255fbe6a1..ee6b756162 100644 --- a/pub/tree/src/js/components/TocComponent.coffee +++ b/pub/tree/src/js/components/TocComponent.coffee @@ -9,17 +9,14 @@ module.exports = query {body:'r'}, recl hash:null displayName: "TableOfContents" - _click: (e) -> - document.location.hash = @urlsafe $(e.target).text() - - urlsafe: (str) -> - str.toLowerCase().replace(/\ /g, "-").replace(/[^a-z0-9~_.-]/g,"") + _click: (id)-> + -> if id then document.location.hash = id componentDidMount: -> @int = setInterval @checkHash,100 @st = $(window).scrollTop() - $(window).on 'scroll',@checkScroll - @$headers = $('#toc h1, #toc h2, #toc h3, #toc h4') + # $(window).on 'scroll',@checkScroll + @$headers = $('#toc').children('h1,h2,h3,h4').filter('[id]') checkScroll: -> st = $(window).scrollTop() @@ -31,7 +28,7 @@ module.exports = query {body:'r'}, recl $h = $ v hst = $h.offset().top-$h.outerHeight(true)+10 if hst < st - hash = @urlsafe $h.text() + hash = $h.attr('id') if hst > st and hash isnt @hash and hash isnt null @hash = "#"+hash document.location.hash = hash @@ -42,7 +39,7 @@ module.exports = query {body:'r'}, recl hash = document.location.hash.slice(1) for v in @$headers $h = $ v - if hash is @urlsafe $h.text() + if hash is $h.attr('id') @hash = document.location.hash offset = $h.offset().top - $h.outerHeight(true) setTimeout -> $(window).scrollTop offset @@ -52,20 +49,23 @@ module.exports = query {body:'r'}, recl componentWillUnmount: -> clearInterval @int - collectHeaders: (e) -> - hs = [{gn:"h1", ga:{className:"t"}, c:["Table of contents"]}] - for k,v of e - if not v.gn then continue - if v.gn[0] is 'h' and parseInt(v.gn[1]) isnt NaN - _v = _.clone v - delete _v.ga.id - hs.push v - return hs + collectHeader: ({gn,ga,c})-> + if gn and gn[0] is 'h' and parseInt(gn[1]) isnt NaN + ga = _.clone ga + ga.onClick = @_click ga.id + delete ga.id + {gn,ga,c} parseHeaders: -> if @props.body.c - for k,v of @props.body.c + for v in @props.body.c if v.gn is 'div' and v.ga?.id is "toc" - return {gn:"div", ga:{className:"toc",onClick:@_click}, c:@collectHeaders(v.c)} + return { + gn:"div" + ga:{className:"toc"} + c:[ + {gn:"h1", ga:{className:"t"}, c:["Table of contents"]} + (_.filter v.c.map @collectHeader)... + ]} render: -> reactify @parseHeaders() diff --git a/pub/tree/src/js/main.js b/pub/tree/src/js/main.js index 7d2af5e6e3..ad8c8aa38e 100644 --- a/pub/tree/src/js/main.js +++ b/pub/tree/src/js/main.js @@ -933,7 +933,8 @@ module.exports = query({ },{"./Async.coffee":3,"./Reactify.coffee":11}],13:[function(require,module,exports){ -var div, query, reactify, recl; +var div, query, reactify, recl, + slice = [].slice; query = require('./Async.coffee'); @@ -948,17 +949,17 @@ module.exports = query({ }, recl({ hash: null, displayName: "TableOfContents", - _click: function(e) { - return document.location.hash = this.urlsafe($(e.target).text()); - }, - urlsafe: function(str) { - return str.toLowerCase().replace(/\ /g, "-").replace(/[^a-z0-9~_.-]/g, ""); + _click: function(id) { + return function() { + if (id) { + return document.location.hash = id; + } + }; }, componentDidMount: function() { this.int = setInterval(this.checkHash, 100); this.st = $(window).scrollTop(); - $(window).on('scroll', this.checkScroll); - return this.$headers = $('#toc h1, #toc h2, #toc h3, #toc h4'); + return this.$headers = $('#toc').children('h1,h2,h3,h4').filter('[id]'); }, checkScroll: function() { var $h, hash, hst, i, len, ref, results, st, v; @@ -976,7 +977,7 @@ module.exports = query({ $h = $(v); hst = $h.offset().top - $h.outerHeight(true) + 10; if (hst < st) { - hash = this.urlsafe($h.text()); + hash = $h.attr('id'); } if (hst > st && hash !== this.hash && hash !== null) { this.hash = "#" + hash; @@ -998,7 +999,7 @@ module.exports = query({ for (i = 0, len = ref1.length; i < len; i++) { v = ref1[i]; $h = $(v); - if (hash === this.urlsafe($h.text())) { + if (hash === $h.attr('id')) { this.hash = document.location.hash; offset = $h.offset().top - $h.outerHeight(true); setTimeout(function() { @@ -1015,44 +1016,39 @@ module.exports = query({ componentWillUnmount: function() { return clearInterval(this.int); }, - collectHeaders: function(e) { - var _v, hs, k, v; - hs = [ - { - gn: "h1", - ga: { - className: "t" - }, - c: ["Table of contents"] - } - ]; - for (k in e) { - v = e[k]; - if (!v.gn) { - continue; - } - if (v.gn[0] === 'h' && parseInt(v.gn[1]) !== NaN) { - _v = _.clone(v); - delete _v.ga.id; - hs.push(v); - } + collectHeader: function(arg) { + var c, ga, gn; + gn = arg.gn, ga = arg.ga, c = arg.c; + if (gn && gn[0] === 'h' && parseInt(gn[1]) !== NaN) { + ga = _.clone(ga); + ga.onClick = this._click(ga.id); + delete ga.id; + return { + gn: gn, + ga: ga, + c: c + }; } - return hs; }, parseHeaders: function() { - var k, ref, ref1, v; + var i, len, ref, ref1, v; if (this.props.body.c) { ref = this.props.body.c; - for (k in ref) { - v = ref[k]; + for (i = 0, len = ref.length; i < len; i++) { + v = ref[i]; if (v.gn === 'div' && ((ref1 = v.ga) != null ? ref1.id : void 0) === "toc") { return { gn: "div", ga: { - className: "toc", - onClick: this._click + className: "toc" }, - c: this.collectHeaders(v.c) + c: [{ + gn: "h1", + ga: { + className: "t" + }, + c: ["Table of contents"] + }].concat(slice.call(_.filter(v.c.map(this.collectHeader)))) }; } } From 1a02d31022f5567c111788ff25f85151cc048af0 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Mon, 28 Sep 2015 20:48:30 -0400 Subject: [PATCH 59/59] fix timers --- arvo/hoon.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index fbdaf7cda5..48cae2e745 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -10557,7 +10557,7 @@ [@ %sync *] %c [@ %term *] %d [@ %http *] %e - [@ %temp *] %t + [@ %behn *] %b == :: ++ doos :: sleep until