clay, alef, and zuse compile

This commit is contained in:
Ted Blackman 2019-06-28 16:43:52 -07:00
parent 99134ef5b9
commit 889c300092
3 changed files with 64 additions and 51 deletions

View File

@ -53,8 +53,12 @@
::
:: protocol-version: current version of the ames wire protocol
::
!:
=/ protocol-version=?(%0 %1 %2 %3 %4 %5 %6 %7) %0
=, ames
=, able
::
=>
|%
+| %generics
:: $mk-item: constructor for +ordered-map item type
@ -847,7 +851,7 @@
%crud !!
%hear (on-hear:event-core [lane blob]:task)
%hole !!
%init (on-init:event-core ship.task)
%init (on-init:event-core ship=p.task)
%vega on-vega:event-core
%wegh on-wegh:event-core
%memo (on-memo:event-core [ship message]:task)

View File

@ -471,7 +471,7 @@
++ note :: out request $->
$~ [%b %wait *@da] ::
$% $: %a :: to %ames
$>(%want task:able:ames) ::
$>(%memo task:able:ames) ::
== ::
$: %b :: to %behn
$> $? %drip ::
@ -505,8 +505,8 @@
$% [%init-clad ~] ::
== == ::
$: %a :: by %ames
$> $? %send :: XX strange
%woot ::
$> $? %memo ::
%done ::
== ::
gift:able:ames ::
== ::
@ -2790,8 +2790,13 @@
:: Transfer a request to another ship's clay.
::
++ send-over-ames
|= {a/duct b/path c/ship d/{p/@ud q/riff}}
(emit a %pass b %a %want c [%c %question p.q.d (scot %ud p.d) ~] q.d)
|= [=duct =ship index=@ud =riff]
^+ +>
::
=/ =desk p.riff
=/ =wire /warp-index/(scot %p ship)/(scot %tas desk)/(scot %ud index)
=/ =path [%c %question desk (scot %ud index) ~]
(emit duct %pass wire %a %memo ship path riff)
::
:: Create a request that cannot be filled immediately.
::
@ -2815,7 +2820,7 @@
=+ inx=nix.u.ref
=. +>+.$
=< ?>(?=(^ ref) .)
(send-over-ames hen [(scot %ud inx) ~] her inx syd ~ rave)
(send-over-ames hen her inx syd `rave)
%= +>+.$
nix.u.ref +(nix.u.ref)
bom.u.ref (~(put by bom.u.ref) inx [hen rave])
@ -2913,12 +2918,12 @@
?: |(?=(%& -.w) (~(has by cez) p.w)) s
(~(put in s) p.w)
?^ mis
=- (emit hen %give %mack `[%leaf "No such group(s): {-}"]~)
=- (emit hen %give %done `[%perm-fail [%leaf "No such group(s): {-}"]~])
%+ roll ~(tap in `(set @ta)`mis)
|= {g/@ta t/tape}
?~ t (trip g)
:(weld t ", " (trip g))
=< (emit hen %give %mack ~)
=< (emit hen %give %done ~)
?- -.rit
$r wake(per (put-perm per pax red.rit))
$w wake(pew (put-perm pew pax wit.rit))
@ -2969,7 +2974,7 @@
=: fod.u.ref (~(del by fod.u.ref) hen)
bom.u.ref (~(del by bom.u.ref) u.nux)
==
(send-over-ames hen [(scot %ud u.nux) ~] her u.nux syd ~)
(send-over-ames hen her u.nux syd ~)
::
:: Handles a request.
::
@ -4105,7 +4110,7 @@
=| mos/(list move)
=/ des ~(tap in ~(key by dos.rom.ruf))
|-
?~ des [[[hen %give %mack ~] mos] ..^^$]
?~ des [[[hen %give %done ~] mos] ..^^$]
=/ den ((de our now ski hen ruf) our i.des)
=^ mor ruf
=< abet:wake
@ -4352,25 +4357,19 @@
(start-request:den for u.q.rif)
[mos ..^$]
::
%west
=* wer p.req
=* pax q.req
=* res r.req
?: ?=({%question *} pax)
=+ ryf=;;(riff res)
:_ ..^$
:~ [hen %give %mack ~]
=/ =wire
[(scot %p our) (scot %p wer) t.pax]
[hen %pass wire %c %werp wer our ryf]
==
?> ?=({%answer @ @ ~} pax)
=+ syd=(slav %tas i.t.pax)
=+ inx=(slav %ud i.t.t.pax)
=^ mos ruf
=/ den ((de our now ski hen ruf) wer syd)
abet:(take-foreign-answer:den inx ;;((unit rand) res))
[[[hen %give %mack ~] mos] ..^$]
%memo
=* her ship.req
=* pax path.message.req
=* res payload.message.req
::
?> ?=({%question *} pax)
=+ ryf=;;(riff res)
:_ ..^$
:~ [hen %give %done ~]
=/ =wire
[%foreign-warp (scot %p her) t.pax]
[hen %pass wire %c %werp her our ryf]
==
::
%wegh
:_ ..^$ :_ ~
@ -4430,6 +4429,7 @@
++ take :: accept response
|= {tea/wire hen/duct hin/(hypo sign)}
^+ [*(list move) ..^$]
::
?: ?=({$commit @ *} tea)
=* syd i.t.tea
=^ mos ruf
@ -4451,6 +4451,11 @@
abet:(take-mount:den q.hin)
[mos ..^$]
::
?: ?=([%foreign-warp *] tea)
?> ?=(%writ +<.q.hin)
:_ ..^$
[hen %give %memo /remove-me (bind `riot`p.q.hin rant-to-rand)]~
::
?: ?=({%foreign-request @ @ @ *} tea)
=/ her (slav %p i.t.tea)
=/ syd (slav %tas i.t.t.tea)
@ -4484,6 +4489,21 @@
`cage`(result-to-cage:ford build-result.result.q.hin)
== ==
::
?: ?=([%warp-index @ @ @ ~] tea)
?> ?=(%memo +<.q.hin)
?> ?=([%remove-me ~] path.message.q.hin)
::
=+ ;; res=(unit rand) payload.message.q.hin
::
=/ her=ship (slav %p i.t.tea)
=/ =desk (slav %tas i.t.t.tea)
=/ index=@ud (slav %ud i.t.t.t.tea)
::
=^ mos ruf
=/ den ((de our now ski hen ruf) her desk)
abet:(take-foreign-answer:den index res)
[mos ..^$]
::
?- -.+.q.hin
%init-clad
~|(%clad-not-real !!)
@ -4534,28 +4554,16 @@
::
(handle-task hen queued-task)
::
%writ
?> ?=({@ @ *} tea)
~| i=i.tea
~| it=i.t.tea
=+ him=(slav %p i.t.tea)
:_ ..^$
:~ :* hen %pass /writ-want %a
%want him [%c %answer t.t.tea]
(bind p.+.q.hin rant-to-rand)
==
==
:: handled in the wire dispatcher
::
%memo !!
%writ !!
::
%send
[[[hen %give +.q.hin] ~] ..^$]
::
%woot
?~ q.q.hin
%done
?~ error=error.q.hin
[~ ..^$]
~& [%clay-lost p.q.hin tea]
?~ u.q.q.hin
[~ ..^$]
%- (slog >p.u.u.q.q.hin< q.u.u.q.q.hin)
~& [%clay-lost u.error tea]
%- (slog >tag.u.error< tang.u.error)
[~ ..^$]
==
::

View File

@ -195,6 +195,7 @@
:: +vane-task: general tasks shared across vanes
::
+$ vane-task
$~ [%born ~]
$% :: i/o device replaced (reset state)
::
[%born ~]
@ -215,7 +216,7 @@
[%wegh ~]
:: receive message via %ames
::
[%memo p=ship q=path r=*]
[%memo =ship =message:ames]
==
:: ::::
:::: ++http ::