urbit/main/lib/pony.hoon

68 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]
2013-11-03 05:29:28 +04:00
%. +<
2013-10-16 01:02:23 +04:00
?:((lien -.u.q.top |=(a=slip =(pax p.a))) +.u.q.top +.u.q.bot)
::
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]
2013-09-29 00:21:18 +04:00
|* [rul=_rule woo=||([@da *] bowl)]
^- 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
2013-10-16 01:02:23 +04:00
|= 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=*]
2013-09-29 00:21:18 +04:00
|= woo=||([@da (unit ,*)] bowl)
^- 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]
^- bowl
?+ -.nut ~& [%bad-nut nut] !!
%rt (woo now p.nut)
2013-09-29 00:21:18 +04:00
==
--