shrub/arvo/ford.hoon

704 lines
24 KiB
Plaintext
Raw Normal View History

:: :: %ford, new execution control
2014-04-23 21:02:36 +04:00
!? 164
::::
|= pit=vase
=> =~
2014-06-03 09:07:32 +04:00
:: structures
|%
++ gift :: out result <-$
$% [%made p=(each beet (list tank))] :: computed result
== ::
++ kiss :: in request ->$
$% [%exec p=@p q=(unit silk)] :: make / kill
== ::
++ move ,[p=duct q=(mold note gift)] :: local move
++ note :: out request $->
2014-06-04 14:40:09 +04:00
$% [%warp p=sock q=riff] :: to %clay
2014-06-03 09:07:32 +04:00
== ::
++ sign :: in result $-<
2014-06-04 14:40:09 +04:00
$% [%writ p=riot] :: by %clay
2014-06-03 09:07:32 +04:00
== ::
-- ::
2014-04-23 21:02:36 +04:00
|% :: structures
++ axle :: all %ford state
2014-05-31 02:10:39 +04:00
$: %0 :: version for update
2014-05-14 04:04:23 +04:00
pol=(map ship baby) ::
== ::
++ baby :: state by ship
$: tad=[p=@ud q=(map ,@ud task)] :: tasks by number
2014-05-16 04:46:48 +04:00
dym=(map duct ,@ud) :: duct to task number
jav=(map ,* calx) :: cache
2014-04-23 21:02:36 +04:00
== ::
2014-05-07 21:42:31 +04:00
++ bolt :: gonadic edge
|* a=$+(* *) :: product clam
2014-05-14 04:04:23 +04:00
$: p=cafe :: cache
$= q ::
2014-06-01 00:22:49 +04:00
$% [%0 p=(set bead) q=a] :: depends/product
[%1 p=(set ,[p=bead q=(list tank)])] :: blocks
2014-05-14 04:04:23 +04:00
[%2 p=(list tank)] :: error
== ::
2014-04-23 21:02:36 +04:00
== ::
2014-05-07 21:42:31 +04:00
:: ::
++ burg :: gonadic rule
|* [a=$+(* *) b=$+(* *)] :: from and to
2014-05-16 00:17:54 +04:00
$+([c=cafe d=a] (bolt b)) ::
2014-05-07 21:42:31 +04:00
:: ::
2014-05-14 04:04:23 +04:00
++ cafe :: live cache
$: p=(set calx) :: used
q=(map ,* calx) :: cache
== ::
:: ::
2014-05-14 21:32:00 +04:00
++ calm :: cache metadata
$: laz=@da :: last accessed
2014-06-01 00:22:49 +04:00
dep=(set bead) :: dependencies
2014-05-14 21:32:00 +04:00
== ::
2014-05-14 04:04:23 +04:00
++ calx :: concrete cache line
2014-05-14 23:38:37 +04:00
$% [%comp p=calm q=cage r=twig] :: compile by text
2014-05-16 04:46:48 +04:00
[%slap p=calm q=[p=vase q=twig] r=vase] :: slap
2014-05-14 04:04:23 +04:00
== ::
2014-04-30 21:04:07 +04:00
++ task :: problem in progress
2014-05-14 04:04:23 +04:00
$: nah=duct :: cause
2014-05-10 11:10:46 +04:00
kas=silk :: problem
2014-06-01 00:22:49 +04:00
kig=[p=@ud q=(map ,@ud bead)] :: blocks
2014-04-23 21:02:36 +04:00
== ::
2014-05-07 21:42:31 +04:00
-- ::
2014-04-30 21:04:07 +04:00
|% ::
2014-05-16 04:46:48 +04:00
++ calf :: reduce calx
|* sem=* :: a typesystem hack
|= cax=calx
?+ sem !!
%comp ?>(?=(%comp -.cax) r.cax)
%slap ?>(?=(%slap -.cax) r.cax)
==
::
2014-05-14 04:04:23 +04:00
++ calk :: cache lookup
|= a=cafe ::
2014-05-14 06:44:44 +04:00
|= [b=@tas c=*] ::
^- [(unit calx) cafe] ::
2014-05-14 04:04:23 +04:00
=+ d=(~(get by q.a) [b c]) ::
?~ d [~ a] ::
2014-05-14 06:44:44 +04:00
[d a(p (~(put in p.a) u.d))] ::
2014-05-14 04:04:23 +04:00
:: ::
2014-05-14 21:32:00 +04:00
++ came ::
2014-05-14 04:04:23 +04:00
|= [a=cafe b=calx] :: cache install
^- cafe ::
a(q (~(put by q.a) [-.b q.b] b)) ::
:: ::
++ chub :: cache merge
|= [a=cafe b=cafe] ::
^- cafe ::
[(grom p.a p.b) (grum q.a q.b)] ::
:: ::
2014-04-30 21:04:07 +04:00
++ colt :: reduce to save
|= lex=axle ::
2014-05-16 04:46:48 +04:00
^- axle
%= lex
pol
%- ~(run by pol.lex)
|= bay=baby
bay(jav ~)
==
2014-04-30 21:04:07 +04:00
::
2014-05-16 00:17:54 +04:00
++ fine |* [a=cafe b=*] :: bolt from data
2014-06-01 00:22:49 +04:00
[p=`cafe`a q=[%0 p=*(set bead) q=b]] ::
2014-05-16 00:17:54 +04:00
++ flaw |=([a=cafe b=(list tank)] [p=a q=[%2 p=b]]) :: bolt from error
2014-05-07 21:42:31 +04:00
::
2014-05-14 04:04:23 +04:00
++ grom :: merge sets
|* [one=(set) two=(set)]
^+ one
2014-05-09 04:34:57 +04:00
(~(gas in one) (~(tap in two) ~)) :: XX ugh
::
2014-05-14 04:04:23 +04:00
++ grum :: merge maps
|* [one=(map) two=(map)]
^+ one
(~(gas by one) (~(tap by two) ~)) :: XX ugh
2014-05-07 21:42:31 +04:00
::
2014-04-30 21:04:07 +04:00
++ za :: per event
2014-05-14 04:04:23 +04:00
=| $: $: $: our=ship :: computation owner
tea=wire :: event place
hen=duct :: event floor
== ::
$: now=@da :: event date
eny=@ :: unique entropy
2014-05-07 21:42:31 +04:00
ska=$+(* (unit (unit))) :: system namespace
== ::
mow=(list move) :: pending actions
== ::
2014-05-14 04:04:23 +04:00
bay=baby :: all owned state
== ::
|%
2014-06-03 09:07:32 +04:00
++ abet :: resolve
2014-05-14 04:04:23 +04:00
^- [(list move) baby]
[(flop mow) bay]
2014-04-30 21:04:07 +04:00
::
2014-06-03 09:07:32 +04:00
++ apex :: call
|= kus=(unit silk)
2014-06-03 09:07:32 +04:00
^+ +>
?~ kus
2014-05-14 04:04:23 +04:00
=+ num=(need (~(get by dym.bay) hen))
=+ tas=(need (~(get by q.tad.bay) num))
2014-05-16 04:46:48 +04:00
amok:~(camo zo [num tas])
2014-05-22 21:39:51 +04:00
=+ num=p.tad.bay
?> !(~(has by dym.bay) hen)
=: p.tad.bay +(p.tad.bay)
dym.bay (~(put by dym.bay) hen num)
==
~(exec zo [num `task`[hen u.kus 0 ~]])
2014-06-03 09:07:32 +04:00
::
++ axon :: take
|= [num=@ud tik=@ud sin=sign]
^+ +>
?- -.sin
%writ
=+ tus=(~(get by q.tad.bay) num)
?~ tus
~& [%ford-lost num]
+>.$
(~(resp zo [num u.tus]) tik p.sin)
==
::
2014-04-30 21:04:07 +04:00
++ zo
|_ [num=@ud task]
2014-05-14 04:04:23 +04:00
++ abet %_(..zo q.tad.bay (~(put by q.tad.bay) num +<+))
2014-06-04 14:40:09 +04:00
++ amok
%_ ..zo
q.tad.bay (~(del by q.tad.bay) num)
dym.bay (~(del by dym.bay) nah)
==
2014-05-16 04:46:48 +04:00
++ camo :: stop requests
^+ .
2014-06-01 00:22:49 +04:00
=+ kiz=(~(tap by q.kig) *(list ,[p=@ud q=bead]))
2014-05-16 04:46:48 +04:00
|- ^+ +>
?~ kiz +>
%= $
kiz t.kiz
mow :_ mow
2014-05-24 00:46:43 +04:00
:- hen
:^ %toss %c
2014-06-03 09:07:32 +04:00
[(scot %p our) (scot %ud num) (scot %ud p.i.kiz) ~]
[%warp [our p.q.i.kiz] q.q.i.kiz ~]
2014-05-16 04:46:48 +04:00
==
::
2014-04-30 21:04:07 +04:00
++ camp :: request a file
2014-06-01 00:22:49 +04:00
|= [ren=care bem=bead]
2014-04-30 21:04:07 +04:00
^+ +>
=+ tik=(scot %ud p.kig)
=: p.kig +(p.kig)
2014-05-09 04:34:57 +04:00
q.kig (~(put by q.kig) p.kig bem)
2014-04-30 21:04:07 +04:00
==
%= $
mow :_ mow
2014-05-24 00:46:43 +04:00
:- hen
:^ %toss %c
2014-06-03 09:07:32 +04:00
[(scot %p our) (scot %ud num) (scot %ud tik) ~]
[%warp [our p.bem] q.bem [~ %& %x r.bem s.bem]]
2014-04-30 21:04:07 +04:00
==
2014-05-07 21:42:31 +04:00
::
2014-05-14 21:32:00 +04:00
++ clef :: cache a result
2014-05-14 23:38:37 +04:00
|* sem=*
2014-05-14 21:32:00 +04:00
|* [hoc=(bolt) fun=(burg)]
?- -.q.hoc
%2 hoc
%1 hoc
%0
=^ cux p.hoc ((calk p.hoc) sem q.q.hoc)
?~ cux
=+ nuf=(cope hoc fun)
?- -.q.nuf
%2 nuf
%1 nuf
%0
:- p=(came p.nuf `calx`[sem `calm`[now p.q.nuf] q.q.hoc q.q.nuf])
2014-05-14 23:38:37 +04:00
q=q.nuf
2014-05-14 21:32:00 +04:00
==
:- p=p.hoc
^= q
:+ %0 p.q.hoc
2014-05-16 04:46:48 +04:00
((calf sem) u.cux)
2014-05-14 21:32:00 +04:00
==
::
2014-05-07 21:42:31 +04:00
++ coax :: bolt across
|* [hoc=(bolt) fun=(burg)]
2014-05-14 04:04:23 +04:00
?- -.q.hoc
2014-05-16 00:17:54 +04:00
%0 =+ nuf=$:fun(..+<- p.hoc)
:- p=p.nuf
2014-05-14 04:04:23 +04:00
^= q
?- -.q.nuf
%0 [%0 p=(grom p.q.hoc p.q.nuf) q=[q.q.hoc q.q.nuf]]
%1 q.nuf
%2 q.nuf
2014-05-07 21:42:31 +04:00
==
2014-05-16 00:17:54 +04:00
%1 =+ nuf=$:fun(..+<- p.hoc)
:- p=p.nuf
2014-05-14 04:04:23 +04:00
^= q
?- -.q.nuf
%0 q.hoc
%1 [%1 p=(grom p.q.nuf p.q.hoc)]
%2 q.nuf
2014-05-07 21:42:31 +04:00
==
%2 hoc
==
::
++ cope :: bolt along
|* [hoc=(bolt) fun=(burg)]
2014-05-14 04:04:23 +04:00
?- -.q.hoc
2014-05-07 21:42:31 +04:00
%2 hoc
%1 hoc
2014-05-16 00:17:54 +04:00
%0 =+ nuf=(fun p.hoc q.q.hoc)
:- p=p.nuf
2014-05-14 04:04:23 +04:00
^= q
?- -.q.nuf
%2 q.nuf
%1 q.nuf
%0 [%0 p=(grom `_p.q.nuf`p.q.hoc p.q.nuf) q=q.q.nuf]
== ==
2014-05-07 21:42:31 +04:00
::
++ coup :: toon to bolt
2014-05-16 00:17:54 +04:00
|= cof=cafe
|* [ton=toon fun=$+(* *)]
:- p=cof
2014-05-14 04:04:23 +04:00
^= q
2014-05-07 21:42:31 +04:00
?- -.ton
2014-05-09 04:34:57 +04:00
%2 [%2 p=p.ton]
2014-06-01 00:22:49 +04:00
%0 [%0 p=*(set bead) q=(fun p.ton)]
2014-05-16 00:17:54 +04:00
%1 =- ?- faw
2014-06-01 00:22:49 +04:00
& [%1 p=(turn p.faw |=(a=bead [a *(list tank)]))]
2014-05-09 04:34:57 +04:00
| [%2 p=p.faw]
2014-05-07 21:42:31 +04:00
==
^= faw
2014-06-01 00:22:49 +04:00
|- ^- (each (list bead) (list tank))
2014-05-07 21:42:31 +04:00
?~ p.ton [%& ~]
=+ nex=$(p.ton t.p.ton)
=+ pax=(path i.p.ton)
=+ zis=(tome (path i.p.ton))
?~ zis
[%| (smyt pax) ?:(?=(& -.nex) ~ p.nex)]
?- -.nex
2014-05-09 04:34:57 +04:00
& [%& u.zis p.nex]
2014-05-07 21:42:31 +04:00
| nex
==
2014-04-30 21:04:07 +04:00
==
2014-05-07 21:42:31 +04:00
::
2014-05-16 04:46:48 +04:00
++ dash :: process cache
|= cof=cafe
^+ +>
%_(+> jav.bay q.cof)
::
2014-05-07 21:42:31 +04:00
++ exec :: execute app
2014-04-30 21:04:07 +04:00
^+ ..zo
2014-05-09 04:34:57 +04:00
?: !=(~ q.kig) ..zo
2014-04-30 21:04:07 +04:00
|- ^+ ..zo
2014-05-16 04:46:48 +04:00
=+ bot=(make [~ jav.bay] kas)
=. ..exec (dash p.bot)
2014-05-14 04:04:23 +04:00
?- -.q.bot
%0 amok:(expo [%made %& p.q.bot q.q.bot])
%2 amok:(expo [%made %| p.q.bot])
%1 =+ zuk=(~(tap by p.q.bot) ~)
2014-05-09 04:34:57 +04:00
=< abet
|- ^+ ..exec
?~ zuk ..exec
2014-06-01 00:22:49 +04:00
=+ foo=`_..exec`(camp %x `bead`p.i.zuk)
2014-05-09 04:34:57 +04:00
$(zuk t.zuk, ..exec foo)
==
2014-05-07 21:42:31 +04:00
::
2014-06-03 09:07:32 +04:00
++ expo :: return gift
|= gef=gift
~& [%expo -.gef]
2014-06-03 09:07:32 +04:00
%_(+> mow :_(mow [hen %give gef]))
2014-05-09 04:34:57 +04:00
::
2014-05-14 21:32:00 +04:00
++ fade :: compile
2014-05-16 00:17:54 +04:00
|= [cof=cafe kas=silk]
2014-05-14 21:32:00 +04:00
^- (bolt twig)
2014-05-16 00:17:54 +04:00
%+ (clef %comp) (make cof kas)
2014-05-14 23:38:37 +04:00
^- (burg cage twig)
2014-05-16 00:17:54 +04:00
|= [cof=cafe cay=cage]
2014-05-14 21:32:00 +04:00
?. ?=(@ q.q.cay)
2014-05-16 00:17:54 +04:00
(flaw cof ~)
2014-05-14 21:32:00 +04:00
=+ vex=((full vest) [[1 1] (trip q.q.cay)])
?~ q.vex
2014-05-16 00:17:54 +04:00
(flaw cof [%leaf "syntax error: {<p.p.vex>} {<q.p.vex>}"] ~)
(fine cof p.u.q.vex)
2014-05-14 21:32:00 +04:00
::
2014-05-31 16:52:06 +04:00
++ gush :: sill to twig
|= [cof=cafe sil=sill]
^- (bolt twig)
?- -.sil
%0 (fade cof [%done ~ [%atom [%atom %$] p.sil]])
%1 (fine cof p.sil)
%2 (fade cof [%boil %hoon p.sil])
%3 %+ cope (make cof p.sil)
|= [cof=cafe cay=cage]
(fine cof (twig q.q.cay))
==
::
++ kale :: mutate
|= [cof=cafe kas=silk muy=(list (pair wing silk))]
^- (bolt cage)
%+ cope
|- ^- (bolt (list (pair wing vase)))
?~ muy (fine cof ~)
%+ cope (make cof q.i.muy)
|= [cof=cafe cay=cage]
%+ cope ^$(muy t.muy)
|= [cof=cafe rex=(list (pair wing vase))]
(fine cof [[p.i.muy q.cay] rex])
|= [cof=cafe yom=(list (pair wing vase))]
%+ cope (make cof kas)
|= [cof=cafe cay=cage]
=+ ^= vow
%+ slop q.cay
|- ^- vase
?~ yom [[%atom %n] ~]
(slop q.i.yom $(yom t.yom))
%+ cope
%^ maim cof vow
^- twig
:+ %cncb [%& 2]~
=+ axe=3
|- ^- (list (pair wing twig))
?~ yom ~
:- [p.i.yom [%$ (peg axe 2)]]
$(yom t.yom, axe (peg axe 3))
|= [cof=cafe vax=vase]
(fine cof p.cay vax)
::
2014-05-12 02:48:41 +04:00
++ krab :: load to twig
2014-06-01 00:22:49 +04:00
|= [cof=cafe for=logo how=logo rem=spur bem=bead]
2014-05-12 02:48:41 +04:00
^- (bolt vase)
2014-05-16 00:17:54 +04:00
%+ cope (fade cof %bake how bem)
|= [cof=cafe gen=twig]
%+ cope (maim cof pit gen)
|= [cof=cafe gat=vase]
(maul cof gat !>([`beak`[p.bem q.bem r.bem] for +:s.bem rem]))
2014-05-07 21:42:31 +04:00
::
++ lace :: load and check
2014-06-01 00:22:49 +04:00
|= [cof=cafe for=logo rem=spur bem=bead]
2014-05-09 04:34:57 +04:00
^- (bolt (unit vase))
2014-05-12 02:48:41 +04:00
=+ bek=`beak`[p.bem q.bem r.bem]
2014-05-16 00:17:54 +04:00
%+ cope (lend cof bem)
|= [cof=cafe arc=arch]
2014-05-07 21:42:31 +04:00
?^ q.arc
2014-05-16 00:17:54 +04:00
(cope (liar cof bem) (lake for bek))
2014-05-12 02:48:41 +04:00
?: (~(has by r.arc) %hoon)
2014-05-16 00:17:54 +04:00
%+ cope (krab cof for %hoon rem bem)
2014-05-12 02:48:41 +04:00
(lake for bek)
?: (~(has by r.arc) %hook)
2014-05-16 00:17:54 +04:00
%+ cope (krab cof for %hook rem bem)
|= [cof=cafe vax=vase]
%+ cope ((lair for bem) cof vax)
|= [cof=cafe vax=vase]
(fine cof ~ vax)
(fine cof ~)
2014-05-07 21:42:31 +04:00
::
++ lake :: check/coerce
|= [for=logo bek=beak]
2014-05-16 00:17:54 +04:00
|= [cof=cafe sam=vase]
2014-05-09 04:34:57 +04:00
^- (bolt (unit vase))
2014-05-12 02:48:41 +04:00
?: ?=(?(%gate %core %hoon %hook) for)
2014-05-16 00:17:54 +04:00
(fine cof ~ sam)
2014-06-01 00:22:49 +04:00
%+ cope (make cof %boil %gate bek /ref/[for]/sys)
2014-05-16 00:17:54 +04:00
|= [cof=cafe cay=cage]
%+ cope (lane cof p.q.cay [%cnzy %$])
|= [cof=cafe ref=type]
2014-05-07 21:42:31 +04:00
?: (~(nest ut ref) | p.sam)
2014-05-16 00:17:54 +04:00
(fine cof ~ sam)
%+ cope (maul cof q.cay sam)
|= [cof=cafe pro=vase]
(fine cof ~ pro)
2014-05-07 21:42:31 +04:00
::
2014-05-12 02:48:41 +04:00
++ lair :: metaload
2014-06-01 00:22:49 +04:00
|= [for=logo bem=bead]
2014-05-16 00:17:54 +04:00
|= [cof=cafe vax=vase]
2014-05-12 02:48:41 +04:00
^- (bolt vase)
?. (~(nest ut -:!>(*silk)) | p.vax)
2014-05-16 00:17:54 +04:00
(flaw cof (smyt (tope bem)) ~)
%+ cope (make cof ((hard silk) q.vax))
|= [cof=cafe cay=cage]
2014-05-12 02:48:41 +04:00
=+ too=`logo`?@(p.cay p.cay %noun)
2014-05-16 00:17:54 +04:00
(link cof for too [p.bem q.bem r.bem] q.cay)
2014-05-12 02:48:41 +04:00
::
2014-05-07 21:42:31 +04:00
++ lane :: type infer
2014-05-16 00:17:54 +04:00
|= [cof=cafe typ=type gen=twig]
%+ (coup cof) (mule |.((~(play ut typ) gen)))
2014-05-07 21:42:31 +04:00
|=(ref=type ref)
::
++ lend :: load arch
2014-06-01 00:22:49 +04:00
|= [cof=cafe bem=bead]
2014-05-07 21:42:31 +04:00
^- (bolt arch)
=+ von=(ska %cy (tope bem))
2014-05-16 00:17:54 +04:00
?~ von [p=cof q=[%1 [bem ~] ~ ~]]
(fine cof ((hard arch) (need u.von)))
2014-05-07 21:42:31 +04:00
::
++ liar :: load vase
2014-06-01 00:22:49 +04:00
|= [cof=cafe bem=bead]
^- (bolt vase)
2014-05-07 21:42:31 +04:00
=+ von=(ska %cx (tope bem))
?~ von
2014-05-14 04:04:23 +04:00
[p=*cafe q=[%1 [[bem ~] ~ ~]]]
2014-05-07 21:42:31 +04:00
?~ u.von
2014-05-16 00:17:54 +04:00
(flaw cof (smyt (tope bem)) ~)
(fine cof ?^(u.u.von [%cell %noun %noun] [%atom %$]) u.u.von)
2014-05-07 21:42:31 +04:00
::
++ lily :: translation targets
2014-05-16 00:17:54 +04:00
|= [cof=cafe for=logo bek=beak]
2014-05-07 21:42:31 +04:00
^- (bolt (list ,@tas))
%+ cope
2014-06-01 00:22:49 +04:00
%+ cope (lend cof bek `path`~[%tan for %sys])
2014-05-16 00:17:54 +04:00
|= [cof=cafe arc=arch]
(fine cof (turn (~(tap by r.arc) ~) |=([a=@tas b=~] a)))
|= [cof=cafe all=(list ,@tas)]
(fine cof ?.(=(%hoon for) all [%hoot all]))
2014-05-07 21:42:31 +04:00
::
++ lima :: load at depth
2014-06-01 00:22:49 +04:00
|= [cof=cafe for=logo rem=spur bem=bead]
2014-05-07 21:42:31 +04:00
^- (bolt (unit vase))
2014-05-16 00:17:54 +04:00
%+ cope (lend cof bem)
|= [cof=cafe arc=arch]
2014-05-09 04:34:57 +04:00
^- (bolt (unit vase))
2014-05-07 21:42:31 +04:00
?: (~(has by r.arc) for)
2014-05-16 00:17:54 +04:00
(lace cof for rem bem(s [for s.bem]))
2014-05-09 04:34:57 +04:00
%+ cope
2014-05-16 00:17:54 +04:00
%- lion
:^ cof
for
2014-05-09 04:34:57 +04:00
[p.bem q.bem r.bem]
(turn (~(tap by r.arc) ~) |=([a=@tas b=~] a))
2014-05-16 00:17:54 +04:00
|= [cof=cafe wuy=(unit (list ,@tas))]
?~ wuy (fine cof ~)
2014-05-14 04:04:23 +04:00
?> ?=(^ u.wuy)
2014-05-16 00:17:54 +04:00
%+ cope (make cof %bake i.u.wuy bem)
|= [cof=cafe hoc=cage]
%+ cope (lope cof i.u.wuy t.u.wuy [p.bem q.bem r.bem] q.hoc)
|= [cof=cafe vax=vase]
(fine cof ~ vax)
2014-05-07 21:42:31 +04:00
::
2014-06-01 00:22:49 +04:00
++ lime :: load bead
|= [cof=cafe for=logo bem=bead]
2014-05-09 04:34:57 +04:00
=+ [mob=bem rem=*path]
2014-05-07 21:42:31 +04:00
|- ^- (bolt vase)
2014-05-16 00:17:54 +04:00
%+ cope (lima cof for rem bem)
|= [cof=cafe vux=(unit vase)]
?^ vux (fine cof u.vux)
2014-05-07 21:42:31 +04:00
?~ s.bem
2014-05-16 00:17:54 +04:00
(flaw cof (smyt (tope mob)) ~)
2014-05-12 02:48:41 +04:00
^$(s.bem t.s.bem, rem [i.s.bem rem])
2014-05-07 21:42:31 +04:00
::
++ link :: translate
2014-05-16 00:17:54 +04:00
|= [cof=cafe too=logo for=logo bek=beak vax=vase]
2014-05-07 21:42:31 +04:00
^- (bolt vase)
2014-05-16 00:17:54 +04:00
?: =(too for) (fine cof vax)
2014-05-07 21:42:31 +04:00
?: &(=(%hoot too) =(%hoon for))
2014-05-16 00:17:54 +04:00
(fine cof !>(ream))
2014-06-01 00:22:49 +04:00
%+ cope (make cof %boil %gate bek /[too]/tan/[for]/sys)
2014-05-16 00:17:54 +04:00
|= [cof=cafe cay=cage]
(maul cof q.cay vax)
2014-05-07 21:42:31 +04:00
::
2014-05-09 04:34:57 +04:00
++ lion :: translation search
2014-05-16 00:17:54 +04:00
|= [cof=cafe too=@tas bek=beak fro=(list ,@tas)]
2014-05-09 04:34:57 +04:00
^- (bolt (unit (list ,@tas)))
2014-05-07 21:42:31 +04:00
=| war=(set ,@tas)
2014-05-16 00:17:54 +04:00
=< -:(apex (fine cof fro))
2014-05-14 04:04:23 +04:00
|% :: XX improve monads
2014-05-07 21:42:31 +04:00
++ apex
|= rof=(bolt (list ,@tas))
2014-05-09 04:34:57 +04:00
^- [(bolt (unit (list ,@tas))) _+>]
2014-05-14 04:04:23 +04:00
?. ?=(%0 -.q.rof) [rof +>.$]
?~ q.q.rof
[[p.rof [%0 p.q.rof ~]] +>.$]
2014-05-16 00:17:54 +04:00
=^ orf +>.$ (apse cof i.q.q.rof)
2014-05-14 04:04:23 +04:00
?. ?=(%0 -.q.orf)
2014-05-16 00:17:54 +04:00
[orf +>.$]
2014-05-14 04:04:23 +04:00
?~ q.q.orf
2014-05-16 00:17:54 +04:00
$(cof p.orf, q.q.rof t.q.q.rof)
[[p.orf [%0 (grom p.q.rof p.q.orf) q.q.orf]] +>.$]
2014-04-30 21:04:07 +04:00
::
2014-05-07 21:42:31 +04:00
++ apse
2014-05-16 00:17:54 +04:00
|= [cof=cafe for=@tas]
2014-05-09 04:34:57 +04:00
^- [(bolt (unit (list ,@tas))) _+>]
?: =(for too)
2014-05-16 00:17:54 +04:00
[(fine cof [~ too ~]) +>.$]
?: (~(has in war) for) [(fine cof ~) +>]
2014-05-07 21:42:31 +04:00
=. war (~(put in war) for)
2014-05-16 00:17:54 +04:00
=^ hoc +>.$ (apex (lily cof for bek))
2014-05-07 21:42:31 +04:00
:_ +>.$
2014-05-16 00:17:54 +04:00
%+ cope hoc
|= [cof=cafe ked=(unit (list ,@tas))]
(fine cof ?~(ked ~ [~ for u.ked]))
2014-05-07 21:42:31 +04:00
--
::
2014-05-16 00:17:54 +04:00
++ lope :: translation pipe
|= [cof=cafe for=logo yaw=(list logo) bek=beak vax=vase]
2014-05-07 21:42:31 +04:00
^- (bolt vase)
2014-05-16 00:17:54 +04:00
?~ yaw (fine cof vax)
%+ cope (link cof i.yaw for bek vax)
|= [cof=cafe yed=vase]
^$(cof cof, yaw t.yaw, vax yed)
2014-05-07 21:42:31 +04:00
::
++ make :: reduce silk
2014-05-16 00:17:54 +04:00
|= [cof=cafe kas=silk]
2014-05-07 21:42:31 +04:00
^- (bolt cage)
2014-06-04 14:40:09 +04:00
~& [%ford-make -.kas]
2014-05-07 21:42:31 +04:00
?- -.kas
2014-04-30 21:04:07 +04:00
^
2014-05-16 00:17:54 +04:00
%. [cof p.kas q.kas]
2014-05-07 21:42:31 +04:00
;~ cope
;~ coax
2014-05-16 00:17:54 +04:00
|=([cof=cafe p=silk q=silk] ^$(cof cof, kas p.kas))
|=([cof=cafe p=silk q=silk] ^$(cof cof, kas q.kas))
2014-05-07 21:42:31 +04:00
==
::
2014-05-16 00:17:54 +04:00
|= [cof=cafe bor=cage heg=cage] ^- (bolt cage)
[p=cof q=[%0 ~ [[p.bor p.heg] (slop q.bor q.heg)]]]
2014-05-07 21:42:31 +04:00
==
2014-04-30 21:04:07 +04:00
::
%bake
2014-05-16 00:17:54 +04:00
%+ cope (lima cof p.kas ~ q.kas)
|= [cof=cafe vux=(unit vase)]
2014-05-09 04:34:57 +04:00
?~ vux
2014-05-16 00:17:54 +04:00
(flaw cof (smyt (tope q.kas)) ~)
(fine cof [p.kas u.vux])
::
%boil
%+ cope (lime cof p.kas q.kas)
|= [cof=cafe vax=vase]
(fine cof `cage`[p.kas vax])
2014-04-30 21:04:07 +04:00
::
%call
2014-05-16 00:17:54 +04:00
%. [cof p.kas q.kas]
2014-05-07 21:42:31 +04:00
;~ cope
;~ coax
2014-05-16 00:17:54 +04:00
|=([cof=cafe p=silk q=silk] ^$(cof cof, kas p))
|=([cof=cafe p=silk q=silk] ^$(cof cof, kas q))
2014-05-07 21:42:31 +04:00
==
::
2014-05-16 00:17:54 +04:00
|= [cof=cafe gat=cage sam=cage]
(maul cof q.gat q.sam)
2014-05-07 21:42:31 +04:00
::
2014-05-16 00:17:54 +04:00
|= [cof=cafe vax=vase]
(fine cof %noun vax)
2014-05-07 21:42:31 +04:00
==
2014-04-30 21:04:07 +04:00
::
2014-05-10 11:10:46 +04:00
%cast
%+ cope $(kas r.kas)
2014-05-16 00:17:54 +04:00
|= [cof=cafe cay=cage]
2014-05-10 11:10:46 +04:00
=+ for=`logo`?@(p.cay p.cay %noun)
2014-05-31 16:52:06 +04:00
%+ cope (link cof p.kas for q.kas q.cay)
2014-05-16 00:17:54 +04:00
|= [cof=cafe vax=vase]
(fine cof [p.kas vax])
2014-04-30 21:04:07 +04:00
::
2014-05-31 16:52:06 +04:00
%done [cof %0 p.kas q.kas]
%mute (kale cof p.kas q.kas)
%pass
%+ cope $(kas p.kas)
|= [cof=cafe cay=cage]
%+ cope (gush cof q.kas)
|= [cof=cafe gen=twig]
%+ cope (maim cof q.cay gen)
|= [cof=cafe vax=vase]
(fine cof %noun vax)
::
2014-05-16 00:17:54 +04:00
%reef (fine cof %noun pit)
2014-04-30 21:04:07 +04:00
==
::
++ maim :: slap
2014-05-16 00:17:54 +04:00
|= [cof=cafe vax=vase gen=twig]
2014-05-07 21:42:31 +04:00
^- (bolt vase)
2014-05-16 04:46:48 +04:00
%+ (clef %slap) (fine cof vax gen)
|= [cof=cafe vax=vase gen=twig]
2014-05-07 21:42:31 +04:00
=+ puz=(mule |.((~(mint ut p.vax) [%noun gen])))
?- -.puz
2014-05-16 00:17:54 +04:00
| (flaw cof p.puz)
& %+ (coup cof) (mock [q.vax q.p.puz] (mole ska))
2014-05-09 04:34:57 +04:00
|= val=*
`vase`[p.p.puz val]
==
2014-04-30 21:04:07 +04:00
::
++ maul :: slam
2014-05-16 00:17:54 +04:00
|= [cof=cafe gat=vase sam=vase]
2014-05-07 21:42:31 +04:00
^- (bolt vase)
=+ top=(mule |.((slit p.gat p.sam)))
?- -.top
2014-05-16 00:17:54 +04:00
| (flaw cof p.top)
& %+ (coup cof) (mong [q.gat q.sam] (mole ska))
|= val=*
2014-05-09 04:34:57 +04:00
`vase`[p.top val]
==
2014-04-30 21:04:07 +04:00
::
++ resp
|= [tik=@ud rot=riot]
^+ ..zo
?> (~(has by q.kig) tik)
?~ rot
2014-05-09 04:34:57 +04:00
amok:(expo [%made %| (smyt (tope (need (~(get by q.kig) tik)))) ~])
2014-04-30 21:04:07 +04:00
exec(q.kig (~(del by q.kig) tik))
--
--
--
2014-04-23 21:02:36 +04:00
. ==
=| axle
=* lex -
2014-05-31 23:40:02 +04:00
|= [now=@da eny=@ ski=sled] :: activate
2014-04-23 21:02:36 +04:00
^? :: opaque core
|% ::
2014-06-03 09:07:32 +04:00
++ call :: request
2014-06-04 21:56:30 +04:00
|= [hen=duct hic=(hypo (hobo kiss))]
2014-06-06 03:00:19 +04:00
=> %= . :: XX temporary
q.hic
^- kiss
?: ?=(%soft -.q.hic)
((hard kiss) p.q.hic)
?: (~(nest ut -:!>(*kiss)) | p.hic) q.hic
~& [%ford-call-flub (,@tas `*`-.q.hic)]
((hard kiss) q.hic)
==
2014-06-04 14:40:09 +04:00
^- [p=(list move) q=_..^$]
2014-05-31 23:40:02 +04:00
=+ ska=(slod ski)
2014-05-22 21:39:51 +04:00
=+ ^= our ^- @p
2014-06-03 09:07:32 +04:00
?- -.q.hic
%exec p.q.hic
2014-05-22 21:39:51 +04:00
==
2014-05-14 04:04:23 +04:00
=+ ^= bay ^- baby
2014-05-22 21:39:51 +04:00
=+ buy=(~(get by pol.lex) our)
2014-05-14 04:04:23 +04:00
?~(buy *baby u.buy)
=^ mos bay
2014-06-03 09:07:32 +04:00
abet:(~(apex za [[our ~ hen] [now eny ska] ~] bay) q.q.hic)
2014-05-22 21:39:51 +04:00
[mos ..^$(pol (~(put by pol) our bay))]
::
2014-04-23 21:02:36 +04:00
++ doze
|= [now=@da hen=duct]
^- (unit ,@da)
~
::
++ load
2014-05-31 23:40:02 +04:00
|= old=axle
2014-05-31 03:51:35 +04:00
^+ ..^$
2014-05-31 23:40:02 +04:00
..^$(+>- old)
2014-04-23 21:02:36 +04:00
::
++ scry
2014-05-27 00:43:40 +04:00
|= [fur=(unit (set monk)) ren=@tas who=ship syd=desk lot=coin tyl=path]
2014-06-01 00:22:49 +04:00
^- (unit (unit (pair lode ,*)))
2014-04-23 21:02:36 +04:00
~
::
2014-05-31 23:40:02 +04:00
++ stay `axle`+>-.$
2014-06-03 09:07:32 +04:00
++ take :: response
|= [tea=wire hen=duct hin=(hypo sign)]
2014-06-06 03:00:19 +04:00
=> %= . :: XX temporary
q.hin
^- sign
?: (~(nest ut -:!>(*sign)) | p.hin) q.hin
~& [%ford-take-flub (,@tas `*`-.q.hin)]
((hard sign) q.hin)
==
2014-06-03 09:07:32 +04:00
^- [p=(list move) q=_..^$]
=+ ska=(slod ski)
?> ?=([@ @ @ ~] tea)
=+ :* our=(need (slaw %p i.tea))
num=(need (slaw %ud i.t.tea))
tik=(need (slaw %ud i.t.t.tea))
==
=+ bay=(need (~(get by pol.lex) our))
=^ mos bay
abet:(~(axon za [[our tea hen] [now eny ska] ~] bay) num tik q.hin)
[mos ..^$(pol (~(put by pol) our bay))]
2014-04-23 21:02:36 +04:00
--