shrub/main/lib/pony.hoon

70 lines
1.8 KiB
Plaintext
Raw Normal View History

2013-09-29 00:21:18 +04:00
!:
:: /=main=/lib/pony/hoon
::
|%
2013-10-16 01:02:23 +04:00
++ pogo :: merge bowls
|= [top=bowl bot=bowl]
^- bowl
:- (weld p.top p.bot)
?~ q.top q.bot
?~ q.bot q.top
:+ ~
(weld -.u.q.top -.u.q.bot)
|= [now=@da pax=path nut=note]
2014-02-08 00:02:30 +04:00
^- bowl
?: (lien -.u.q.top |=(a=slip =(pax p.a)))
^$(top (+.u.q.top +<), p.bot ~)
^$(bot (+.u.q.bot +<), p.top ~)
2013-10-16 01:02:23 +04:00
::
2013-09-29 00:21:18 +04:00
++ polo :: prompt
2013-10-16 01:02:23 +04:00
|= [pim=prom pro=tape def=tape use=tape]
|* [rul=_rule woo=$+([@da *] bowl)]
2013-09-29 00:21:18 +04:00
^- bowl
2013-10-16 01:02:23 +04:00
:- ~ :- ~
2013-09-29 00:21:18 +04:00
:- :~ [[%polo ~] [%up pim pro def]]
==
|= [now=@da pax=path nut=note]
^- bowl
?> &(=([%polo ~] pax) ?=(%up -.nut))
=+ rey=(rush p.nut rul)
?~ rey
:- [[%la %leaf ?~(use "invalid response" use)] ~]
:- ~
[[[[%polo ~] [%up pim pro def]] ~] ..$]
(woo now u.rey)
::
++ pomo |=([gud=gift bol=bowl] [[gud p.bol] q.bol])
++ pomp |=([tix=tape bol=bowl] (pomo la/leaf/tix bol))
2013-10-16 01:02:23 +04:00
++ pond :: text block
|=(lub=@ :_(~ (turn (lore lub) |=(a=@t la/leaf/(trip a)))))
2013-09-29 00:21:18 +04:00
::
++ posh :: pause until
|= end=@da
|= wop=$+(@da bowl)
2013-09-29 00:21:18 +04:00
^- bowl
2013-10-16 01:02:23 +04:00
:- ~ :- ~
2013-09-29 00:21:18 +04:00
:- ^- (list slip)
:~ [~ %wa end]
==
|= [now=@da pax=path nut=note]
(wop now)
::
++ post :: request/response
|= [him=@p cav=@tas msg=*]
|= woo=$+([@da (unit ,*)] bowl)
2013-09-29 00:21:18 +04:00
^- bowl
2013-10-16 01:02:23 +04:00
=+ leg="waiting on {(scow %p him)}/{(trip cav)}"
:- :~ [%sq him cav /request msg]
==
:- ~
2013-09-29 00:21:18 +04:00
:- ^- (list slip)
:~ [/request [%rt ~]]
2013-09-29 00:21:18 +04:00
[/prompt [%up %none leg ~]]
==
|= [now=@da pax=path nut=note]
2013-09-29 00:21:18 +04:00
^- bowl
?+ -.nut ~& [%bad-nut nut] !!
%rt (woo now p.nut)
2013-09-29 00:21:18 +04:00
==
--