Merge branch 'test' into demo

This commit is contained in:
Anton Dyudin 2015-06-03 13:23:41 -07:00
commit ca912bc379
10 changed files with 170 additions and 58 deletions

View File

@ -184,6 +184,23 @@
|= gag=gage ^- (list (pair cage cage)) |= gag=gage ^- (list (pair cage cage))
(unwrap-tang (gage-to-tage gag)) (unwrap-tang (gage-to-tage gag))
:: ::
++ gage-to-success-cages
|= gag=gage
^- (list (pair cage cage))
?. ?=(%tabl -.gag)
(ford-fail ?-(-.gag %| p.gag, %& [>%strange-gage p.p.gag<]~))
%+ murn p.gag
|= [key=gage val=gage] ^- (unit ,[cage cage])
?. ?=(%& -.key)
(ford-fail ?-(-.key %| p.key, %tabl [>%strange-gage<]~))
?- -.val
%tabl (ford-fail >%strange-gage< ~)
%& (some [p.key p.val])
%| =. p.val [(sell q.p.key) p.val]
~> %slog.[0 %*(. >%ford-fail syd %for %why< |2.+> p.val)]
~
==
::
++ gage-to-tage ++ gage-to-tage
|= gag=gage |= gag=gage
^- (each (list (pair cage cage)) tang) ^- (each (list (pair cage cage)) tang)
@ -567,7 +584,7 @@
(apply-edit wen) (apply-edit wen)
+>.$ +>.$
^- (list (pair path cage)) ^- (list (pair path cage))
%+ turn (gage-to-cages res) %+ turn (gage-to-success-cages res)
|= [pax=cage cay=cage] |= [pax=cage cay=cage]
?. ?=(%path p.pax) ?. ?=(%path p.pax)
~|(%clay-take-inserting-strange-path-mark !!) ~|(%clay-take-inserting-strange-path-mark !!)
@ -2749,8 +2766,10 @@
:: ~& >> [pax %ank-kan-sig] :: ~& >> [pax %ank-kan-sig]
~ ~
:: ~& >> [pax %ank-sig] :: ~& >> [pax %ank-sig]
=+ =+ (~(tap by dir.u.kan)) =+ ?~ dir.u.kan
:: ~& [%dirukan pax=pax (~(run by dir.u.kan) (cury test ~))] ~
=+ (~(tap by u.dir.u.kan))
:: ~& [%dirukan pax=pax (~(run by u.dir.u.kan) (cury test ~))]
|- ^- (list (pair path miso)) |- ^- (list (pair path miso))
?~ +< ~ ?~ +< ~
?~ q.i $(+< t) ?~ q.i $(+< t)
@ -2769,16 +2788,18 @@
- -
[[(flop pax) %del q.u.q.u.ank] -] [[(flop pax) %del q.u.q.u.ank] -]
:: ~& >> [pax %neither-sig] :: ~& >> [pax %neither-sig]
=+ %+ weld =+ ?~ dir.u.kan
~
%+ weld
=+ (~(tap by r.u.ank)) =+ (~(tap by r.u.ank))
|- ^- (list ,[p=path q=miso]) |- ^- (list ,[p=path q=miso])
?~ +< ~ ?~ +< ~
=+ (~(get by dir.u.kan) p.i) =+ (~(get by u.dir.u.kan) p.i)
?: ?=([~ ~] -) $(+< t) ?: ?=([~ ~] -) $(+< t)
%- weld :_ $(+< t) %- weld :_ $(+< t)
:: ~& >> [pax %ankhing p.i ?=(~ -)] :: ~& >> [pax %ankhing p.i ?=(~ -)]
^$(pax [p.i pax], ank `q.i, kan ?~(- ~ `u.u.-)) ^$(pax [p.i pax], ank `q.i, kan ?~(- ~ `u.u.-))
=+ (~(tap by dir.u.kan)) =+ (~(tap by u.dir.u.kan))
:: ~& > [%sdirukan pax=pax (~(run by dir.u.kan) (cury test ~))] :: ~& > [%sdirukan pax=pax (~(run by dir.u.kan) (cury test ~))]
|- ^- (list ,[p=path q=miso]) |- ^- (list ,[p=path q=miso])
?~ +< ~ ?~ +< ~

