From 8a8055ba3a0005c7fe0fdd7419d48ac4981cb194 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Tue, 16 Jun 2015 18:06:58 -0700 Subject: [PATCH] demo sched mark --- base/cat/cat.hoon | 4 +++- base/mar/sched.hoon | 29 +++++++++++++++++++++++++++++ base/pub/test.sched | 3 +++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 base/mar/sched.hoon create mode 100644 base/pub/test.sched diff --git a/base/cat/cat.hoon b/base/cat/cat.hoon index c054ecaf27..c93260303b 100644 --- a/base/cat/cat.hoon +++ b/base/cat/cat.hoon @@ -8,12 +8,14 @@ :::: :: |= [^ [arg=(list path)] ~] -=- tang/(flop (zing -)) +=- tang/(flop `tang`(zing -)) %+ turn arg |= pax=path ^- tang =+ ark=;;(arch .^(%cy pax)) ?^ q.ark + ?: =(%sched -:(flop pax)) + [>;;((map ,@da cord) .^(%cx pax))<]~ [leaf/(spud pax) (pretty-file .^(%cx pax))] ?- r.ark :: handle ambiguity ~ diff --git a/base/mar/sched.hoon b/base/mar/sched.hoon new file mode 100644 index 0000000000..7d3b15682e --- /dev/null +++ b/base/mar/sched.hoon @@ -0,0 +1,29 @@ +!: +:::: /hoon/core/sched/mar + :: +|_ dat=(map ,@da cord) +++ grow :: convert to + |% ++ mime `^mime`[/text/x-sched (tact tape)] + ++ tape + (zing `wall`(turn sorted-list |=([a=@da b=cord] "{} {(trip b)}\0a"))) + ++ elem =< ;list: *{(turn sorted-list .)} + |= [tym=@da ite=cord] ^- manx + ;li: ;{b "{}"}: {(trip ite)} + ++ sorted-list + (sort (~(tap by dat)) |=([[l=@ @] [r=@ @]] (lth l r))) + -- +++ grab + |% :: convert from + ++ mime + |= [p=mite q=octs] ^+ dat + =< (mo (turn (lore q.q) .)) + |= a=@t ^- [@da @t] + %+ rash a + ;~ (glue ace) + (cook |=(a=coin ?>(?=([~ %da @] a) `@da`q.p.a)) nuck:so) + (cook crip (star prn)) + == + -- +++ grad |% + ++ sted %mime +-- -- diff --git a/base/pub/test.sched b/base/pub/test.sched new file mode 100644 index 0000000000..84e85f6e1b --- /dev/null +++ b/base/pub/test.sched @@ -0,0 +1,3 @@ +~1970.1.1 Hello world +~1970.2.1 Hallo world? +~1970.1.2 Reordered for goo reason