Merge branch 'test' of github.com:urbit/urbit into test

This commit is contained in:
Galen Wolfe-Pauly 2015-09-10 21:26:58 -07:00
commit 2d5fd00dcb
18 changed files with 625 additions and 307 deletions

View File

@ -10,13 +10,12 @@
!: :: ::
=> |% :: external structures
++ house :: all state
$: %0
$: %1
hoc=(map bone session) :: conversations
== ::
++ session :: per conversation
$: say=sole-share :: command-line state
syd=desk :: active desk
luc=(unit case) :: special case
dir=beam :: active path
poy=(unit dojo-project) :: working
[lib=(list hoof) arc=(list hoof)] :: lib/sur
var=(map term cage) :: variable state
@ -30,7 +29,7 @@
[%file p=beam q=dojo-source] :: save to clay
[%poke p=goal q=dojo-source] :: make and poke
[%show p=dojo-source] :: print
[%verb p=term q=dojo-source] :: store variable
[%verb p=term q=(unit dojo-source)] :: store variable
== ::
++ dojo-source :: construction node
$: p=@ud :: assembly index
@ -45,13 +44,12 @@
[%ge p=dojo-model] :: generator
[%sc p=dojo-model] :: script
[%tu p=(list dojo-source)] :: tuple
[%va p=term] :: dojo variable
[%ur p=purl] :: http GET request
== ::
++ dojo-filter :: pipeline filter
$% [%a p=twig] :: function gate
[%b p=mark] :: simple transmute
[%c p=dojo-model] :: formal filter
== ::
$| mark :: simple transmute
twig :: function gate
::
++ dojo-model :: data construction
$: p=dojo-server :: core source
q=dojo-config :: configuration
@ -89,6 +87,7 @@
++ card :: general card
$% [%diff %sole-effect sole-effect] ::
[%send wire [ship term] clap] ::
[%hiss wire mark [%purl purl]] ::
[%exec wire @p (unit ,[beak silk])] ::
[%deal wire sock term club] ::
[%info wire @p toro] ::
@ -99,7 +98,7 @@
[%unto p=cuft] ::
== ::
-- ::
:: ::
!: ::
:::: ::
:: ::
|_ $: hid=bowl :: system state
@ -121,8 +120,7 @@
;~(plug (most fas sym) dp-config)
==
::
;~ pfix col
%+ stag %poke
;~ plug (cold %poke col)
%+ cook
|= [a=goal b=(each dojo-source (trel term path dojo-config))]
^- (pair goal dojo-source)
@ -137,39 +135,38 @@
==
;~ plug
dp-goal
;~ pose
(stag %& ;~(pfix ace dp-source))
%+ stag %|
;~ plug
;~ pose
(cold %di wut)
(cold %ge lus)
(cold %sc pam)
==
(most fas sym)
dp-config
%+ pick ;~(pfix ace dp-source)
;~ plug
;~ pose
(cold %di wut)
(cold %ge lus)
(cold %sc pam)
==
(most fas sym)
dp-config
==
==
==
::
%+ stag %verb
;~ pfix tis
;~((glue ace) sym dp-source)
;~ plug (cold %verb tis)
;~(plug sym (punt ;~(pfix ace dp-source)))
==
::
%+ stag %file
;~ pfix tar
;~ 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)
==
::
%+ stag %flat
;~ pfix pat
;~ plug (cold %flat pat)
;~((glue ace) (most fas sym) dp-source)
==
::
%+ stag %pill
;~ pfix dot
;~ plug (cold %pill dot)
;~((glue ace) (most fas sym) dp-source)
==
::
@ -179,14 +176,13 @@
++ dp-build :: ++dojo-build
%+ knee *dojo-build |. ~+
;~ pose
;~(pfix lus (stag %ge dp-model-cat))
;~(pfix wut (stag %di dp-model-dog))
;~(pfix buc (stag %va sym))
;~(pfix pam (stag %ec ;~(plug ;~(sfix sym dot) dp-twig)))
(stag %ex dp-twig)
(ifix [sel ser] (stag %tu (most ace dp-source)))
;~(pfix lus ;~(pose (stag %ur auri:epur) (stag %ge dp-model-cat)))
;~(plug (cold %di wut) dp-model-dog)
;~(plug (cold %fi cab) ;~((glue ace) dp-filter dp-source))
dp-value
==
::
++ dp-filter ;~(pose ;~(sfix sym cab) dp-twig) :: ++dojo-filter
++ dp-goal :: ++goal
%+ cook |=(a=goal a)
;~ pose
@ -205,30 +201,28 @@
++ 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 `path`/(scot %p our.hid)/[syd]/(scot %da now.hid)
++ 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-value :: ++dojo-source
%+ cook |=(a=dojo-source a)
%+ stag 0
;~ pose
(ifix [kel ker] (stag %tu (most ace dp-source)))
(stag %va ;~(pfix buc sym))
(stag %tu (ifix [kel ker] (most ace dp-source)))
(stag %ex dp-twig)
==
::
++ dp-config :: ++dojo-config
;~ plug
(star ;~(pfix ace dp-value))
(star ;~(pfix ace (stag 0 dp-value)))
%+ cook
~(gas by *(map term (unit dojo-source)))
%- star
;~ plug
;~(pfix com ace tis sym)
(punt ;~(pfix ace dp-value))
(punt ;~(pfix ace (stag 0 dp-value)))
==
==
--
@ -243,6 +237,12 @@
?> ?=(~ pux)
(he-card(poy `+>+<(pux `way)) %exec way our.hid `[he-beak kas])
::
++ dy-eyre :: send work to eyre
|= [way=wire req=[%purl purl]]
^+ +>+>
?> ?=(~ pux)
(he-card(poy `+>+<(pux `way)) %hiss way %httr req)
::
++ dy-stop :: stop work
^+ +>
?~ pux +>
@ -272,7 +272,7 @@
%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 q.mad) [[%verb p.mad src] +>.$])
%verb =^(src +>.$ (dy-init-source-unit q.mad) [[%verb p.mad src] +>.$])
==
::
++ dy-init-source-unit :: (unit dojo-source)
@ -289,7 +289,7 @@
=: p.src num
q.src bul
==
[src +>.$(num +(num), job (~(put by job) num q.src))]
[src +>.$(num +(num), job (~(put by job) src))]
::
++ dy-init-build :: ++dojo-build
|= bul=dojo-build
@ -299,9 +299,11 @@
%ex [bul +>.$]
%di =^(mod +>.$ (dy-init-model p.bul) [[%di mod] +>.$])
%dv [bul +>.$]
%fi !!
%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 +>.^$]
?~ p.bul [~ +>.^$]
@ -309,7 +311,6 @@
=^ mor +>.^$ $(p.bul t.p.bul)
[[dis mor] +>.^$]
[[%tu dof] +>.$]
%va [bul +>.$]
==
::
++ dy-init-model :: ++dojo-model
@ -384,6 +385,12 @@
(dy-diff %bel ~)
(dy-slam /dial u.pro !>(txt))
::
++ dy-cast
|* [typ=_,* bun=vase]
|= a=vase ^- typ
?> (~(nest ut p.bun) & p.a)
;;(typ q.a)
::
++ dy-over :: finish construction
^+ +>
?- -.mad
@ -415,22 +422,43 @@
(dy-rash %sag p.mad q.q:(~(got by rez) p.q.mad))
::
%verb
~& (~(run by var) mug)
=+ cay=(~(got by rez) p.q.mad)
?~ q.mad
=. var (~(del by var) p.mad)
=< dy-amok
?+ p.mad .
?(%eny %now %our) !!
%lib .(lib ~)
%arc .(arc ~)
%dir .(dir [[our.hid %home ud/0] /])
==
=+ cay=(~(got by rez) p.u.q.mad)
=. var (~(put by var) p.mad cay)
~| bad-set/[p.mad p.q.cay]
=< dy-amok
?+ p.mad .(var (~(put by var) p.mad cay))
?+ p.mad .
%eny ~|(%entropy-is-eternal !!)
%now ~|(%time-is-immutable !!)
%who ~|(%self-is-immutable !!)
%law .(syd ;;(@tas q.q.cay))
%dir ~|(%cd-stub ?>(?=(~ q.q.cay) .))
%lib .(lib ;;((list hoof) q.q.cay))
%arc .(arc ;;((list hoof) q.q.cay))
%our ~|(%self-is-immutable !!)
%lib .(lib ((dy-cast (list hoof) !>(*(list hoof))) q.cay))
%arc .(arc ((dy-cast (list hoof) !>(*(list hoof))) q.cay))
%dir =. dir (need (tome ((dy-cast path !>(*path)) q.cay)))
=- +(..dy (he-diff %tan - ~))
rose/[" " `~]^~[leaf/"=%" (smyt (tope he-beak s.dir))]
==
::
%show
=+ cay=(~(got by rez) p.p.mad)
(dy-rash %tan ?+(p.cay [(sell q.cay)]~ %tang ;;(tang q.q.cay)))
%+ 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 {<p.hit>}"
%+ 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
@ -484,11 +512,12 @@
++ dy-twig-head :: dynamic state
^- cage
:- %noun
!> ^- $: law=desk dir=path
[lib=(list hoof) arc=(list hoof)]
[our=@p now=@da eny=@uvI]
==
[syd / [lib arc] [our now eny]:hid]
=+ sloop=|=([a=vase b=vase] ?:(=(*vase a) b ?:(=(*vase b) a (slop a b))))
%+ sloop
%- ~(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)
::
++ dy-made-dial :: dialog product
|= cag=cage
@ -519,31 +548,63 @@
++ dy-make :: build step
^+ +>
?> ?=(^ cud)
=+ bil=q.u.cud :: XX =*
?: ?=(%ur -.bil)
(dy-eyre /hand %purl p.bil)
%- dy-ford
^- (pair path silk)
?+ -.q.u.cud !!
%di [/dial (dy-silk-init-modo (dy-cage p.p.p.q.u.cud) q.p.q.u.cud)]
%ge [/gent (dy-silk-init-modo (dy-cage p.p.p.q.u.cud) q.p.q.u.cud)]
%dv [/hand [%core he-beak (flop p.q.u.cud)]]
%ec [/hand [%cast p.q.u.cud (dy-mare q.q.u.cud)]]
%ex [/hand (dy-mare p.q.u.cud)]
%va [/hand %$ (~(got by var) p.q.u.cud)]
?+ -.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)]
%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])]
%tu :- /hand
:- %$
:- %noun
|- ^- vase
?~ p.q.u.cud !!
=+ hed=(dy-vase p.i.p.q.u.cud)
?~ t.p.q.u.cud hed
(slop hed $(p.q.u.cud t.p.q.u.cud))
?~ p.bil !!
=+ hed=(dy-vase p.i.p.bil)
?~ t.p.bil hed
(slop hed $(p.bil t.p.bil))
==
::
++ dy-twig-mark :: XX architect
=+ ^= ope
|= gen=twig ^- twig
?: ?=(?(%sggl %sggr) -.gen)
$(gen q.gen)
=+ ~(open ap gen)
?.(=(gen -) $(gen -) gen)
|= gen=twig ^- (unit mark)
=. gen (ope gen)
?: ?=([%cnts [@ ~] ~] gen)
(bind (~(get by var) i.p.gen) head)
?. ?=(%dtkt -.gen) ~
=. p.gen (ope p.gen)
?@ -.p.gen ~
?+ ~(feck ap p.p.gen) ~
[~ %cx]
=+ gin=(ope q.p.gen)
|-
?@ -.gin ~
=. q.gin (ope q.gin)
?^ -.q.gin $(gin q.gin)
=. p.gin (ope p.gin)
?. ?=([[?(%dtzz %dtzy) @ @] [%dtzz %n ~]] gin)
~
(some q.p.gin)
==
::
++ dy-mare :: build expression
|= gen=twig
^- silk
:+ %cast (fall (dy-twig-mark gen) %noun)
:+ %ride gen
:- [%$ dy-twig-head]
[%plan [he-beak ~] / zuse arc lib ~ ~] :: XX spur
[%plan he-beam / zuse arc lib ~ ~]
::
++ dy-step :: advance project
|= nex=@ud
@ -578,9 +639,11 @@
++ he-abet :: resolve
[(flop moz) %_(+> hoc (~(put by hoc) ost +<+))]
::
++ he-beak :: logical beam
^- beak
[our.hid syd ?^(luc u.luc [%da now.hid])]
++ he-beak -:he-beam
++ he-beam :: logical beam
^- beam
?. =(ud/0 r.dir) dir
dir(r [%da now.hid])
::
++ he-card :: emit gift
|= cad=card
@ -602,7 +665,7 @@
?~(poy . ~(dy-stop dy u.poy))
::
++ he-peer :: subscribe to
he-prom
|=(pax=path ?>(=(~ pax) he-prom))
::
++ he-pine :: restore prompt
^+ .
@ -617,7 +680,7 @@
++ he-prom :: send prompt
%- he-diff
:- %pro
[& %$ "> "]
[& %$ ?~(buf "> " "< ")]
::
++ he-made :: result from ford
|= [way=wire dep=@uvH reg=gage]
@ -637,8 +700,15 @@
%tabl !!
==
::
++ he-sigh :: result from ford
|= [way=wire hit=httr]
^+ +>
?> ?=(^ poy)
?> ?=([%hand ~] way) :: XX options?
he-pine:(~(dy-hand dy u.poy(pux ~)) %httr !>(hit))
::
++ he-unto :: result from behn
|= cit=cuft
|= [way=wire cit=cuft]
^+ +>
?. ?=(%coup -.cit)
~& [%strange-unto cit]
@ -678,6 +748,7 @@
|= txt=tape
^+ +>
?~ txt
=< he-prom(buf ~)
%- he-diff
:~ %mor
[%txt "> "]
@ -694,7 +765,7 @@
=. +>.$ (he-diff %mor txt/old nex/~ det/cal ~)
?- -.u.p.doy
%& (he-plan(buf ~) p.u.p.doy)
%| +>.$(buf p.u.p.doy)
%| he-prom(buf p.u.p.doy)
==
==
::
@ -718,51 +789,42 @@
--
::
++ prep
=+ sosh==>(*session .(|4 |5(+ old)))
:: ,_`..prep
|= old=(unit ?(house (map bone ,_sosh))) ^+ [~ ..prep]
=+ sosh==+(*session ,[_say syd=desk * (unit) _|3.-])
:: ,_`..prep
|= old=(unit ?(house [%0 p=(map bone sosh)])) ^+ [~ ..prep]
?~ old `..prep
?. ?=([@ *] u.old)
%= $
u.old
[%0 (~(run by u.old) |=(sos=_sosh sos(|4 [[~ ~] &5.sos |5.sos ""])))]
==
`..prep(+<+ u.old)
?: ?=(%1 -.u.old) `..prep(+<+ u.old)
=< ^$(u.old [%1 (~(run by p.u.old) .)])
|= sos=sosh ^- session
=- ~! [%*(. *session poy *(unit)) -] -
[-.sos [[our.hid syd.sos ud/0] /] ~ |4.sos]
::
:: pattern: ++ foo |=(data he-abet:(~(he-foo he (~(got by hoc) ost)) data))
++ arm (arm-session (~(got by hoc) ost.hid))
++ arm-session
|= ses=session
=> ~(. he [ost.hid ~] ses)
=- [wrap=- +]
|* he-arm=_he-type
|= _+<.he-arm ^- (quip move ..he)
he-abet:(he-arm +<)
::
++ peer-sole
|= [pax=path]
^- (quip move +>)
:: ~& [%dojo-peer ost.hid pax]
~? !=(src.hid our.hid) [%dojo-peer-stranger ost.hid src.hid pax]
~? !=(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 pax]
?> =(~ pax)
=< he-abet
%~ he-peer he
:- [ost.hid ~]
^- session
%*(. *session syd %home)
~? (~(has by hoc) ost.hid) [%dojo-peer-replaced ost.hid]
=+ ses=%*(. *session -.dir [our.hid %home ud/0])
(wrap he-peer):(arm-session ses)
::
++ poke-sole-action
|= [act=sole-action]
^- (quip move +>)
~| [%dojo-poke ost.hid -.act (~(run by hoc) ,~)]
:: ~& [%dojo-poke ost.hid src.hid act]
:: ~? !=(src.hid our.hid) [%dojo-poke ost.hid src.hid]
he-abet:(~(he-type he [ost.hid ~] (~(got by hoc) ost.hid)) act)
::
++ made
|= [way=wire dep=@uvH reg=gage]
he-abet:(~(he-made he [[ost.hid ~] (~(got by hoc) ost.hid)]) way dep reg)
::
++ lame
|= [wut=term why=tang]
he-abet:(~(he-lame he [[ost.hid ~] (~(got by hoc) ost.hid)]) wut why)
::
++ unto
|= [way=wire cit=cuft]
he-abet:(~(he-unto he [[ost.hid ~] (~(got by hoc) ost.hid)]) cit)
|= act=sole-action ~| poke/act %. act
(wrap he-type):arm
::
++ made (wrap he-made):arm
++ sigh-httr (wrap he-sigh):arm
++ sigh-tang |=([a=wire b=tang] ~|(`term`(cat 3 'sigh-' -.a) (mean b)))
++ lame (wrap he-lame):arm
++ unto (wrap he-unto):arm
++ pull
|= [pax=path]
^- (quip move +>)

View File

@ -13,9 +13,10 @@
::
[. talk sole]
=> |% :: data structures
++ house ,[%1 house-1] :: full state
++ house ,[%2 house-2] :: full state
++ house-any :: app history
$% [%1 house-1] :: 1: talk
[%2 house-2] :: 1: talk
== ::
++ house-1 ::
$: stories=(map span story) :: conversations
@ -25,6 +26,15 @@
shells=(map bone shell) :: interaction state
== ::
:: ::
++ house-2 ::
$: stories=(map span story) :: conversations
general=(set bone) :: meta-subscribe
outbox=(pair ,@ud (map ,@ud thought)) :: urbit outbox
folks=(map ship human) :: human identities
shells=(map bone shell) :: interaction state
log=(map span ,@ud) :: logged to clay
== ::
:: ::
++ story :: wire content
$: count=@ud :: (lent grams)
grams=(list telegram) :: all history
@ -1699,7 +1709,10 @@
|= [cod=command]
^- [(list move) _+>]
:: ~& [%talk-poke-command src.hid cod]
ra-abet:(~(ra-apply ra ost.hid ~) src.hid cod)
=^ mos +>.$
ra-abet:(~(ra-apply ra ost.hid ~) src.hid cod)
=^ mow +>.$ log-all-to-file
[(welp mos mow) +>.$]
::
++ poke-sole-action :: accept console
|= [act=sole-action]
@ -1707,8 +1720,12 @@
::
++ diff-talk-report ::
|= [way=wire rad=report]
%+ etch-friend way |= [man=span cuz=station]
ra-abet:(~(ra-diff-talk-report ra ost.hid ~) man cuz rad)
^- (quip move +>)
=^ mos +>.$
%+ etch-friend way |= [man=span cuz=station]
ra-abet:(~(ra-diff-talk-report ra ost.hid ~) man cuz rad)
=^ mow +>.$ log-all-to-file
[(welp mos mow) +>.$]
::
++ coup-repeat ::
|= [way=wire saw=(unit tang)]
@ -1758,28 +1775,55 @@
=^ moz +>.$ ra-abet:(~(ra-cancel ra ost.hid ~) src.hid pax)
[moz +>.$(shells (~(del by shells) ost.hid))]
::
++ log-all-to-file
^- (quip move .)
:_ %_ .
log %- ~(urn by log)
|=([man=span len=@ud] count:(~(got by stories) man))
==
%+ murn (~(tap by log))
|= [man=span len=@ud]
^- (unit move)
?: (gte len count:(~(got by stories) man))
~
`(log-to-file man)
::
++ log-to-file
|= man=span
^- move
=+ 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-save
|= man=span
^- (quip move +>)
:_ +>.$
=+ paf=/(scot %p our.hid)/home/(scot %da now.hid)/talk/[man]/jam
=+ grams:(~(got by stories) man)
[ost.hid %info /jamfile our.hid (foal paf [%jam !>((jam -))])]~
[[(log-to-file man) ~] +>.$]
::
++ poke-load
|= man=span
=+ ^= grams
%- (hard (list telegram))
%- cue
%- (hard ,@)
.^(%cx /(scot %p our.hid)/home/(scot %da now.hid)/talk/[man]/jam)
.^ %cx
/(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))))]
::
++ poke-log
|= man=span
^- (quip move +>)
:- [(log-to-file man) ~]
+>.$(log (~(put by log) man count:(~(got by stories) man)))
::
++ prep
|= [old=(unit house)]
|= [old=(unit house-any)]
^- (quip move +>)
?~ old
ra-abet:~(ra-init ra 0 ~)
[~ +>(+<+ u.old)]
|-
?- -.u.old
%1 $(u.old [%2 stories general outbox folks shells ~]:u.old)
%2 [~ +>.^$(+<+ u.old)]
==
--

