Revise some bowl handling.

This commit is contained in:
C. Guy Yarvin 2013-10-15 14:02:23 -07:00
parent 520225bf87
commit 92e9a93fa0
4 changed files with 51 additions and 97 deletions

View File

@ -8,14 +8,14 @@
=- ^- bowl
?^ arg (fud p.arg)
%+ pomp ""
%+ (polo ~ %text "Do you have a ship and a ticket? " "yes" ~)
%+ (polo %text "Do you have a ship and a ticket? " "yes" ~)
;~(pose (jest %yes) (just %no))
|= [* ans=@t]
?. =(%yes ans)
:_ ~
:~ [%la %leaf "Please ask curtis.yarvin@gmail.com for one."]
==
%+ (polo ~ %text "Your ship: ~" ~ ~)
%+ (polo %text "Your ship: ~" ~ ~)
fed:ag
|= [* mig=@p]
^- bowl
@ -64,18 +64,18 @@
%+ pomp " for whom should I build?"
%+ pomp ""
%+ pomp " -- Bunting, _Chomei at Toyama_"
%+ pond ^:@/===doc%/warning/txt
%+ (polo ~ %text "Your ticket: ~" ~ ~)
%+ pogo (pond ^:@/===doc%/warning/txt)
%+ (polo %text "Your ticket: ~" ~ ~)
fed:ag
|= [* tic=@p]
%+ pond ^:@/===doc%/entropy/txt
%+ (polo ~ %pass "Entropy: " ~ ~)
%+ pogo (pond ^:@/===doc%/entropy/txt)
%+ (polo %pass "Entropy: " ~ ~)
(boss 256 (more gon qit))
|= [* tey=@]
=. tey (shax tey)
%+ pomp "Entropy check: {<`@p`(mug tey)>}"
%+ pond ^:@/===doc%/language/txt
%+ (polo ~ %text "Language: " "en" ~)
%+ pogo (pond ^:@/===doc%/language/txt)
%+ (polo %text "Language: " "en" ~)
%+ sear
|= [a=@ b=@]
^- (unit ,@ta)
@ -87,12 +87,12 @@
%+ pomp "Okay, we'll be speaking {(need (glon lag))}."
^- bowl
?. ?=(%duke ran)
%+ (polo ~ %text "Name: " ~ ~)
%+ (polo %text "Name: " ~ ~)
(boss 256 (more gon qit))
|= [now=@da nam=@]
(moss now tic tey lag (gcos [ran nam]))
%+ pond ^:@/===doc%/identity/txt
%+ (polo ~ %text "Form: %" "lady" ~)
%+ pogo (pond ^:@/===doc%/identity/txt)
%+ (polo %text "Form: %" "lady" ~)
;~ pose
(jest %anon)
(jest %band)
@ -109,7 +109,7 @@
?+ fom !!
%anon (moss now tic tey lag [%duke %anon ~])
%punk
%+ (polo ~ %text "Handle: " ~ ~)
%+ (polo %text "Handle: " ~ ~)
(boss 256 (plus alp))
|= [now=@da puc=@t]
(moss now tic tey lag [%duke %punk puc])
@ -117,33 +117,33 @@
?(%band %crew %dept %fair %home %holy)
%- moon
|= [* gov=govt]
%+ (polo ~ %text "Name: " ~ ~)
%+ (polo %text "Name: " ~ ~)
loon
|= [now=@da nam=@t]
(moss now tic tey lag [%duke (what fom `corp`[nam gov])])
::
?(%lord %lady)
%+ pond ^:@/===doc%/person/txt
%+ (polo ~ %text "Year you were born: " "19" ~)
%+ pogo (pond ^:@/===doc%/person/txt)
%+ (polo %text "Year you were born: " "19" ~)
dim:ag
|= [* yar=@]
%- moon
|= [* gov=govt]
%+ pond ^:@/===doc%/name/txt
%+ (polo ~ %text "First name: " ~ ~)
%+ pogo (pond ^:@/===doc%/name/txt)
%+ (polo %text "First name: " ~ ~)
loon
|= [* fis=@t]
%+ (polo ~ %text "Middle name (or blank): " ~ ~)
%+ (polo %text "Middle name (or blank): " ~ ~)
;~(pose (stag ~ loon) (easy ~))
|= [* mid=(unit ,@t)]
%+ (polo ~ %text "Nickname/handle (or blank): " ~ ~)
%+ (polo %text "Nickname/handle (or blank): " ~ ~)
;~(pose (stag ~ loon) (easy ~))
|= [* nik=(unit ,@t)]
%+ (polo ~ %text "Last name: " ~ ~)
%+ (polo %text "Last name: " ~ ~)
loon
|= [* las=@t]
%+ pond ^:@/===doc%/banner/txt
%+ (polo ~ %text "Banner: %" "blue" ~)
%+ pogo (pond ^:@/===doc%/banner/txt)
%+ (polo %text "Banner: %" "blue" ~)
;~ pose
(jest %white)
(jest %blue)
@ -159,8 +159,8 @@
::
++ moon
|* woo=||([@da govt] bowl)
%+ pond ^:@/===doc%/location/txt
%+ (polo ~ %text "Location: " "us/94114" ~)
%+ pogo (pond ^:@/===doc%/location/txt)
%+ (polo %text "Location: " "us/94114" ~)
;~ pose
;~ plug
(cook |=([a=@ b=@] (cat 3 a b)) ;~(plug low low))
@ -177,7 +177,8 @@
|= [now=@da tic=@p tey=@ ges=gens]
^- bowl
=+ bur=(shax :(mix (jam ges) tey))
%+ (posh (add ~s1 now)) ~[la/leaf/"generating 2048-bit RSA key..."]
%+ pomp "generating 2048-bit RSA key..."
%- (posh (add ~s1 now))
|= now=@da
=+ loy=(brew 2.048 bur)
%- (post bos %ta [mig tic ges pub:ex:loy])

