Middle stage of clay restructuring.

This commit is contained in:
C. Guy Yarvin 2014-05-29 19:12:02 -07:00
parent c123d4e115
commit 7d0be097de

View File

@ -7,24 +7,24 @@
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 4cA, filesystem logic ::
::
|%
::
++ un :: per ship
|= [who=@p now=@da ruf=raft]
=+ ^= yar ^- room
=+ yar=(~(get by fat.ruf) who)
?~(yar *room u.yar)
::
|%
++ de :: per desk
|= [now=@da hun=duct hez=(unit duct)]
|= [[who=@p for=@p] syd=@ta rede]
=* red +<+>
=| yel=(list ,[p=duct q=card])
=| byn=(list ,[p=duct q=riot])
=| vag=(list ,[p=duct q=card])
=| say=(list ,[p=duct q=path r=ship s=[p=@ud q=riff]])
|%
++ abet
^- [(list move) raft]
:_ ruf(fat (~(put by fat.ruf) who yar))
^- [(list move) rede]
:_ red
;: weld
%+ turn (flop yel)
|=([a=duct b=card] [hun.yar %give b])
|=([a=duct b=card] [hun %give b])
::
%+ turn (flop byn)
|=([a=duct b=riot] [a %give [%writ b]])
@ -38,77 +38,6 @@
[%toss %a b %want [who c] [%q %re p.q.d (scot %ud p.d) ~] q.d]
==
::
++ doze
=+ saz=(turn (~(tap by dos.yar) ~) |=([a=@tas b=*] a))
=| nex=(unit ,@da)
|- ^+ nex
?~ saz nex
$(saz t.saz, nex (hunt nex doze:(di i.saz)))
::
++ wake
^+ .
=+ saz=(turn (~(tap by dos.yar) ~) |=([a=@tas b=*] a))
|- ^+ ..wake
?~ saz ..wake
$(saz t.saz, ..wake abet:wake:(di i.saz))
::
++ zest
|= his=@p
:~ :- %load
=+ sim=(scot %p his)
=+ sod=(~(tap by dos.yar) ~)
|- ^- (list ,[p=@tas q=path q=rave])
?~ sod ~
=+ xiq=(~(tap by `cult`p.q.i.sod) ~)
|- ^- (list ,[p=@tas q=path r=rave])
?~ xiq ^$(sod t.sod)
=+ nex=$(xiq t.xiq)
?. ?& ?=([[%c @ *] *] p.i.xiq)
=(sim i.t.i.p.i.xiq)
== nex
[[p.i.sod t.t.i.p.i.xiq q.i.xiq] nex]
::
:- %know
=+ rob=(~(get by rid.yar) his)
?~ rob ~
=+ vob=(~(tap by u.rob) ~)
|-
?~ vob ~
:- p.i.vob
:~ [%lim lim.q.i.vob]
[%qyx qyx.q.i.vob]
?~ ref.q.i.vob
~
:~ [%nix nix.u.ref.q.i.vob]
[%bom bom.u.ref.q.i.vob]
[%fod fod.u.ref.q.i.vob]
==
==
==
::
++ zeta
|= [his=@p syd=@tas lok=case tyl=path]
^- (unit)
?. ?=([%da @] lok) ~
?. ?=(~ tyl) ~
?+ syd ~
%show [~ `tank`>(zest his)<]
%tell [~ (zest his)]
==
::
++ de :: per desk
|_ [for=@p syd=@ta rede]
++ abet
?: =(for who)
%_(..de dos.yar (~(put by dos.yar) syd qyx dom))
%_ ..de
rid.yar
=+ ^= rob ^- (map ,@tas rede)
=+ rob=(~(get by rid.yar) for)
?~(rob ~ u.rob)
(~(put by rid.yar) for (~(put by rob) syd `rede`+<+>.abet))
==
::
++ aver :: read
|= mun=mood
^- (unit (unit ,*))
@ -230,7 +159,7 @@
|= [hen=duct wen=@da lem=nori]
^+ +>
%= +>
vag ?~(hez.yar vag :_(vag [u.hez.yar [%ergo who syd let.dom]]))
vag ?~(hez vag :_(vag [u.hez [%ergo who syd let.dom]]))
yel
=+ pre=`path`~[(scot %p for) syd (scot %ud let.dom)]
?- -.lem
@ -338,13 +267,49 @@
==
==
--
++ un :: domestic ship
|= [who=@p now=@da ruf=raft]
=+ ^= yar ^- room
=+ yar=(~(get by fat.ruf) who)
?~(yar *room u.yar)
|%
++ abet ruf(fat (~(put by fat.ruf) who yar))
++ doze
=+ saz=(turn (~(tap by dos.yar) ~) |=([a=@tas b=*] a))
=| nex=(unit ,@da)
|- ^+ nex
?~ saz nex
$(saz t.saz, nex (hunt nex doze:(di i.saz)))
::
++ pish
|= [syd=@ta red=rede]
%_(+> dos.yar (~(put by dos.yar) syd [qyx.red dom.red]))
::
++ posh
|= [for=@p syd=@ta red=rede]
%_ +>
rid.yar
=+ ^= rob ^- (map ,@tas rede)
=+ rob=(~(get by rid.yar) for)
?~(rob ~ u.rob)
(~(put by rid.yar) for (~(put by rob) syd red))
==
::
++ wake
=+ saz=(turn (~(tap by dos.yar) ~) |=([a=@tas b=*] a))
=| moz=(list move)
=< [moz ..wake]
|- ^+ +
?~ saz +
=+ sog=abet:wake:(di i.saz)
$(saz t.saz, moz (weld moz -.sog), ..wake (pish i.saz +.sog))
::
++ di
|= syd=@ta
=+ ^= saq ^- dojo
=+ saq=(~(get by dos.yar) syd)
?~(saq *dojo u.saq)
~(. de who syd now p.saq ~ q.saq)
((de now hun.yar hez.yar) [who who] syd now p.saq ~ q.saq)
::
++ do
|= [him=ship syd=@tas]
@ -353,7 +318,7 @@
=+ yit=?~(roy ~ (~(get by u.roy) syd))
?^(yit u.yit `rede`[~2000.1.1 ~ [~ *rind] *dome])
:: ~& [%do-qyx him syd qyx.red]
~(. de him syd red)
((de now hun.yar hez.yar) [who him] syd red)
--
--
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@ -384,9 +349,11 @@
=+ yar=(need (~(get by fat.ruf) p.fav))
[~ ..^$(fat.ruf (~(put by fat.ruf) p.fav yar(hez [~ hen])))]
=^ mos ruf
=+ ^= zot
abet:(exec:(di:wake:(un p.fav now ruf) q.fav) hen now r.fav)
abet:zot(hez.yar ?.(=(%into -.fav) hez.yar.zot [~ hen]))
=+ une=(un p.fav now ruf)
=+ zot=abet:(exec:(di:wake:une q.fav) hen now r.fav)
:- -.zot
=. une (pish:une q.fav +.zot)
abet:une(hez.yar ?.(=(%into -.fav) hez.yar.une [~ hen]))
[mos ..^$]
::
%waft
@ -394,21 +361,28 @@
=+ syd=(need (slaw %tas i.tea))
=+ inx=(need (slaw %ud i.t.tea))
=^ mos ruf
=< abet
=< abet
=< wake
%. [inx ((hard riot) q.fav)]
knit:(do:(un p.p.fav now ruf) q.p.fav syd)
=+ une=(un p.p.fav now ruf)
=+ zot=abet:wake:(knit:(do:une q.p.fav syd) [inx ((hard riot) q.fav)])
:- -.zot
abet:(posh:une q.p.fav syd +.zot)
[mos ..^$]
::
%warp
=^ mos ruf
=< abet
=+ une=(un p.p.fav now ruf)
=+ wex=?.(=(p.p.fav q.p.fav) (do:une q.p.fav p.q.fav) (di:une p.q.fav))
=+ ^= wex
?. =(p.p.fav q.p.fav)
(do:une q.p.fav p.q.fav)
(di:une p.q.fav)
=+ ^= woo
?~ q.q.fav
abet:(ease:wex hen)
abet:(eave:wex hen u.q.q.fav)
:- -.woo
=< abet
?: =(p.p.fav q.p.fav)
(pish:une p.q.fav +.woo)
(posh:une q.p.fav p.q.fav +.woo)
[mos ..^$]
::
%wart
@ -440,8 +414,9 @@
=| mos=(list move)
|- ^- [p=(list move) q=vane]
?~ dal [mos ..^^$(las.ruf now)]
=^ som ruf abet:wake:(un i.dal now ruf)
$(dal t.dal, mos (weld som mos))
=+ une=(un i.dal now ruf)
=^ som une wake:une
$(dal t.dal, ruf abet:une, mos (weld som mos))
==
::
++ call :: process move
@ -491,7 +466,7 @@
?~ luk [~ ~]
=+ une=(un our now ruf)
?: =(%$ ren)
[~ (zeta:une his syd u.luk tyl)]
[~ ~]
=+ run=((soft care) ren)
?~ run [~ ~]
%. [u.run u.luk tyl]