From d15578859bc4a72c81f4afdc9c5be9d1d19b5ffd Mon Sep 17 00:00:00 2001 From: Curtis Yarvin Date: Sun, 20 May 2018 13:23:01 -0700 Subject: [PATCH 1/2] Badly done. --- app/dojo.hoon | 2 +- app/hood.hoon | 8 ++--- lib/hall.hoon | 2 +- lib/hood/womb.hoon | 11 ++++--- lib/new-hoon.hoon | 2 +- sur/twitter.hoon | 4 +-- sys/hoon.hoon | 82 ++++++++++++++++++++++++---------------------- sys/vane/eyre.hoon | 6 ++-- 8 files changed, 61 insertions(+), 56 deletions(-) diff --git a/app/dojo.hoon b/app/dojo.hoon index 9dbd486a3..293fcf646 100644 --- a/app/dojo.hoon +++ b/app/dojo.hoon @@ -1709,7 +1709,7 @@ => ~(. he moz ses) =- [wrap=- +] =+ he-arm=he-type - |% +- $ + |@ +- $ |: +<.he-arm ^- (quip move _..he) he-abet:(he-arm +<) diff --git a/app/hood.hoon b/app/hood.hoon index d3a5dd8e8..5e71e7f64 100644 --- a/app/hood.hoon +++ b/app/hood.hoon @@ -43,7 +43,7 @@ {$1 lac/(map @tas hood-part)} :: ++ hood-good :: extract specific =+ hed=$:hood-head - |% +- $ + |@ +- $ |: paw=$:hood-part ?- hed $drum ?>(?=($drum -.paw) `part:hood-drum`paw) @@ -56,7 +56,7 @@ ++ hood-head _-:$:hood-part :: initialize state ++ hood-make :: =+ $:{our/@p hed/hood-head} :: - |% +- $ + |@ +- $ ?- hed $drum (make:hood-drum our) $helm *part:hood-helm @@ -87,7 +87,7 @@ == :: ++ able :: find+make part =+ hed=$:hood-head - |% +- $ + |@ +- $ =+ rep=(~(get by lac) hed) =+ par=?^(rep u.rep `hood-part`(hood-make our.hid hed)) ((hood-good hed) par) @@ -95,7 +95,7 @@ :: ++ ably :: save part =+ $:{(list) hood-part} - |% +- $ + |@ +- $ [(flop +<-) %_(+> lac (~(put by lac) +<+< +<+))] -- :: :: :: diff --git a/lib/hall.hoon b/lib/hall.hoon index 2adfb5ce3..7a22790a6 100644 --- a/lib/hall.hoon +++ b/lib/hall.hoon @@ -246,7 +246,7 @@ :: ++ or =+ typ=$:|-($@(@tas {@tas $})) - |% +- $ + |@ +- $ |= con/coin ::^- _(snag *@ (turn (limo typ) |*(a/@tas [a (odo:raid:wired a)]))) ?> ?=($$ -.con) diff --git a/lib/hood/womb.hoon b/lib/hood/womb.hoon index 710bf51b7..82d86d717 100644 --- a/lib/hood/womb.hoon +++ b/lib/hood/womb.hoon @@ -195,8 +195,9 @@ [min=1 ctr=1 und=~ ove=~ max=(dec (bex (bex a))) box=~] :: ++ fo - |_ (foil $@(~ *)) - ++ nth :: index + =| (foil $@(~ *)) + |@ + +- nth :: index |= a/@u ^- (pair (unit @u) @u) ?: (lth a ~(wyt in und)) =+ out=(snag a (sort ~(tap in und) lth)) @@ -208,7 +209,7 @@ $(a (dec a), +<.nth new) :: +- fin +< :: abet - ++ new :: alloc + +- new :: alloc ?: =(ctr +(max)) +< =. ctr +(ctr) ?. (~(has in ove) ctr) +< @@ -233,8 +234,8 @@ =+ n=new(+< new) n(und (~(put in und.n) ctr)) :: - ++ fit |=(a/@u &((lte min a) (lte a max))) :: in range - ++ gud :: invariant + +- fit |=(a/@u &((lte min a) (lte a max))) :: in range + +- gud :: invariant ?& (fit(max +(max)) ctr) (~(all in und) fit(max ctr)) (~(all in ove) fit(min ctr)) diff --git a/lib/new-hoon.hoon b/lib/new-hoon.hoon index 6d3438dc4..27f8adb3e 100644 --- a/lib/new-hoon.hoon +++ b/lib/new-hoon.hoon @@ -767,7 +767,7 @@ ++ multi-homo |* a=(list (list)) ^+ =< $ - |% +- $ ?:(*? ~ [i=(homo (snag 0 a)) t=$]) + |@ +- $ ?:(*? ~ [i=(homo (snag 0 a)) t=$]) -- a :: diff --git a/sur/twitter.hoon b/sur/twitter.hoon index ef1a03c1b..9ba9ac9ab 100644 --- a/sur/twitter.hoon +++ b/sur/twitter.hoon @@ -64,14 +64,14 @@ ++ heads |*(a/(pole) ?~(a a [-<.a (heads +.a)])) ++ fork-clams =+ $:{a/(pair _{term *} (pole _{term *}))} - |% +- $ + |@ +- $ ?~ q.a p.a ?(p.a (fork-clams q.a)) -- :: ++ normalize =+ $:{a/_{@ *}} - |% +- $ + |@ +- $ |= b/* ^+ [?@(- . .)]:(a b) (a b) diff --git a/sys/hoon.hoon b/sys/hoon.hoon index 60c435f1f..e8fa08b38 100644 --- a/sys/hoon.hoon +++ b/sys/hoon.hoon @@ -241,19 +241,19 @@ |* {a/$-(* *) b/$-(* *)} =< +:|.((a (b))) :: type check =+ c=+<.b - |% +- $ (a (b c)) + |@ +- $ (a (b c)) -- :: ++ cury :: curry left |* {a/$-(^ *) b/*} =+ c=+<+.a - |% +- $ (a b c) + |@ +- $ (a b c) -- :: ++ curr :: curry right |* {a/$-(^ *) c/*} =+ b=+<+.a - |% +- $ (a b c) + |@ +- $ (a b c) -- :: ++ fore |*(a/$-(* *) |*(b/$-(* *) (pair a b))) :: pair before @@ -653,7 +653,7 @@ ++ homo :: homogenize |* a/(list) ^+ =< $ - |% +- $ ?:(*? ~ [i=(snag 0 a) t=$]) + |@ +- $ ?:(*? ~ [i=(snag 0 a) t=$]) -- a :: @@ -685,7 +685,7 @@ ++ limo :: listify |* a/* ^+ =< $ - |% +- $ ?~(a ~ ?:(*? [i=-.a t=$] $(a +.a))) + |@ +- $ ?~(a ~ ?:(*? [i=-.a t=$] $(a +.a))) -- a :: @@ -833,7 +833,7 @@ :: ++ welp :: faceless weld =| {* *} - |% + |@ +- $ ?~ +<- +<-(. +<+) @@ -842,7 +842,7 @@ :: ++ zing :: promote =| * - |% + |@ +- $ ?~ +< +< @@ -1230,7 +1230,8 @@ :: ++ in :: set engine ~/ %in - |_ a/(tree) :: (set) + =| a/(tree) :: (set) + |@ +- all :: logical AND ~/ %all |* b/$-(* ?) @@ -1295,7 +1296,7 @@ +- dif :: difference ~/ %dif =+ b=a - |% + |@ +- $ |- ^+ a ?~ b @@ -1345,7 +1346,7 @@ +- int :: intersection ~/ %int =+ b=a - |% + |@ +- $ |- ^+ a ?~ b @@ -1408,7 +1409,7 @@ +- uni :: union ~/ %uni =+ b=a - |% + |@ +- $ ?: =(a b) a |- ^+ a @@ -1443,7 +1444,7 @@ ~/ %by =| a/(tree (pair)) :: (map) =* node ?>(?=(^ a) n.a) - |% + |@ +- all :: logical AND ~/ %all |* b/$-(* ?) @@ -1500,7 +1501,7 @@ +- dif :: difference ~/ %dif =+ b=a - |% + |@ +- $ |- ^+ a ?~ b @@ -1571,7 +1572,7 @@ +- int :: intersection ~/ %int =+ b=a - |% + |@ +- $ |- ^+ a ?~ b @@ -1659,7 +1660,7 @@ +- uni :: union, merge ~/ %uni =+ b=a - |% + |@ +- $ |- ^+ a ?~ b @@ -1681,7 +1682,7 @@ :: +- uno :: general union =+ b=a - |% + |@ +- $ |* meg/$-({* * *} *) |- ^+ a @@ -1732,7 +1733,8 @@ :: :: :: ++ ja :: jar engine - |_ a/(tree (pair * (list))) :: (jar) + =| a/(tree (pair * (list))) :: (jar) + |@ +- get :: gets list by key |* b/* =+ c=(~(get by a) b) @@ -1744,7 +1746,8 @@ (~(put by a) b [c d]) -- ++ ju :: jug engine - |_ a/(tree (pair * (tree))) :: (jug) + =| a/(tree (pair * (tree))) :: (jug) + |@ +- del :: del key-set pair |* {b/* c/*} ^+ a @@ -1783,7 +1786,8 @@ :: :: :: ++ to :: queue engine - |_ a/(tree) :: (qeu) + =| a/(tree) :: (qeu) + |@ +- bal |- ^+ a ?~ a ~ @@ -1885,7 +1889,7 @@ ++ le :: construct list |* a/(list) ^+ =< $ - |% +- $ ?:(*? ~ [i=(snag 0 a) t=$]) + |@ +- $ ?:(*? ~ [i=(snag 0 a) t=$]) -- a :: :: @@ -3713,7 +3717,7 @@ {$2 p/(list tank)} :: stack trace == :: ++ wonk =+ veq=$:edge :: product from edge - |% +- $ ?~(q.veq !! p.u.q.veq) :: + |@ +- $ ?~(q.veq !! p.u.q.veq) :: -- :: -- => :: :: @@ -4414,7 +4418,7 @@ ++ bend :: conditional comp ~/ %bend =+ raq=|*({a/* b/*} [~ u=[a b]]) - |% + |@ +- $ ~/ %fun |* {vex/edge sab/rule} @@ -4433,7 +4437,7 @@ ++ comp ~/ %comp =+ raq=|*({a/* b/*} [a b]) :: arbitrary compose - |% + |@ +- $ ~/ %fun |* {vex/edge sab/rule} @@ -4562,7 +4566,7 @@ ++ here :: place-based apply ~/ %here =+ [hez=|=({a/pint b/*} [a b]) sef=*rule] - |% + |@ +- $ ~/ %fun |= tub/nail @@ -4623,7 +4627,7 @@ :: ++ knee :: callbacks =| {gar/* sef/_|.(*rule)} - |% +- $ + |@ +- $ |= tub/nail ^- (like _gar) ((sef) tub) @@ -5649,7 +5653,7 @@ ++ mule :: typed virtual ~/ %mule =+ taq=|.(**) - |% +- $ + |@ +- $ =+ mud=(mute taq) ?- -.mud %& [%& p=$:taq] @@ -8631,7 +8635,7 @@ :: ++ lead =+ [sem=@tas out=[** $:life]] - |% +- $ + |@ +- $ [[sem -.out] +.out] -- :: @@ -8645,7 +8649,7 @@ =+ =< $ $: etc/_^|(|:(** $:{* life})) == - |% +- $ + |@ +- $ |* bud/* ^+ [bud vit] ?: =(~ bud) [bud vit] @@ -8672,7 +8676,7 @@ tri/_^|(|:(** $:{* life})) qua/_^|(|:(** $:{* life})) == - |% +- $ + |@ +- $ |* bud/* =^ yal vit (one -.bud) =^ ves vit (two +<.bud) @@ -8685,7 +8689,7 @@ =+ =< $ $: etc/_^|(|:(** $:{* life})) == - |% +- $ + |@ +- $ |* bud/* ^+ [bud vit] ?: =(~ bud) [bud vit] @@ -8704,7 +8708,7 @@ two/_^|(|:(** $:{* life})) tri/_^|(|:(** $:{* life})) == - |% +- $ + |@ +- $ |* bud/* =^ yal vit (one -.bud) =^ ves vit (two +<.bud) @@ -8746,7 +8750,7 @@ $: one/_^|(|:(** $:{* life})) two/_^|(|:(** $:{* life})) == - |% +- $ + |@ +- $ |* bud/* =^ yal vit (one -.bud) =^ ves vit (two +.bud) @@ -9085,7 +9089,7 @@ -- ++ def =+ deft:arc - |% +- $ + |@ +- $ => +< |% ++ pord |*(* (form +< *nock)) :: wrap mint formula @@ -9142,7 +9146,7 @@ :: ++ bin =+ deft:lib - |% +- $ + |@ +- $ => +< |% ++ rame @@ -9161,7 +9165,7 @@ ++ eclo (ecco gelp) ++ ecco =+ rame - |% +- $ + |@ +- $ => +< |: $:{rum/clom rig/(list (pair wing hoon))} ^- foat @@ -9176,7 +9180,7 @@ :: ++ oc =+ inc=(bin:ad) - |% +- $ + |@ +- $ => inc |% ++ echo @@ -13022,20 +13026,20 @@ :: ++ toad :: untrap parser exp =+ har=expa - |% +- $ + |@ +- $ =+ dur=(ifix [lit rit] $:har(tol |)) ?:(tol ;~(pose ;~(pfix gap $:har(tol &)) dur) dur) -- :: ++ rune :: build rune =+ [dif=*rule tuq=** har=expa] - |% +- $ + |@ +- $ ;~(pfix dif (stag tuq (toad har))) -- :: ++ runo :: rune plus =+ [dif=*rule hil=** tuq=** har=expa] - |% +- $ + |@ +- $ ;~(pfix dif (stag hil (stag tuq (toad har)))) -- :: diff --git a/sys/vane/eyre.hoon b/sys/vane/eyre.hoon index e853ceb7f..b97fd6d9b 100644 --- a/sys/vane/eyre.hoon +++ b/sys/vane/eyre.hoon @@ -1057,7 +1057,7 @@ ++ abet ..handle ++ done . ++ teba =+ a=$-(* _..handle) - |% +- $ + |@ +- $ |*(b/* %_(done ..handle (a b))) -- ++ del-deps (teba ^del-deps) @@ -1617,7 +1617,7 @@ ..ix(wix (~(del by wix) ire)) :: ++ teba =+ a=$-(* _..ix) - |% +- $ + |@ +- $ |*(b/* %_(done ..ix (a b))) -- ++ give-json (teba ^give-json) @@ -1798,7 +1798,7 @@ :: XX block reqs until correct core checked in? ++ warn |=(a/tang ((slog (flop a)) abet)) ++ with =+ $:{a/vase b/$-(vase abet)} - |% +- $ |=(c/vase (b (slam a c))) -- + |@ +- $ |=(c/vase (b (slam a c))) -- ++ root-beak `beak`[our %home da+now] :: :: Main From f060b46e440895722f4db2d63703c997d620663b Mon Sep 17 00:00:00 2001 From: Curtis Yarvin Date: Sun, 20 May 2018 14:33:06 -0700 Subject: [PATCH 2/2] Modify for all-wet core. --- lib/hood/womb.hoon | 58 ++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/lib/hood/womb.hoon b/lib/hood/womb.hoon index 82d86d717..a50ff973f 100644 --- a/lib/hood/womb.hoon +++ b/lib/hood/womb.hoon @@ -8,6 +8,7 @@ :: :: :: :::: :: :: :: :: :: +!: |% ++ foil :: ship allocation map |* a=mold :: entry mold @@ -195,8 +196,7 @@ [min=1 ctr=1 und=~ ove=~ max=(dec (bex (bex a))) box=~] :: ++ fo - =| (foil $@(~ *)) - |@ + |_ (foil $@(~ *)) +- nth :: index |= a/@u ^- (pair (unit @u) @u) ?: (lth a ~(wyt in und)) @@ -208,32 +208,6 @@ ?: =(0 a) [(some ctr) a] $(a (dec a), +<.nth new) :: - +- fin +< :: abet - +- new :: alloc - ?: =(ctr +(max)) +< - =. ctr +(ctr) - ?. (~(has in ove) ctr) +< - new(ove (~(del in ove) ctr)) - :: - +- get :: nullable - |= a/@p ^+ ?~(box ~ q.n.box) - (fall (~(get by box) (neis a)) ~) - :: - +- put - |* {a/@u b/*} ^+ fin :: b/_(~(got by box)) - ~| put+[a fin] - ?> (fit a) - =; adj adj(box (~(put by box) a b)) - ?: (~(has in box) a) fin - ?: =(ctr a) new - ?: (lth a ctr) - ?. (~(has in und) a) fin - fin(und (~(del in und) a)) - ?. =(a ctr:new) :: heuristic - fin(ove (~(put in ove) a)) - =+ n=new(+< new) - n(und (~(put in und.n) ctr)) - :: +- fit |=(a/@u &((lte min a) (lte a max))) :: in range +- gud :: invariant ?& (fit(max +(max)) ctr) @@ -251,6 +225,34 @@ ?:((~(has by box) min) 1 0) == == + :: + +- fin +< :: abet + :: + +- get :: nullable + |= a/@p ^+ ?~(box ~ q.n.box) + (fall (~(get by box) (neis a)) ~) + :: + +- put + |* {a/@u b/*} ^+ fin :: b/_(~(got by box)) + ~| put+[a fin] + :: ?> (fit a) + =; adj adj(box (~(put by box) a b)) + ?: (~(has in box) a) fin + ?: =(ctr a) new + ?: (lth a ctr) + ?. (~(has in und) a) fin + fin(und (~(del in und) a)) + ?. =(a ctr:new) :: heuristic + fin(ove (~(put in ove) a)) + =+ n=new(+< new) + n(und (~(put in und.n) ctr)) + :: + +- new :: alloc + |- ^+ +>- + ?: =(ctr +(max)) +>- + =. ctr +(ctr) + ?. (~(has in ove) ctr) +>- + $(ove (~(del in ove) ctr)) -- -- :: :: ::