View File

@ -5,11 +5,11 @@
|= [est=time *]
|= [who=@p ~]
^- bowl
%+ (polo ~ %pass "passphrase: " ~ ~)
%+ (polo %pass "passphrase: " ~ ~)
(boss 256 (more gon qit))
|= [now=@da fra=@]
%+ (posh (add ~s1 now))
~[la/leaf/"generating carrier {(scow %p who)} (#{(scow %ud who)})"]
%+ pomp "generating carrier {(scow %p who)} (#{(scow %ud who)})"
%- (posh (add ~s1 now))
|= now=@da
:_ ~
=+ bur=(shax (add who (shax fra)))

View File

@ -2,11 +2,23 @@
:: /=main=/lib/pony/hoon
::
|%
++ 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]
%. [now pax nut]
?:((lien -.u.q.top |=(a=slip =(pax p.a))) +.u.q.top +.u.q.bot)
::
++ polo :: prompt
|= [gim=(list gift) pim=prom pro=tape def=tape use=tape]
|= [pim=prom pro=tape def=tape use=tape]
|* [rul=_rule woo=||([@da *] bowl)]
^- bowl
:- gim :- ~
:- ~ :- ~
:- :~ [[%polo ~] [%up pim pro def]]
==
|= [now=@da pax=path nut=note]
@ -21,16 +33,14 @@
::
++ pomo |=([gud=gift bol=bowl] [[gud p.bol] q.bol])
++ pomp |=([tix=tape bol=bowl] (pomo la/leaf/tix bol))
++ pond :: show text block
|= [lub=@ bol=bowl]
^- bowl
:_(q.bol (weld (turn (lore lub) |=(a=@t la/leaf/(trip a))) p.bol))
++ pond :: text block
|=(lub=@ :_(~ (turn (lore lub) |=(a=@t la/leaf/(trip a)))))
::
++ posh :: pause until
|= end=@da
|= [gim=(list gift) wop=||(@da bowl)]
|= wop=||(@da bowl)
^- bowl
:- gim :- ~
:- ~ :- ~
:- ^- (list slip)
:~ [~ %wa end]
==
@ -41,7 +51,7 @@
|= [him=@p cav=@tas msg=*]
|= woo=||([@da (unit ,*)] bowl)
^- bowl
=+ leg="waiting for {(scow %p him)}"
=+ leg="waiting on {(scow %p him)}/{(trip cav)}"
:- :~ [%sq him cav /request msg]
==
:- ~
@ -54,62 +64,4 @@
?+ -.nut ~& [%bad-nut nut] !!
%rt (woo now p.nut)
==
::
++ pour
|= $: est=@da
dyz=(list ,[p=@tas q=[p=ship q=disc r=moat]])
wop=||([@da (map ,@tas ,[p=@ud q=(list frog)])] bowl)
==
^- bowl
?~ dyz (wop est ~)
=+ :* zyd=(~(gas by *(map ,@tas ,[p=ship q=disc r=moat])) dyz)
fyx=*(map ,@tas ,[p=@ud q=(list frog)])
==
=< apex
|%
++ apex
^- bowl
?~ zyd done
:- ~ :- ~
:- bite
|= [now=@da how=path wat=note]
?> ?=([%eg *] wat)
?> ?=([%pull @ ~] how)
apex:(bice(est now) i.t.how p.wat)
::
++ bice
|= [cyt=@tas rot=riot]
^+ +>
?~ rot
~& [%bice-done cyt]
+>(zyd (~(del by zyd) cyt))
?> ?=(%ud -.q.p.u.rot)
=+ geb=(need (~(get by zyd) cyt))
=+ saq=(~(get by fyx) cyt)
%= +>.$
zyd
%+ ~(put by zyd) cyt
?> =(p.p.r.geb p.q.p.u.rot)
geb(p.r [%ud +(p.q.p.u.rot)])
::
fyx
%+ ~(put by fyx) cyt
:- ?~(saq p.q.p.u.rot p.u.saq)
[((hard frog) r.u.rot) ?~(saq ~ q.u.saq)]
==
::
++ bite
^- (list slip)
=+ who=?>(?=(^ zyd) p.n.zyd)
:- `slip`[/prod [%up %none "waiting for <who> at <est>..." ~]]
=+ fuh=(~(tap by zyd) ~)
%+ turn fuh
|= [a=@tas b=[p=ship q=disc r=moat]]
=+ bys=`slip`[[%pull a ~] %es p.b q.b [%| r.b]]
bys
::
++ done
^- bowl
(wop est fyx)
--
--

View File

@ -1,9 +1,10 @@
!:
=> .(+ =>(+ ^/=main=/pony))
=> .(+ =>(+ ^/=main=/lib/pony))
|= [est=@da *]
|= [sle=@dr ~]
^- bowl
%+ (posh (add est sle)) ~[la/leaf/"sleeping for {(scow %dr sle)}..."]
%+ pomp "sleeping for {(scow %dr sle)}..."
%- (posh (add est sle))
|= now=@da
:_ ~
:~ [%la %leaf "slept."]