all (well-formed) test apps work

This commit is contained in:
pcmonk 2014-07-25 19:10:24 -07:00
parent 2b9b533a6f
commit 2b4fec9a51
6 changed files with 103 additions and 58 deletions

View File

@ -1096,7 +1096,7 @@
++ rack :: rack:am
|= [soq=sock num=@ud cha=path cop=coop] :: e2e ack
=+ oh=(ho:(um p.soq) q.soq)
=. oh (cook:oh cop num cha)
=. oh (cook:oh cop num cha ~)
(cans:oh cha)
::
++ wake :: wake:am
@ -1145,8 +1145,8 @@
=+ rum=(need (~(get by raz.bah) cha))
=. rum
%= rum
mis (~(del by mis.rum) did.rum)
did +(did.rum)
mis (~(del by mis.rum) did.rum)
==
(coat cha rum)
::
@ -1157,32 +1157,30 @@
?~ cun
+>.$(raz.bah (~(put by raz.bah) cha rum))
?. =(%good p.u.cun) +>.$
?> ?=(^ r.u.cun)
%= +>.$
?> ?=(^ s.u.cun)
%= +>.$
raz.bah (~(put by raz.bah) cha rum(dod |))
bin
:_ bin
:^ %mulk
[our her]
`soap`[[p:sen:gus clon:diz] cha did.rum]
u.r.u.cun
raz.bah
%+ ~(put by raz.bah) cha
%= rum
out
%+ ~(put by out.rum) did.rum
(need (~(get by out.rum) did.rum))
==
u.s.u.cun
==
::
++ cook :: cook:ho:um:am
|= [cop=coop num=@ud cha=path]
|= [cop=coop num=@ud cha=path ram=(unit ,[ryn=lane dam=flap])]
^+ +> :: acknowledgment
:: ~& [%back kay dam]
:: ~& [%cook cop num cha ram]
=+ rum=(need (~(get by raz.bah) cha))
=+ ^- [ryn=lane dam=flap]
(need (~(get by out.rum) num))
=. rum rum(out (~(del by out.rum) num))
=. bah bah(raz (~(put by raz.bah) cha rum))
?^ ram [ryn.u.ram dam.u.ram]
=+ (~(get by mis.rum) num)
?^ - [q r]:u
~&(%ack-late-or-redundant !!)
=. raz.bah
%+ ~(put by raz.bah) cha
rum(dod &, bum ?~(cop bum.rum (~(put by bum.rum) num u.cop)))
=^ roc diz (zuul:diz now [%buck cop dam ~s0])
(busk(diz (wast:diz ryn)) xong:diz roc)
::
@ -1290,15 +1288,15 @@
=+ cun=(~(get by mis.rum) did.rum)
?~ cun
+>.$(raz.bah (~(put by raz.bah) cha rum))
=. +>.$ cock(kay p.u.cun, dam q.u.cun)
=. +>.$ cock(kay p.u.cun, dam r.u.cun)
=. +>.$ ?. =(%good p.u.cun) +>.$
?> ?=(^ r.u.cun)
?> ?=(^ s.u.cun)
%- emit
^- boon
:^ %milk
[our her]
`soap`[[p:sen:gus clon:diz] cha did.rum]
u.r.u.cun
u.s.u.cun
%= $
mis.rum (~(del by mis.rum) did.rum)
did.rum +(did.rum)
@ -1312,19 +1310,26 @@
?~(rum *race u.rum)
?. (gte num did.rum)
cock :: always ack a dup
(coot cha rum(mis (~(put by mis.rum) num [kay dam dut])))
(coot cha rum(mis (~(put by mis.rum) num [kay ryn dam dut])))
::
++ deer :: deer:la:ho:um:am
|= [cha=path num=@ud dut=(unit)] :: interpret message
^+ +>
=+ ^= rum ^- race
=+ rum=(~(get by raz.bah) cha)
?~(rum *race u.rum)
=+ rum=(fall (~(get by raz.bah) cha) *race)
%= +>.$
+>
?. (gte num did.rum)
(cook (~(get by bum.rum) num) num cha) :: always ack a dup
(coat cha rum(mis (~(put by mis.rum) num [kay dam dut])))
?. (gte num did.rum) :: always ack a dup
:: ~& [%deer-1 num]
(cook (~(get by bum.rum) num) num cha ~ ryn dam)
?: dod.rum
:: ~& [%deer-2 num]
(coat cha rum(mis (~(put by mis.rum) num [kay ryn dam dut])))
:: ~& [%deer-3 num]
%= +>.+>.$
raz.bah
%+ ~(put by raz.bah) cha
rum(mis (~(put by mis.rum) num [kay ryn dam dut]))
==
==
::
++ dine :: dine:la:ho:um:am
@ -1345,7 +1350,7 @@
(dear q.fud r.fud ?-(kay %dead ~, %good [~ s.fud]))
::
%bund
~& [%bund q.fud r.fud]
:: ~& [%bund q.fud r.fud]
?> =(p:sen:gus p.fud)
(deer q.fud r.fud ?-(kay %dead ~, %good [~ s.fud]))
::
@ -1521,8 +1526,8 @@
did.b
=+ ciy=(~(tap by mis.b) ~)
%+ turn ciy
|= [c=@ud d=[p=cape q=flap r=(unit)]]
[c p.d q.d]
|= [c=@ud d=[p=cape q=lane r=flap s=(unit)]]
[c p.d r.d]
::
[%ryl (~(tap to ryl.bah) ~)]
[%lun lun.wod.dur.diz]
@ -1773,7 +1778,12 @@
%gh :: %gall response
?> ?=([@ ~] t.t.q.q.bon)
=+ app=`term`(need ((sand %tas) i.t.t.q.q.bon))
:_ fox [hen %pass ~ %g %roth p.bon app r.bon]~
=+ ^= pax
:^ (scot %p p.p.bon)
(scot %p q.p.bon)
(scot %ud r.q.bon)
q.q.bon
:_ fox [hen %pass pax %g %roth p.bon app r.bon]~
==
::
%ouzo
@ -1808,6 +1818,7 @@
=+ soq=[(slav %p i.tea) (slav %p i.t.tea)]
=+ num=(slav %ud i.t.t.tea)
=+ pax=t.t.t.tea
:: ~& [%knap soq num pax]
=+ ^= fuy
=< zork =< zank
%^ ~(rack am [now fox]) soq num :- pax