View File

@ -57,6 +57,7 @@
++ calx :: concrete cache line ++ calx :: concrete cache line
$% [%hood p=calm q=(pair beam cage) r=hood] :: compile $% [%hood p=calm q=(pair beam cage) r=hood] :: compile
[%bake p=calm q=(trel mark beam heel) r=(unit vase)]:: load [%bake p=calm q=(trel mark beam heel) r=(unit vase)]:: load
[%lilt p=calm q=arch r=(jug mark mark)] :: translation graph
[%slit p=calm q=[p=type q=type] r=type] :: slam type [%slit p=calm q=[p=type q=type] r=type] :: slam type
[%slim p=calm q=[p=type q=twig] r=(pair type nock)]:: mint [%slim p=calm q=[p=type q=twig] r=(pair type nock)]:: mint
[%slap p=calm q=[p=vase q=twig] r=vase] :: compute [%slap p=calm q=[p=vase q=twig] r=vase] :: compute
@ -81,6 +82,7 @@
?+ sem !! ?+ sem !!
%hood ?>(?=(%hood -.cax) r.cax) %hood ?>(?=(%hood -.cax) r.cax)
%bake ?>(?=(%bake -.cax) r.cax) %bake ?>(?=(%bake -.cax) r.cax)
%lilt ?>(?=(%lilt -.cax) r.cax)
%slap ?>(?=(%slap -.cax) r.cax) %slap ?>(?=(%slap -.cax) r.cax)
%slam ?>(?=(%slam -.cax) r.cax) %slam ?>(?=(%slam -.cax) r.cax)
%slim ?>(?=(%slim -.cax) r.cax) %slim ?>(?=(%slim -.cax) r.cax)
@ -275,6 +277,8 @@
%lime lime %lime lime
%lima lima %lima lima
%link link %link link
%lion lion
%lily lily
%lope lope %lope lope
%make make %make make
%meow meow %meow meow
@ -435,9 +439,9 @@
%+ cope %+ cope
|- ^- (bolt (list (pair gage gage))) |- ^- (bolt (list (pair gage gage)))
?~ p.gag (fine cof ~) ?~ p.gag (fine cof ~)
%+ cope (fret ^$(gag q.i.p.gag)) %+ cope (fret ^$(gag q.i.p.gag, cof cof))
|= [cof=cafe val=gage] |= [cof=cafe val=gage]
%+ cope ^$(p.gag t.p.gag) %+ cope ^$(p.gag t.p.gag, cof cof)
|= [cof=cafe rex=(list (pair gage gage))] |= [cof=cafe rex=(list (pair gage gage))]
(fine cof [[p.i.p.gag val] rex]) (fine cof [[p.i.p.gag val] rex])
|= [cof=cafe rex=(list (pair gage gage))] |= [cof=cafe rex=(list (pair gage gage))]
@ -826,18 +830,24 @@
$(yom t.yom, axe (peg axe 3)) $(yom t.yom, axe (peg axe 3))
:: ::
++ lace :: load and check ++ lace :: load and check
|= [cof=cafe for=mark bem=beam arg=heel] |= [cof=cafe for=mark bem=beam]
^- (bolt (unit vase)) ^- (bolt (unit (burg heel vase)))
%+ cope (lend cof bem) %+ cope (lend cof bem)
|= [cof=cafe arc=arch] |= [cof=cafe arc=arch]
?^ q.arc ?^ q.arc
(cope (cope (liar cof bem) (lake for)) (fest (norm ska bem))) %+ (fest (norm ska bem)) cof
?: (~(has by r.arc) %hook) |=([cof=cafe arg=heel] (cope (liar cof bem) (lake for)))
?. (~(has by r.arc) %hook)
(flue cof)
%+ cope (lend cof bem(s [%hook s.bem]))
|= [cof=cafe arc=arch]
?~ q.arc
(flue cof)
%+ (fest (norm ska bem(s [%hook s.bem]))) cof
|= [cof=cafe arg=heel]
%+ cope (fade cof %hook bem) %+ cope (fade cof %hook bem)
|= [cof=cafe hyd=hood] |= [cof=cafe hyd=hood]
%+ cope (cope (abut:(meow bem arg) cof hyd) (lake for)) (cope (abut:(meow bem arg) cof hyd) (lake for))
(fest (norm ska bem))
(flue cof)
:: ::
++ lake :: check/coerce ++ lake :: check/coerce
|= for=mark |= for=mark
@ -910,6 +920,7 @@
^- (bolt arch) ^- (bolt arch)
=+ von=(save ~ %cy bem) =+ von=(save ~ %cy bem)
?~ von [p=cof q=[%1 [%y bem ~] ~ ~]] ?~ von [p=cof q=[%1 [%y bem ~] ~ ~]]
:: %+ flag (norm ska bem)
(fine cof ((hard arch) q.q:(need u.von))) (fine cof ((hard arch) q.q:(need u.von)))
:: ::
++ liar :: load vase ++ liar :: load vase
@ -923,40 +934,73 @@
(fine cof q.u.u.von) (fine cof q.u.u.von)
:: ::
++ lily :: translation targets ++ lily :: translation targets
|= [cof=cafe for=mark] |= [cof=cafe for=mark] ^- (bolt (set ,@tas))
^- (bolt (list ,@tas)) %+ cope (lilt cof)
|= [cof=cafe lil=(jug mark mark)]
(fine cof (~(get ju lil) for))
::
++ lilt
|= cof=cafe ^- (bolt (jug mark mark))
%+ cope (lend cof [bek /mar])
|= [cof=cafe arc=arch]
%+ (clef %lilt) (fine cof arc)
|= [cof=cafe arc=arch]
:: =- =+((cope - |=([cafe lil=(jug mark mark)] ~&(lil=lil (flue cof)))) +<)
=+ all=(~(tap by r.arc))
~! all
|- ^- (bolt (jug mark mark))
?~ all (flue cof)
%+ cope $(cof cof, all t.all)
|= [cof=cafe lil=(jug mark mark)]
=* for p.i.all
=+ raf=(fang cof for) =+ raf=(fang cof for)
?: =(%2 -.q.raf) (flue cof) ?: =(%2 -.q.raf) (fine cof lil)
%+ cope raf %+ cope raf
|= [cof=cafe vax=vase] |= [cof=cafe vax=vase]
%+ fine cof %+ fine cof
%- ~(gas ju lil)
~| weg=(jam 3 p.vax)
%+ weld %+ weld
^- (list ,@tas) ^- (list ,[mark mark])
?. (slob %garb p.vax) ~ ?. (slob %grab p.vax) ~
=+ gav=((soft (list ,@tas)) q:(slap vax [%cnzy %garb])) =+ gab=(slap vax [%cnzy %grab])
?~(gav ~ u.gav) :: =+ opt=(skip (sloe p.gap) |=(fro=mark =(fro %noun)))
(turn (sloe p.gab) |=(fro=mark [fro for]))
?. (slob %grow p.vax) ~ ?. (slob %grow p.vax) ~
=+ gow=(slap vax [%cnzy %grow]) =+ gow=(slap vax [%cnzy %grow])
(sort (sloe p.gow) aor) (turn (sloe p.gow) |=(too=mark [for too]))
:: ::
++ lima :: load at depth ++ lima :: load at depth
|= [cof=cafe for=mark bem=beam arg=heel] |= [cof=cafe for=mark bem=beam arg=heel]
%+ (clef %bake) [p=cof q=[%0 p=[bem `~] q=[for bem arg]]] %+ (clef %bake) [p=cof q=[%0 p=[bem `~] q=[for bem arg]]]
|= [cof=cafe for=mark bem=beam arg=heel] |= [cof=cafe for=mark bem=beam arg=heel]
^- (bolt (unit vase)) ^- (bolt (unit vase))
%+ cope
%+ cope (lend cof bem) %+ cope (lend cof bem)
|= [cof=cafe arc=arch] |= [cof=cafe arc=arch] ^- (bolt (map mark (burg heel vase)))
^- (bolt (unit vase)) ?~ r.arc (flue cof)
?: (~(has by r.arc) for) %+ cope $(r.arc l.r.arc)
(lace cof for bem(s [for s.bem]) arg) |= [cof=cafe lam=(map mark (burg heel vase))]
=+ haz=(turn (~(tap by r.arc) ~) |=([a=@tas b=~] a)) %+ cope ^$(r.arc r.r.arc, cof cof)
?~ haz (flue cof) |= [cof=cafe ram=(map mark (burg heel vase))]
%+ cope (lion cof for haz) =. for p.n.r.arc
%+ cope
?. ((sane %tas) for) (flue cof)
(lace cof for bem(s [for s.bem]))
|= [cof=cafe nod=(unit (burg heel vase))]
%+ fine cof
?^(nod [[for u.nod] lam ram] (~(uni by lam) ram))
|= [cof=cafe mal=(map mark (burg heel vase))]
=+ lit=(~(get by mal) for)
?^ lit
(cope (u.lit cof arg) (fest bem))
=+ opt=(sa (turn (~(tap by mal)) head)) :: XX asymptotics
%+ cope (lion cof for opt)
|= [cof=cafe wuy=(list ,@tas)] |= [cof=cafe wuy=(list ,@tas)]
?~ wuy (flue cof) ?~ wuy (flue cof)
%+ cope (cope (make cof %bake i.wuy bem arg) furl) %+ cope ((~(got by mal) i.wuy) cof arg)
|= [cof=cafe hoc=cage] |= [cof=cafe hoc=vase]
%+ cope (lope cof i.wuy t.wuy q.hoc) %+ cope (lope cof i.wuy t.wuy hoc)
|= [cof=cafe vax=vase] |= [cof=cafe vax=vase]
((fest bem) cof vax) ((fest bem) cof vax)
:: ::
@ -994,22 +1038,24 @@
`(slap gab [%cnzy for]) `(slap gab [%cnzy for])
?~ zat ?~ zat
(flaw cof [%leaf "ford: no link: {<[for too]>}"]~) (flaw cof [%leaf "ford: no link: {<[for too]>}"]~)
~| [%link-maul for too]
(maul cof u.zat vax) (maul cof u.zat vax)
:: ::
++ lion :: translation search ++ lion :: translation search
|= [cof=cafe too=mark fro=(list mark)] |= [cof=cafe too=mark fro=(set mark)]
:: ~& lion/[too=too fro=(sa fro)] :: ~& lion/[too=too fro=(sa fro)]
^- (bolt (list mark)) ^- (bolt (list mark))
=| $: war=(map mark (list mark)) =| $: war=(map mark (list mark))
pax=(list mark) won=[p=mark q=(qeu mark)] pax=(list mark) won=[p=mark q=(qeu mark)]
== ==
%. [cof fro] %. [cof fro]
|= [cof=cafe fro=(list mark)] ^- (bolt (list mark)) |= [cof=cafe fro=(set mark)] ^- (bolt (list mark))
?: =(too p.won) ?: =(too p.won)
(fine cof (flop pax)) (fine cof (flop pax))
=. fro (skip fro ~(has by war)) =+ for=(skip (~(tap by fro)) ~(has by war))
=: q.won (~(gas to q.won) fro) =. for (sort for aor) :: XX useful?
war (~(gas by war) (turn fro |=(mark [+< pax]))) =: q.won (~(gas to q.won) for)
war (~(gas by war) (turn for |=(mark [+< pax])))
== ==
?: =(~ q.won) ?: =(~ q.won)
(flue cof) (flue cof)
@ -1062,7 +1108,7 @@
== ==
:: ::
%bake %bake
:: ~& [%bake-start (tope q.kas)] :: ~& > [p.kas (tope q.kas)]
%+ cool |.(leaf/"ford: bake {<p.kas>} {<(tope q.kas)>}") %+ cool |.(leaf/"ford: bake {<p.kas>} {<(tope q.kas)>}")
%+ cope (lima cof p.kas q.kas r.kas) %+ cope (lima cof p.kas q.kas r.kas)
|= [cof=cafe vux=(unit vase)] |= [cof=cafe vux=(unit vase)]
@ -1110,7 +1156,7 @@
|= [cof=cafe cay=cage] |= [cof=cafe cay=cage]
^- (bolt gage) ^- (bolt gage)
%+ cool |.(leaf/"ford: casting {<p.cay>} to {<p.kas>}") %+ cool |.(leaf/"ford: casting {<p.cay>} to {<p.kas>}")
%+ cope (lion cof p.kas p.cay ~) %+ cope (lion cof p.kas p.cay `~)
|= [cof=cafe wuy=(list ,@tas)] |= [cof=cafe wuy=(list ,@tas)]
%+ cope %+ cope
?~ wuy ?~ wuy
@ -1174,11 +1220,11 @@
%+ cope %+ cope
|- ^- (bolt (list (pair gage gage))) |- ^- (bolt (list (pair gage gage)))
?~ p.kas (fine cof ~) ?~ p.kas (fine cof ~)
%+ cope (make cof p.i.p.kas) %+ cope (fret (make cof p.i.p.kas))
|= [cof=cafe key=gage] |= [cof=cafe key=gage]
%+ cope (make cof q.i.p.kas) %+ cope (fret (make cof q.i.p.kas))
|= [cof=cafe val=gage] |= [cof=cafe val=gage]
%+ cope ^^$(cof cof, p.kas t.p.kas) %+ cope ^^$(p.kas t.p.kas, cof cof)
|= [cof=cafe rex=(list (pair gage gage))] |= [cof=cafe rex=(list (pair gage gage))]
(fine cof [[key val] rex]) (fine cof [[key val] rex])
|= [cof=cafe rex=(list (pair gage gage))] |= [cof=cafe rex=(list (pair gage gage))]
@ -1297,7 +1343,7 @@
?~ src (fine cof ..body) ?~ src (fine cof ..body)
%+ cope (wilt cof i.src) %+ cope (wilt cof i.src)
|= [cof=cafe sel=_..body] |= [cof=cafe sel=_..body]
^$(cof cof, src t.src, ..body sel) ^$(src t.src, ..body sel, cof cof)
:: ::
++ chad :: atomic list ++ chad :: atomic list
|= [cof=cafe bax=vase doe=term hon=horn] |= [cof=cafe bax=vase doe=term hon=horn]
@ -1367,7 +1413,7 @@
%+ cope %+ cope
|- ^- (bolt (list vase)) |- ^- (bolt (list vase))
?~ p.hon (flue cof) ?~ p.hon (flue cof)
%+ cope ^$(hon i.p.hon) %+ cope ^$(cof cof, hon i.p.hon)
|= [cof=cafe vax=vase] |= [cof=cafe vax=vase]
%+ cope ^$(cof cof, p.hon t.p.hon) %+ cope ^$(cof cof, p.hon t.p.hon)
|= [cof=cafe tev=(list vase)] |= [cof=cafe tev=(list vase)]

View File

@ -1029,6 +1029,7 @@
%merg `%c %merg `%c
%plug `%c %plug `%c
%them `%e %them `%e
%wait `%t
%want `%a %want `%a
%warp `%c %warp `%c
== ==

View File

@ -2051,6 +2051,14 @@
(~(del by a) b) (~(del by a) b)
(~(put by a) b e) (~(put by a) b e)
:: ::
+- gas :: concatenate
|* b=(list ,[p=* q=*])
=> .(b `(list ,_?>(?=([[* ^] ^] a) [p=p q=n.q]:n.a))`b)
|- ^+ a
?~ b
a
$(b t.b, a (put(+< a) p.i.b q.i.b))
::
+- get :: gets set by key +- get :: gets set by key
|* b=* |* b=*
=+ c=(~(get by a) b) =+ c=(~(get by a) b)

View File

@ -2324,7 +2324,7 @@
:: ::
++ khan :: ++ khan ::
$: fil=(unit (unit cage)) :: XX see khan-to-soba $: fil=(unit (unit cage)) :: XX see khan-to-soba
dir=(map ,@ta (unit khan)) :: dir=(unit (map ,@ta (unit khan))) ::
== :: == ::
++ mick (list ,[path (unit mime)]) ++ mick (list ,[path (unit mime)])
++ riff ,[p=desk q=(unit rave)] :: request/desist ++ riff ,[p=desk q=(unit rave)] :: request/desist

View File

@ -0,0 +1,12 @@
::
:::: /hook/gate/reload/hood/cat
::
/? 314
::
::::
!:
|= $: [now=@da eny=@uvI bec=beak]
[arg=(list term) ~]
==
:+ %hood-reload-desk %base
arg

View File

@ -0,0 +1,12 @@
::
:::: /hook/gate/reload/hood/cat
::
/? 314
::
::::
!:
|= $: [now=@da eny=@uvI bec=beak]
[arg=[desk (list term)] ~]
==
:- %hood-reload-desk
arg

View File

@ -0,0 +1,11 @@
::
:::: /hook/gate/reset/hood/cat
::
/? 314
::
::::
!:
|= $: [now=@da eny=@uvI bec=beak]
[arg=~ ~]
==
[%hood-reset ~]

View File

@ -87,7 +87,8 @@
%- emil %- emil
%- flop %- flop
%+ turn all %+ turn all
=+ ark=(arch .^(%cy /(scot %p our)/[syd]/(scot %da now)/arvo)) =+ top=`path`/(scot %p our)/[syd]/(scot %da now)/arvo
=+ ark=(arch .^(%cy top))
=+ van=(~(tap by r.ark)) =+ van=(~(tap by r.ark))
|= nam=@tas |= nam=@tas
=. nam =. nam
@ -98,12 +99,9 @@
?> ?=([[@ ~] ~] zaz) ?> ?=([[@ ~] ~] zaz)
`term`p.i.zaz `term`p.i.zaz
=+ tip=(end 3 1 nam) =+ tip=(end 3 1 nam)
=+ way=[(scot %p our) %home (scot %da now) %arvo nam %hoon ~] =+ way=(welp top /[nam])
=+ fil=(,@ .^(%cx way)) =+ fil=(,@ .^(%cx (welp way /hoon)))
:* %flog [%flog /reload [%veer ?:(=('z' tip) %$ tip) way fil]]
/reload
[%veer ?:(=('z' tip) %$ tip) way (,@ .^(%cx way))]
==
:: ::
++ poke-invite :: send invite; fake ++ poke-invite :: send invite; fake
|= [who=@p myl=@t] =< abet |= [who=@p myl=@t] =< abet

View File

@ -110,7 +110,7 @@ CodeMirror.defineMode("hoon", function() {
} }
if(stream.eat('`')){ if(stream.eat('`')){
state.space = false state.space = true
return 'operator' return 'operator'
} }
if(stream.sol() && stream.eatWhile(glyph)){ if(stream.sol() && stream.eatWhile(glyph)){
@ -131,8 +131,10 @@ CodeMirror.defineMode("hoon", function() {
return 'builtin' return 'builtin'
return 'operator' return 'operator'
} }
if(stream.eat(/[=:.^]/)) if(stream.eat(/[=:.^]/)){
state.space = true
return 'operator' return 'operator'
}
stream.next() stream.next()
return 'builtin' return 'builtin'
} }
@ -154,4 +156,5 @@ CodeMirror.defineMode("hoon", function() {
return res return res
}); });
CodeMirror.registerHelper("wordChars", "hoon", /[-\\w]/);
CodeMirror.defineMIME("text/x-hoon", "hoon"); CodeMirror.defineMIME("text/x-hoon", "hoon");