2016-03-24 23:57:05 +03:00
|
|
|
::
|
|
|
|
:::: /hoon/plan/mar
|
|
|
|
::
|
|
|
|
/? 310
|
2016-03-29 01:17:08 +03:00
|
|
|
/- plan-acct, plan-diff
|
2016-11-17 04:42:58 +03:00
|
|
|
::
|
2016-03-24 23:57:05 +03:00
|
|
|
:::: ~fyr
|
|
|
|
::
|
2016-12-07 06:13:33 +03:00
|
|
|
=, eyre
|
2016-12-03 04:11:44 +03:00
|
|
|
=, html
|
2016-12-03 01:14:39 +03:00
|
|
|
=, format
|
2016-06-03 02:04:01 +03:00
|
|
|
|_ all/{{who/@txname loc/@txloc} acc/(map knot plan-acct)}
|
2016-03-24 23:57:05 +03:00
|
|
|
::
|
|
|
|
++ grow :: convert to
|
2016-03-26 02:19:48 +03:00
|
|
|
=+ all
|
2016-03-24 23:57:05 +03:00
|
|
|
|%
|
|
|
|
++ txt
|
2016-03-26 02:19:48 +03:00
|
|
|
^- wain
|
2016-03-26 02:27:17 +03:00
|
|
|
:+ (cat 3 'User ' ?~(who 'of Urbit' who))
|
2016-06-03 02:04:01 +03:00
|
|
|
(cat 3 'Location ' ?~(loc %unknown loc))
|
2017-02-13 23:43:18 +03:00
|
|
|
%+ turn (sort ~(tap by acc) aor)
|
2016-03-29 01:36:59 +03:00
|
|
|
|= {a/knot b/plan-acct} ^- cord
|
2016-03-26 02:19:48 +03:00
|
|
|
%+ rap 3
|
2016-03-29 01:36:59 +03:00
|
|
|
:^ a ': ' usr.b
|
2016-12-03 04:11:44 +03:00
|
|
|
?~(url.b ~ [', ' (apix:en-purl u.url.b)])
|
2016-03-29 01:36:59 +03:00
|
|
|
::
|
|
|
|
++ plan-json
|
2016-12-03 02:47:16 +03:00
|
|
|
%- pairs:enjs :~
|
2016-03-29 01:36:59 +03:00
|
|
|
who+?~(who ~ s+who)
|
2016-06-03 02:04:01 +03:00
|
|
|
loc+?~(loc ~ s+loc)
|
2016-03-29 01:36:59 +03:00
|
|
|
acc+o+(~(run by acc) json-acct)
|
|
|
|
==
|
|
|
|
++ json-acct :: helper
|
|
|
|
|= a/plan-acct ^- json
|
2016-12-03 04:11:44 +03:00
|
|
|
=/ url ?~(url.a ~ (tape:enjs (apix:en-purl u.url.a)))
|
2016-12-03 02:47:16 +03:00
|
|
|
(pairs:enjs usr+s+usr.a url+url ~)
|
2016-03-24 23:57:05 +03:00
|
|
|
--
|
|
|
|
++ grab |% :: convert from
|
2016-07-12 01:57:21 +03:00
|
|
|
++ noun {{cord cord} (map knot plan-acct)} :: clam from %noun
|
2016-03-24 23:57:05 +03:00
|
|
|
++ txt
|
2016-03-26 02:19:48 +03:00
|
|
|
|^ |= a/wain ^+ all
|
|
|
|
?> ?=({@t @t *} a)
|
2016-03-26 02:27:17 +03:00
|
|
|
:- [(rash i.a user) (rash i.t.a location)]
|
|
|
|
(malt (turn t.t.a |=(b/cord (rash b account))))
|
2016-03-26 02:19:48 +03:00
|
|
|
::
|
2016-03-26 02:27:17 +03:00
|
|
|
++ user ;~(pfix (jest 'User ') (cook crip (star prn)))
|
2016-03-29 01:17:08 +03:00
|
|
|
++ knot (sear (flit |=(a/^knot !=('' a))) urs:ab)
|
2016-06-03 02:04:01 +03:00
|
|
|
++ location ;~(pfix (jest 'Location ') (cook crip (star prn)))
|
2016-03-26 02:27:17 +03:00
|
|
|
++ account
|
2016-03-26 02:19:48 +03:00
|
|
|
;~ plug
|
2016-03-29 01:17:08 +03:00
|
|
|
knot
|
|
|
|
;~(pfix col ace knot)
|
2016-12-03 04:11:44 +03:00
|
|
|
(punt ;~(pfix com ace aurf:de-purl))
|
2016-03-26 02:19:48 +03:00
|
|
|
==
|
|
|
|
--
|
2016-12-03 01:14:39 +03:00
|
|
|
++ mime |=({* a/octs} (txt (to-wain q.a))) :: XX mark translation
|
2016-03-24 23:57:05 +03:00
|
|
|
--
|
|
|
|
++ grad
|
|
|
|
|%
|
|
|
|
++ form %plan-diff
|
|
|
|
++ diff
|
2016-03-29 01:17:08 +03:00
|
|
|
|= neu/_all ^- plan-diff :: XXX map functions
|
|
|
|
:+ ?:(=(-.all -.neu) ~ (some -.neu))
|
2017-02-13 23:43:18 +03:00
|
|
|
=< (malt `(list {knot $~})`(murn ~(tap by acc.all) .))
|
2016-03-29 01:17:08 +03:00
|
|
|
|= {a/knot *} ^- (unit {knot $~})
|
|
|
|
?:((~(has by acc.neu) a) ~ (some [a ~]))
|
2017-02-13 23:43:18 +03:00
|
|
|
=< (malt (murn ~(tap by acc.neu) .))
|
2016-03-29 01:17:08 +03:00
|
|
|
|= {a/knot b/plan-acct} ^- (unit {knot plan-acct})
|
2016-03-26 02:27:17 +03:00
|
|
|
?: =([~ b] (~(get by acc.all) a))
|
2016-03-24 23:57:05 +03:00
|
|
|
~
|
|
|
|
(some [a b])
|
|
|
|
::
|
|
|
|
++ pact
|
2016-03-29 01:17:08 +03:00
|
|
|
|= dif/plan-diff ^+ all :: XXX map functions
|
|
|
|
:- (fall inf.dif -.all)
|
2016-03-24 23:57:05 +03:00
|
|
|
=; neu (~(uni by neu) put.dif)
|
2017-02-13 23:43:18 +03:00
|
|
|
=+ del=~(tap by del.dif)
|
2016-03-26 02:27:17 +03:00
|
|
|
|- ^+ acc.all
|
|
|
|
?~ del acc.all
|
|
|
|
$(del t.del, acc.all (~(del by acc.all) p.i.del))
|
2016-03-25 00:34:19 +03:00
|
|
|
::
|
|
|
|
++ can-join
|
|
|
|
|= {ali/plan-diff bob/plan-diff} ^- ?
|
2016-03-29 01:17:08 +03:00
|
|
|
?& !&(?=({{^ *} {^ *}} +<) !=(u.inf.ali u.inf.bob)) :: compatible info
|
2016-03-26 02:19:48 +03:00
|
|
|
=(~ (~(int by `(map knot *)`del.ali) put.bob)) :: no del-put
|
2016-03-25 00:34:19 +03:00
|
|
|
=(~ (~(int by `(map knot *)`put.ali) del.bob)) :: conflicts
|
|
|
|
.= (~(int by put.ali) put.bob) :: and all put
|
|
|
|
(~(int by put.bob) put.ali) :: values match
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ join
|
|
|
|
|= {ali/plan-diff bob/plan-diff}
|
|
|
|
^- (unit plan-diff)
|
|
|
|
?. (can-join ali bob)
|
|
|
|
~
|
2016-03-29 01:17:08 +03:00
|
|
|
%^ some
|
|
|
|
(mate inf.ali inf.bob)
|
|
|
|
(~(uni by del.ali) del.bob)
|
|
|
|
(~(uni by put.ali) put.bob)
|
2016-03-24 23:57:05 +03:00
|
|
|
--
|
|
|
|
--
|