View File

@ -407,7 +407,7 @@
=+ yoo=abet:(busk:(yule:u.ouy %nil) u.s.sem 0 huq)
yoo(can.sub.siq (~(put by can.sub.siq.yoo) nap sem(s ~)))
%nice
?> ?=(%mess i.mab)
?. ?=(%mess i.mab) u.ouy
(hear:woy ~ %& %json !>((joba %ok %b &)))
?(%rust %rush)
?< ?=(~ t.mab)

View File

@ -1,4 +1,4 @@
!: :: %gall, user-level applications
:: :: %gall, user-level applications
!? 164
::::
|= pit=vase
@ -45,8 +45,7 @@
++ move ,[p=duct q=(mold note gift)] :: typed move
++ note :: out request $->
$? $: %a :: to %ames
$% [%want p=sock q=path r=*] ::
[%wont p=sock q=path r=*] ::
$% [%wont p=sock q=path r=*] ::
== == ::
$: %c :: to %clay
$% [%warp p=sock q=riff] ::
@ -80,7 +79,7 @@
== ::
++ roon :: foreign response
$% [%d p=mark q=*] :: diff
[%e p=(unit ,[p=term q=(list tank)])] :: error
[%e p=ares] :: error
[%f p=mark q=*] :: full refresh
[%k ~] :: message response
== ::
@ -120,7 +119,7 @@
++ sign :: in result $<-
$? [?(%b %c %d %e) @tas *] ::
$: %a :: by %ames
$% [%went p=ship q=cape] ::
$% [%woot p=ship q=coop] ::
== == ::
$: %g :: by %gall
$% [%dumb ~] ::
@ -375,14 +374,12 @@
%a ~
%g
:_ ~ :- hen
:+ %pass [%r pax]
^- note
?- -.+.sih
%dumb !!
%mean !!
%nice !!
%rush (rod %d p.+.sih q.+.sih)
%rust (rod %f p.+.sih q.+.sih)
%mean [%give %mean p.+.sih]
%nice [%give %nice ~]
%rush [%pass [%r pax] (rod %d p.+.sih q.+.sih)]
%rust [%pass [%r pax] (rod %f p.+.sih q.+.sih)]
==
==
%u !!
@ -394,7 +391,8 @@
=+ mat=(need (~(get by pol.all) p.saq))
=+ sad=(need (~(get by sap.mat) q.saq))
=+ neh=(need (~(get by r.sad) num))
:_ ..^$ :_ ~
:_ ..^$
:- [hen %give %nice ~] :_ ~
^- move :- neh
?- -.ron
%d [%pass /x/d `note`[%f %exec p.saq ~ %vale p.ron saq q.ron]]
@ -733,11 +731,14 @@
=+ you=(need (slaw %p i.t.t.pax))
=^ gyd +>.$ (meek q.hin)
?~ gyd
=. +>.$ (give %mean ~ %peer-fail ~)
(give [%dumb ~])
=+ kee=[you t.t.t.pax]
=+ ash=(sham q.q.u.gyd)
?: =(`ash (~(get by peq.sat) ost))
+>.$
=. +>.$
?: (~(has by sup.sat) ost) +>.$ (give %nice ~)
%- %= give
peq.sat (~(put by peq.sat) ost ash)
sup.sat (~(put by sup.sat) ost kee)
@ -750,7 +751,9 @@
=+ you=(need (slaw %p i.t.t.pax))
=^ gud +>.$ (mack q.hin)
?^ gud
=. +>.$ (give %mean ~ %peer-fail ~)
(give [%dumb ~])
=. +>.$ (give %nice ~)
%= +>.$
sup.sat (~(put by sup.sat) ost [you t.t.t.pax])
pus.sat (~(put ju pus.sat) t.t.t.pax ost)
@ -775,6 +778,7 @@
=^ gud +>.$ (mack q.hin)
?^ gud +>.$
=+ pax=+:(fall (~(get by sup.sat) ost) *[ship path])
=. +>.$ (give %nice ~)
%= +>.$
sup.sat (~(del by sup.sat) ost)
pus.sat (~(del ju pus.sat) pax ost)

View File

@ -2591,9 +2591,9 @@
== ::
++ race :: inbound stream
$: did=@ud :: filled sequence
bum=(map ,@ud ares) ::
mis=(map ,@ud ,[p=cape q=flap r=(unit)]) :: misordered
out=(map ,@ud ,[p=lane q=flap]) :: processing
dod=? :: not processing
bum=(map ,@ud ares) :: nacks
mis=(map ,@ud ,[p=cape q=lane r=flap s=(unit)]) :: misordered
== ::
++ rank ?(%czar %king %duke %earl %pawn) :: ship width class
++ rant :: namespace binding

View File

@ -1,25 +1,41 @@
!:
:: Read ::
|_ [hid=hide vat=tape]
++ peer |= [ost=bone ship pax=path]
++ peer
|= [ost=bone ship pax=path]
~& pax
?~ pax
$(pax ~[(rsh 3 1 (scot %p our.hid))])
?> ?=([cord ~] pax)
:_ +>
:_ +>.$
:~ [ost %pass /ret %g %show [(slav %p (cat 3 '~' i.pax)) %written] our.hid /]
:^ ost %pass /heyya
:^ %g %mess [(slav %p (cat 3 '~' i.pax)) %written]
:+ our.hid %json !>(`json`[%s %hallo])
:: :^ ost %pass /heyya
:: :^ %g %mess [(slav %p (cat 3 '~' i.pax)) %written]
:: :+ our.hid %json !>(`json`[%s %hola])
:: :^ ost %pass /heyya
:: :^ %g %mess [(slav %p (cat 3 '~' i.pax)) %written]
:: :+ our.hid %json !>(`json`[%s %buenos-dias])
:: :^ ost %pass /heyya
:: :^ %g %mess [(slav %p (cat 3 '~' i.pax)) %written]
:: :+ our.hid %json !>(`json`[%s %buenas-tardes])
:: :^ ost %pass /heyya
:: :^ %g %mess [(slav %p (cat 3 '~' i.pax)) %written]
:: :+ our.hid %json !>(`json`[%s %buenas-tardes])
==
++ pour
|= [pax=path sin=*]
:_ +>
?: =(/ret pax)
=+ sin=;;(,[%g @tas mark *] sin)
=+ sin=;;(,[%g p=@tas q=*] sin)
?: ?=(%nice p.sin)
~& %pour-nice ~
?: ?=(%mean p.sin)
~& %pour-mean ~
=+ sin=;;(,[%g p=@tas q=mark r=*] sin)
~& [%pour-ret p.sin q.sin]
=+ gif=;;(,[?(%rust %rush) %hymn manx] +.sin)
%+ turn (~(tap in (~(get ju pus.hid) /)))
|= ost=bone
%+ turn (~(tap by sup.hid))
|= [ost=bone you=ship pax=path]
[ost give/gif]
?: =(/heyya pax)
~& [%pour-acked sin]

View File

@ -3,6 +3,7 @@
++ gift
$% [%mean p=ares]
[%nice ~]
[%rust %hymn manx]
==
++ move ,[p=bone q=(mold note gift)]
++ note ,~
@ -11,7 +12,8 @@
|_ [hid=hide vat=tape]
++ root
[(crip <our.hid>) %main (crip <lat.hid>) ~]
++ peek |= [you=ship pax=path]
::
++ page
:- %hymn
;html
;head
@ -24,10 +26,22 @@
;textarea(id "texx", onchange js):"{vat}"
==
==
++ peek
|= [you=ship pax=path]
page
:: ^- [(list move) _+>]
:: :_ +>.$ :_ ~
:: [ost %give %rust page]
++ poke-json
|= [ost=bone you=ship jon=json]
^- [(list move) _+>]
=. vat (need (sa:jo jon))
~& vat
[[`move`[ost %give %nice ~] ~] +>.$]
~& [%poke-vat vat]
:_ +>.$
:* [ost %give %mean ~ %alan-kay ~[leaf/"is a failure"]]
~
:: %+ turn (~(tap by sup.hid))
:: |= [ost=bone you=ship pax=path]
:: [ost %give %rust page]
==
--