urbit/web/unmark/all.hoon

66 lines
1.3 KiB
Plaintext
Raw Normal View History

:: Render all %%/{@u}.txt test cases
::
:::: /hoon/all/unmark/web
::
2017-11-14 05:40:15 +03:00
/+ cram
2017-08-04 01:34:16 +03:00
::
2017-11-28 03:22:08 +03:00
/= cor
/^ (list {@ud wain})
/: /%%/
/; |= a/(map knot wain)
=; kid/(list {@ud wain}) (sort kid dor)
%+ murn ~(tap by a)
|= {b/knot c/wain}
%+ bind (slaw %ud b)
|=(d/@ud [d c])
/_ /txt/
::
|%
++ rolt |=(a/wall `tape`?~(a ~ ?~(t.a i.a :(weld i.a "\0a" $(a t.a)))))
++ wush
2017-08-04 01:34:16 +03:00
|= {wid/@u tan/tang} ^- tape
(rolt (zing (turn tan |=(a/tank (wash 0^wid a)))))
::
++ mads
2017-11-14 05:29:43 +03:00
=, userlib
|= a/wain ^- manx
=/ try/(each manx tang)
%- mule |.
elm:(static:cram (rash (nule:unix ';>' a) apex:(sail &):vast))
?- -.try
$& p.try
2017-11-14 05:29:43 +03:00
$| ;div
;h3: ERROR
;pre: {(wush 120 p.try)}
== ==
::
2017-08-04 01:34:16 +03:00
++ split-on
=| hed/wain
|= {mid/@t all/wain} ^+ [hed all]
?~ all !!
?: =(mid i.all) [(flop hed) t.all]
$(all t.all, hed :_(hed i.all))
::
++ strip
|= a/manx ^- manx
:_ (turn c.a ..$)
?+ g.a g.a
{@ {$id *} *} g.a(a t.a.g.a)
{$$ {$$ *} $~}
=< g.a(v.i.a (tufa (turn (tuba v.i.a.g.a) .)))
|=(b/@c `@`?+(b b $~-~201c. '"', $~-~201d. '"'))
==
--
2017-08-04 01:34:16 +03:00
::
^- manx
;ul
2017-08-04 01:34:16 +03:00
;li
;ul
;* ^- marl
%+ turn cor
|= {num/@u txt/wain}
2017-11-14 05:29:43 +03:00
;li: ;{p -[<num>]} +{(mads txt)} ;{hr}
2017-08-04 01:34:16 +03:00
==
==
2017-11-14 05:40:15 +03:00
==