Merge branch 'nobreach' into moretalk

This commit is contained in:
Anton Dyudin 2015-09-29 12:31:29 -07:00
commit 9dd386d4b2
31 changed files with 1871 additions and 745 deletions

View File

@ -10,7 +10,7 @@
!: :: :: !: :: ::
=> |% :: external structures => |% :: external structures
++ house :: all state ++ house :: all state
$: %2 $: %3
hoc=(map bone session) :: conversations hoc=(map bone session) :: conversations
== :: == ::
++ session :: per conversation ++ session :: per conversation
@ -23,14 +23,17 @@
buf=tape :: multiline buffer buf=tape :: multiline buffer
== :: == ::
++ dojo-command :: ++ dojo-command ::
$% [%flat p=path q=dojo-source] :: noun to unix atom $& (pair dojo-sink dojo-source) :: route value
[%pill p=path q=dojo-source] :: noun to unix pill [%brev p=term] :: unbind variable
:: [%tree p=path q=dojo-source] :: noun to unix tree ++ dojo-sink ::
[%file p=beam q=dojo-source] :: save to clay $% [%flat p=path] :: atom to unix
[%http p=?(%post %put) q=purl r=dojo-source] :: http outbound [%pill p=path] :: noun to unix pill
[%poke p=goal q=dojo-source] :: make and poke :: [%tree p=path] :: noun to unix tree
[%show p=dojo-source] :: print [%file p=beam] :: save to clay
[%verb p=term q=(unit dojo-source)] :: store variable [%http p=?(%post %put) q=purl] :: http outbound
[%poke p=goal] :: poke app
[%show p=?(0 1 2 3)] :: print val/type/twig
[%verb p=term] :: store variable
== :: == ::
++ dojo-source :: construction node ++ dojo-source :: construction node
$: p=@ud :: assembly index $: p=@ud :: assembly index
@ -104,26 +107,30 @@
++ dp :: dojo parser ++ dp :: dojo parser
|% |%
++ dp-default-app %hood ++ dp-default-app %hood
++ dp-specify ++ dp-message :: %poke
|= [gol=goal mod=dojo-model] |= [gol=goal mod=dojo-model] ^- dojo-command
^- (pair goal dojo-source) [[%poke gol] [0 [%ge mod(q.p [q.gol q.p.mod])]]]
[gol [0 [%ge mod(q.p [q.gol q.p.mod])]]]
:: ::
++ dp-command-line ;~(sfix dp-command (just '\0a')) ++ dp-command-line ;~(sfix dp-command (just '\0a'))
++ dp-variable :: %verb or %brev
|* [sym=_rule src=_rule]
%- cook :_ ;~(plug sym (punt src))
|= [a=term b=(unit dojo-source)] ^- dojo-command
?~(b [%brev a] [[%verb a] u.b])
::
++ dp-command :: ++dojo-command ++ dp-command :: ++dojo-command
%+ knee *dojo-command |. ~+ %+ knee *dojo-command |. ~+
;~ pose ;~ pose
;~ plug (cold %poke bar) ;~ pfix bar
%+ cook dp-specify %+ cook dp-message
(stag [our.hid dp-default-app] dp-model) (stag [our.hid dp-default-app] dp-model)
== ==
:: ::
;~ plug (cold %poke col) ;~ pfix col
%+ cook %+ cook
|= [a=goal b=$&(dojo-model dojo-source)] |= [a=goal b=$&(dojo-model dojo-source)]
^- (pair goal dojo-source) ?@ -.b [[%poke a] b]
?@ -.b [a b] (dp-message a b)
(dp-specify a b)
;~ plug ;~ plug
dp-goal dp-goal
;~ pose ;~ pose
@ -133,21 +140,26 @@
== ==
== ==
:: ::
;~(plug (cold %file tar) dp-beam ;~(pfix ace dp-source)) ;~(pfix tis (dp-variable sym ;~(pfix ace dp-source)))
;~(plug (cold %flat pat) (most fas sym) ;~(pfix ace dp-source)) ;~ pfix fas
;~(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)
;~ pose ;~ pose
;~(plug (cold %arc hep) (punt ;~(pfix gap dp-hooves))) (dp-variable (cold %arc hep) ;~(pfix gap dp-hooves))
;~(plug (cold %lib lus) (punt ;~(pfix gap dp-hooves))) (dp-variable (cold %lib lus) ;~(pfix gap dp-hooves))
(stag %dir :(stag ~ 0 %ex %clsg dp-poor)) :(stag [%verb %dir] 0 %ex %clsg dp-poor)
== ==
== ==
:: ::
(stag %show dp-source) ;~((glue ace) dp-sink dp-source)
(stag [%show %0] dp-source)
==
++ dp-sink
;~ pose
;~(plug (cold %file tar) dp-beam)
;~(plug (cold %flat pat) (most fas sym))
;~(plug (cold %pill dot) (most fas sym))
;~(plug (cold %http lus) (easy %post) auri:epur)
;~(plug (cold %http hep) (easy %put) auri:epur)
(stag %show (cook ?(1 2 3) (cook lent (stun [1 3] wut))))
== ==
++ dp-hooves :: hoof list ++ dp-hooves :: hoof list
:(stag 0 %ex %clsg (cook |=(a=tusk a) (most ;~(plug com gaw) dp-hoof))) :(stag 0 %ex %clsg (cook |=(a=tusk a) (most ;~(plug com gaw) dp-hoof)))
@ -196,17 +208,17 @@
== ==
++ dp-beam :: ++beam ++ dp-beam :: ++beam
%+ cook |=(a=path =+((tome a) ?^(- u [he-beak (flop a)]))) %+ cook |=(a=path =+((tome a) ?^(- u [he-beak (flop a)])))
=+ vez=(vang & dp-path) =+ vez=(vang | dp-path)
(sear plex:vez (stag %clsg poor:vez)) (sear plex:vez (stag %clsg poor:vez))
:: ::
++ dp-model ;~(plug dp-server dp-config) :: ++dojo-model ++ dp-model ;~(plug dp-server dp-config) :: ++dojo-model
++ dp-path (tope he-beam) :: ++path ++ dp-path (tope he-beam) :: ++path
++ dp-server (stag 0 (most fas sym)) :: ++dojo-server ++ dp-server (stag 0 (most fas sym)) :: ++dojo-server
++ dp-twig tall:(vang & dp-path) :: ++twig ++ dp-twig tall:(vang | dp-path) :: ++twig
++ dp-poor poor:(vang & (tope dir)) :: (list ++twig) ++ dp-poor poor:(vang | (tope dir)) :: (list ++twig)
++ dp-value :: ++dojo-source ++ dp-value :: ++dojo-source
;~ pose ;~ pose
(stag %tu (ifix [kel ker] (most ace dp-source))) (stag %tu (ifix [sel ser] (most ace dp-source)))
(stag %ex dp-twig) (stag %ex dp-twig)
== ==
:: ::
@ -262,25 +274,11 @@
++ dy-init-command :: ++dojo-command ++ dy-init-command :: ++dojo-command
|= mad=dojo-command |= mad=dojo-command
^+ [mad +>] ^+ [mad +>]
?- -.mad ?@ -.mad [mad +>.$]
%file =^(src +>.$ (dy-init-source q.mad) [mad(q src) +>.$]) =. q.mad
%flat =^(src +>.$ (dy-init-source q.mad) [mad(q src) +>.$]) ?+(-.p.mad q.mad %http [0 %as %mime q.mad])
%pill =^(src +>.$ (dy-init-source q.mad) [mad(q src) +>.$]) =^ src +>.$ (dy-init-source q.mad)
%poke =^(src +>.$ (dy-init-source q.mad) [mad(q src) +>.$]) [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 %as %mime r.mad]
=^ src +>.$ (dy-init-source r.mad)
[mad(r src) +>.$]
==
::
++ dy-init-source-unit :: (unit dojo-source)
|= urc=(unit dojo-source)
^+ [urc +>]
?~ urc [~ +>]
=^ src +> (dy-init-source u.urc)
[`src +>.$]
:: ::
++ dy-init-source :: ++dojo-source ++ dy-init-source :: ++dojo-source
|= src=dojo-source |= src=dojo-source
@ -291,6 +289,13 @@
== ==
[src +>.$(num +(num), job (~(put by job) src))] [src +>.$(num +(num), job (~(put by job) src))]
:: ::
++ dy-init-source-unit :: (unit dojo-source)
|= urc=(unit dojo-source)
^+ [urc +>]
?~ urc [~ +>]
=^ src +> (dy-init-source u.urc)
[`src +>.$]
::
++ dy-init-build :: ++dojo-build ++ dy-init-build :: ++dojo-build
|= bul=dojo-build |= bul=dojo-build
^+ [bul +>] ^+ [bul +>]
@ -390,49 +395,24 @@
:: ::
++ dy-over :: finish construction ++ dy-over :: finish construction
^+ +> ^+ +>
?- -.mad ?: ?=([%show 3] -.mad)
%poke (dy-rash %tan (dy-show-source q.mad) ~) :: XX separate command
%- he-card(poy ~) ?: ?=(%brev -.mad)
:* %deal =. var (~(del by var) p.mad)
/poke
[our.hid p.p.mad]
q.p.mad
%poke
(~(got by rez) p.q.mad)
==
::
%file
%- he-card(poy ~) :*
%info
/file
our.hid
(foal (tope p.mad) (~(got by rez) p.q.mad))
==
::
%flat
=+ out=q.q:(~(got by rez) p.q.mad)
?^ out
(dy-rash %tan [%leaf "not an atom"]~)
(dy-rash %sav p.mad out)
::
%pill
(dy-rash %sag p.mad q.q:(~(got by rez) p.q.mad))
::
%verb
?~ 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 =< dy-amok
?+ p.mad . ?+ p.mad .
?(%eny %now %our) !!
%lib .(lib ~)
%arc .(arc ~)
%dir .(dir [[our.hid %home ud/0] /])
==
=+ cay=(~(got by rez) p.q.mad)
?- -.p.mad
%verb
=. var (~(put by var) p.p.mad cay)
~| bad-set/[p.p.mad p.q.cay]
=< dy-amok
?+ p.p.mad .
%eny ~|(%entropy-is-eternal !!) %eny ~|(%entropy-is-eternal !!)
%now ~|(%time-is-immutable !!) %now ~|(%time-is-immutable !!)
%our ~|(%self-is-immutable !!) %our ~|(%self-is-immutable !!)
@ -442,21 +422,53 @@
=- +(..dy (he-diff %tan - ~)) =- +(..dy (he-diff %tan - ~))
rose/[" " `~]^~[leaf/"=%" (smyt (tope he-beak s.dir))] rose/[" " `~]^~[leaf/"=%" (smyt (tope he-beak s.dir))]
== ==
::
%poke
%- he-card(poy ~)
:* %deal
/poke
[our.hid p.p.p.mad]
q.p.p.mad
%poke
cay
==
::
%file
%- he-card(poy ~) :*
%info
/file
our.hid
(foal (tope p.p.mad) cay)
==
::
%flat
?^ q.q.cay
(dy-rash %tan [%leaf "not an atom"]~)
(dy-rash %sav p.p.mad q.q.cay)
::
%pill
(dy-rash %sag p.p.mad q.q.cay)
:: ::
%http %http
=+ cay=(~(got by rez) p.r.mad)
?> ?=(%mime p.cay) ?> ?=(%mime p.cay)
=+ mim=;;(mime q.q.cay) =+ mim=;;(mime q.q.cay)
=+ maf=(~(add ja *math) content-type/(moon p.mim)) =+ maf=(~(add ja *math) content-type/(moon p.mim))
(dy-eyre /show [q.mad p.mad maf ~ q.mim]) (dy-eyre /show [q.p.mad p.p.mad maf ~ q.mim])
:: ::
%show %show
(dy-show (~(got by rez) p.p.mad)) %+ dy-print cay
?- p.p.mad
0 ~
1 ~[[%rose [~ " " ~] (skol p.q.cay) ~] [%rose [~ " " ~] >p.cay< ~]]
2 [%rose [~ " " ~] (dy-show-type-noun p.q.cay) ~]~
==
== ==
:: ::
++ dy-show ++ dy-show |=(cay=cage (dy-print cay ~))
|= cay=cage ++ dy-print
|= [cay=cage tan=tang]
%+ dy-rash %tan %+ dy-rash %tan
%- welp :_ tan
?+ p.cay [(sell q.cay)]~ ?+ p.cay [(sell q.cay)]~
%tang ;;(tang q.q.cay) %tang ;;(tang q.q.cay)
%httr %httr
@ -468,6 +480,53 @@
(turn `wain`?~(r.hit ~ (lore q.u.r.hit)) trip) (turn `wain`?~(r.hit ~ (lore q.u.r.hit)) trip)
== ==
:: ::
++ dy-show-type-noun
|= a=type ^- tank
=- >[-]<
|- ^- $? $% [%atom @tas]
[%cell _$ _$]
[%cube * _$]
[%face @tas _$]
[%fork _$ _$]
[%hold (list ,[_$ twig])]
==
wain :: "<|core|>"
?(%noun %void)
==
?+ a a
[?(%cube %face) ^] a(q $(a q.a))
[?(%cell %fork) ^] a(p $(a p.a), q $(a q.a))
[%bull ^] $(a q.a)
[%core ^] `wain`/core
[%hold *] a(p (turn p.a |=([b=type c=twig] [^$(a b) c])))
==
::
++ dy-show-source
|= a=dojo-source ^- tank
=- >[-]<
=+ `[@ bil=dojo-build]`a
|- ^- $& [_$ _$]
$? twig
$% [%ur purl]
[%dv path]
[%as mark _$]
[%do twig _$]
[%ge path (list ,_$) (map term (unit ,_$))]
==
==
?- -.bil
?(%ur %dv) bil
%ex p.bil
%tu ?~ p.bil !!
|-
?~ t.p.bil ^$(bil q.i.p.bil)
[^$(bil q.i.p.bil) $(p.bil t.p.bil)]
%as bil(q $(bil q.q.bil))
%do bil(q $(bil q.q.bil))
%ge :+ %ge q.p.p.bil
[(turn p.q.p.bil ..$) (~(run by q.q.p.bil) (lift ..$))]
==
::
++ dy-edit :: handle edit ++ dy-edit :: handle edit
|= cal=sole-change |= cal=sole-change
^+ +>+> ^+ +>+>
@ -643,6 +702,8 @@
|= nex=@ud |= nex=@ud
^+ +>+> ^+ +>+>
?> ?=(~ cud) ?> ?=(~ cud)
?: ?=([%show 3] -.mad)
dy-over
?: =(nex num) ?: =(nex num)
dy-over dy-over
dy-make(cud `[nex (~(got by job) nex)]) dy-make(cud `[nex (~(got by job) nex)])
@ -836,12 +897,17 @@
=+ session-1==+(*session ,_-(poy *(unit))) =+ session-1==+(*session ,_-(poy *(unit)))
=+ session-0==+(*session-1 ,[_say syd=desk * _|2.-]) =+ session-0==+(*session-1 ,[_say syd=desk * _|2.-])
:: ,_`..prep :: ,_`..prep
=+ hoze=$%([%0 p=(map bone session-0)] [%1 p=(map bone session-1)]) =+ ^= hoze
$% [%0 p=(map bone session-0)]
[%1 p=(map bone session-1)]
[%2 p=(map bone session-1)]
==
|= old=(unit ?(house hoze)) ^+ [~ ..prep] |= old=(unit ?(house hoze)) ^+ [~ ..prep]
?~ old `..prep ?~ old `..prep
?- -.u.old ?- -.u.old
%2 `..prep(+<+ u.old) %3 `..prep(+<+ u.old)
%1 `..prep(+<+ [%2 (~(run by p.u.old) |=(session-1 +<(poy ~)))]) %2 `..prep(+<+ [%3 (~(run by p.u.old) |=(session-1 +<(poy ~)))])
%1 `..prep(+<+ [%3 (~(run by p.u.old) |=(session-1 +<(poy ~)))])
%0 =< ^$(u.old [%1 (~(run by p.u.old) .)]) %0 =< ^$(u.old [%1 (~(run by p.u.old) .)])
|= sos=session-0 ^- session-1 |= sos=session-0 ^- session-1
[-.sos [[our.hid syd.sos ud/0] /] |3.sos] [-.sos [[our.hid syd.sos ud/0] /] |3.sos]

View File

@ -56,6 +56,11 @@
~? ?=(^ saw) [%kiln-spam-lame u.saw] ~? ?=(^ 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-drum-phat (wrap take-coup-phat):from-drum
++ coup-helm-hi (wrap coup-hi):from-helm ++ coup-helm-hi (wrap coup-hi):from-helm
++ diff-sole-effect-drum-phat (wrap diff-sole-effect-phat):from-drum ++ diff-sole-effect-drum-phat (wrap diff-sole-effect-phat):from-drum
@ -72,41 +77,45 @@
++ from-helm (from-lib %helm [..$ ,_abet]:(helm)) ++ from-helm (from-lib %helm [..$ ,_abet]:(helm))
++ from-kiln (from-lib %kiln [..$ ,_abet]:(kiln)) ++ from-kiln (from-lib %kiln [..$ ,_abet]:(kiln))
:: ::
++ init-helm |=([way=wire *] [~ +>]) ++ init-helm |=([way=wire *] [~ +>])
++ made-kiln (wrap take-made):from-kiln ++ made-kiln (wrap take-made):from-kiln
++ mere-kiln (wrap take-mere):from-kiln ++ mere-kiln (wrap take-mere):from-kiln
++ mere-kiln-sync (wrap take-mere-sync):from-kiln ++ mere-kiln-sync (wrap take-mere-sync):from-kiln
++ note-helm (wrap take-note):from-helm ++ note-helm (wrap take-note):from-helm
++ onto-drum (wrap take-onto):from-drum ++ onto-drum (wrap take-onto):from-drum
++ peer-drum (wrap peer):from-drum ++ peer-drum (wrap peer):from-drum
++ poke-dill-belt (wrap poke-dill-belt):from-drum ++ poke-dill-belt (wrap poke-dill-belt):from-drum
++ poke-drum-link (wrap poke-link):from-drum ++ poke-drum-link (wrap poke-link):from-drum
::++ poke-drum-exit (wrap poke-exit):from-drum ::++ poke-drum-exit (wrap poke-exit):from-drum
++ poke-drum-start (wrap poke-start):from-drum ++ poke-drum-start (wrap poke-start):from-drum
++ poke-helm-hi (wrap poke-hi):from-helm ++ poke-helm-hi (wrap poke-hi):from-helm
++ poke-helm-init (wrap poke-init):from-helm ++ poke-helm-init (wrap poke-init):from-helm
++ poke-helm-invite (wrap poke-invite):from-helm ++ poke-helm-invite (wrap poke-invite):from-helm
++ poke-helm-mass (wrap poke-mass):from-helm ++ poke-helm-mass (wrap poke-mass):from-helm
++ poke-helm-reload (wrap poke-reload):from-helm ++ poke-helm-reload (wrap poke-reload):from-helm
++ poke-helm-reload-desk (wrap poke-reload-desk):from-helm ++ poke-helm-reload-desk (wrap poke-reload-desk):from-helm
++ poke-helm-reset (wrap poke-reset):from-helm ++ poke-helm-reset (wrap poke-reset):from-helm
++ poke-helm-send-hi (wrap poke-send-hi):from-helm ++ poke-helm-send-hi (wrap poke-send-hi):from-helm
++ poke-helm-verb (wrap poke-verb):from-helm ++ poke-helm-verb (wrap poke-verb):from-helm
++ poke-helm-begin (wrap poke-begin):from-helm ++ poke-helm-begin (wrap poke-begin):from-helm
++ poke-hood-sync (wrap poke-sync):from-kiln ++ poke-hood-sync (wrap poke-sync):from-kiln
++ poke-kiln-cp (wrap poke-cp):from-kiln ++ poke-kiln-cp (wrap poke-cp):from-kiln
++ poke-kiln-label (wrap poke-label):from-kiln ++ poke-kiln-label (wrap poke-label):from-kiln
++ poke-kiln-merge (wrap poke-merge):from-kiln ++ poke-kiln-merge (wrap poke-merge):from-kiln
++ poke-kiln-mount (wrap poke-mount):from-kiln ++ poke-kiln-cancel (wrap poke-cancel):from-kiln
++ poke-kiln-mv (wrap poke-mv):from-kiln ++ poke-kiln-mount (wrap poke-mount):from-kiln
++ poke-kiln-rm (wrap poke-rm):from-kiln ++ poke-kiln-mv (wrap poke-mv):from-kiln
++ poke-kiln-schedule (wrap poke-schedule):from-kiln ++ poke-kiln-rm (wrap poke-rm):from-kiln
++ poke-kiln-sync (wrap poke-sync):from-kiln ++ poke-kiln-schedule (wrap poke-schedule):from-kiln
++ poke-kiln-unmount (wrap poke-unmount):from-kiln ++ poke-kiln-sync (wrap poke-sync):from-kiln
++ poke-kiln-unsync (wrap poke-unsync):from-kiln ++ poke-kiln-start-autoload (wrap poke-start-autoload):from-kiln
++ poke-will (wrap poke-will):from-helm ++ poke-kiln-autoload (wrap poke-autoload):from-kiln
++ quit-drum-phat (wrap quit-phat):from-drum ++ poke-kiln-unmount (wrap poke-unmount):from-kiln
++ reap-drum-phat (wrap reap-phat):from-drum ++ poke-kiln-unsync (wrap poke-unsync):from-kiln
++ woot-helm (wrap take-woot):from-helm ++ poke-will (wrap poke-will):from-helm
++ writ-kiln-sync (wrap take-writ):from-kiln ++ 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
-- --

View File

@ -24,7 +24,8 @@
:: ::
|_ $: bowl |_ $: bowl
client client
connected=_| connected=_| :: subscribed to talk
count=@ud :: # messages from talk
unordered=(map ,[@uvH @u] (pair ship flesh:work-stuff:talk)) unordered=(map ,[@uvH @u] (pair ship flesh:work-stuff:talk))
== ==
++ at ++ at
@ -82,7 +83,7 @@
|= up=update |= up=update
^+ +> ^+ +>
?- -.up ?- -.up
%add ?>(?=(%comment +<.up) (send-change %add-comment +>.up)) %add ?>(?=(%comment +<.up) (send-change %add-comment our +>.up))
%doer %doer
?- +<.up ?- +<.up
%release (send-change %set-doer ~) %release (send-change %set-doer ~)
@ -114,6 +115,7 @@
%- unit %- unit
$: client $: client
_| _|
@ud
(map ,[@uvH @u] (pair ship flesh:work-stuff:talk)) (map ,[@uvH @u] (pair ship flesh:work-stuff:talk))
== ==
^- [(list move) _+>.$] ^- [(list move) _+>.$]
@ -124,7 +126,7 @@
?: connected ?: connected
[~ .] [~ .]
:_ .(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 ++ process-duty
|= [when=@da her=ship from=(set station:talk) action=duty:work-stuff:talk] |= [when=@da her=ship from=(set station:talk) action=duty:work-stuff:talk]
@ -256,7 +258,7 @@
%set-done tax.u.tax(done ?.(don.meat.action ~ `when)) %set-done tax.u.tax(done ?.(don.meat.action ~ `when))
%add-comment %add-comment
%= tax.u.tax %= 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)) =+ ooo=(~(get by unordered) id.action +(version.action))
@ -309,28 +311,25 @@
abut:send-create:(at | +.cod) abut:send-create:(at | +.cod)
== ==
:: ::
:: XX maybe need to check that we haven't received this message before :: XX test the disconnection case
:: by keeping a counter of last message received
:: XX definitely do this!
:: XX handle and test the disconnection case
::
++ diff-talk-report ++ diff-talk-report
|= [way=wire rep=report:talk] |= [way=wire rep=report:talk]
^- [(list move) _+>.$] ^- [(list move) _+>.$]
?> ?=(%grams -.rep) ?> ?=(%grams -.rep)
|- ^- [(list move) _+>.^$] |- ^- [(list move) _+>.^$]
?~ q.rep [~ +>.^$] ?~ q.rep [~ +>.^$]
=. count +(count)
=* her p.i.q.rep =* her p.i.q.rep
=* when p.r.q.i.q.rep =* when p.r.q.i.q.rep
=* said r.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) =+ ^- from=(set station:talk)
%- sa ^- (list station:talk) %- sa ^- (list station:talk)
%+ murn (~(tap by q.q.i.q.rep)) %+ murn (~(tap by q.q.i.q.rep))
=> talk => talk
|= [par=partner *] |= [par=partner *]
`(unit station)`?.(?=(%& -.par) ~ `p.par) `(unit station)`?.(?=(%& -.par) ~ `p.par)
?. ?=(%tax -.said)
$(p.rep +(p.rep), q.rep t.q.rep)
=^ mos +>.^$ (process-duty when her from +.said) =^ mos +>.^$ (process-duty when her from +.said)
=^ mof +>.^$ $(p.rep +(p.rep), q.rep t.q.rep) =^ mof +>.^$ $(p.rep +(p.rep), q.rep t.q.rep)
[(weld mos mof) +>.^$] [(weld mos mof) +>.^$]

View File

@ -413,7 +413,7 @@
vix=(bex +((cut 0 [25 2] mag))) :: width of sender vix=(bex +((cut 0 [25 2] mag))) :: width of sender
tay=(cut 0 [27 5] mag) :: message type tay=(cut 0 [27 5] mag) :: message type
== ==
?> =(4 vez) ?> =(5 vez)
?> =(chk (end 0 20 (mug bod))) ?> =(chk (end 0 20 (mug bod)))
:+ [(end 3 wix bod) (cut 3 [wix vix] bod)] :+ [(end 3 wix bod) (cut 3 [wix vix] bod)]
(kins tay) (kins tay)
@ -433,7 +433,7 @@
=+ tay=(ksin q.kec) =+ tay=(ksin q.kec)
%+ mix %+ mix
%+ can 0 %+ can 0
:~ [3 4] :~ [3 5]
[20 (mug bod)] [20 (mug bod)]
[2 yax] [2 yax]
[2 qax] [2 qax]
@ -1018,7 +1018,7 @@
++ gnaw :: gnaw:am ++ gnaw :: gnaw:am
|= [kay=cape ryn=lane pac=rock] :: process packet |= [kay=cape ryn=lane pac=rock] :: process packet
^- [p=(list boon) q=fort] ^- [p=(list boon) q=fort]
?. =(4 (end 0 3 pac)) [~ fox] ?. =(5 (end 0 3 pac)) [~ fox]
=+ kec=(bite pac) =+ kec=(bite pac)
?: (goop p.p.kec) [~ fox] ?: (goop p.p.kec) [~ fox]
?. (~(has by urb.ton.fox) q.p.kec) ?. (~(has by urb.ton.fox) q.p.kec)

View File

@ -162,11 +162,7 @@
mer=mer.jod mer=mer.jod
== ==
=* red -> =* red ->
=| yel=(list ,[p=duct q=gift]) =| mow=(list move)
=| 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)
|% |%
++ abet ++ abet
^- [(list move) raft] ^- [(list move) raft]
@ -176,23 +172,7 @@
ruf(hoy (~(put by hoy.ruf) her rug)) ruf(hoy (~(put by hoy.ruf) her rug))
=+ dos=(~(put by dos.u.rom) syd [qyx dom dok mer]) =+ dos=(~(put by dos.u.rom) syd [qyx dom dok mer])
ruf(fat (~(put by fat.ruf) her [(need hun) dos])) ruf(fat (~(put by fat.ruf) her [(need hun) dos]))
;: weld (flop mow)
%+ 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
==
:: ::
++ aver :: read ++ aver :: read
|= mun=mood |= mun=mood
@ -260,6 +240,14 @@
(mule |.(`~`~|([%expected-path got=p.pax] !!))) (mule |.(`~`~|([%expected-path got=p.pax] !!)))
$(tay t.tay, can (~(put by can) ((hard path) q.q.pax) q.i.tay)) $(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 ++ balk :: read and send
|= [hen=duct cay=(unit (each cage lobe)) mun=mood] |= [hen=duct cay=(unit (each cage lobe)) mun=mood]
^+ +> ^+ +>
@ -268,18 +256,18 @@
:: ::
++ bait ++ bait
|= [hen=duct tym=@da] |= [hen=duct tym=@da]
%_(+> tag :_(tag [hen %pass /tyme %t %wait tym])) (emit hen %pass /tyme %t %wait tym)
:: ::
++ best ++ best
|= [hen=duct tym=@da] |= [hen=duct tym=@da]
%_(+> tag :_(tag [hen %pass /tyme %t %rest tym])) (emit hen %pass /tyme %t %rest tym)
:: ::
++ blab :: ship result ++ blab :: ship result
|= [hen=duct mun=mood dat=(each cage lobe)] |= [hen=duct mun=mood dat=(each cage lobe)]
^+ +> ^+ +>
?: ?=(%& -.dat) ?: ?=(%& -.dat)
+>.$(byn [[hen ~ [p.mun q.mun syd] r.mun p.dat] byn]) (emit hen %give %writ ~ [p.mun q.mun syd] r.mun p.dat)
=- +>.$(tag [- tag]) %- emit
:* hen %pass [%blab p.mun (scot q.mun) syd r.mun] :* 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) %f %exec our ~ [her syd q.mun] (lobe-to-silk:ze r.mun p.dat)
== ==
@ -295,7 +283,15 @@
:: ::
++ blub :: ship stop ++ blub :: ship stop
|= hen=duct |= 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 ++ duce :: produce request
|= rov=rove |= rov=rove
@ -309,8 +305,10 @@
?. ?=([%sing %v *] rav) rav ?. ?=([%sing %v *] rav) rav
[%many %| [%ud let.dom] `case`q.p.rav r.p.rav] [%many %| [%ud let.dom] `case`q.p.rav r.p.rav]
=+ inx=nix.u.ref =+ 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) nix.u.ref +(nix.u.ref)
bom.u.ref (~(put by bom.u.ref) inx [hen vaw]) bom.u.ref (~(put by bom.u.ref) inx [hen vaw])
fod.u.ref (~(put by fod.u.ref) hen inx) 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=(skim can |=(paf=path =(pax (scag (lent pax) paf))))
?~ mus ?~ mus
+>.$ +>.$
%_ +>.$ %- emit
tag :* hen %pass [%ergoing (scot %p her) syd ~] %f
:_ tag %exec our ~ [her syd %da now] %tabl
:* hen %pass [%ergoing (scot %p her) syd ~] %f ^- (list (pair silk silk))
%exec our ~ [her syd %da now] %tabl %+ turn `(list path)`mus
^- (list (pair silk silk)) |= a=path
%+ turn `(list path)`mus ^- (pair silk silk)
|= a=path :- [%$ %path !>(a)]
^- (pair silk silk) :+ %cast %mime
:- [%$ %path !>(a)] =+ (need (need (read-x:ze let.dom a)))
:+ %cast %mime ?: ?=(%& -<)
=+ (need (need (read-x:ze let.dom a))) [%$ p.-]
?: ?=(%& -<) (lobe-to-silk:ze a p.-)
[%$ p.-]
(lobe-to-silk:ze a p.-)
==
== ==
:: ::
++ ease :: release request ++ ease :: release request
@ -364,8 +359,10 @@
|- ^+ +.$ |- ^+ +.$
=+ nux=(~(get by fod.u.ref) hen) =+ nux=(~(get by fod.u.ref) hen)
?~ nux +.$ ?~ 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) fod.u.ref (~(del by fod.u.ref) hen)
bom.u.ref (~(del by bom.u.ref) u.nux) 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]) (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 ++ echo :: announce changes
|= [wen=@da lem=nuri] |= [wen=@da lem=nuri]
^+ +> ^+ +>
%_ +>.$ =+ pre=`path`~[(scot %p her) syd (scot %ud let.dom)]
yel ?- -.lem
=+ pre=`path`~[(scot %p her) syd (scot %ud let.dom)] | (print-to-dill '=' %leaf :(weld (trip p.lem) " " (spud pre)))
?- -.lem & |- ^+ +>.^$
| :_ yel ?~ p.lem +>.^$
[hen %note '=' %leaf :(weld (trip p.lem) " " (spud pre))] =. +>.^$
& |- ^+ yel %+ print-to-dill
?~ p.lem yel ?-(-.q.i.p.lem %del '-', %ins '+', %dif ':')
:_ $(p.lem t.p.lem) [%leaf (spud (weld pre p.i.p.lem))]
:- hen $(p.lem t.p.lem)
:+ %note
?-(-.q.i.p.lem %del '-', %ins '+', %dif ':')
[%leaf (spud (weld pre p.i.p.lem))]
==
== ==
:: ::
++ edit :: apply changes ++ edit :: apply changes
@ -472,107 +457,97 @@
?& ?=([?(%hoon %hook) *] (flop pax)) ?& ?=([?(%hoon %hook) *] (flop pax))
?=(%mime p.p.mis) ?=(%mime p.p.mis)
== ==
=- %_ +>.$ =. +>.$
tag (welp - tag) %- emil
dok ^- (list move)
:- ~ :~ :* hen %pass
:* %+ turn del [%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] |= [pax=path mis=miso]
?> ?=(%del -.mis)
pax
::
%+ turn ink
|= [pax=path mis=miso]
^- (pair path cage)
?> ?=(%ins -.mis) ?> ?=(%ins -.mis)
:- [%$ %path -:!>(*path) pax]
=+ =>((flop pax) ?~(. %$ i)) =+ =>((flop pax) ?~(. %$ i))
[pax - [%atom %t] ((hard ,@t) +>.q.q.p.mis)] [%cast - [%$ p.mis]]
:: ==
~ :* hen %pass
:: [%diffing (scot %p her) syd (scot %da wen) ~]
%- mo %f %exec our ~ [her syd %da wen] %tabl
^- (list (pair silk silk))
%+ turn dif %+ turn dif
|= [pax=path mis=miso] |= [pax=path mis=miso]
?> ?=(%dif -.mis) ?> ?=(%dif -.mis)
[pax p.mis] =+ (need (need (read-x:ze let.dom pax)))
:: ?> ?=(%& -<)
~ :- [%$ %path -:!>(*path) pax]
:: [%pact [%$ p.-] [%$ p.mis]]
%- mo ==
:* hen %pass
[%castifying (scot %p her) syd (scot %da wen) ~]
%f %exec our ~ [her syd %da wen] %tabl
^- (list (pair silk silk))
%+ turn mut %+ turn mut
|= [pax=path mis=miso] |= [pax=path mis=miso]
?> ?=(%mut -.mis) ?> ?=(%mut -.mis)
[pax p.mis] :- [%$ %path -:!>(*path) pax]
:: =+ (lobe-to-mark:ze (~(got by q:(aeon-to-yaki:ze let.dom)) pax))
~ [%cast - [%$ 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)]
==
== ==
== ==
^- (list move) %_ +>.$
:~ :* hen %pass dok
[%inserting (scot %p her) syd (scot %da wen) ~] :- ~
%f %exec our ~ [her syd %da wen] %tabl :* (turn del |=([pax=path mis=miso] ?>(?=(%del -.mis) pax)))
^- (list (pair silk silk)) ::
%+ turn ins %+ 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] |= [pax=path mis=miso]
^- (unit (pair path mime))
?> ?=(%ins -.mis) ?> ?=(%ins -.mis)
:- [%$ %path -:!>(*path) pax] ?. ?=(%mime p.p.mis)
=+ =>((flop pax) ?~(. %$ i)) ~
[%cast - [%$ p.mis]] `[pax ((hard mime) q.q.p.mis)]
== ::
:* hen %pass ^- (list (pair path mime))
[%diffing (scot %p her) syd (scot %da wen) ~] %+ murn ink
%f %exec our ~ [her syd %da wen] %tabl
^- (list (pair silk silk))
%+ turn dif
|= [pax=path mis=miso] |= [pax=path mis=miso]
?> ?=(%dif -.mis) ^- (unit (pair path mime))
=+ (need (need (read-x:ze let.dom pax))) ?> ?=(%ins -.mis)
?> ?=(%& -<) ?> ?=(%mime p.p.mis)
:- [%$ %path -:!>(*path) pax] `[pax ((hard mime) q.q.p.mis)]
[%pact [%$ p.-] [%$ p.mis]] ::
== ^- (list (pair path mime))
:* hen %pass %+ murn mut
[%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] |= [pax=path mis=miso]
^- (unit (pair path mime))
?> ?=(%mut -.mis) ?> ?=(%mut -.mis)
:- [%$ %path -:!>(*path) pax] ?. ?=(%mime p.p.mis)
=+ (lobe-to-mark:ze (~(got by q:(aeon-to-yaki:ze let.dom)) pax)) ~
[%cast - [%$ p.mis]] `[pax ((hard mime) q.q.p.mis)]
== ==
==
== ==
:: ::
++ silkify ++ silkify
@ -691,8 +666,7 @@
%+ turn cat %+ turn cat
|= [pax=path cay=cage] |= [pax=path cay=cage]
[pax (page-to-lobe:ze [p q.q]:cay)] [pax (page-to-lobe:ze [p q.q]:cay)]
=- %_(+>.$ tag [- tag]) %- emit
^- move
:* hen %pass :* hen %pass
[%mutating (scot %p her) syd (scot %da wen) ~] [%mutating (scot %p her) syd (scot %da wen) ~]
%f %exec our ~ [her syd %da wen] %tabl %f %exec our ~ [her syd %da wen] %tabl
@ -733,11 +707,8 @@
^+ +> ^+ +>
:: ~& %taking-patch :: ~& %taking-patch
?: ?=(%| -.res) ?: ?=(%| -.res)
%_ +>.$ =. dok ~
dok ~ (print-to-dill '!' %rose [" " "" ""] leaf/"clay patch failed" p.res)
yel
[[hen %note '!' %rose [" " "" ""] leaf/"clay patch failed" p.res] yel]
==
:: ~& %editing :: ~& %editing
=+ ^- sim=(list (pair path misu)) =+ ^- sim=(list (pair path misu))
?~ dok ?~ dok
@ -795,38 +766,31 @@
=+ can=(mo sim) =+ can=(mo sim)
:: ~& %forming-ergo :: ~& %forming-ergo
:: =- ~& %formed-ergo - :: =- ~& %formed-ergo -
%_ +>.$ %- emit(dok ~)
dok ~ :* hen %pass [%ergoing (scot %p her) syd ~] %f
tag %exec our ~ [her syd %da now] %tabl
:_ tag ^- (list (pair silk silk))
:* hen %pass [%ergoing (scot %p her) syd ~] %f %+ turn (~(tap in sum))
%exec our ~ [her syd %da now] %tabl |= a=path
^- (list (pair silk silk)) ^- (pair silk silk)
%+ turn (~(tap in sum)) :- [%$ %path !>(a)]
|= a=path =+ b=(~(got by can) a)
^- (pair silk silk) ?: ?=(%del -.b)
:- [%$ %path !>(a)] [%$ %null !>(~)]
=+ b=(~(got by can) a) =+ (~(get by mim.u.dok) a)
?: ?=(%del -.b) ?^ - [%$ %mime !>(u.-)]
[%$ %null !>(~)] :+ %cast %mime
=+ (~(get by mim.u.dok) a) =+ (need (need (read-x:ze let.dom a)))
?^ - [%$ %mime !>(u.-)] ?: ?=(%& -<)
:+ %cast %mime [%$ p.-]
=+ (need (need (read-x:ze let.dom a))) (lobe-to-silk:ze a p.-)
?: ?=(%& -<)
[%$ p.-]
(lobe-to-silk:ze a p.-)
==
== ==
:: ::
++ take-ergo ++ take-ergo
|= res=gage |= res=gage
^+ +> ^+ +>
?: ?=(%| -.res) ?: ?=(%| -.res)
%_ +>.$ (print-to-dill '!' %rose [" " "" ""] leaf/"clay ergo failed" p.res)
yel
[[hen %note '!' %rose [" " "" ""] leaf/"clay ergo failed" p.res] yel]
==
?~ hez ~|(%no-sync-duct !!) ?~ hez ~|(%no-sync-duct !!)
=+ ^- can=(map path (unit mime)) =+ ^- can=(map path (unit mime))
%- mo ^- mode %- mo ^- mode
@ -839,33 +803,27 @@
~ ~
`((hard mime) q.q.mim) `((hard mime) q.q.mim)
=+ mus=(must-ergo (turn (~(tap by can)) head)) =+ mus=(must-ergo (turn (~(tap by can)) head))
%= +>.$ %- emil
reg %+ turn (~(tap by mus))
%- welp :_ reg |= [pot=term len=@ud pak=(set path)]
%+ turn (~(tap by mus)) :* u.hez %give %ergo pot
|= [pot=term len=@ud pak=(set path)] %+ turn (~(tap in pak))
:* u.hez %ergo pot |= pax=path
%+ turn (~(tap in pak)) [(slag len pax) (~(got by can) pax)]
|= pax=path
[(slag len pax) (~(got by can) pax)]
==
== ==
:: ::
++ checkout-ankh ++ checkout-ankh
|= hat=(map path lobe) |= hat=(map path lobe)
^+ +> ^+ +>
%_ +>.$ %- emit
tag :* hen %pass [%patching (scot %p her) syd ~] %f
:_ tag %exec our :^ ~ [her syd %da now] %tabl
:* hen %pass [%patching (scot %p her) syd ~] %f ^- (list (pair silk silk))
%exec our :^ ~ [her syd %da now] %tabl %+ turn (~(tap by hat))
^- (list (pair silk silk)) |= [a=path b=lobe]
%+ turn (~(tap by hat)) ^- (pair silk silk)
|= [a=path b=lobe] :- [%$ %path-hash !>([a b])]
^- (pair silk silk) (lobe-to-silk:ze a b)
:- [%$ %path-hash !>([a b])]
(lobe-to-silk:ze a b)
==
== ==
:: ::
++ apply-foreign-update :: apply subscription ++ apply-foreign-update :: apply subscription
@ -1016,34 +974,10 @@
!! !!
== ==
:: ::
++ rand-to-rant
|= rut=rand
^+ +>
~| [%x-over-network-not-implemented [p q -.r]:rut hen] !!
:: =- %_(+>.$ tag [- tag])
:: :* 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 ++ validate-x
|= [car=care cas=case pax=path peg=page] |= [car=care cas=case pax=path peg=page]
^+ +> ^+ +>
=- %_(+>.$ tag [- tag]) %- emit
:* hen %pass :* hen %pass
[%foreign-x (scot %p our) (scot %p her) syd car (scot cas) pax] [%foreign-x (scot %p our) (scot %p her) syd car (scot cas) pax]
%f %exec our ~ [her syd cas] %f %exec our ~ [her syd cas]
@ -1065,8 +999,8 @@
++ validate-plops ++ validate-plops
|= [cas=case lem=(unit ,@da) pop=(set plop)] |= [cas=case lem=(unit ,@da) pop=(set plop)]
^+ +> ^+ +>
=- %_(+>.$ tag [- tag])
=+ lum=(scot %da (fall lem *@da)) =+ lum=(scot %da (fall lem *@da))
%- emit
:* hen %pass :* hen %pass
[%foreign-plops (scot %p our) (scot %p her) syd lum ~] [%foreign-plops (scot %p our) (scot %p her) syd lum ~]
%f %exec our ~ [her syd cas] %tabl %f %exec our ~ [her syd cas] %tabl
@ -1074,15 +1008,8 @@
%+ turn (~(tap in pop)) %+ turn (~(tap in pop))
|= a=plop |= a=plop
?- -.a ?- -.a
%delta %delta [[%$ %blob !>([%delta p.a q.a *page])] [%vale p.r.a q.r.a]]
:- [%$ %blob !>([%delta p.a q.a *page])] %direct [[%$ %blob !>([%direct p.a *page])] [%vale p.q.a q.q.a]]
[%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 !!
== ==
== ==
:: ::
@ -1101,7 +1028,6 @@
?- -.bol ?- -.bol
%delta [-.bol p.bol q.bol p.cay q.q.cay] %delta [-.bol p.bol q.bol p.cay q.q.cay]
%direct [-.bol p.bol p.cay q.q.cay] %direct [-.bol p.bol p.cay q.q.cay]
%indirect ~| %plop-indirect-not-implemented !!
== ==
%^ apply-foreign-update %^ apply-foreign-update
lem lem
@ -1219,6 +1145,15 @@
(bleb p.i.xiq +(u.nab) ?:(p.q.i.xiq ~ `[u.nab u.huy])) (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 ++ ze
|% |%
++ aeon-to-tako ~(got by hit.dom) ++ aeon-to-tako ~(got by hit.dom)
@ -1231,7 +1166,6 @@
?- - ?- -
%delta p.q %delta p.q
%direct p.q %direct p.q
%indirect p.q
== ==
++ lobe-to-silk :: XX maybe move hoo{n,k} stuff here ++ lobe-to-silk :: XX maybe move hoo{n,k} stuff here
|= [pax=path lob=lobe] |= [pax=path lob=lobe]
@ -1249,7 +1183,6 @@
=+ bol=(~(got by lat.ran) lob) =+ bol=(~(got by lat.ran) lob)
?- -.bol ?- -.bol
%direct [%volt q.bol] %direct [%volt q.bol]
%indirect [%volt q.bol]
%delta ~| delta/q.q.bol %delta ~| delta/q.q.bol
[%pact $(lob q.q.bol) [%volt r.bol]] [%pact $(lob q.q.bol) [%volt r.bol]]
== ==
@ -1482,7 +1415,6 @@
?- -.gar ?- -.gar
%direct (~(put in far) lob) %direct (~(put in far) lob)
%delta (~(put in $(lob q.q.gar)) lob) %delta (~(put in $(lob q.q.gar)) lob)
%indirect (~(put in $(lob r.gar)) lob)
== ==
:: ::
++ data-twixt-takos ++ data-twixt-takos
@ -1530,6 +1462,15 @@
~ ~
```[%null [%atom %n] ~] ```[%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 ++ read-x
|= [yon=aeon pax=path] |= [yon=aeon pax=path]
^- (unit (unit (each cage lobe))) ^- (unit (unit (each cage lobe)))
@ -1556,8 +1497,6 @@
=+ bol=(lobe-to-blob u.lob) =+ bol=(lobe-to-blob u.lob)
?: ?=(%direct -.bol) ?: ?=(%direct -.bol)
((hard ,@t) q.q.bol) ((hard ,@t) q.q.bol)
?: ?=(%indirect -.bol)
((hard ,@t) q.q.bol)
?> ?=(%delta -.bol) ?> ?=(%delta -.bol)
=+ txt=$(u.lob q.q.bol) =+ txt=$(u.lob q.q.bol)
?> ?=(%txt-diff p.r.bol) ?> ?=(%txt-diff p.r.bol)
@ -1611,6 +1550,8 @@
?^(r.mun [~ ~] [~ ~ %& %aeon !>(yon)]) ?^(r.mun [~ ~] [~ ~ %& %aeon !>(yon)])
?: ?=(%u p.mun) ?: ?=(%u p.mun)
(read-u yon r.mun) (read-u yon r.mun)
?: ?=(%v p.mun)
(bind (read-v yon r.mun) (curr bind (cury same %&)))
?: ?=(%x p.mun) ?: ?=(%x p.mun)
(read-x yon r.mun) (read-x yon r.mun)
?: ?=(%y p.mun) ?: ?=(%y p.mun)
@ -1645,7 +1586,7 @@
:: %- ~(run by hat) :: %- ~(run by hat)
:: |= a=lobe :: |= a=lobe
:: =+ (lobe-to-blob a) :: =+ (lobe-to-blob a)
:: ?-(-.- %direct q.-, %indirect q.-, %delta !!) :: ?-(-.- %direct q.-, %delta !!)
::`+>.$(ank.dom (checkout-ankh -), let.dom yon) ::`+>.$(ank.dom (checkout-ankh -), let.dom yon)
:: ::
++ update-lat :: update-lat:ze ++ update-lat :: update-lat:ze
@ -1716,7 +1657,17 @@
^+ ..me ^+ ..me
?: don ?: don
..me(mer `dat) ..me(mer `dat)
..me(mer ~, reg :_(reg [hen %mere gon.dat])) =. mer ~
=> (emit hen.dat %give %mere gon.dat)
..me
::
++ emit
|= move
%_(+> ..ze (^emit +<))
::
++ emil
|= (list move)
%_(+> ..ze (^emil +<))
:: ::
++ route ++ route
|= [sat=term res=(each riot gage)] |= [sat=term res=(each riot gage)]
@ -1759,7 +1710,7 @@
:: ::
++ fetch-ali ++ fetch-ali
^+ . ^+ .
=- %_(+ tag [- tag], wat.dat %ali) %- emit(wat.dat %ali)
:* hen %pass :* hen %pass
[%merge (scot %p p.bob) q.bob (scot %p p.ali) q.ali %ali ~] [%merge (scot %p p.bob) q.bob (scot %p p.ali) q.ali %ali ~]
%c %warp [p.bob p.ali] q.ali %c %warp [p.bob p.ali] q.ali
@ -1937,7 +1888,7 @@
++ diff-bas ++ diff-bas
|= [nam=term yak=yaki oth=(trel ship desk case) yuk=yaki] |= [nam=term yak=yaki oth=(trel ship desk case) yuk=yaki]
^+ +> ^+ +>
=- %_(+>.$ tag [- tag]) %- emit
:* hen %pass :* hen %pass
=+ (cat 3 %diff- nam) =+ (cat 3 %diff- nam)
[%merge (scot %p p.bob) q.bob (scot %p p.ali) q.ali - ~] [%merge (scot %p p.bob) q.bob (scot %p p.ali) q.ali - ~]
@ -1982,15 +1933,18 @@
|= [pax=path lob=lobe] |= [pax=path lob=lobe]
(~(has by q.bas.dat) pax) (~(has by q.bas.dat) pax)
=. cal.dal.dat =. cal.dal.dat
%- mo %- mo ^- (list (pair path lobe))
%+ skim (~(tap by q.bas.dat)) %+ murn (~(tap by q.bas.dat))
|= [pax=path lob=lobe] |= [pax=path lob=lobe]
^- (unit (pair path lobe))
=+ a=(~(get by q.ali.dat) pax) =+ a=(~(get by q.ali.dat) pax)
=+ b=(~(get by q.bob.dat) pax) =+ b=(~(get by q.bob.dat) pax)
?& ?=(^ a) ?. ?& ?=(^ a)
!=([~ lob] a) !=([~ lob] a)
=([~ lob] b) =([~ lob] b)
== ==
~
`[pax +.a]
=. can.dal.dat p.can =. can.dal.dat p.can
=. old.dal.dat =. old.dal.dat
%- mo ^- (list ,[path ~]) %- mo ^- (list ,[path ~])
@ -2022,15 +1976,18 @@
|= [pax=path lob=lobe] |= [pax=path lob=lobe]
(~(has by q.bas.dat) pax) (~(has by q.bas.dat) pax)
=. cal.dob.dat =. cal.dob.dat
%- mo %- mo ^- (list (pair path lobe))
%+ skim (~(tap by q.bas.dat)) %+ murn (~(tap by q.bas.dat))
|= [pax=path lob=lobe] |= [pax=path lob=lobe]
^- (unit (pair path lobe))
=+ a=(~(get by q.ali.dat) pax) =+ a=(~(get by q.ali.dat) pax)
=+ b=(~(get by q.bob.dat) pax) =+ b=(~(get by q.bob.dat) pax)
?& ?=(^ b) ?. ?& ?=(^ b)
!=([~ lob] b) !=([~ lob] b)
=([~ lob] a) =([~ lob] a)
== ==
~
`[pax +.b]
=. can.dob.dat p.can =. can.dob.dat p.can
=. old.dob.dat =. old.dob.dat
%- mo ^- (list ,[path ~]) %- mo ^- (list ,[path ~])
@ -2046,7 +2003,7 @@
|- ^+ +.$ |- ^+ +.$
?+ gem.dat ~| [%merge-weird-gem gem.dat] !! ?+ gem.dat ~| [%merge-weird-gem gem.dat] !!
?(%mate %meld) ?(%mate %meld)
=- %_(+.$ tag [- tag], wat.dat %merge) %- emit(wat.dat %merge)
:* hen %pass :* hen %pass
[%merge (scot %p p.bob) q.bob (scot %p p.ali) q.ali %merge ~] [%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 %f %exec p.bob ~ [p.bob q.bob da/now] %tabl
@ -2080,7 +2037,7 @@
:: ::
++ build ++ build
^+ . ^+ .
=- %_(+ tag [- tag], wat.dat %build) %- emit(wat.dat %build)
:* hen %pass :* hen %pass
[%merge (scot %p p.bob) q.bob (scot %p p.ali) q.ali %build ~] [%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 %f %exec p.bob ~ [p.bob q.bob da/now] %tabl
@ -2119,7 +2076,7 @@
%- ~(urn by con) %- ~(urn by con)
|= [pax=path *] |= [pax=path *]
(~(got by q.bas.dat) pax) (~(got by q.bas.dat) pax)
=. con :: add/del conflict =. con :: change/del conflict
%- ~(uni by con) %- ~(uni by con)
%- mo ^- (list ,[path *]) %- mo ^- (list ,[path *])
%+ skim (~(tap by old.dal.dat)) %+ skim (~(tap by old.dal.dat))
@ -2128,7 +2085,7 @@
~| %strange-add-and-del ~| %strange-add-and-del
!! !!
(~(has by can.dob.dat) pax) (~(has by can.dob.dat) pax)
=. con :: add/del conflict =. con :: change/del conflict
%- ~(uni by con) %- ~(uni by con)
%- mo ^- (list ,[path *]) %- mo ^- (list ,[path *])
%+ skim (~(tap by old.dob.dat)) %+ skim (~(tap by old.dob.dat))
@ -2175,6 +2132,13 @@
[(lobe-to-mark u.-) u.-] [(lobe-to-mark u.-) u.-]
[p q.q]:cay [p q.q]:cay
[(~(put by hat) pax p.bol) (~(put by lat) p.bol bol)] [(~(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 =+ ^- hat=(map path lobe) :: all the content
%- ~(uni by old) %- ~(uni by old)
%- ~(uni by new.dal.dat) %- ~(uni by new.dal.dat)
@ -2183,6 +2147,7 @@
%- ~(uni by cal.dob.dat) %- ~(uni by cal.dob.dat)
%- ~(uni by hot) %- ~(uni by hot)
cas cas
:: ~& > hat=(~(run by hat) mug)
=+ ^- del=(map path ,?) =+ ^- del=(map path ,?)
(~(run by (~(uni by old.dal.dat) old.dob.dat)) |=(~ %|)) (~(run by (~(uni by old.dal.dat) old.dob.dat)) |=(~ %|))
=. gon.dat [%& (sa (turn (~(tap by con)) head))] =. gon.dat [%& (sa (turn (~(tap by con)) head))]
@ -2201,11 +2166,11 @@
:: ::
++ checkout ++ checkout
^+ . ^+ .
=- %_(+ tag [- tag], wat.dat %checkout)
=+ ^- val=beak =+ ^- val=beak
?: ?=(%init gem.dat) ?: ?=(%init gem.dat)
[p.ali q.ali cas.dat] [p.ali q.ali cas.dat]
[p.bob q.bob da/now] [p.bob q.bob da/now]
%- emit(wat.dat %checkout)
:* hen %pass :* hen %pass
[%merge (scot %p p.bob) q.bob (scot %p p.ali) q.ali %checkout ~] [%merge (scot %p p.bob) q.bob (scot %p p.ali) q.ali %checkout ~]
%f %exec p.bob ~ val %tabl %f %exec p.bob ~ val %tabl
@ -2244,7 +2209,6 @@
:: ::
++ ergo ++ ergo
^+ . ^+ .
=- %_(+ tag [- tag], wat.dat %ergo)
=+ ^- sum=(set path) =+ ^- sum=(set path)
=+ (must-ergo (turn (~(tap by erg.dat)) head)) =+ (must-ergo (turn (~(tap by erg.dat)) head))
=+ (turn (~(tap by -)) (corl tail tail)) =+ (turn (~(tap by -)) (corl tail tail))
@ -2256,6 +2220,7 @@
?: ?=(%init gem.dat) ?: ?=(%init gem.dat)
[p.ali q.ali cas.dat] [p.ali q.ali cas.dat]
[p.bob q.bob da/now] [p.bob q.bob da/now]
%- emit(wat.dat %ergo)
:* hen %pass :* hen %pass
[%merge (scot %p p.bob) q.bob (scot %p p.ali) q.ali %ergo ~] [%merge (scot %p p.bob) q.bob (scot %p p.ali) q.ali %ergo ~]
%f %exec p.bob ~ val %tabl %f %exec p.bob ~ val %tabl
@ -2292,17 +2257,15 @@
(error:he %ergo-no-hez ~) (error:he %ergo-no-hez ~)
?: ?=(%| -.gon.dat) ?: ?=(%| -.gon.dat)
+>.$ +>.$
%* done he =+ mus=(must-ergo (turn (~(tap by erg.dat)) head))
reg =< done:he
=+ mus=(must-ergo (turn (~(tap by erg.dat)) head)) %- emil
%- welp :_ reg %+ turn (~(tap by mus))
%+ turn (~(tap by mus)) |= [pot=term len=@ud pak=(set path)]
|= [pot=term len=@ud pak=(set path)] :* u.hez %give %ergo pot
:* u.hez %ergo pot %+ turn (~(tap in pak))
%+ turn (~(tap in pak)) |= pax=path
|= pax=path [(slag len pax) (~(got by can) pax)]
[(slag len pax) (~(got by can) pax)]
==
== ==
:: ::
++ he ++ he
@ -2350,7 +2313,6 @@
=+ bol=(~(got by lat.ran) lob) =+ bol=(~(got by lat.ran) lob)
?- -.bol ?- -.bol
%direct [%volt q.bol] %direct [%volt q.bol]
%indirect [%volt q.bol]
%delta [%pact $(lob q.q.bol) [%volt r.bol]] %delta [%pact $(lob q.q.bol) [%volt r.bol]]
== ==
:: ::
@ -2408,6 +2370,20 @@
%boat %boat
:_ ..^$ :_ ..^$
[hen %give %hill (turn (~(tap by mon.ruf)) head)]~ [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 %init
:_ %_ ..^$ :_ %_ ..^$
@ -2422,14 +2398,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 %into
=. hez.ruf `hen =. hez.ruf `hen

View File

@ -216,6 +216,7 @@
=. +> (sync %home our %base) =. +> (sync %home our %base)
=. +> ?. ?=(?(%king %czar) can) +> =. +> ?. ?=(?(%king %czar) can) +>
(sync %kids our %base) (sync %kids our %base)
=. +> autoload
=. +> peer =. +> peer
|- ^+ +>+ |- ^+ +>+
?~ myt +>+ ?~ myt +>+
@ -255,7 +256,18 @@
%_ +>.$ %_ +>.$
moz moz
:_ 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-start-autoload [%cube ~ [%atom %n]] ~
==
== ==
:: ::
++ pump :: send diff ack ++ pump :: send diff ack

View File

@ -148,6 +148,7 @@
:: ::
++ fcgi :: credential caboose ++ fcgi :: credential caboose
|= [quy=quay ced=cred] ^- coin |= [quy=quay ced=cred] ^- coin
~& fcgi/[`@uv`(mug ced) quy]
:* %many :* %many
[%$ %ta ~] [%$ %ta ~]
[%blob ced] [%blob ced]
@ -431,13 +432,14 @@
urb.waspFrom = function(sel,attr){ urb.waspFrom = function(sel,attr){
Array.prototype.map.call(document.querySelectorAll(sel), Array.prototype.map.call(document.querySelectorAll(sel),
function(ele){ 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() var xhr = new XMLHttpRequest()
xhr.open("HEAD", ele[attr]) xhr.open("HEAD", ele[attr])
xhr.send() xhr.send()
xhr.onload = function(){ xhr.onload = function(){
var tag = JSON.parse(this.getResponseHeader("etag")) var dep = this.getResponseHeader("etag")
if(tag) urb.wasp(tag) if(dep) urb.wasp(JSON.parse(dep.substr(2)))
}})} }})}
if(urb.wasp){urb.waspFrom('script','src'); urb.waspFrom('link','href')} if(urb.wasp){urb.waspFrom('script','src'); urb.waspFrom('link','href')}
''' '''
@ -771,7 +773,7 @@
== ==
~| q.q.cay ~| q.q.cay
=+ ((hard ,[mit=mite rez=octs]) 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) (give-thou 200 ~[etag/dep content-type/(moon mit)] ~ rez)
== ==
== ==

View File

@ -499,6 +499,19 @@
++ dash :: process cache ++ dash :: process cache
|= cof=cafe |= cof=cafe
^+ +> ^+ +>
~? |
:+ %dash (lent (skim (~(tap in p.cof)) |=(a=calx ?=(%bake -.a))))
=. q.cof (~(dif by q.cof) jav.bay)
=+ num=10
%. |= a=(list calx)
=+ len=(lent a)
=- [len (scag num (turn a f)) ?:((gth len num) %etc ~)]
=+ dewe=|=(beam +<(s ?+(s s [@ %web *] t.t.s)))
f=|=(b=calx [-.b ?+(-.b ~ %bake [p.q.b (tope (dewe q.q.b))])])
%~ run by
=< `(jar term calx)`(~(rep by q.cof) .)
|= [[* a=calx] b=(jar term calx)]
(~(add ja b) -.a a)
%_(+> jav.bay q.cof) %_(+> jav.bay q.cof)
:: ::
++ diff :: diff ++ diff :: diff
@ -1866,7 +1879,6 @@
:: ::
++ load :: highly forgiving ++ load :: highly forgiving
|= old=axle |= old=axle
::=. pol.old (~(run by pol.old) |=(baby +<(jav ~)))
..^$(+>- old) ..^$(+>- old)
::=. old ::=. old
:: ?. ?=([%0 *] old) old :: remove at 1 :: ?. ?=([%0 *] old) old :: remove at 1

View File

@ -1122,6 +1122,7 @@
%deal `%g %deal `%g
%exec `%f %exec `%f
%flog `%d %flog `%d
%drop `%c
%info `%c %info `%c
%merg `%c %merg `%c
%mont `%c %mont `%c

View File

@ -696,6 +696,7 @@
$(a t.a) $(a t.a)
:: ::
++ murn :: maybe transform ++ murn :: maybe transform
~/ %murn
|* [a=(list) b=$+(* (unit))] |* [a=(list) b=$+(* (unit))]
|- |-
?~ a ~ ?~ a ~
@ -705,6 +706,7 @@
[i=u.c t=$(a t.a)] [i=u.c t=$(a t.a)]
:: ::
++ reap :: replicate ++ reap :: replicate
~/ %reap
|* [a=@ b=*] |* [a=@ b=*]
|- ^- (list ,_b) |- ^- (list ,_b)
?~ a ~ ?~ a ~
@ -727,6 +729,7 @@
$(a t.a, b b(+<+ (b i.a +<+.b))) $(a t.a, b b(+<+ (b i.a +<+.b)))
:: ::
++ skid :: separate ++ skid :: separate
~/ %skid
|* [a=(list) b=$+(* ?)] |* [a=(list) b=$+(* ?)]
|- ^+ [p=a q=a] |- ^+ [p=a q=a]
?~ a [~ ~] ?~ a [~ ~]

View File

@ -1836,7 +1836,6 @@
++ blob :: fs blob ++ blob :: fs blob
$% [%delta p=lobe q=[p=mark q=lobe] r=page] :: delta on q $% [%delta p=lobe q=[p=mark q=lobe] r=page] :: delta on q
[%direct p=lobe q=page] :: immediate [%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 ++ boat (map (pair bone wire) (trel bean ship path)) :: outgoing subs
++ boon :: fort output ++ boon :: fort output
@ -2360,6 +2359,7 @@
== :: == ::
++ kiss-clay :: in request ->$ ++ kiss-clay :: in request ->$
$% [%boat ~] :: pier rebooted $% [%boat ~] :: pier rebooted
[%drop p=@p q=@tas] :: cancel pending merge
[%info p=@p q=@tas r=nori] :: internal edit [%info p=@p q=@tas r=nori] :: internal edit
[%init p=@p] :: report install [%init p=@p] :: report install
[%into p=@tas q=? r=mode] :: external edit [%into p=@tas q=? r=mode] :: external edit

13
gen/hood/autoload.hoon Normal file
View File

@ -0,0 +1,13 @@
::
:::: /hoon/autoload/hood/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[arg=?(~ [? ~]) ~]
==
:- %kiln-autoload
`(unit ,?)`?~(arg ~ `-.arg)

View File

@ -70,113 +70,552 @@
font-weight: 500; font-weight: 500;
font-style: normal; font-style: normal;
} }
@font-face { body,
font-family: "scp"; html {
src: url("//storage.googleapis.com/urbit-extra/scp-bold.woff"); font-family: "bau", "Helvetica Neue", helvetica, arial, sans-serif;
font-weight: 600;
font-style: normal;
} }
@font-face {
font-family: "scp";
src: url("//storage.googleapis.com/urbit-extra/scp-black.woff");
font-weight: 700;
font-style: normal;
}
html,
body {
margin: 0;
padding: 0;
}
html,
input,
button,
body {
font-family: "bau";
font-size: 18px;
}
pre,
code, code,
.mono { pre,
font-family:"scp"; li:before,
.spin,
#bred a,
h3.time {
font-family: "scp", "Courier New", courier, monospace;
} }
body,
#c { html {
width: 32rem; font-size: 18px;
margin-left: -16rem; font-weight: 400;
position: absolute; line-height: 1.6rem;
left: 50%; -webkit-text-size-adjust: none;
}
a {
color: #000;
text-decoration: none;
border-bottom: 2px solid #000;
display: inline-block;
line-height: 0.8rem;
}
hr {
display: inline-block;
width: 6rem;
border: 0;
border-top: 2px solid #f4f4f4;
} }
h1 { h1 {
font-size: 1.6rem; margin-top: 4rem;
font-weight: 500;
} }
h2,
h1:after { h3 {
content: "\2014"; margin: 0;
margin-left: 1rem;
}
#c pre {
font-size: .6rem;
margin-top: 2rem; margin-top: 2rem;
} }
h1,
#pass { h2,
width: 32rem; h3,
} h4,
strong {
button {
border: .3rem solid #000;
background-color: #fff;
font-size: 1rem;
padding: .3rem;
font-weight: 500; font-weight: 500;
} }
h4 {
.sig { margin-bottom: 0.3rem;
font-weight: 400;
font-size: 2rem;
display: inline;
vertical-align: middle;
} }
h5 {
span#ship { font-style: italic;
font-family: 'bau'; font-weight: 200;
font-weight: 400; margin: 0;
font-size: 1.2rem; }
text-transform: uppercase; h1 code,
letter-spacing: .1rem; h2 code,
h3 code {
font-size: inherit;
padding: 0.3rem;
}
pre,
code {
font-size: 0.8rem;
}
pre {
background-color: #f5f5f5;
padding: 0.3rem;
margin-left: -0.3rem;
}
code {
line-height: 1.2rem;
background-color: #f4f4f4;
margin-top: -0.05rem;
padding: 0.2rem;
display: inline-block; display: inline-block;
min-width: 1rem;
} }
ul {
input { list-style: none;
font-family: 'scp'; padding: 0;
}
li:before {
content: "+";
padding-right: 0.3rem;
font-size: 0.8rem;
font-weight: 600;
}
#nav,
#cont {
left: 50%;
}
#cont {
width: 42rem;
margin-left: -21rem;
background-color: #fff;
z-index: 1;
}
#nav {
position: fixed;
top: 0rem;
width: 57rem;
padding-top: 1rem;
z-index: 0;
margin-left: -32rem;
overflow: hidden;
opacity: 0;
transition: opacity 1s ease-in-out;
}
#nav.moving {
opacity: 1;
transition: opacity 0.3s ease-in-out;
}
#nav:hover {
opacity: 1;
transition: opacity 0.3s ease-in-out;
}
#cont {
position: absolute;
top: 0;
margin-bottom: 9rem;
}
.loading {
display: inline-block;
}
.spin {
color: #fff;
padding: 0.6rem;
font-size: 0.7rem;
font-weight: 600;
letter-spacing: 0.1rem;
z-index: 3;
}
.loading > .spin {
background-color: #555;
}
#body .loading > .spin {
background-color: #000;
}
.spin.state-0:before {
content: "\2599";
}
.spin.state-1:before {
content: "\259B";
}
.spin.state-2:before {
content: "\259C";
}
.spin.state-3:before {
content: "\259F";
}
#load.load {
display: inline-block;
font-weight: 500;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(10,10,10,0.4);
opacity: 1;
transition: opacity 1s ease-in-out;
z-index: 4;
}
img.logo {
height: 2rem;
width: 2rem;
}
h3.time {
margin-top: 0.3rem;
font-size: 0.7rem;
font-weight: 200;
}
#nav .links > div {
display: inline-block;
vertical-align: top;
}
#nav #sibs {
width: 8rem;
transition: margin-top 0.3s ease-in-out;
overflow: hidden;
}
#nav #sibs > div {
height: 20px;
margin-bottom: 4px;
}
.focus #sibs {
margin-top: 0 !important;
transition: margin-top 0.3s ease-in-out;
}
#nav a,
.list > li > a {
text-transform: uppercase;
font-size: 0.7rem;
font-weight: 200;
letter-spacing: 1px;
white-space: nowrap;
}
.list > li > a {
border-bottom: none;
margin-bottom: 0.3rem;
}
#nav a,
.list > li > a h1 {
border-bottom: 1px solid #000;
margin-right: 0.3rem;
}
#nav .active a {
font-weight: 500;
text-decoration: none;
}
#up {
padding-right: 1rem;
margin-top: -0.3rem;
}
#sides {
float: right;
}
#sides a {
margin-right: 0.6rem;
}
#nav .arow-up,
#nav .arow-next,
#nav .arow-prev {
width: 0;
height: 0;
border: 0.4rem solid transparent;
}
#nav .arow-up {
border-bottom: 0.6rem solid #000;
}
#nav .arow-next {
border-left: 0.6rem solid #000;
}
#nav .arow-prev {
border-right: 0.6rem solid #000;
}
#bred {
width: 5rem;
padding-right: 1rem;
text-align: right;
font-size: 0.6rem;
white-space: nowrap;
overflow: hidden;
}
#bred a {
text-transform: lowercase;
vertical-align: top;
}
#bred > div {
float: right;
}
#bred > div > div {
display: inline-block;
margin-top: -0.2rem;
}
#bred a,
#kids a {
margin-right: 0.3rem;
}
#bred a {
margin-left: 0.3rem;
}
.short {
width: 32rem;
}
.list h1,
.list li a > div p {
margin: 0;
}
.list li a > div,
.list li a > div p {
display: inline; display: inline;
} }
.list li a > div p {
span#ship, margin-left: 0.3rem;
input { }
border: none; .list li a > div p:first-child {
padding: .3rem; margin-left: 0;
outline: none; }
border-bottom: 3px solid #555; .list li a > div p code {
font-size: 0.7rem;
font-weight: 400;
text-transform: none;
}
.list li a h1 code {
text-transform: lowercase;
border-bottom: 1px solid #000;
}
.list li a code {
padding: 0.2rem;
}
.list h1,
.list li a > div div {
display: inline;
}
.list li a > div div {
margin-left: 0.6rem;
overflow: hidden;
}
.list h1 {
font-size: 0.7rem;
}
.list.posts .post {
margin-bottom: 2rem;
}
.list.posts .post h1 {
text-transform: none;
font-size: 1.6rem;
line-height: 1.8rem;
margin-bottom: 1rem;
display: block;
}
.list.posts .post h2 {
font-size: 0.7rem;
font-weight: 400;
line-height: 1rem;
margin-top: 0;
}
.list.posts li.post:before {
content: "";
}
div.root h1 {
margin-bottom: 2rem;
}
div.root .list .sub {
margin-left: 0;
margin-right: 0.6rem;
}
div.root > p {
width: 27rem;
margin-top: 2rem;
}
h2.sub {
font-size: 0.7rem;
font-weight: 400;
line-height: 1rem;
letter-spacing: 1px;
margin-top: 0;
text-transform: uppercase;
}
div.post h1 {
font-size: 2.8rem;
line-height: 4rem;
display: block;
margin-top: 1rem;
margin-bottom: 1rem;
}
div.post h2 {
line-height: 1rem;
letter-spacing: 1px;
}
div.post h2 {
margin-top: 4rem;
}
div.post h2 {
font-size: 1.2rem;
font-weight: 500;
}
div.post p {
font-size: 1.2rem;
line-height: 2.2rem;
}
div.post li p {
display: inline;
}
div.toc {
margin-top: 3rem;
margin-bottom: 3rem;
}
div.toc h1,
div.toc h2,
div.toc h3,
div.toc h4 {
font-weight: 400;
cursor: pointer;
text-decoration: underline;
font-size: 1.2rem;
margin-top: 0.3rem;
margin-bottom: 0.3rem;
}
div.toc h2 {
margin-left: 1rem;
}
div.toc h3 {
margin-left: 2rem;
}
div.toc h4 {
margin-left: 3rem;
}
div.toc h1.t {
font-weight: 500;
font-size: 2rem;
text-decoration: none;
margin-bottom: 2rem;
}
#body .CodeMirror {
font-size: 0.8rem;
line-height: 1rem;
}
#body .CodeMirror .cm-header {
font-weight: 200;
}
#body .CodeMirror-gutters {
background-color: #fff;
padding-right: 1rem;
margin-left: -1rem;
}
.error {
color: #f91733;
}
.warning {
background-color: #ff3537;
padding: 1rem;
width: 18rem;
margin: 2rem 0;
color: #fff;
}
.warning a {
color: inherit;
border-color: #fff;
}
.warning h1 {
font-size: 1rem;
}
.warning h1,
.warning p {
margin: 0 0.3rem;
}
.warning.w {
width: auto;
}
@media only screen and (max-width: 1170px) {
#nav,
#nav > div,
#nav.up,
#nav.top,
#nav > .focus {
transform: translate3d(0, 0, 0);
-webkit-transform: translate3d(0, 0, 0);
}
#nav {
position: fixed;
top: 0;
opacity: 1;
width: 42rem;
margin-left: -21rem;
background-color: #fff;
z-index: 2;
}
#nav.m-down,
#nav.m-up {
position: absolute;
}
#nav.m-down.m-fixed {
position: fixed;
top: 0;
}
#nav > div {
max-height: 1rem;
overflow: hidden;
transition: max-height 0.3s ease-in-out;
}
#nav > .focus {
max-height: 40rem;
transition: max-height 0.3s ease-in-out;
}
#cont {
top: 3rem;
}
}
@media only screen and (min-width: 320px) and (max-width: 1024px) {
body,
html {
font-size: 21px;
}
#nav,
#cont {
width: 94%;
padding-left: 3%;
margin-left: 0;
}
#nav {
position: fixed;
padding-top: 0;
opacity: 1;
left: 0;
background-color: #fff;
z-index: 2;
}
#nav > div {
max-height: 1.4rem;
}
#nav > div {
padding-top: 0.6rem;
}
#nav #sibs {
width: 18rem;
}
#nav #sibs > div {
height: 20px;
line-height: 20px;
}
#nav a {
display: inline-block;
font-size: 0.7rem;
}
#nav #sides {
float: right;
}
#nav .arow-up,
#nav .arow-next,
#nav .arow-prev {
margin-right: 0;
border: 0.4rem solid transparent;
}
#nav .arow-up {
border-bottom: 0.6rem solid #000;
}
#nav .arow-next {
border-left: 0.6rem solid #000;
}
#nav .arow-prev {
margin-right: 1rem;
border-right: 0.6rem solid #000;
}
#cont {
top: 3rem;
left: 0;
padding-bottom: 9rem;
}
#cont h1:first-child {
margin-top: 0;
}
.short {
width: 100%;
}
} }
@media only screen and (min-device-width: 320px) and (max-device-width: 480px) { @media only screen and (min-device-width: 320px) and (max-device-width: 480px) {
#c { #nav > div {
width: 16rem; max-height: 1.6rem;
margin-left: -8rem;
} }
#pass { #nav a {
width: 16rem; font-size: 0.7rem;
} }
input { #nav #sibs > div {
-webkit-appearance: none; height: 20px;
border-radius: 0; line-height: 20px;
} }
} }

View File

@ -10,6 +10,7 @@
++ kiln-pith :: ++ kiln-pith ::
$: rem=(map desk kiln-desk) :: $: rem=(map desk kiln-desk) ::
syn=(map kiln-sync ,[let=@ud ust=bone]) :: syn=(map kiln-sync ,[let=@ud ust=bone]) ::
autoload=? ::
== :: == ::
++ kiln-desk :: per-desk state ++ kiln-desk :: per-desk state
$: auto=? :: escalate on failure $: auto=? :: escalate on failure
@ -54,6 +55,7 @@
=> |% :: arvo structures => |% :: arvo structures
++ card :: ++ card ::
$% [%exec wire @p ~ [beak silk]] :: $% [%exec wire @p ~ [beak silk]] ::
[%drop wire @p @tas] ::
[%info wire @p @tas nori] :: [%info wire @p @tas nori] ::
[%mont wire @tas @p @tas path] :: [%mont wire @tas @p @tas path] ::
[%ogre wire $|(@tas beam)] :: [%ogre wire $|(@tas beam)] ::
@ -64,6 +66,8 @@
++ pear :: poke fruit ++ pear :: poke fruit
$% [%talk-command command:talk] :: $% [%talk-command command:talk] ::
[%kiln-merge kiln-merge] :: [%kiln-merge kiln-merge] ::
[%helm-reload (list term)] ::
[%helm-reset ~] ::
== :: == ::
++ move (pair bone card) :: user-level move ++ move (pair bone card) :: user-level move
-- --
@ -118,6 +122,10 @@
|= kiln-merge |= kiln-merge
abet:abet:(merge:(work syd) ali sud gim) abet:abet:(merge:(work syd) ali sud gim)
:: ::
++ poke-cancel
|= syd=desk
abet:(emit %drop /cancel our syd)
::
++ do-info ++ do-info
|= [mez=tape tor=toro] |= [mez=tape tor=toro]
abet:(emit:(spam leaf/mez ~) %info /kiln our tor) abet:(emit:(spam leaf/mez ~) %info /kiln our tor)
@ -148,6 +156,25 @@
=+ old=;;((map ,@da cord) (fall (file where) ~)) =+ old=;;((map ,@da cord) (fall (file where) ~))
(foal where %sched !>((~(put by old) tym eve))) (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
%+ 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 |=(way=wire ?>(?=([@ ~] way) (work i.way))) :: general handler
++ take-mere :: ++ take-mere ::
|= [way=wire are=(each (set path) (pair term tang))] |= [way=wire are=(each (set path) (pair term tang))]
@ -171,7 +198,7 @@
== ==
abet:abet:(mere:(auto hos) mes) abet:abet:(mere:(auto hos) mes)
:: ::
++ take-writ :: ++ take-writ-sync ::
|= [way=wire rot=riot] |= [way=wire rot=riot]
?> ?=([@ @ @ ~] way) ?> ?=([@ @ @ ~] way)
=+ ^- hos=kiln-sync =+ ^- hos=kiln-sync
@ -181,6 +208,24 @@
== ==
abet:abet:(writ:(auto hos) rot) abet:abet:(writ:(auto hos) rot)
:: ::
++ take-writ-autoload
|= [way=wire rot=riot]
?> ?=([@ ~] way)
?> ?=(^ 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])
=. +>.$
%- emit :*
%warp /kiln/autoload/[syd] [our our] %home ~
%next %y da/now /arvo/[syd]/hoon
==
abet
::
++ spam ++ spam
|= mes=(list tank) |= mes=(list tank)
((slog mes) ..spam) ((slog mes) ..spam)
@ -244,7 +289,7 @@
?+ p.p.mes ?+ p.p.mes
:* (render "sync failed" sud her syd) :* (render "sync failed" sud her syd)
leaf/"please manually merge the desks with" 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/""
leaf/"error code: {<p.p.mes>}" leaf/"error code: {<p.p.mes>}"
q.p.mes q.p.mes
@ -457,7 +502,7 @@
""" """
done setting up scratch space in {<[-]>} done setting up scratch space in {<[-]>}
please resolve the following conflicts and run please resolve the following conflicts and run
:+merge {<syd>} our {<[-]>} |merge {<syd>} our {<[-]>}
""" """
%^ tanks-if-any %^ tanks-if-any
"annotated conflicts in:" annotated "annotated conflicts in:" annotated

View File

@ -63,7 +63,8 @@
%set-tags =+(feh "{(tr-term -.feh)} {<tag>}") %set-tags =+(feh "{(tr-term -.feh)} {<tag>}")
%set-title =+(feh "{(tr-term -.feh)} {<(trip til)>}") %set-title =+(feh "{(tr-term -.feh)} {<(trip til)>}")
%set-description =+(feh "{(tr-term -.feh)} {<(trip des)>}") %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)>}"
== ==
-- --
-- --

View File

@ -71,7 +71,7 @@
set-title/so set-title/so
set-description/so set-description/so
set-done/bo set-done/bo
add-comment/so add-comment/(ot ship/(su fed:ag) com/so ~)
== ==
-- --
++ grow-work-duty ++ grow-work-duty
@ -123,7 +123,7 @@
%set-title [%s til] %set-title [%s til]
%set-description [%s des] %set-description [%s des]
%set-done [%b don] %set-done [%b don]
%add-comment [%s com] %add-comment (jobe ship/(jope who) com/[%s com] ~)
== ==
-- --
++ grab ++ grab

View File

@ -1,11 +0,0 @@
<div class="root">
# Log —
<search/>
<list dataPreview="true" dataType="post"></list>
Please direct all questions or inquiries to [urbit@urbit.org](mailto:urbit@urbit.org). You can also subscribe to the [urbit-dev]() mailing list or follow [@urbit_]() on twitter.
</div>

View File

@ -1,10 +0,0 @@
<div class="post">
# Technical demo — Part ii
<h2 class="sub">2015 07 16</h2>
<h2 class="sub">Curtis, Galen, Philip, Anton and Henry</h2>
<iframe src="https://player.vimeo.com/video/133395510?color=fff&amp;title=0&amp;byline=0&amp;portrait=0" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>

View File

@ -1,10 +0,0 @@
<div class="post">
# Technical demo — Part i
<h2 class="sub">2015-07-17</h2>
<h2 class="sub">Curtis, Galen, Philip, Anton and Henry</h2>
<iframe src="https://player.vimeo.com/video/133395510?color=fff&amp;title=0&amp;byline=0&amp;portrait=0" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe>
</div>

View File

@ -1,14 +0,0 @@
---
title: Advantages
---
<div class="post">
# Concrete advantages of urbit
<h2 class="sub">2015-7-18</h2>
<h2 class="sub">Philip Monk</h2>
# Item 1
# Item 2
</div>

View File

@ -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: <mime> -> <mark-type>
++ txt: <txt> -> <mark-type>
...
++ grow:
++ mime: <mark-type> -> <mime>
++ txt: <mark-type> -> <txt>
...
++ grad
++ diff: (<mark-type>, <mark-type>) -> <diff-type>
++ pact: (<mark-type>, <diff-type>) -> <mark-type>
++ join: (<diff-type>, <diff-type>) -> <diff-type> or NULL
++ mash: (<diff-type>, <diff-type>) -> <diff-type>
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.

View File

@ -102,10 +102,13 @@ hr {
border: 0; border: 0;
border-top: 2px solid #f4f4f4; border-top: 2px solid #f4f4f4;
} }
h1 {
margin-top: 4rem;
}
h2, h2,
h3 { h3 {
margin: 0; margin: 0;
margin-top: 1rem; margin-top: 2rem;
} }
h1, h1,
h2, h2,
@ -433,8 +436,8 @@ div.post li p {
display: inline; display: inline;
} }
div.toc { div.toc {
margin-top: 6rem; margin-top: 3rem;
margin-bottom: 6rem; margin-bottom: 3rem;
} }
div.toc h1, div.toc h1,
div.toc h2, div.toc h2,
@ -444,6 +447,8 @@ div.toc h4 {
cursor: pointer; cursor: pointer;
text-decoration: underline; text-decoration: underline;
font-size: 1.2rem; font-size: 1.2rem;
margin-top: 0.3rem;
margin-bottom: 0.3rem;
} }
div.toc h2 { div.toc h2 {
margin-left: 1rem; margin-left: 1rem;
@ -458,6 +463,7 @@ div.toc h1.t {
font-weight: 500; font-weight: 500;
font-size: 2rem; font-size: 2rem;
text-decoration: none; text-decoration: none;
margin-bottom: 2rem;
} }
#body .CodeMirror { #body .CodeMirror {
font-size: 0.8rem; font-size: 0.8rem;
@ -474,6 +480,27 @@ div.toc h1.t {
.error { .error {
color: #f91733; color: #f91733;
} }
.warning {
background-color: #ff3537;
padding: 1rem;
width: 18rem;
margin: 2rem 0;
color: #fff;
}
.warning a {
color: inherit;
border-color: #fff;
}
.warning h1 {
font-size: 1rem;
}
.warning h1,
.warning p {
margin: 0 0.3rem;
}
.warning.w {
width: auto;
}
@media only screen and (max-width: 1170px) { @media only screen and (max-width: 1170px) {
#nav, #nav,
#nav > div, #nav > div,

View File

@ -32,10 +32,13 @@ hr
border 0 border 0
border-top 2px solid #f4f4f4 border-top 2px solid #f4f4f4
h1
margin-top 4rem
h2 h2
h3 h3
margin 0 margin 0
margin-top 1rem margin-top 2rem
h1 h1
h2 h2
@ -361,8 +364,8 @@ div.post
display inline display inline
div.toc div.toc
margin-top 6rem margin-top 3rem
margin-bottom 6rem margin-bottom 3rem
h1 h1
h2 h2
@ -372,6 +375,8 @@ div.toc
cursor pointer cursor pointer
text-decoration underline text-decoration underline
font-size 1.2rem font-size 1.2rem
margin-top .3rem
margin-bottom .3rem
h2 h2
margin-left 1rem margin-left 1rem
@ -386,6 +391,7 @@ div.toc
font-weight 500 font-weight 500
font-size 2rem font-size 2rem
text-decoration none text-decoration none
margin-bottom 2rem
#body .CodeMirror #body .CodeMirror
font-size .8rem font-size .8rem
@ -402,4 +408,25 @@ div.toc
.error .error
color rgba(249,23,51,1) color rgba(249,23,51,1)
.warning
background-color rgb(255,53,55)
padding 1rem
width 18rem
margin 2rem 0
color #fff
a
color inherit
border-color #fff
h1
font-size 1rem
h1
p
margin 0 .3rem
.warning.w
width auto
@import 'mobile' @import 'mobile'

View File

@ -34,10 +34,10 @@ module.exports = (queries, Child, load=_load)-> recl
filterWith: (have,_queries)-> filterWith: (have,_queries)->
return _queries unless have? return _queries unless have?
request = {} request = {}
for k of _queries for k of _queries when k isnt 'kids'
request[k] = _queries[k] unless have[k] isnt undefined request[k] = _queries[k] unless have[k] isnt undefined
if _queries.kids? and have.kids? if _queries.kids?
if _.isEmpty have.kids if not have.kids?
request.kids = _queries.kids request.kids = _queries.kids
else else
request.kids = {} request.kids = {}

View File

@ -7,4 +7,5 @@ module.exports =
list: require './ListComponent.coffee' list: require './ListComponent.coffee'
kids: require './KidsComponent.coffee' kids: require './KidsComponent.coffee'
toc: require './TocComponent.coffee' toc: require './TocComponent.coffee'
email: require './EmailComponent.coffee'
lost: recl render: -> (div {}, "<lost(", @props.children, ")>") lost: recl render: -> (div {}, "<lost(", @props.children, ")>")

View File

@ -0,0 +1,45 @@
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) ->
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: ->
$.post @props.dataPath,{email:@$email.val()},() =>
@setState {submit:true}
componentDidMount: -> @$email = $('input.email')
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)

View File

@ -9,29 +9,26 @@ module.exports = query {body:'r'}, recl
hash:null hash:null
displayName: "TableOfContents" displayName: "TableOfContents"
_click: (e) -> _click: (id)->
document.location.hash = @urlsafe $(e.target).text() -> if id then document.location.hash = id
urlsafe: (str) ->
str.toLowerCase().replace(/\ /g, "-").replace(/[^a-z0-9~_.-]/g,"")
componentDidMount: -> componentDidMount: ->
@int = setInterval @checkHash,100 @int = setInterval @checkHash,100
@st = $(window).scrollTop() @st = $(window).scrollTop()
$(window).on 'scroll',@checkScroll # $(window).on 'scroll',@checkScroll
@$headers = $('#toc h1, #toc h2, #toc h3, #toc h4') @$headers = $('#toc').children('h1,h2,h3,h4').filter('[id]')
checkScroll: -> checkScroll: ->
st = $(window).scrollTop() st = $(window).scrollTop()
if Math.abs(@st-st) > 10 if Math.abs(@st-st) > 10
hash = null hash = null
@st = st @st = st
for k,v of @$headers for v in @$headers
continue if v.tagName is undefined continue if v.tagName is undefined
$h = $ v $h = $ v
hst = $h.offset().top-$h.outerHeight(true)+10 hst = $h.offset().top-$h.outerHeight(true)+10
if hst < st if hst < st
hash = @urlsafe $h.text() hash = $h.attr('id')
if hst > st and hash isnt @hash and hash isnt null if hst > st and hash isnt @hash and hash isnt null
@hash = "#"+hash @hash = "#"+hash
document.location.hash = hash document.location.hash = hash
@ -40,9 +37,9 @@ module.exports = query {body:'r'}, recl
checkHash: -> checkHash: ->
if document.location.hash?.length > 0 and document.location.hash isnt @hash if document.location.hash?.length > 0 and document.location.hash isnt @hash
hash = document.location.hash.slice(1) hash = document.location.hash.slice(1)
for k,v of @$headers for v in @$headers
$h = $ v $h = $ v
if hash is @urlsafe $h.text() if hash is $h.attr('id')
@hash = document.location.hash @hash = document.location.hash
offset = $h.offset().top - $h.outerHeight(true) offset = $h.offset().top - $h.outerHeight(true)
setTimeout -> $(window).scrollTop offset setTimeout -> $(window).scrollTop offset
@ -52,20 +49,23 @@ module.exports = query {body:'r'}, recl
componentWillUnmount: -> componentWillUnmount: ->
clearInterval @int clearInterval @int
collectHeader: ({gn,ga,c})->
if gn and gn[0] is 'h' and parseInt(gn[1]) isnt NaN
collectHeaders: (e) -> ga = _.clone ga
hs = [{gn:"h1", ga:{className:"t"}, c:["Table of contents"]}] ga.onClick = @_click ga.id
for k,v of e delete ga.id
if not v.gn then continue {gn,ga,c}
if v.gn[0] is 'h' and parseInt(v.gn[1]) isnt NaN
hs.push v
return hs
parseHeaders: -> parseHeaders: ->
if @props.body.c 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" 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() render: -> reactify @parseHeaders()

View File

@ -36,7 +36,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; var BodyComponent, CLICK, Links, TreeActions, TreeStore, a, clas, div, query, reactify, recl, ref;
clas = require('classnames'); clas = require('classnames');
@ -290,7 +290,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; var TreeActions, TreeStore, _load, code, div, recl, ref, span;
_load = require('./LoadComponent.coffee'); _load = require('./LoadComponent.coffee');
@ -350,12 +350,14 @@ module.exports = function(queries, Child, load) {
} }
request = {}; request = {};
for (k in _queries) { for (k in _queries) {
if (have[k] === void 0) { if (k !== 'kids') {
request[k] = _queries[k]; if (have[k] === void 0) {
request[k] = _queries[k];
}
} }
} }
if ((_queries.kids != null) && (have.kids != null)) { if (_queries.kids != null) {
if (_.isEmpty(have.kids)) { if (have.kids == null) {
request.kids = _queries.kids; request.kids = _queries.kids;
} else { } else {
request.kids = {}; request.kids = {};
@ -392,7 +394,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; var div, query, reactify, recl;
query = require('./Async.coffee'); query = require('./Async.coffee');
@ -418,7 +420,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; var div, recl, ref, textarea;
recl = React.createClass; recl = React.createClass;
@ -455,6 +457,7 @@ module.exports = {
list: require('./ListComponent.coffee'), list: require('./ListComponent.coffee'),
kids: require('./KidsComponent.coffee'), kids: require('./KidsComponent.coffee'),
toc: require('./TocComponent.coffee'), toc: require('./TocComponent.coffee'),
email: require('./EmailComponent.coffee'),
lost: recl({ lost: recl({
render: function() { render: function() {
return div({}, "<lost(", this.props.children, ")>"); return div({}, "<lost(", this.props.children, ")>");
@ -464,7 +467,88 @@ 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) {
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) {
if (valid === true) {
this.submit();
e.stopPropagation();
e.preventDefault();
return false;
} else {
return this.$email.addClass('error');
}
}
},
submit: function() {
return $.post(this.props.dataPath, {
email: this.$email.val()
}, (function(_this) {
return function() {
return _this.setState({
submit: true
});
};
})(this));
},
componentDidMount: function() {
return this.$email = $('input.email');
},
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; var a, div, hr, li, query, reactify, recl, ref, ul;
reactify = require('./Reactify.coffee'); reactify = require('./Reactify.coffee');
@ -504,7 +588,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; var a, clas, div, h1, li, query, reactify, recl, ref, ul;
clas = require('classnames'); clas = require('classnames');
@ -600,7 +684,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; var div, input, recl, ref, textarea;
recl = React.createClass; recl = React.createClass;
@ -641,7 +725,7 @@ module.exports = recl({
},{}],10:[function(require,module,exports){ },{}],11:[function(require,module,exports){
var Virtual, div, load, reactify, recl, ref, rele, span, walk; var Virtual, div, load, reactify, recl, ref, rele, span, walk;
recl = React.createClass; recl = React.createClass;
@ -709,7 +793,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, var a, div, input, query, reactify, recl, ref,
slice = [].slice; slice = [].slice;
@ -848,8 +932,9 @@ 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; var div, query, reactify, recl,
slice = [].slice;
query = require('./Async.coffee'); query = require('./Async.coffee');
@ -864,35 +949,35 @@ module.exports = query({
}, recl({ }, recl({
hash: null, hash: null,
displayName: "TableOfContents", displayName: "TableOfContents",
_click: function(e) { _click: function(id) {
return document.location.hash = this.urlsafe($(e.target).text()); return function() {
}, if (id) {
urlsafe: function(str) { return document.location.hash = id;
return str.toLowerCase().replace(/\ /g, "-").replace(/[^a-z0-9~_.-]/g, ""); }
};
}, },
componentDidMount: function() { componentDidMount: function() {
this.int = setInterval(this.checkHash, 100); this.int = setInterval(this.checkHash, 100);
this.st = $(window).scrollTop(); this.st = $(window).scrollTop();
$(window).on('scroll', this.checkScroll); return this.$headers = $('#toc').children('h1,h2,h3,h4').filter('[id]');
return this.$headers = $('#toc h1, #toc h2, #toc h3, #toc h4');
}, },
checkScroll: function() { checkScroll: function() {
var $h, hash, hst, k, ref, results, st, v; var $h, hash, hst, i, len, ref, results, st, v;
st = $(window).scrollTop(); st = $(window).scrollTop();
if (Math.abs(this.st - st) > 10) { if (Math.abs(this.st - st) > 10) {
hash = null; hash = null;
this.st = st; this.st = st;
ref = this.$headers; ref = this.$headers;
results = []; results = [];
for (k in ref) { for (i = 0, len = ref.length; i < len; i++) {
v = ref[k]; v = ref[i];
if (v.tagName === void 0) { if (v.tagName === void 0) {
continue; continue;
} }
$h = $(v); $h = $(v);
hst = $h.offset().top - $h.outerHeight(true) + 10; hst = $h.offset().top - $h.outerHeight(true) + 10;
if (hst < st) { if (hst < st) {
hash = this.urlsafe($h.text()); hash = $h.attr('id');
} }
if (hst > st && hash !== this.hash && hash !== null) { if (hst > st && hash !== this.hash && hash !== null) {
this.hash = "#" + hash; this.hash = "#" + hash;
@ -906,15 +991,15 @@ module.exports = query({
} }
}, },
checkHash: function() { 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) { if (((ref = document.location.hash) != null ? ref.length : void 0) > 0 && document.location.hash !== this.hash) {
hash = document.location.hash.slice(1); hash = document.location.hash.slice(1);
ref1 = this.$headers; ref1 = this.$headers;
results = []; results = [];
for (k in ref1) { for (i = 0, len = ref1.length; i < len; i++) {
v = ref1[k]; v = ref1[i];
$h = $(v); $h = $(v);
if (hash === this.urlsafe($h.text())) { if (hash === $h.attr('id')) {
this.hash = document.location.hash; this.hash = document.location.hash;
offset = $h.offset().top - $h.outerHeight(true); offset = $h.offset().top - $h.outerHeight(true);
setTimeout(function() { setTimeout(function() {
@ -931,42 +1016,39 @@ module.exports = query({
componentWillUnmount: function() { componentWillUnmount: function() {
return clearInterval(this.int); return clearInterval(this.int);
}, },
collectHeaders: function(e) { collectHeader: function(arg) {
var hs, k, v; var c, ga, gn;
hs = [ gn = arg.gn, ga = arg.ga, c = arg.c;
{ if (gn && gn[0] === 'h' && parseInt(gn[1]) !== NaN) {
gn: "h1", ga = _.clone(ga);
ga: { ga.onClick = this._click(ga.id);
className: "t" delete ga.id;
}, return {
c: ["Table of contents"] gn: gn,
} ga: ga,
]; c: c
for (k in e) { };
v = e[k];
if (!v.gn) {
continue;
}
if (v.gn[0] === 'h' && parseInt(v.gn[1]) !== NaN) {
hs.push(v);
}
} }
return hs;
}, },
parseHeaders: function() { parseHeaders: function() {
var k, ref, ref1, v; var i, len, ref, ref1, v;
if (this.props.body.c) { if (this.props.body.c) {
ref = this.props.body.c; ref = this.props.body.c;
for (k in ref) { for (i = 0, len = ref.length; i < len; i++) {
v = ref[k]; v = ref[i];
if (v.gn === 'div' && ((ref1 = v.ga) != null ? ref1.id : void 0) === "toc") { if (v.gn === 'div' && ((ref1 = v.ga) != null ? ref1.id : void 0) === "toc") {
return { return {
gn: "div", gn: "div",
ga: { ga: {
className: "toc", className: "toc"
onClick: this._click
}, },
c: this.collectHeaders(v.c) c: [{
gn: "h1",
ga: {
className: "t"
},
c: ["Table of contents"]
}].concat(slice.call(_.filter(v.c.map(this.collectHeader))))
}; };
} }
} }
@ -979,7 +1061,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; var Dispatcher;
Dispatcher = require('flux').Dispatcher; Dispatcher = require('flux').Dispatcher;
@ -1001,7 +1083,7 @@ module.exports = _.extend(new Dispatcher(), {
},{"flux":16}],14:[function(require,module,exports){ },{"flux":17}],15:[function(require,module,exports){
var rend; var rend;
rend = React.render; rend = React.render;
@ -1148,7 +1230,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. Copyright (c) 2015 Jed Watson.
Licensed under the MIT License (MIT), see Licensed under the MIT License (MIT), see
@ -1199,7 +1281,7 @@ $(function() {
}()); }());
},{}],16:[function(require,module,exports){ },{}],17:[function(require,module,exports){
/** /**
* Copyright (c) 2014-2015, Facebook, Inc. * Copyright (c) 2014-2015, Facebook, Inc.
* All rights reserved. * All rights reserved.
@ -1211,7 +1293,7 @@ $(function() {
module.exports.Dispatcher = require('./lib/Dispatcher') 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. * Copyright (c) 2014, Facebook, Inc.
* All rights reserved. * All rights reserved.
@ -1463,7 +1545,7 @@ var _prefix = 'ID_';
module.exports = Dispatcher; module.exports = Dispatcher;
},{"./invariant":18}],18:[function(require,module,exports){ },{"./invariant":19}],19:[function(require,module,exports){
/** /**
* Copyright (c) 2014, Facebook, Inc. * Copyright (c) 2014, Facebook, Inc.
* All rights reserved. * All rights reserved.
@ -1518,7 +1600,11 @@ var invariant = function(condition, format, a, b, c, d, e, f) {
module.exports = invariant; module.exports = invariant;
},{}],19:[function(require,module,exports){ },{}],20:[function(require,module,exports){
var dedup;
dedup = {};
module.exports = { module.exports = {
get: function(path, query, cb) { get: function(path, query, cb) {
var url; var url;
@ -1526,6 +1612,10 @@ module.exports = {
query = "no-query"; query = "no-query";
} }
url = (window.tree.basepath(path)) + ".json?q=" + (this.encode(query)); url = (window.tree.basepath(path)) + ".json?q=" + (this.encode(query));
if (dedup[url]) {
return;
}
dedup[url] = true;
return $.get(url, {}, function(data) { return $.get(url, {}, function(data) {
if (cb) { if (cb) {
return cb(null, data); return cb(null, data);
@ -1569,7 +1659,7 @@ module.exports = {
},{}],20:[function(require,module,exports){ },{}],21:[function(require,module,exports){
var EventEmitter, MessageDispatcher, QUERIES, TreeStore, _curr, _data, _tree, clog; var EventEmitter, MessageDispatcher, QUERIES, TreeStore, _curr, _data, _tree, clog;
EventEmitter = require('events').EventEmitter; EventEmitter = require('events').EventEmitter;
@ -1609,23 +1699,32 @@ TreeStore = _.extend(EventEmitter.prototype, {
return this.fulfillAt(this.getTree(path.split('/')), path, query); return this.fulfillAt(this.getTree(path.split('/')), path, query);
}, },
fulfillAt: function(tree, path, query) { fulfillAt: function(tree, path, query) {
var data, k, ref, sub, t; var data, have, k, sub, t;
data = this.fulfillLocal(path, query); data = this.fulfillLocal(path, query);
for (k in query) { have = _data[path];
t = query[k]; if (have != null) {
if (!QUERIES[k]) { for (k in query) {
continue; 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]) { if (query.kids) {
throw TypeError("Wrong query type: " + k + ", '" + t + "'"); if (have.EMPTY) {
} data.kids = {};
data[k] = (ref = _data[path]) != null ? ref[k] : void 0; } else {
} for (k in tree) {
if (query.kids) { sub = tree[k];
data.kids = {}; if (data.kids == null) {
for (k in tree) { data.kids = {};
sub = tree[k]; }
data.kids[k] = this.fulfillAt(sub, path + "/" + k, query.kids); data.kids[k] = this.fulfillAt(sub, path + "/" + k, query.kids);
}
}
} }
} }
if (!_.isEmpty(data)) { if (!_.isEmpty(data)) {
@ -1678,29 +1777,7 @@ TreeStore = _.extend(EventEmitter.prototype, {
this.loadValues(tree[k], path + "/" + k, v); this.loadValues(tree[k], path + "/" + k, v);
} }
if (data.kids && _.isEmpty(data.kids)) { if (data.kids && _.isEmpty(data.kids)) {
old.body = { old.EMPTY = true;
gn: 'div',
c: [
{
gn: 'h1',
ga: {
className: 'error'
},
c: ['Error: Empty path']
}, {
gn: 'div',
c: [
{
gn: 'pre',
c: [this.getCurr()]
}, {
gn: 'span',
c: ['is either empty or does not exist.']
}
]
}
]
};
} }
return _data[path] = old; return _data[path] = old;
}, },
@ -1805,7 +1882,7 @@ 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. // Copyright Joyent, Inc. and other Node contributors.
// //
// Permission is hereby granted, free of charge, to any person obtaining a // Permission is hereby granted, free of charge, to any person obtaining a
@ -2108,4 +2185,4 @@ function isUndefined(arg) {
return arg === void 0; return arg === void 0;
} }
},{}]},{},[14]); },{}]},{},[15]);

View File

@ -1,6 +1,9 @@
dedup = {} # XX wrong layer
module.exports = module.exports =
get: (path,query="no-query",cb) -> get: (path,query="no-query",cb) ->
url = "#{window.tree.basepath(path)}.json?q=#{@encode query}" 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 $.get url, {}, (data) -> if cb then cb null,data
encode: (obj)-> encode: (obj)->
delim = (n)-> Array(n+1).join('_') || '.' delim = (n)-> Array(n+1).join('_') || '.'

View File

@ -21,13 +21,17 @@ TreeStore = _.extend EventEmitter.prototype, {
fulfill: (path,query) -> @fulfillAt (@getTree path.split '/'),path,query fulfill: (path,query) -> @fulfillAt (@getTree path.split '/'),path,query
fulfillAt: (tree,path,query)-> fulfillAt: (tree,path,query)->
data = @fulfillLocal path, query data = @fulfillLocal path, query
for k,t of query when QUERIES[k] have = _data[path]
if t isnt QUERIES[k] then throw TypeError "Wrong query type: #{k}, '#{t}'" if have?
data[k] = _data[path]?[k] for k,t of query when QUERIES[k]
if query.kids if t isnt QUERIES[k] then throw TypeError "Wrong query type: #{k}, '#{t}'"
data.kids = {} data[k] = have[k]
for k,sub of tree if query.kids
data.kids[k] = @fulfillAt sub, path+"/"+k, 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 data unless _.isEmpty data
fulfillLocal: (path, query)-> fulfillLocal: (path, query)->
@ -54,14 +58,16 @@ TreeStore = _.extend EventEmitter.prototype, {
@loadValues tree[k], path+"/"+k, v @loadValues tree[k], path+"/"+k, v
if data.kids && _.isEmpty data.kids if data.kids && _.isEmpty data.kids
old.body = old.EMPTY = true
gn: 'div' # XX why here?
c: [ {gn:'h1', ga:{className:'error'}, c:['Error: Empty path']} # old.body =
{gn:'div', c:[ # gn: 'div'
{gn:'pre', c:[@getCurr()]} # c: [ {gn:'h1', ga:{className:'error'}, c:['Error: Empty path']}
{gn:'span', c:['is either empty or does not exist.']} # {gn:'div', c:[
# {gn:'list'} XX handle empty snip # {gn:'pre', c:[@getCurr()]}
] }] # {gn:'span', c:['is either empty or does not exist.']}
# # {gn:'list'} XX handle empty snip
# ] }]
_data[path] = old _data[path] = old

View File

@ -93,7 +93,7 @@
[%set-title til=@t] :: set title [%set-title til=@t] :: set title
[%set-description des=@t] :: XX (list ,@t) :: set description [%set-description des=@t] :: XX (list ,@t) :: set description
[%set-done don=?] :: set done [%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 :: ++ task ::
$: id=@uvH :: $: id=@uvH ::