urbit/app/test.hoon

57 lines
1.1 KiB
Plaintext
Raw Normal View History

::
2017-02-14 01:57:07 +03:00
=, gall
=, ford
2017-11-14 03:31:46 +03:00
=, format
2016-11-17 02:05:24 +03:00
|_ {bowl $~}
++ peek _~
2017-11-14 03:31:46 +03:00
++ made-a-core
|= {a/spur @uvH b/gage}
:_ +>.$
?> ?=([%tabl ^ ~] b)
=/ cur p.i.p.b
%- %- slog
?+ -.cur !!
%| (flop p.cur)
%& ~ ::[(sell q.p.cur)]~
==
=/ nex/(list spur)
=<(p ;;(,[%& %cont * p=(list spur)] q.i.p.b))
?~ nex ~
[ost (build-core nex)]~
::
++ build-core
|= [a=spur b=(list spur)]
~& >> (flop a)
:^ %exec a-core+a our
%- some
^- bilk
:- now-beak
:~ %tabl
[[%core now-beak a] [%$ %cont !>(b)]]
==
2016-11-17 02:05:24 +03:00
::
++ poke-noun
2017-12-07 01:58:34 +03:00
|= [%cores a=path] ::TODO restore historical [%marks ~] handler
2017-11-14 03:31:46 +03:00
:_ +>
?: [dry=|]
~&((list-cores a) ~)
[ost (build-core [- +]:(list-cores a))]~
::
++ list-cores
|= a/path ^- (list spur)
=/ sup (flop a)
|- ^- (list spur)
2017-11-30 00:32:22 +03:00
%- zing
%+ turn
=- (sort ~(tap by -) aor)
dir:.^(arch %cy (en-beam now-beak sup))
|= [a=knot ~] ^- (list spur)
2017-11-14 03:31:46 +03:00
=. sup [a sup]
2017-11-30 00:32:22 +03:00
?~ [fil:.^(arch %cy (en-beam now-beak [%hoon sup]))]
^$
~& (flop sup)
[sup ^$]
2016-11-17 02:05:24 +03:00
::
++ now-beak %_(byk r [%da now])
--