shrub/gen/walk.hoon

161 lines
3.8 KiB
Plaintext
Raw Normal View History

2017-04-05 03:33:20 +03:00
!:
2017-03-26 07:25:04 +03:00
::::
::
:- %say
|= $: {now/@da * bec/beak}
*
==
2017-04-05 03:33:20 +03:00
=< :- %noun
%hello
2017-03-26 07:25:04 +03:00
|%
::
2017-04-05 03:33:20 +03:00
++ ap
2017-03-26 07:25:04 +03:00
|_ gen/twig
2017-04-05 03:33:20 +03:00
++ gi
=| whit
=* wit -
|%
++ gray
^- ?
|
:: on reflection, perhaps just obsessive linting
::
:: ?| ?=(^ lab)
:: ?=(^ boy)
:: |- ^- ?
:: ?~ def |
:: |($(def l.def) $(def r.def) !(~(has in use) p.n.def))
:: ==
::
++ grad
|= $: gen/twig
wit/whit
aid/$-({? twig whit} {twig whit})
2017-03-26 07:25:04 +03:00
==
2017-04-05 03:33:20 +03:00
^- (unit (pair twig whit))
=: ^gen gen
^wit wit
2017-03-26 07:25:04 +03:00
==
2017-04-05 03:33:20 +03:00
?: =([~ ~ ~ ~] wit) `[gen wit]
=< apex
|%
++ apex
^- (unit (pair twig whit))
=^ one wit prim
=^ two wit senc(gen one)
?: =(gen two)
~
`(aid & two wit)
::
:: resolve body and label issues
::
++ prim
^- (pair twig whit)
?: ?=(^ -.gen) flam
?+ -.gen flam
$halo flam
$base runk
$leaf runk
2017-09-18 01:10:40 +03:00
$bcpt runk
2017-09-18 02:31:49 +03:00
$bccb runk
$bccl runk
$bccn runk
$bchp runk
$bckt runk
$bcwt runk
$bcts flam
$bcsm runk
2017-09-18 04:32:20 +03:00
$brcb ((doof -.gen +>.gen) p.gen)
$brcl ((doof -.gen +>.gen) p.gen)
$brcn ((doof -.gen +>.gen) p.gen)
$brdt ((doof -.gen +>.gen) p.gen)
$brkt ((doof -.gen +>.gen) p.gen)
$brhp ((doof -.gen +>.gen) p.gen)
$brsg ((doof -.gen +>.gen) p.gen)
$brtr ((doof -.gen +>.gen) p.gen)
2017-09-17 21:14:12 +03:00
$brts ((doof -.gen +>.gen) p.gen)
2017-09-18 04:32:20 +03:00
$brwt ((doof -.gen +>.gen) p.gen)
2017-04-05 03:33:20 +03:00
==
::
:: resolve variable issues
::
++ senc
^- (pair twig whit)
?: ?=(^ -.gen) flam
?+ -.gen flam
2017-09-20 02:24:30 +03:00
$ktts ((helk -.gen +>.gen) p.gen)
2017-09-18 02:31:49 +03:00
$bcts ((helk -.gen +>.gen) p.gen)
2017-04-05 03:33:20 +03:00
$var ((hulp -.gen +>.gen) p.gen)
$rev ((hulp -.gen +>.gen) p.gen)
$sip ((hulp -.gen +>.gen) p.gen)
$aka ((humm -.gen +>.gen) p.gen)
==
::
++ flam [gen wit]
++ grif
|= {cog/term wat/what}
^- {what whit}
?: =(~ def)
?~ boy [wat wit]
[boy wit(boy ~)]
=+ yeb=(~(get by def) cog)
?~ yeb [wat wit]
[`u.yeb wit(use (~(put in use) cog))]
::
++ doof
|* {pif/@tas suf/*}
|= pac/chap
^- (pair twig whit)
:_ wit(lab ~, boy ~)
=- [pif - suf]
^- chap
:- ?~(lab p.pac [u.lab ~])
?~(boy q.pac boy)
::
++ helk
|* {pif/@tas suf/*}
|= got/toga
^- (pair twig whit)
=^ gef wit (tong got)
[[pif gef suf] wit]
::
++ hulp
|* {pif/@tas suf/*}
|= hot/toro
^- (pair twig whit)
=^ tog wit (tong p.hot)
[[pif [tog q.hot] suf] wit]
::
++ humm
|* {pif/@tas suf/*}
|= {cog/term wat/what)
^- (pair twig whit)
=^ taw wit (grif cog wat)
[[pif [cog taw] suf] wit]
::
++ runk
^- (pair twig whit)
?~ boy flam
[[%halo boy gen] wit(boy ~)]
::
++ tong
|= got/toga
^- {toga whit}
?@ got
=^ wat wit (grif got ~)
?~ wat [got wit]
[[%1 [wat got] [%0 ~]] wit]
?- -.got
$0 [got wit]
$1 =^ wat wit (grif q.p.got p.p.got)
=^ sub wit $(got q.got)
[[%1 [wat q.p.got] sub] wit]
$2 =^ one wit $(got p.got)
=^ two wit $(got q.got)
[[%2 one two] wit]
==
--
2017-03-26 07:25:04 +03:00
--
--
--