Builds literal schematics

This commit is contained in:
Ted Blackman 2018-03-15 18:38:33 -07:00
parent 6adf5b8652
commit 90238aee31
2 changed files with 60 additions and 6 deletions

View File

@ -19,7 +19,7 @@
++ test-call ++ test-call
~& %test-call ~& %test-call
%- expect-eq !> %- expect-eq !>
:- ~ :- [duct=~ %give %made now %complete %result %$ %noun !>(**)]~
=- -.- =- -.-
%- call:(ford-turbo) %- call:(ford-turbo)
:* duct=~ :* duct=~

View File

@ -816,13 +816,67 @@
:: +ev: per-event core :: +ev: per-event core
:: ::
++ ev ++ ev
|_ [[our=@p now=@da scry=sley] =ford-state] |_ [[our=@p =duct now=@da scry=sley] =ford-state]
:: +build: perform a fresh +build, either live or once :: +build: perform a fresh +build, either live or once
:: ::
++ build ++ start-build
|= [=schematic date=(unit @da)] |= [=schematic date=(unit @da)]
^- [(list move) ^ford-state] ^- [(list move) ^ford-state]
[~ ford-state] ::
?~ date
(execute [now schematic] live=&)
(execute [u.date schematic] live=|)
::
++ execute
|= [=build live=?]
^- [moves=(list move) ^ford-state]
:: TODO this is only a dummy; fill in state mutation logic
(make build)
::
++ make
|= =build
^- [(list move) ^ford-state]
|^
?- -.schematic.build
^ !!
%$ (literal literal.schematic.build)
::
%alts !!
%bake !!
%bunt !!
%call !!
%cast !!
%core !!
%dude !!
%file !!
%hood !!
%path !!
%plan !!
%reef !!
%ride !!
%slit !!
%slim !!
%scry !!
%vale !!
%volt !!
::
:: clay diff and merge operations
::
%diff !!
%join !!
%mash !!
%mute !!
%pact !!
==
++ literal
|= =cage
^- [(list move) ^ford-state]
:_ ford-state
:_ ~
^- move
:- duct
[%give %made date.build result=[%complete [%result [%$ cage]]]]
--
++ rebuild !! ++ rebuild !!
++ unblock !! ++ unblock !!
++ cancel !! ++ cancel !!
@ -871,8 +925,8 @@
:: with the new :ship-state and produce it along with :moves. :: with the new :ship-state and produce it along with :moves.
:: ::
=^ ship-state state-by-ship (find-or-create-ship-state our.task) =^ ship-state state-by-ship (find-or-create-ship-state our.task)
=* event-args [[our.task now scry] ship-state] =* event-args [[our.task duct now scry] ship-state]
=* build-func ~(build ev event-args) =* build-func ~(start-build ev event-args)
=^ moves ship-state (build-func schematic.task date.task) =^ moves ship-state (build-func schematic.task date.task)
=. state-by-ship (~(put by state-by-ship) our.task ship-state) =. state-by-ship (~(put by state-by-ship) our.task ship-state)
:: ::