shrub/gen/solid.hoon

76 lines
1.9 KiB
Plaintext
Raw Normal View History

:: Compile arvo as a pill noun, without compiler changes.
:: usage
::
:: .urbit/pill +solid
2015-06-18 04:08:47 +03:00
::
2016-02-11 03:41:28 +03:00
:::: /hoon/solid/gen
2015-06-18 04:08:47 +03:00
::
/? 310
2015-06-18 04:08:47 +03:00
::
::::
!:
2015-09-12 03:24:51 +03:00
:- %say
2016-08-11 21:15:06 +03:00
|= $: {now/@da eny/@uvJ bec/beak}
2017-12-07 04:51:26 +03:00
{arg/$@($~ {top/path $~}) dub/_|}
2015-06-18 04:08:47 +03:00
==
2017-12-07 04:51:26 +03:00
?~ arg $(arg ~[top=`path`/(scot %p p.bec)/[q.bec]/(scot %da now)/sys])
2017-12-07 04:53:17 +03:00
::
:- %noun
2017-12-07 04:51:26 +03:00
=+ pax=`path`(weld top.arg `path`[%hoon ~])
2017-12-07 21:13:34 +03:00
=+ arp=`path`(weld top.arg `path`[%arvo ~])
2015-06-18 04:08:47 +03:00
~& %solid-start
=+ txt=.^(@t %cx (weld pax `path`[%hoon ~]))
=+ rax=.^(@t %cx (weld arp `path`[%hoon ~]))
=+ ^= ken
2018-03-19 06:54:47 +03:00
=- ?:(?=(%& -.res) p.res (mean (flop p.res)))
^= res %- mule |.
~& %solid-loaded
=+ gen=(rain pax txt)
~& %solid-parsed
=+ one=(~(mint ut %noun) %noun gen)
~& %solid-compiled
2017-12-07 04:51:26 +03:00
?. dub
=+ two=(~(mint ut p.one) %noun (rain arp rax))
~& %solid-arvo
[7 q.one q.two]
=/ tri
'''
:: XX moveme to, uh arvo probably, this depends on too many names
|= [pax=path txt=@t arp=path rax=@t]
=+ gen=(rain pax txt)
~& %solid-double-parsed
=+ one=(~(mint ut %noun) %noun gen)
~& %solid-double-compiled
=+ two=(~(mint ut p.one) %noun (rain arp rax))
~& %solid-arvo
[7 q.one q.two]
'''
=+ all=.*(0 q.one)
.* all
:+ 7 =<(+ .*(all [9 2 0+2 1+[p.one tri] 0+7]))
[9 2 0+2 1+[pax txt arp rax] 0+7]
::
~& [%solid-kernel `@ux`(mug ken)]
2015-06-18 04:08:47 +03:00
:- ken
=+ all=.*(0 ken)
=+ ^= vay ^- (list {p/@tas q/path})
:~ [%$ /zuse]
[%b /vane/behn]
[%d /vane/dill]
2017-12-07 08:28:11 +03:00
[%a /vane/ames]
[%c /vane/clay]
[%g /vane/gall]
[%e /vane/eyre]
2017-12-07 08:28:11 +03:00
[%f /vane/ford]
2015-06-18 04:08:47 +03:00
==
|- ^+ all
?~ vay all
2017-12-07 04:51:26 +03:00
=+ pax=(weld top.arg q.i.vay)
2016-01-26 03:47:58 +03:00
=+ txt=.^(@ %cx (weld pax `path`[%hoon ~]))
2015-06-18 04:08:47 +03:00
=+ sam=[now `ovum`[[%gold ~] [%veer p.i.vay pax txt]]]
~& [%solid-veer i.vay]
=+ gat=.*(all .*(all [0 42]))
=+ nex=+:.*([-.gat [sam +>.gat]] -.gat)
$(vay t.vay, all nex)