View File

@ -413,7 +413,7 @@
vix=(bex +((cut 0 [25 2] mag))) :: width of sender
tay=(cut 0 [27 5] mag) :: message type
==
?> =(3 vez)
?> =(4 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 3]
:~ [3 4]
[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]
?. =(3 (end 0 3 pac)) [~ fox]
?. =(4 (end 0 3 pac)) [~ fox]
=+ kec=(bite pac)
?: (goop p.p.kec) [~ fox]
?. (~(has by urb.ton.fox) q.p.kec)

View File

@ -14,12 +14,15 @@
$: qyx=cult :: subscribers
dom=dome :: desk data
dok=(unit dork) :: outstanding diffs
mer=(map (pair ship desk) mery) :: outstanding merges
mer=(unit mery) :: outstanding merge
== ::
++ gift gift-clay :: out result <-$
++ kiss kiss-clay :: in request ->$
++ mery ::
$: gem=germ :: strategy
++ mery :: merge state
$: sor=(pair ship desk) :: merge source
hen=duct :: formal source
gem=germ :: strategy
wat=wait :: waiting on
cas=case :: ali's case
ali=yaki :: ali's commit
bob=yaki :: bob's commit
@ -33,6 +36,9 @@
erg=(map path ,?) :: ergoable changes
gon=(each (set path) (pair term (list tank))) :: return value
== ::
++ wait $? %null %ali %diff-ali %diff-bob :: what are we
%merge %build %checkout %ergo :: waiting for?
== ::
++ moot ,[p=case q=case r=path s=(map path lobe)] :: stored change range
++ move ,[p=duct q=(mold note gift)] :: local move
++ nako $: gar=(map aeon tako) :: new ids
@ -46,7 +52,7 @@
== == ::
$: %c :: to %clay
$% [%info p=@p q=@tas r=nori] :: internal edit
[%merg p=@p q=@tas r=@p s=@tas t=germ] :: merge desks
[%merg p=@p q=@tas r=@p s=@tas t=case u=germ] :: merge desks
[%warp p=sock q=riff] ::
== == ::
$: %d ::
@ -90,7 +96,7 @@
qyx=cult :: subscribers
dom=dome :: revision state
dok=(unit dork) :: outstanding diffs
mer=(map (pair ship desk) mery) :: outstanding merges
mer=(unit mery) :: outstanding merges
== ::
++ rind :: request manager
$: nix=@ud :: request index
@ -434,12 +440,12 @@
| :_ yel
[hen %note '=' %leaf :(weld (trip p.lem) " " (spud pre))]
& |- ^+ yel
?~ q.p.lem yel
:_ $(q.p.lem t.q.p.lem)
?~ p.lem yel
:_ $(p.lem t.p.lem)
:- hen
:+ %note
?-(-.q.i.q.p.lem %del '-', %ins '+', %dif ':')
[%leaf (spud (weld pre p.i.q.p.lem))]
?-(-.q.i.p.lem %del '-', %ins '+', %dif ':')
[%leaf (spud (weld pre p.i.p.lem))]
==
==
::
@ -454,10 +460,10 @@
wake:(echo:(checkout-ankh u.hat) wen lem)
?. =(~ dok)
~& %already-applying-changes +>
=+ del=(skim q.p.lem :(corl (cury test %del) head tail))
=+ ins=(skim q.p.lem :(corl (cury test %ins) head tail))
=+ dif=(skim q.p.lem :(corl (cury test %dif) head tail))
=+ mut=(skim q.p.lem :(corl (cury test %mut) head tail))
=+ del=(skim p.lem :(corl (cury test %del) head tail))
=+ ins=(skim p.lem :(corl (cury test %ins) head tail))
=+ dif=(skim p.lem :(corl (cury test %dif) head tail))
=+ mut=(skim p.lem :(corl (cury test %mut) head tail))
=^ ink ins
^- [(list (pair path miso)) (list (pair path miso))]
%+ skid `(list (pair path miso))`ins
@ -619,10 +625,10 @@
^- (list (pair path misu))
(turn u.mut.u.dok |=([pax=path cal=[lobe cage]] [pax %dif cal]))
==
=+ hat=(edit:ze wen %& *cart sim)
=+ hat=(edit:ze wen %& sim)
?~ dok ~& %no-changes !!
?~ -.hat
([echo(dok ~)]:.(+>.$ +.hat) wen %& *cart sim)
([echo(dok ~)]:.(+>.$ +.hat) wen %& sim)
(checkout-ankh(lat.ran lat.ran.+.hat) u.-.hat)
::
++ take-inserting
@ -755,26 +761,28 @@
^- (list (pair path misu))
(turn u.mut.u.dok |=([pax=path cal=[lobe cage]] [pax %dif cal]))
==
=^ hat +>.$ (edit:ze now %& *cart sim) :: XX do same in ++apply-edit
=^ hat +>.$ (edit:ze now %& sim) :: XX do same in ++apply-edit
?~ dok ~& %no-dok +>.$
=>
%= .
+>.$
?< ?=(~ hat) :: XX whut?
(echo now %& *cart sim)
(echo now %& sim)
==
?~ dok ~& %no-dok +>.$
=+ ^- cat=(list (pair path cage))
=+ ^- cat=(list (trel path lobe cage))
%+ turn (gage-to-cages res)
|= [pax=cage cay=cage]
?. ?=(%path p.pax)
?. ?=(%path-hash p.pax)
~|(%patch-bad-path-mark !!)
[((hard path) q.q.pax) cay]
[-< -> +]:[((hard ,[path lobe]) q.q.pax) cay]
:: ~& %canned
:: ~& %checking-out
=. ank.dom (checkout-ankh:ze (mo cat))
=. +>.$ =>(wake ?>(?=(^ dok) .))
:: ~& %checked-out
:: ~& %waking
=. +>.$ =>(wake ?>(?=(^ dok) .))
:: ~& %waked
?~ hez +>.$(dok ~)
=+ mus=(must-ergo (turn sim head))
?: =(~ mus)
@ -855,7 +863,7 @@
%+ turn (~(tap by hat))
|= [a=path b=lobe]
^- (pair silk silk)
:- [%$ %path !>(a)]
:- [%$ %path-hash !>([a b])]
(lobe-to-silk:ze a b)
==
==
@ -921,23 +929,8 @@
^+ +>
(edit wen lem)
::
++ exem :: execute merge
|= [wen=@da him=@p sud=@tas gem=germ] :: aka direct change
!!
:: ?. (gte p.mer let.dom) !! :: no
:: =. +>.$ %= +>.$
:: hut.ran (~(uni by hut.r.mer) hut.ran)
:: lat.ran (~(uni by lat.r.mer) lat.ran)
:: let.dom p.mer
:: hit.dom (~(uni by q.mer) hit.dom)
:: ==
:: =+ ^= hed :: head commit
:: =< q
:: %- ~(got by hut.ran)
:: %- ~(got by hit.dom)
:: let.dom
:: (echa:wake:(checkout-ankh hed))
::
:: Be careful to call ++wake if/when necessary. Every case
:: must call it individually.
++ take-foreign-update :: external change
|= [inx=@ud rut=(unit rand)]
^+ +>
@ -952,7 +945,8 @@
==
?~ rut
=+ rav=`rave`q.u.ruv
%= +>+.$
=< ?>(?=(^ ref) .)
%_ wake
lim
?.(&(?=(%many -.rav) ?=(%da -.q.q.rav)) lim `@da`p.q.q.rav)
::
@ -984,7 +978,7 @@
%null [[%atom %n] ~]
%nako !>(~|([%harding [&1 &2 &3]:q.r.u.rut] ((hard nako) q.r.u.rut)))
==
?. ?=(%nako p.r.u.rut) +>+.$
?. ?=(%nako p.r.u.rut) [?>(?=(^ ref) .)]:wake
=+ rav=`rave`q.u.ruv
?> ?=(%many -.rav)
|- ^+ +>+.^$
@ -1009,7 +1003,8 @@
==
::
%y
%_ +>+.$
=< ?>(?=(^ ref) .)
%_ wake
haw.u.ref
%+ ~(put by haw.u.ref)
[p.p.u.rut q.p.u.rut q.u.rut]
@ -1017,7 +1012,7 @@
==
::
%z
~| %its-prolly-reasonable-to-request-ankh-over-the-network-sorry
~| %its-prolly-not-reasonable-to-request-ankh-over-the-network-sorry
!!
==
::
@ -1335,21 +1330,14 @@
(make-delta p.mys [(lobe-to-mark u.har) u.har] [p q.q]:q.mys)
:: XX check vase !evil
:: XX of course that's a problem, p.u.ber isn't in rang since it
:: was just cretated. We shouldn't be sending multiple
:: was just created. We shouldn't be sending multiple
:: diffs
%+ ~(put by bar) pax
(make-delta p.mys [(lobe-to-mark p.u.ber) p.u.ber] [p q.q]:q.mys)
:: XX check vase !evil
:: %+ ~(put by bar) pax
:: (make-delta p.mys [(lobe-to-mark p.u.ber) p.u.ber] [p q.q]:q.mys)
:: :: XX check vase !evil
~|([%two-diffs-for-same-file syd pax] !!)
==
::
++ as-arch
^- arch
:+ p.ank.dom
?~(q.ank.dom ~ [~ p.u.q.ank.dom])
|- ^- (map ,@ta ,~)
?~ r.ank.dom ~
[[p.n.r.ank.dom ~] $(r.ank.dom l.r.ank.dom) $(r.ank.dom r.r.ank.dom)]
::
++ case-to-aeon :: case-to-aeon:ze
|= lok=case :: act count through
^- (unit aeon)
@ -1372,35 +1360,19 @@
==
::
++ checkout-ankh
|= hat=(map path cage)
|= hat=(map path (pair lobe cage))
^- ankh
%- cosh
:: %- cosh
%+ roll (~(tap by hat) ~)
|= [[pat=path zar=cage] ank=ankh]
|= [[pat=path lob=lobe zar=cage] ank=ankh]
^- ankh
%- cosh
:: %- cosh
?~ pat
ank(q [~ (sham q.q.zar) zar])
=+ nak=(~(get by r.ank) i.pat)
ank(fil [~ lob zar])
=+ nak=(~(get by dir.ank) i.pat)
%= ank
r %+ ~(put by r.ank) i.pat
$(pat t.pat, ank (fall nak *ankh))
==
::
++ cosh
|= ank=ankh
%_ ank
p
^- cash
%+ mix ?~(q.ank 0 p.u.q.ank)
=+ axe=1
|- ^- cash
?~ r.ank *@
;: mix
(shaf %dash (mix axe (shaf %dush (mix p.n.r.ank p.q.n.r.ank))))
$(r.ank l.r.ank, axe (peg axe 2))
$(r.ank r.r.ank, axe (peg axe 3))
==
dir %+ ~(put by dir.ank) i.pat
$(pat t.pat, ank (fall nak *ankh))
==
::
++ edit :: edit:ze
@ -1442,20 +1414,12 @@
=(u.zat lob)
:: =((lobe-to-cage u.zat) (lobe-to-cage lob))
::
++ forge-nori :: forge-nori:ze
|= yak=yaki :: forge nori
^- nori
!!
:: ?~ p.yak !! :: no parent, no diff
:: :+ %& *cart :: diff w/ 1st parent
:: (~(tap by (diff-yakis (tako-to-yaki i.p.yak) yak)) ~)
::
++ forge-yaki :: forge-yaki:ze
|= [wen=@da par=(unit tako) lem=suba] :: forge yaki
=+ ^= per
?~ par ~
~[u.par]
=+ gar=(update-lat (apply-changes q.lem) lat.ran)
=+ gar=(update-lat (apply-changes lem) lat.ran)
:- (make-yaki per +.gar wen) :: from existing diff
-.gar :: fix lat
::
@ -1555,7 +1519,7 @@
=+ ^= yak
%- aeon-to-yaki
let.dom
?^(r.mun ~ [~ %w !>([t.yak (forge-nori yak)])])
?^(r.mun ~ !!) :: [~ %w !>([t.yak (forge-nori yak)])])
(query(ank.dom ank:(descend-path:(zu ank.dom) r.mun)) p.mun)
::
++ read-u
@ -1575,7 +1539,10 @@
?~ tak
~
?: &(?=(~ ref) =(yon let.dom))
`(bind q.ank:(descend-path:(zu ank.dom) pax) (corl (cury same %&) tail))
:- ~
%+ bind
fil.ank:(descend-path:(zu ank.dom) pax)
(corl (cury same %&) tail)
=+ yak=(tako-to-yaki u.tak)
=+ lob=(~(get by q.yak) pax)
?~ lob
@ -1647,6 +1614,15 @@
?: ?=(%x p.mun)
(read-x yon r.mun)
?: ?=(%y p.mun)
:: =- ~& :* %dude-someones-getting-curious
:: mun=mun
:: yon=yon
:: our=our
:: her=her
:: syd=syd
:: hep=-
:: ==
:: -
(bind (read-y yon r.mun) (curr bind (cury same %&)))
%+ bind
(rewind yon)
@ -1690,8 +1666,8 @@
++ descend :: descend
|= lol=@ta
^+ +>
=+ you=(~(get by r.ank) lol)
+>.$(ram [lol ram], ank ?~(you [*cash ~ ~] u.you))
=+ you=(~(get by dir.ank) lol)
+>.$(ram [lol ram], ank ?~(you [~ ~] u.you))
::
++ descend-path :: descend recursively
|= way=path
@ -1700,20 +1676,60 @@
--
::
++ me :: merge ali into bob
|= [ali=(pair ship desk) alh=(unit ankh)] :: from
|= [ali=(pair ship desk) alh=(unit ankh) new=?] :: from
=+ bob=`(pair ship desk)`[our syd] :: to
=+ dat=(fall (~(get by mer) ali) *mery) :: merge data
=+ ^- dat=(each mery term)
?~ mer
?: new
=+ *mery
`-(sor ali:+, hen hen:+, wat %null)
[%| %not-actually-merging]
?. new
?: =(ali sor.u.mer)
`u.mer
~& :* %already-merging-from-somewhere-else
ali=ali
sor=sor.u.mer
gem=gem.u.mer
wat=wat.u.mer
cas=cas.u.mer
hen=hen
henmer=hen.u.mer
==
[%| %already-merging-from-somewhere-else]
~& :* %already-merging-from-somewhere
ali=ali
sor=sor.u.mer
gem=gem.u.mer
wat=wat.u.mer
cas=cas.u.mer
hen=hen
henmer=hen.u.mer
==
[%| %already-merging-from-somewhere]
?: ?=(%| -.dat)
~|(p.dat !!)
=+ dat=p.dat
=| don=? :: keep going
|%
++ abet
^+ ..me
?: don
..me(mer (~(put by mer) ali dat))
..me(mer (~(del by mer) ali), reg :_(reg [hen %mere gon.dat]))
..me(mer `dat)
..me(mer ~, reg :_(reg [hen %mere gon.dat]))
::
++ route
|= [sat=term res=(each riot gage)]
^+ +>.$
?. =(sat wat.dat)
~| :* %hold-your-horses-merge-out-of-order
sat=sat
wat=wat.dat
ali=ali
bob=bob
hepres=-.res
==
!!
?+ +< ~|((crip <[%bad-stage sat ?~(-.res %riot %gage)]>) !!)
[%ali %& *] %.(p.res fetched-ali)
[%diff-ali %| *] %.(p.res diffed-ali)
@ -1725,14 +1741,12 @@
==
::
++ start
|= gem=germ
|= [cas=case gem=germ]
^+ +>
?: (~(has by mer) ali)
(error:he %already-merging ~)
?: &(=(0 let.dom) !?=(?(%init %that) gem))
(error:he %no-bob-desk ~)
=. cas.dat cas
=. gem.dat gem
=. cas.dat [%da now]
?: =(0 let.dom)
fetch-ali(gem.dat %init)
=+ (~(get by hit.dom) let.dom)
@ -1745,7 +1759,7 @@
::
++ fetch-ali
^+ .
=- %_(+ tag [- tag])
=- %_(+ tag [- tag], 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
@ -1774,7 +1788,7 @@
%init
?. =(let.dom 0)
(error:he %bad-init-merge ~)
:: skim hook/hoon files/
:: 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 %&))
@ -1831,6 +1845,8 @@
?(%meet %mate %meld)
?: =(r.ali.dat r.bob.dat)
done:he
?. (~(has by hut.ran) r.bob.dat)
(error:he %bad-bob-tako >r.bob.dat< ~)
?: (~(has in (reachable-takos r.bob.dat)) r.ali.dat)
done:he
?: (~(has in (reachable-takos r.ali.dat)) r.bob.dat)
@ -1950,7 +1966,7 @@
::
++ diff-ali
^+ .
(diff-bas %ali ali.dat ali bob.dat)
(diff-bas(wat.dat %diff-ali) %ali ali.dat ali bob.dat)
::
++ diffed-ali
|= res=gage
@ -1990,7 +2006,7 @@
::
++ diff-bob
^+ .
(diff-bas %bob bob.dat bob ali.dat)
(diff-bas(wat.dat %diff-bob) %bob bob.dat bob ali.dat)
::
++ diffed-bob
|= res=gage
@ -2033,7 +2049,7 @@
|- ^+ +.$
?+ gem.dat ~| [%merge-weird-gem gem.dat] !!
?(%mate %meld)
=- %_(+.$ tag [- tag])
=- %_(+.$ 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
@ -2067,7 +2083,7 @@
::
++ build
^+ .
=- %_(+ tag [- tag])
=- %_(+ 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
@ -2188,11 +2204,14 @@
::
++ checkout
^+ .
=- %_(+ tag [- tag])
=+ val=?:(?=(%init gem.dat) ali bob)
=- %_(+ tag [- tag], wat.dat %checkout)
=+ ^- 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 %checkout ~]
%f %exec p.bob ~ [p.val q.val cas.dat] %tabl
%f %exec p.bob ~ val %tabl
^- (list (pair silk silk))
%+ murn (~(tap by q.new.dat))
|= [pax=path lob=lobe]
@ -2215,7 +2234,10 @@
+>.$
=. let.dom +(let.dom)
=. hit.dom (~(put by hit.dom) let.dom r.new.dat)
=. ank.dat (checkout-ankh:ze (~(uni by bop.dat) p.can))
=. ank.dat
%- checkout-ankh:ze
%- ~(run by (~(uni by bop.dat) p.can))
|=(cage [(page-to-lobe p q.q) +<])
=. ank.dom ank.dat
=> .(..wake wake)
?~ hez done:he
@ -2225,7 +2247,7 @@
::
++ ergo
^+ .
=- %_(+ tag [- tag])
=- %_(+ tag [- tag], wat.dat %ergo)
=+ ^- sum=(set path)
=+ (must-ergo (turn (~(tap by erg.dat)) head))
=+ (turn (~(tap by -)) (corl tail tail))
@ -2293,7 +2315,7 @@
++ error
|= [err=term tan=(list tank)]
^+ ..he
..he(don |, gon.dat [%| err >ali< >bob< tan])
..he(don |, gon.dat [%| err >ali< >bob< >cas.dat< >gem.dat< tan])
::
++ find-merge-points
|= [p=yaki q=yaki] :: maybe need jet
@ -2324,7 +2346,7 @@
?> ?=(%& -<)
[%$ p.-]
?: =([~ lob] lal)
[%$ +:(need q.ank:(descend-path:(zu (need alh)) pax))]
[%$ +:(need fil.ank:(descend-path:(zu (need alh)) pax))]
=+ bol=(~(got by lat.ran) lob)
?- -.bol
%direct [%volt q.bol]
@ -2396,7 +2418,7 @@
=+ [bos=(sein p.q.hic) can=(clan p.q.hic)]
%- zing ^- (list (list move))
:~ ?: =(bos p.q.hic) ~
[hen %pass /init-merge %c %merg p.q.hic %base bos %kids %init]~
[hen %pass /init-merge %c %merg p.q.hic %base bos %kids da/now %init]~
::
~
==
@ -2428,7 +2450,7 @@
?: =(0 let.dom.u.dos)
=+ cos=(mode-to-soba ~ s.bem q.q.hic r.q.hic)
=+ ^- [one=(list ,[path miso]) two=(list ,[path miso])]
%+ skid q.cos
%+ skid cos
|= [a=path b=miso]
?& ?=(%ins -.b)
?=(%mime p.p.b)
@ -2436,8 +2458,8 @@
?| =([%hook ~] -)
=([%hoon ~] -)
== ==
:~ [hen %pass /one %c %info p.bem q.bem %& p.cos one]
[hen %pass /two %c %info p.bem q.bem %& p.cos two]
:~ [hen %pass /one %c %info p.bem q.bem %& one]
[hen %pass /two %c %info p.bem q.bem %& two]
==
=+ yak=(~(got by hut.ran.ruf) (~(got by hit.dom.u.dos) let.dom.u.dos))
=+ cos=(mode-to-soba q.yak (flop s.bem) q.q.hic r.q.hic)
@ -2448,7 +2470,7 @@
[~ ..^$]
=^ mos ruf
=+ den=((de now hen ruf) [. .]:p.q.hic q.q.hic)
abet:abet:(start:(me:ze:den [r.q.hic s.q.hic] ~) t.q.hic)
abet:abet:(start:(me:ze:den [r.q.hic s.q.hic] ~ &) t.q.hic u.q.hic)
[mos ..^$]
::
%mont
@ -2494,6 +2516,12 @@
%warp
=^ mos ruf
=+ den=((de now hen ruf) p.q.hic p.q.q.hic)
:: =- ~? ?=([~ %sing %w *] q.q.q.hic)
:: :* %someones-warping
:: rav=u.q.q.q.hic
:: mos=-<
:: ==
:: -
=< abet
?~ q.q.q.hic
ease:den
@ -2581,7 +2609,7 @@
ank.dom
=^ mos ruf
=+ den=((de now hen ruf) [. .]:our syd)
abet:abet:(route:(me:ze:den [her sud] kan) sat dat)
abet:abet:(route:(me:ze:den [her sud] kan |) sat dat)
[mos ..^$]
?: ?=([%blab care @ @ *] tea)
?> ?=(%made +<.q.hin)
@ -2737,7 +2765,6 @@
++ mode-to-soba
|= [hat=(map path lobe) pax=path all=? mod=mode]
^- soba
:- *cart
%+ welp
^- (list (pair path miso))
?. all

View File

@ -49,7 +49,7 @@
[%sith p=@p q=@uw r=?] ::
== ::
++ note-clay ::
$% [%merg p=@p q=@tas r=@p s=@tas t=germ] :: merge desks
$% [%merg p=@p q=@tas r=@p s=@tas t=case u=germ] :: merge desks
[%warp p=sock q=riff] :: wait for clay, hack
== ::
++ note-dill :: note to self, odd
@ -209,7 +209,7 @@
=+ myt=(flop (need tem))
=+ can=(clan our)
=. tem ~
=. moz :_(moz [hen %pass / %c %merg our %home our %base %init])
=. moz :_(moz [hen %pass / %c %merg our %home our %base da/now %init])
=. moz :_(moz [hen %pass ~ %g %conf [[our ram] %load our %home]])
=. +> ?: ?=(%czar can) +>
(sync %base (sein our) %kids)

View File

@ -152,10 +152,10 @@
%- ~(gas by *(map ,@ span))
=| rac=(list (pair ,@ span))
|- ^+ rac
?~ r.arc rac
=. rac $(r.arc l.r.arc, rac $(r.arc r.r.arc))
=+ gib=(wox p.n.r.arc)
?~(gib rac [[u.gib p.n.r.arc] rac])
?~ dir.arc rac
=. rac $(dir.arc l.dir.arc, rac $(dir.arc r.dir.arc))
=+ gib=(wox p.n.dir.arc)
?~(gib rac [[u.gib p.n.dir.arc] rac])
::
++ tack :: fold path to term
|= a=[i=term t=(list term)] ^- term
@ -326,7 +326,7 @@
:^ %pass
[(scot %p our) (scot %ud num) (scot %ud p.kig) ~]
%c
~& >> [%camping bem]
~& >> [%camping ren bem]
[%warp [our p.bem] q.bem [~ %sing ren r.bem (flop s.bem)]]
==
::
@ -924,7 +924,7 @@
%^ lash cof bem
|= [cof=cafe dir=span]
%+ cope (lend cof bem(s [dir s.bem]))
(flux |=(a=arch ?~(r.a ~ (some ~))))
(flux |=(a=arch ?~(dir.a ~ (some ~))))
::
++ marks
=< (cope (laze cof bem) (flux .))
@ -956,12 +956,12 @@
=. s.bem [for s.bem]
%+ cope (lend cof bem)
|= [cof=cafe arc=arch]
?^ q.arc (fine cof (some &))
?. (~(has by r.arc) %hook)
?^ fil.arc (fine cof (some &))
?. (~(has by dir.arc) %hook)
(flue cof)
%+ cope (lend cof bem(s [%hook s.bem]))
|= [cof=cafe arc=arch]
?~ q.arc
?~ fil.arc
(flue cof)
(fine cof (some |))
::
@ -1029,7 +1029,7 @@
++ lash :: filter at beam
|* [cof=cafe bem=beam fun=(burg span (unit))]
%+ cope (lend cof bem)
|=([cof=cafe arc=arch] ((some-in-map fun) cof r.arc))
|=([cof=cafe arc=arch] ((some-in-map fun) cof dir.arc))
::
++ lear :: load core
|= [cof=cafe bem=beam] ^- (bolt vase)
@ -1096,7 +1096,7 @@
++ wide
%+ cope (lend cof here)
|= [cof=cafe arc=arch]
=+ all=(skim (turn (~(tap by r.arc)) head) (sane %tas))
=+ all=(skim (turn (~(tap by dir.arc)) head) (sane %tas))
=. all (sort all gth) :: short-deepest
|- ^- (bolt (map mark vase))
?~ all (fine cof res)
@ -1104,7 +1104,7 @@
|= [cof=cafe res=(map mark vase)]
=. ^res res
=- (cope - (tall i.all))
?. (~(has by r.arc) %hoon) (flue cof)
?. (~(has by dir.arc) %hoon) (flue cof)
node(cof cof)
::
++ tall
@ -1697,7 +1697,7 @@
%+ cool |.(leaf/"ford: wilt {<[(tope p.hop)]>}")
%+ cope (lend cof p.hop)
|= [cof=cafe arc=arch]
?: (~(has by r.arc) %hoon)
?: (~(has by dir.arc) %hoon)
%+ cope (fade cof %hoon p.hop)
|= [cof=cafe hyd=hood]
%+ cope (apex(boy ~) cof hyd)

View File

@ -10193,7 +10193,7 @@
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
~% %arvo + ~
|%
++ arch ,[p=@uvI q=(unit ,@uvI) r=(map ,@ta ,~)] :: fundamental node
++ arch ,[hax=@uvI fil=(unit ,@uvI) dir=(map ,@ta ,~)]:: fundamental node
++ arvo (mold ,[p=term q=mill] mill) :: arvo card
++ beam ,[[p=ship q=desk r=case] s=path] :: global name
++ beak ,[p=ship q=desk r=case] :: garnish with beak

View File

@ -1028,26 +1028,26 @@
|= [pax=path val=cage]
^- miso
=+ dir=((hard arch) .^(%cy pax))
?~ q.dir [%ins val]
?~ fil.dir [%ins val]
[%mut val]
::
++ file :: simple file load
|= pax=path
^- (unit)
=+ dir=((hard arch) .^(%cy pax))
?~(q.dir ~ [~ .^(%cx pax)])
?~(fil.dir ~ [~ .^(%cx pax)])
::
++ foal :: high-level write
|= [pax=path val=cage]
^- toro
?> ?=([* * * *] pax)
[i.t.pax [%& [*cart [[t.t.t.pax (feel pax val)] ~]]]]
[i.t.pax [%& [[[t.t.t.pax (feel pax val)] ~]]]]
::
++ fray :: high-level delete
|= pax=path
^- toro
?> ?=([* * * *] pax)
[i.t.pax [%& [*cart [[t.t.t.pax [%del ~]] ~]]]]
[i.t.pax [%& [[[t.t.t.pax [%del ~]] ~]]]]
::
++ furl :: unify changes
|= [one=toro two=toro]
@ -1056,7 +1056,7 @@
?> ?& =(p.one p.two) :: same path
&(?=(& -.q.one) ?=(& -.q.two)) :: both deltas
==
[p.one [%& [*cart (weld q.p.q.one q.p.q.two)]]]
[p.one [%& (weld p.q.one p.q.two)]]
::
++ tame :: parse kite path
|= hap=path
@ -1811,9 +1811,8 @@
++ aeon ,@ud ::
++ agon (map ,[p=ship q=desk] ,[p=@ud q=@ud r=waks]) :: mergepts
++ ankh :: fs node (new)
$: p=cash :: recursive hash
q=(unit ,[p=cash q=cage]) :: file
r=(map ,@ta ankh) :: folders
$: fil=(unit ,[p=lobe q=cage]) :: file
dir=(map ,@ta ankh) :: folders
== ::
++ apex ,[p=@uvI q=(map ,@ta ,@uvI) r=(map ,@ta ,~)] :: node report (old)
++ ares (unit ,[p=term q=(list tank)]) :: possible error
@ -1872,14 +1871,12 @@
$? %good :: delivered
%dead :: rejected
== ::
++ cart ,[p=cash q=cash] :: hash change
++ care ?(%u %v %w %x %y %z) :: clay submode
++ case :: ship desk case spur
$% [%da p=@da] :: date
[%tas p=@tas] :: label
[%ud p=@ud] :: number
== ::
++ cash ,@uvH :: ankh hash
++ chum ,@uvI :: hashed passcode
++ clot :: symmetric record
$: yed=(unit ,[p=hand q=code]) :: outbound
@ -2260,11 +2257,11 @@
lys=@da :: last sent
pac=rock :: packet data
== ::
++ soba ,[p=cart q=(list ,[p=path q=miso])] :: delta
++ soba (list ,[p=path q=miso]) :: delta
++ sock ,[p=ship q=ship] :: outgoing [from to]
++ spur path :: ship desk case spur
++ step ,[p=bray q=gens r=pass] :: identity stage
++ suba ,[p=cart q=(list ,[p=path q=misu])] :: delta
++ suba (list ,[p=path q=misu]) :: delta
++ tako ,@ :: yaki ref
++ tick ,@ud :: process id
++ toro ,[p=@ta q=nori] :: general change
@ -2358,7 +2355,7 @@
[%info p=@p q=@tas r=nori] :: internal edit
[%init p=@p] :: report install
[%into p=@tas q=? r=mode] :: external edit
[%merg p=@p q=@tas r=@p s=@tas t=germ] :: merge desks
[%merg p=@p q=@tas r=@p s=@tas t=case u=germ] :: merge desks
[%mont p=@tas q=@p r=@tas s=path] :: mount to unix
[%ogre p=$|(@tas beam)] :: delete mount point
[%warp p=sock q=riff] :: file request

View File

@ -13,18 +13,18 @@
|= pax=path
^- tang
=+ ark=;;(arch .^(%cy pax))
?^ q.ark
?^ fil.ark
?: =(%sched -:(flop pax))
[>;;((map ,@da cord) .^(%cx pax))<]~
[leaf/(spud pax) (pretty-file .^(%cx pax))]
?- r.ark :: handle ambiguity
?- dir.ark :: handle ambiguity
~
[rose/[" " `~]^~[leaf/"~" (smyt pax)]]~
[[@t ~] ~ ~]
$(pax (welp pax /[p.n.r.ark]))
$(pax (welp pax /[p.n.dir.ark]))
*
=- [palm/[": " ``~]^-]~
:~ rose/[" " `~]^~[leaf/"*" (smyt pax)]
`tank`(subdir pax r.ark)
`tank`(subdir pax dir.ark)
==
==

View File

@ -8,4 +8,4 @@
::
|= [^ [arg=path ~] ~]
=+ lon=((hard arch) .^(%cy arg))
tang/[?~(r.lon leaf/"~" (subdir arg r.lon))]~
tang/[?~(dir.lon leaf/"~" (subdir arg dir.lon))]~

View File

@ -10,11 +10,11 @@
(turn paf |=(a=span leaf/(trip a)))
|- ^- [dir=? paf=path]
=+ arf=;;(arch .^(%cy (weld pax paf)))
?^ q.arf
?^ fil.arf
[| paf]
?~ r.arf
?~ dir.arf
[& paf] :: !!
?. ?=([^ ~ ~] r.arf)
?. ?=([^ ~ ~] dir.arf)
[& paf]
$(paf (welp paf /[p.n.r.arf]))
$(paf (welp paf /[p.n.dir.arf]))
--

View File

@ -102,7 +102,7 @@
%+ turn all
=+ top=`path`/(scot %p our)/[syd]/(scot %da now)/arvo
=+ ark=(arch .^(%cy top))
=+ van=(~(tap by r.ark))
=+ van=(~(tap by dir.ark))
|= nam=@tas
=. nam
?. =(1 (met 3 nam))

View File

@ -57,7 +57,7 @@
[%info wire @p @tas nori] ::
[%mont wire @tas @p @tas path] ::
[%ogre wire $|(@tas beam)] ::
[%merg wire @p @tas @p @tas germ] ::
[%merg wire @p @tas @p @tas case germ] ::
[%poke wire dock pear] ::
[%warp wire sock riff] ::
== ::
@ -228,7 +228,7 @@
%- blab :_ ~
:* ost %merg
/kiln/sync/[syd]/(scot %p her)/[sud]
our syd her sud
our syd her sud ud/let
?: =(0 .^(%cw /(scot %p our)/[syd]/(scot %da now)))
%init
%mate
@ -317,7 +317,7 @@
::
++ perform ::
^+ .
(blab [ost %merg /kiln/[syd] our syd her sud gem] ~)
(blab [ost %merg /kiln/[syd] our syd her sud cas gem] ~)
::
++ fancy-merge :: send to self
|= [syd=desk her=@p sud=desk gem=?(%auto germ)]
@ -344,7 +344,7 @@
?~ saw
=> (spam leaf/"%melding %{(trip sud)} into scratch space" ~)
%- blab :_ ~
[ost %merg /kiln/[syd] our (cat 3 syd '-scratch') her sud gem]
[ost %merg /kiln/[syd] our (cat 3 syd '-scratch') her sud cas gem]
=+ :- "failed to set up conflict resolution scratch space"
"I'm out of ideas"
lose:(spam leaf/-< leaf/-> u.saw)
@ -475,9 +475,8 @@
=< win
%- blab:(spam tan)
:_ ~
:* ost %info /kiln/[syd]
our (cat 3 syd '-scratch')
%& *cart
:* ost %info /kiln/[syd] our
(cat 3 syd '-scratch') %&
%+ murn can
|= [p=path q=(unit miso)]
`(unit (pair path miso))`?~(q ~ `[p u.q])

View File

@ -7,10 +7,11 @@
++ grow |% ++ wall (turn wain trip)
++ wain (lore cord)
++ json (need (poja cord))
++ cord
++ cord q:octs
++ octs
~| hit
?> =(2 (div p.hit 100))
q:(need r.hit)
(need r.hit)
--
++ grab :: convert from
|%

10
mar/log.hoon Normal file
View File

@ -0,0 +1,10 @@
::
:::: /hoon/core/log/mar
::
!:
|_ man=span
++ grab
|% :: convert from
++ noun span :: clam from %noun
--
--

178
mar/talk/telegrams.hoon Normal file
View File

@ -0,0 +1,178 @@
::
:::: /hoon/talk-telegrams/mar
::
/? 314
/- talk
!:
=+ talk
|_ gam=(list telegram)
::
++ grab
|%
++ noun (list telegram)
++ mime |=(^mime (json (rash q.q apex:poja)))
++ json
=> [jo ..telegram]
|= a=json ^- (list telegram)
=- (need ((ar (ot ship/(su fed:ag) thought/thot ~)) a))
|%
++ op :: parse keys of map
|* [fel=_rule wit=fist]
%+ cu mo
%- ci :_ (om wit)
|= a=(map cord ,_(need *wit))
^- (unit (list ,_[(wonk *fel) (need *wit)]))
(zl (turn (~(tap by a)) (head-rush fel)))
::
++ as :: array as set
:: |*(a=fist (cu sa (ar a))) :: XX types
|* a=fist
%- 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))
::
++ head-rush
|* a=_rule
|* [b=cord c=*]
=+ nit=(rush b a)
?~ nit ~
(some [u.nit c])
::
::
++ thot
^- $+(json (unit thought))
%- ot :~
serial/(ci (slat %uv) so)
audience/audi
statement/stam
==
::
++ audi (op parn memb) :: audience
++ auri (op parn (ci (soft presence) so))
++ memb (ot envelope/lope delivery/(ci (soft delivery) so) ~)
++ lope (ot visible/bo sender/(mu (su parn)) ~)
::
++ parn
^- $+(nail (like partner))
%+ peach
;~((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) ~)
==
--
--
::
++ grow
|%
++ mime [/text/json (taco (crip (pojo json)))]
++ json
=> +
|^
:- %a
%+ turn gam
|= telegram
(jobe ship/(jope p) thought/(thot q) ~)
::
++ jove
|= [a=envelope b=delivery]
%- jobe :~
envelope/(jobe visible/[%b p.a] sender/?~(q.a ~ s/(parn u.q.a)) ~)
delivery/[%s b]
==
::
++ jope |=(a=ship (jape +:<a>)) ::[%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]
|= c=(map ,_+<.a ,_+<.b)
(jobe (turn (~(tap by c)) (both a b)))
::
++ both :: cons two gates
|* [a=_,* b=_,*]
|=(c=_[+<.a +<.b] [(a -.c) (b +.c)])
::
++ thot
|= thought
(jobe serial/(jape <p>) audience/(audi q) statement/(stam r) ~)
::
++ audi (jome parn jove)
++ bouq
|= a=bouquet
a/(turn (~(tap in a)) |=(b=path a/(turn b |=(c=span s/c))))
::
++ parn
|= a=partner ^- cord
?- -.a
%& (stat p.a)
%| %- crip
?- -.p.a
%twitter "{(trip -.p.a)}/{(trip p.p.a)}"
==
==
::
++ stat
|= a=station ^- cord
(crip "{<p.a>}/{(trip q.a)}")
::
++ stam
|= statement
(jobe date/(jode p) bouquet/(bouq q) speech/(spec r) ~)
::
++ spec
|= a=speech
%+ 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 <p.a>))
%app (jobe txt/[%s q.a] src/[%s p.a] ~)
%fat (jobe tor/(tors p.a) taf/$(a q.a) ~)
:: %inv (jobe ship/(jope p.a) party/[%s q.a] ~)
==
::
++ tors
|= a=torso
%+ joba -.a
?- -.a
%text [%s (role +.a)]
%tank [%a (turn +.a joke)]
%name (jobe nom/s/p.a mon/$(a q.a) ~)
==
::
--
--
::
++ grad
|%
++ form %talk-telegrams
++ diff |=((list telegram) +<)
++ pact |=((list telegram) +<)
++ join |=([(list telegram) (list telegram)] `(unit mime)`~)
--
--

View File

@ -36,7 +36,7 @@ Message = recl
speech = @props.thought.statement.speech
attachments = []
while speech.fat?
attachments.push pre {}, speech.fat.fat.tank.join("\n")
attachments.push pre {}, speech.fat.tor.tank.join("\n")
speech = speech.fat.taf # XX
if !speech? then return;
if speech.lin?.say is false then klass += " say"

View File

@ -268,7 +268,7 @@ Message = recl({
speech = this.props.thought.statement.speech;
attachments = [];
while (speech.fat != null) {
attachments.push(pre({}, speech.fat.fat.tank.join("\n")));
attachments.push(pre({}, speech.fat.tor.tank.join("\n")));
speech = speech.fat.taf;
}
if (speech == null) {
@ -700,7 +700,7 @@ var Member, MessageActions, MessageStore, StationActions, StationStore, br, div,
recl = React.createClass;
ref = [React.DOM.div, React.DOM.br, React.DOM.input, React.DOM.textarea], div = ref[0], br = ref[1], input = ref[2], textarea = ref[3];
ref = React.DOM, div = ref.div, br = ref.br, input = ref.input, textarea = ref.textarea;
MessageActions = require('../actions/MessageActions.coffee');