shrub/arvo/batz.hoon

1286 lines
43 KiB
Plaintext
Raw Normal View History

!:
2013-09-29 00:21:18 +04:00
:: batz (4b), shell
::
2013-12-15 09:42:27 +04:00
|= pit=vase
2013-09-29 00:21:18 +04:00
^- vane
=> =~
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 4bA, shell models ::
::
|%
++ bard :: new session
2013-12-15 09:42:27 +04:00
|= who=ship ^- brad
2013-09-29 00:21:18 +04:00
%* . *brad
hox (scot %p who)
cwd %try
fog [0 ~]
p.hit 1
p.sur 1
p.god 1
==
++ brad :: session/dynamic
$: fog=(list ,@ud) :: task consoles
fen=(map ,@tas ,@ud) :: named tasks
2013-09-29 00:21:18 +04:00
hox=@ta :: identity text
cws=path :: working spur
cwd=@tas :: working desk
loq=(unit case) :: working version
pyr=pyre :: compose cache
war=(map ,@tas coal) :: variables
sac=(list skit) :: library stack
sev=(map ,@tas (set ,[p=@ud q=@ud r=wire])) :: message servers
tem=(map ,[p=@ud q=@ud r=wire] ,@da) :: timeouts
2013-09-29 00:21:18 +04:00
hit=[p=@ud q=(list ,@t)] :: command history
sur=[p=@ud q=(qeu vase)] :: result history
god=[p=@ud q=(map ,@ud task)] :: task state
== ::
:: ::
++ bran :: static "state"
$: nub=vase ::
2013-12-13 05:44:15 +04:00
$= vax :: chestnut vases
2013-09-29 00:21:18 +04:00
$: sot=vase :: 'slot'
== ::
2013-12-13 05:44:15 +04:00
$= gen ::
2013-12-15 11:07:57 +04:00
$: yom=twig :: '*(set ,@tas)'
zim=twig :: '*(map ,@tas ,*)'
2013-09-29 00:21:18 +04:00
== ::
2013-12-13 05:44:15 +04:00
$= typ :: chestnut types
2013-12-15 11:07:57 +04:00
$: gee=type :: '*twig'
2013-09-29 00:21:18 +04:00
liz=type :: '*(list ,@t)'
pah=type :: '*path'
noq=type :: '*note'
tak=type :: '*tart'
vas=type :: '*vase'
== ::
== ::
::
++ bred :: make defaults
=+ nib=pit
=+ pal=~(play ut p.nib)
~+
%* . *bran
nub nib
sot.vax (slap nib (vice 'slot'))
yom.gen (vice '*(set ,@tas)')
zim.gen (vice '*(map ,@tas ,*)')
2013-12-15 11:07:57 +04:00
gee.typ (pal (vice '*twig'))
2013-09-29 00:21:18 +04:00
liz.typ (pal (vice '*(list ,@t)'))
pah.typ (pal (vice '*path'))
noq.typ (pal (vice '*note'))
tak.typ (pal (vice '*tart'))
vas.typ (pal (vice '*vase'))
==
++ brat ,[[who=ship bran] brad] :: don't ask why
++ brim (list ,[p=ship q=brad]) :: session
-- ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 4bB, session engine ::
::
|%
++ be :: repl/shell
2013-12-15 09:42:27 +04:00
|= brat :: core state
2013-12-16 05:15:04 +04:00
|= [now=@da eny=@ sky=$+(* (unit))]
2013-09-29 00:21:18 +04:00
=+ wen=(scot %da now)
=+ wer=`path`[hox cwd wen cws]
=+ rew=(flop wer)
=+ vez=(vang | wer)
|%
++ abet `brat`+<.^$ :: abet:be
2013-11-14 07:31:55 +04:00
++ fang :: fang:be
2013-12-15 09:42:27 +04:00
|= [gyp=@ud ted=@ud lap=wire] :: validate waiter
2013-09-29 00:21:18 +04:00
^- ? :: XX hack
=+ dog=(~(get by q.god) gyp)
2013-09-29 00:21:18 +04:00
?~ dog |
=+ gib=(~(get by q.wip.u.dog) ted)
2013-09-29 00:21:18 +04:00
?~ gib |
2013-11-14 07:31:55 +04:00
(~(has by q.u.gib) lap)
::
++ fanx :: fang:be
2013-12-15 09:42:27 +04:00
|= [gyp=@ud ted=@ud lap=wire] :: validate waiter
2013-11-14 07:31:55 +04:00
^- ? :: XX hack
=+ dog=(~(get by q.god) gyp)
?~ dog |
=+ gib=(~(get by q.wip.u.dog) ted)
2013-12-24 00:49:15 +04:00
?> ?=(^ gib)
?. ?=([%ma *] lap) |
(~(has by q.u.gib) t.lap)
::
++ fear :: fear:be
2013-12-15 09:42:27 +04:00
|= tea=wire :: validate wire
^- ? :: XX hack
2013-11-14 07:31:55 +04:00
(fanx (feat tea))
2013-09-29 00:21:18 +04:00
::
++ feat :: feat:be
2013-12-15 09:42:27 +04:00
|= tea=wire :: decode wire
2013-09-29 00:21:18 +04:00
^- [p=@ud q=@ud r=wire]
?> ?=([@ @ *] tea)
=+ [ped=(slay i.tea) wad=(slay i.t.tea)]
?> &(?=([~ %$ %ud @] ped) ?=([~ %$ %ud @] wad))
[q.p.u.ped q.p.u.wad t.t.tea]
::
++ fest :: fest:be
2013-12-15 09:42:27 +04:00
|= [gyp=@ud hen=duct] :: find a task
2013-09-29 00:21:18 +04:00
(fi gyp hen (need (~(get by q.god) gyp)))
::
++ fist :: fist:be
2013-12-15 09:42:27 +04:00
|= hen=duct :: new task
2013-09-29 00:21:18 +04:00
=+ [gyp=p.god gyr=*task]
=: p.god +(p.god)
q.god (~(put by q.god) p.god *task)
==
(fi gyp hen gyr)
::
2013-11-14 06:44:14 +04:00
++ flub :: flub:be
2013-12-15 09:42:27 +04:00
|= [gyp=@ud ted=@ud lap=wire] :: delete timer
2013-11-14 06:44:14 +04:00
^+ +>
2013-12-08 05:10:14 +04:00
~& [%flub tem]
2013-11-14 06:44:14 +04:00
+>(tem (~(del by tem) [gyp ted lap]))
::
2013-09-29 00:21:18 +04:00
++ lake :: lake:be
2013-12-15 09:42:27 +04:00
|= [hen=duct gyp=@ud ted=@ud lap=wire] :: deliver wakeup
2013-09-29 00:21:18 +04:00
^- [p=(list move) q=brat]
abet:lash:abet:(glob:(past:(fest gyp hen) ted) lap [%wake ~])
::
++ lead :: lead:be
2013-12-15 09:42:27 +04:00
|= [tea=wire hen=duct] :: route note
2013-09-29 00:21:18 +04:00
^- [p=wire q=_ra:*fi]
=+ fat=(feat tea)
[r.fat (past:(fest p.fat hen) q.fat)]
::
++ lean :: lean:be
2013-12-15 09:42:27 +04:00
|= [tea=wire hen=duct fav=card] :: deliver card
2013-09-29 00:21:18 +04:00
^+ *fi
=+ lay=(lead tea hen)
?> ?=([%ma *] p.lay)
abet:(glob:q.lay t.p.lay fav)
::
++ leap :: leap:be
2013-12-15 09:42:27 +04:00
|= [tea=wire hen=duct fav=card] :: handle event
2013-09-29 00:21:18 +04:00
^- [p=(list move) q=brat]
?: ?=([%crud *] fav)
[[[[~ %iron who] [/d hen] [%flog fav]] ~] +<.^^$]
?+ -.fav
2013-09-29 00:21:18 +04:00
[[[[~ %iron who] hen fav] ~] +<.^^$]
%hail [[[[~ %iron who] hen [%helo prot]] ~] +<.^^$]
%line =+ gyp=?>(?=(^ fog) i.fog)
?: &(=(0 gyp) =(%$ p.fav)) $(fav [%hail ~])
=< abet
?: =(0 gyp)
lash:(gill:(fist hen) p.fav)
lash:(como:(fest gyp hen) p.fav)
%kill =+ gyp=?>(?=(^ fog) i.fog)
2014-01-04 11:28:16 +04:00
?: =(0 gyp) [[[[~ %iron who] hen [%logo ~]] ~] +<.^^$]
2013-09-29 00:21:18 +04:00
abet:kill:(fest gyp hen)
%ling ?> ?=(^ fog)
=> .(fog (weld t.fog `(list ,@ud)`[i.fog ~]))
[[[[~ %iron who] hen [%helo prot]] ~] +<.^^$]
%noop [~ +<.^^$]
%thee abet:lash:(lean tea hen fav)
2013-10-27 07:55:53 +04:00
%thou ~& [%leap-thou fav]
abet:lash:(lean tea hen fav)
%waft :: ~& [%leap-waft fav]
abet:lash:(lean tea hen fav)
%went ?. (fear tea)
2013-11-14 07:31:55 +04:00
~& [%went-fear tea]
[~ +<.^^$]
2013-11-14 07:31:55 +04:00
abet:lash:(lean tea hen fav)
2013-11-08 05:45:48 +04:00
%writ abet:lash:(loam tea hen +.fav)
2013-09-29 00:21:18 +04:00
%wart (lion hen +.fav)
==
::
2013-10-16 06:24:02 +04:00
++ leon :: leon:be
2013-12-15 09:42:27 +04:00
|= [hen=duct him=@p cak=@tas sic=path val=*] :: default handling
2013-10-16 06:24:02 +04:00
^- [(list move) brat]
?+ cak [~ +<.^^$]
%hi (levo hen "< " him val)
2013-10-21 23:30:03 +04:00
%yu (levo hen "> " ((hard ,[@p @]) val))
2013-10-16 06:24:02 +04:00
==
::
++ levo :: levo:be
2013-12-15 09:42:27 +04:00
|= [hen=duct pre=tape him=@p val=*] :: default message
^- [(list move) brat]
2013-10-16 06:24:02 +04:00
=+ fom=?:(=(0 val) "remains quietly present" (trip ((hard ,@) val)))
:_ +<.^^$
=+ fom=(trip ((hard ,@) val))
^- (list move)
:~ :+ [~ %iron who] [/d hen]
:+ %flog %text
;: weld
2013-10-16 06:24:02 +04:00
pre
(scow %p him)
": "
(trip ((hard ,@) val))
==
==
::
2013-09-29 00:21:18 +04:00
++ loam :: loam:be
2013-12-15 09:42:27 +04:00
|= [tea=wire hen=duct rot=riot] :: file response
2013-09-29 00:21:18 +04:00
^+ *fi
=+(a=(lead tea hen) abet:(gall:q.a p.a rot))
::
++ lion :: lion:be
2013-12-15 09:42:27 +04:00
|= [hen=duct him=@p cak=@tas sic=path val=*] :: handle request
2013-09-29 00:21:18 +04:00
^- [(list move) brat]
=+ yes=(~(get by sev) cak)
2013-10-16 06:24:02 +04:00
?~ yes (leon hen him cak sic val)
2013-09-29 00:21:18 +04:00
=+ sey=(~(tap by u.yes) *(list ,[p=@ud q=@ud r=wire]))
|- ^- [(list move) brat]
?~ sey [~ +<.^^^$]
=^ von +<.^^^$
=< abet
=< lash
=< abet
=< abet
%- pong:(ox:(past:(fest p.i.sey hen) q.i.sey) r.i.sey)
[%wart him cak sic val]
2013-09-29 00:21:18 +04:00
=^ vun +<.^^^$ $(sey t.sey)
[(weld von vun) +<.^^^$]
::
++ prot :: prot:be
^- [p=path q=prod] :: get prompt
?> ?=(^ fog)
?. =(0 i.fog)
perd:(fest i.fog ~)
:- /
:+ %text
;: weld
(trip (rap 3 [hox '/' cwd ~]))
2013-09-29 00:21:18 +04:00
?~(loq "=" (scow u.loq))
2014-01-04 11:28:16 +04:00
?~(cws "" (spud cws))
"> "
2013-09-29 00:21:18 +04:00
==
~
::
++ fi :: fi:be
2013-12-15 09:42:27 +04:00
|= [gyp=@ud hen=duct gyr=task] :: process task
2013-09-29 00:21:18 +04:00
=| duv=(list ,[p=duct q=card])
|%
++ abet :: abet:fi:be
^- [(list move) brat] :: resolve
=+ ^= fod ^+ [p=fog q=q.god]
?~ q.wip.gyr
2013-12-15 09:42:27 +04:00
:- (skip fog |=(a=@ud =(a gyp)))
2013-09-29 00:21:18 +04:00
(~(del by q.god) gyp)
2013-12-15 09:42:27 +04:00
:- ?:((lien fog |=(a=@ud =(a gyp))) fog [gyp fog])
2013-09-29 00:21:18 +04:00
q=(~(put by q.god) gyp gyr)
=+ sam==(fog p.fod)
=: fog p.fod
q.god q.fod
==
:_ +<.^^$
%+ turn
2013-09-29 00:21:18 +04:00
(flop `_duv`?:(sam duv [[~ [%helo prot]] duv]))
2013-12-15 09:42:27 +04:00
|=([p=duct q=card] [[~ %iron who] (weld p hen) q])
2013-09-29 00:21:18 +04:00
::
2013-12-15 09:42:27 +04:00
++ bitt |=(lap=path [(scot %ud gyp) lap]) :: bitt:fi:be
2013-09-29 00:21:18 +04:00
++ como :: como:fi:be
2013-12-15 09:42:27 +04:00
|= lin=@t :: command
2013-09-29 00:21:18 +04:00
^+ +>
=+ ryg=~(top to paq.gyr)
?~ ryg
2013-09-29 00:21:18 +04:00
+>.$
abet:abet:(pong:(ox:(past p.u.ryg) q.u.ryg) [%line lin])
::
++ gill :: gill:fi:be
2013-12-15 09:42:27 +04:00
|= lin=@t :: input line
2013-09-29 00:21:18 +04:00
^+ +>
=+ zif=((full lark:lo) [1 1] (trip lin))
?~ q.zif
2013-09-29 00:21:18 +04:00
=+ duf=[p=~(rend co ~ %ud p.p.zif) q=~(rend co ~ %ud q.p.zif)]
(warn "<syntax error at [{p.duf} {q.duf}]>")
?~ p.u.q.zif
+>.$
(lime u.p.u.q.zif)
:: :: hoop:fi:be
++ hoop :: delete prompt
2013-12-15 09:42:27 +04:00
|= [lap=wire ted=@ud] :: XX ugly
2013-09-29 00:21:18 +04:00
^+ +>
%= +>
2013-11-09 01:06:04 +04:00
duv :_(duv [[/b ~] [%hail ~]])
2013-09-29 00:21:18 +04:00
paq.gyr
%- ~(gas to *(qeu gyro))
2013-09-29 00:21:18 +04:00
%+ skip
(~(tap to paq.gyr) *(list gyro))
2013-12-15 09:42:27 +04:00
|=(a=gyro &(=(ted p.a) =(lap q.a)))
2013-09-29 00:21:18 +04:00
==
::
++ hoot :: hoot:fi:be
2013-12-15 09:42:27 +04:00
|= [lap=wire ted=@ud pod=prod] :: install prompt
2013-09-29 00:21:18 +04:00
^+ +>
2013-11-09 01:06:04 +04:00
%_ +>
2014-01-04 11:28:16 +04:00
duv :_(duv [[/b ~] [%hail ~]])
paq.gyr (~(put to paq.gyr) [ted lap pod])
2013-11-09 01:06:04 +04:00
==
2013-09-29 00:21:18 +04:00
::
++ kill
^+ .
2013-12-15 09:42:27 +04:00
=+ pew=(sort (turn (~(tap by q.wip.gyr) ~) |=([p=@ud *] p)) lth)
2013-09-29 00:21:18 +04:00
|- ^+ ..kill
?~ pew ..kill
$(pew t.pew, ..kill abet:goon:(past i.pew))
::
++ lash :: lash:fi:be
^+ . :: execute task
2013-12-15 09:42:27 +04:00
=+ pew=(sort (turn (~(tap by q.wip.gyr) ~) |=([p=@ud *] p)) lth)
2013-09-29 00:21:18 +04:00
|- ^+ ..lash
?~ pew ..lash
$(pew t.pew, ..lash abet:grip:(past i.pew))
::
++ lime :: lime:fi:be
2013-12-15 09:42:27 +04:00
|= kal=lark :: start task
2013-09-29 00:21:18 +04:00
^+ +>
(limp q.kal)
::
++ limp :: limp:fi:be
2013-12-15 09:42:27 +04:00
|= kaw=(list lath) :: start pipeline
2013-09-29 00:21:18 +04:00
^+ +>
?~ kaw +>
$(kaw t.kaw, +>.$ (pant i.kaw ?:(=(~ t.kaw) ~ [~ +(p.wip.gyr)])))
::
++ pant :: pant:fi:be
2013-12-15 09:42:27 +04:00
|= [lat=lath nex=(unit ,@ud)] :: start thread
2013-09-29 00:21:18 +04:00
%= +>
p.wip.gyr +(p.wip.gyr)
q.wip.gyr
2013-09-29 00:21:18 +04:00
(~(put by q.wip.gyr) p.wip.gyr [nex ~ [~ ~ ~ %n ~ *claw lat]])
==
::
++ past :: past:fi:be
2013-12-15 09:42:27 +04:00
|= ted=@ud :: select thread
2013-09-29 00:21:18 +04:00
^+ ra
=+ bek=(need (~(get by q.wip.gyr) ted))
~(. ra ted p.bek q.bek r.bek)
::
++ perd :: perd:fi:be
^- [p=path q=prod] :: produce prompt
=+ top=~(top to paq.gyr)
?~(top [/ %none "[waiting...]" ~] [q.u.top r.u.top])
::
++ warn :: warn:fi:be
2013-12-15 09:42:27 +04:00
|= txt=tape :: send warning
2013-09-29 00:21:18 +04:00
^+ +>
+>(duv :_(duv [~ [%warn txt]]))
::
++ ra :: ra:fi:be
|_ $: ted=@ud :: thread id
nex=(unit ,@ud) :: next in pipeline
loz=(map wire goal) :: waiting for
orb=boor :: image
==
::
++ abet :: resolve
^+ ..ra
?: &(?=(%r -.s.orb) |(=(~ p.s.orb) =(~ loz)))
=> (gird ~)
=> guff
=. ..ra ?~(nex ..ra abet:(glob:(past u.nex) ~ [%pipe ~]))
..ra(q.wip.gyr (~(del by q.wip.gyr) ted))
..ra(q.wip.gyr (~(put by q.wip.gyr) ted nex loz orb))
::
2013-12-15 09:42:27 +04:00
++ bist |=(lap=path (bitt (scot %ud ted) lap)) :: form path
2013-09-29 00:21:18 +04:00
++ bust :: slice coal
2013-12-15 09:42:27 +04:00
|= [axe=axis vux=coal]
2013-09-29 00:21:18 +04:00
^- coal
=< q
%+ slam sot.vax
(slop [[%atom %$] axe] [vas.typ vux])
::
++ fret :: process coal
2013-12-15 09:42:27 +04:00
|= poc=coal
2013-09-29 00:21:18 +04:00
^- beef
:- ((hard (list gilt)) +:(bust 2 poc))
=+ doy=(bust 3 poc)
?~ +.doy [~ %r ~]
:- ((hard (list slip)) +>-.doy)
[%r ~ (bust 7 doy)]
::
++ gall :: deliver result
2013-12-15 09:42:27 +04:00
|= [lap=wire rot=riot]
2013-09-29 00:21:18 +04:00
^+ +>
?. ?=([%au * *] lap)
?> ?=([%ma *] lap)
(glob t.lap [%writ rot])
=+ dup=(slay i.t.lap)
?> ?=([~ %$ %ud @] dup)
=+ kit=(need (~(get by p.orb) q.p.u.dup))
?~ rot
%_(+>.$ ..ra (warn (spud (meat kit))), s.orb [%r ~])
+>.$(p.orb (~(del by p.orb) q.p.u.dup))
::
++ gasp :: logical path
^- path
[hox cwd ?~(loq wen (scot u.loq)) cws]
::
++ gird :: change slips
2013-12-15 09:42:27 +04:00
|= ask=(list slip)
2013-09-29 00:21:18 +04:00
^+ +>
=+ zal=(~(tap by loz) ~)
=+ zim=(~(gas by *(map path goal)) ask) :: XX clumsy
=. +>.$
|- ^+ +>.^$
?~ zal +>.^$
%= $
zal t.zal
+>.^$ ?:((~(has by zim) p.i.zal) +>.^$ abet:pang:(ox p.i.zal))
==
|- ^+ +>.^$
?~ ask +>.^$
$(ask t.ask, +>.^$ abet:(pane:(ox p.i.ask) q.i.ask))
::
++ glee :: assemble stack
=+ [kas=sac boy=nub]
2013-09-29 00:21:18 +04:00
|- ^- [(unit coal) _+>]
?~ kas [[~ boy] +>.$]
=^ vid +>.$ $(kas t.kas)
?~ vid [~ +>.$]
=^ lez +>.$ (grok | (gnat i.kas) u.vid)
?~ lez
[~ good:+>.$(sac t.kas)]
[[~ q.u.lez] +>.$]
2013-09-29 00:21:18 +04:00
::
++ glib :: pending note
2013-12-15 09:42:27 +04:00
|= [lap=wire nob=nose]
2013-09-29 00:21:18 +04:00
^+ +>
%_(+> r.orb (~(put to r.orb) [lap nob]))
::
++ glob :: extern
2013-12-15 09:42:27 +04:00
|= [lap=wire fav=card]
2013-09-29 00:21:18 +04:00
^+ +>
%_(+> q.orb (~(put to q.orb) [lap fav]))
::
++ glum :: blocked thread
2013-12-15 09:42:27 +04:00
|= [gez=(list path) hog=boar]
2013-09-29 00:21:18 +04:00
=| [inx=@ud err=(list path) bez=(map ,@ud kite)]
|- ^+ +>.^$
?~ gez
2013-09-29 00:21:18 +04:00
?: =(~ err)
+>.^$(orb [bez ~ ~ hog])
|- ^+ +>.^^$
?~ err +>.^^$(orb [~ ~ ~ %r ~])
$(err t.err, ..ra (warn (spud i.err)))
=+ myt=(tame i.gez)
?~ myt
$(gez t.gez, err [i.gez err])
2013-09-29 00:21:18 +04:00
%= $
gez t.gez
inx +(inx)
bez (~(put by bez) inx u.myt)
+>.^$ (gulp (bist %au (scot %ud inx) ~) u.myt)
==
::
++ gnat :: skit to path
2013-12-15 09:42:27 +04:00
|= sik=skit
2013-12-01 07:04:29 +04:00
(weld q.sik `path`[?~(p.sik wen u.p.sik) r.sik])
2013-09-29 00:21:18 +04:00
::
++ gaur :: print skit
2013-12-15 09:42:27 +04:00
|= sik=skit
2013-09-29 00:21:18 +04:00
^+ +>
%+ gram ~
:+ %note '^'
:- %leaf
;: weld
(spud q.sik)
?~(p.sik "=" (spud u.p.sik ~))
2013-09-29 00:21:18 +04:00
(spud r.sik)
"/hoon"
==
::
++ good :: print skits
=+ kas=sac
|- ^+ +>
?~(kas +> (gaur:$(kas t.kas) i.kas))
::
++ goon :: kill
^+ .
.(s.orb [%r ~])
::
++ grab :: chase simple path
2013-12-15 11:07:57 +04:00
|= lam=lamb ^- twig
2013-09-29 00:21:18 +04:00
?- -.lam
& =+ tes=(sky [%cx hox %main wen %bin p.lam %hoon ~])
(grad [hox ?^(tes %main cwd) wen %bin p.lam ~])
| p.lam
==
::
2013-12-15 11:07:57 +04:00
++ grad :: path to twig
|= pax=path ^- twig
2014-01-05 07:56:33 +04:00
[%clsg (turn pax |=(a=@ta [%dtzy %ta a]))]
2013-09-29 00:21:18 +04:00
::
++ gram :: add action
2013-12-15 09:42:27 +04:00
|= [hom=duct fav=card]
2013-09-29 00:21:18 +04:00
%_(+> duv [[hom fav] duv])
::
++ gran :: add actions
2013-12-15 09:42:27 +04:00
|= vid=(list ,[p=duct q=card])
2013-09-29 00:21:18 +04:00
^+ +>
?~(vid +> $(vid t.vid, +> (gram i.vid)))
::
++ gray :: process result
2013-12-15 09:42:27 +04:00
|= ton=toon
2013-09-29 00:21:18 +04:00
^- [(unit) _+>]
?- -.ton
%0 [[~ p.ton] +>]
%1 [~ (glum ((list path) p.ton) s.orb)]
%2 [~ (gram(orb [~ ~ ~ %r ~]) ~ [%crud %exit p.ton])]
==
::
++ grid :: process result
2013-12-15 09:42:27 +04:00
|= [ton=toon fun=_|+(* +>)]
2013-09-29 00:21:18 +04:00
^+ +>
?- -.ton
%0 (fun p.ton)
%1 (glum ((list path) p.ton) s.orb)
%2 (gram(orb [~ ~ ~ %r ~]) ~ [%crud %exit p.ton])
==
::
++ grin :: process result
2013-12-15 09:42:27 +04:00
|= [ton=toon hog=boar]
2013-09-29 00:21:18 +04:00
^+ +>
?- -.ton
%0 (haul (fret p.ton))
%1 (glum ((list path) p.ton) hog)
%2 (gram(orb [~ ~ ~ %r ~]) ~ [%crud %exit p.ton])
==
::
++ grip :: step to completion
|- ^+ +
=+(a=grit ?:(=(+.$ a) +.$ $(+.$ a)))
::
++ grit :: work step
|- ^+ +
?. =(~ p.orb) +
=+ hog=s.orb
?- -.hog
%n :: new
2013-09-29 00:21:18 +04:00
=+ gen=?:(?=(0 -.r.hog) s.r.hog p.r.hog)
?~ joy.q.hog
=^ juy +.$ glee
2013-09-29 00:21:18 +04:00
?~ juy +.$
$(s.orb hog(joy.q [~ (need (mang [food:zu war u.juy] sky))]))
?~ ran.q.hog
=^ nur +.$ (gray (mong [slap u.joy.q.hog gen] sky))
2013-09-29 00:21:18 +04:00
?~ nur +.$
$(s.orb hog(ran.q nur))
?: ?=(1 -.r.hog)
=. +.$ (gybe ~ -.u.ran.q.hog +.u.ran.q.hog ~)
$(s.orb [%r ~])
?: ?=(2 -.r.hog)
$(s.orb [%t u.ran.q.hog])
?~ pux.q.hog
=^ wim +.$
2013-09-29 00:21:18 +04:00
(gray (mong [slap u.joy.q.hog (grab q.r.hog)] sky))
?~ wim +.$
$(s.orb hog(pux.q [~ ((hard path) +.u.wim)]))
=+ ^= mop |- ^- (list ,@tas)
?~ r.r.hog ~
=+ mor=$(r.r.hog t.r.r.hog)
?.(?=(| -.i.r.r.hog) mor (weld p.i.r.r.hog mor))
?~ jiv.q.hog
=^ woh +.$ (grow mop u.pux.q.hog)
?~ woh +.$
$(s.orb hog(jiv.q woh))
?~ kyq.q.hog
=^ mux +.$
(gray (mong [fuel:zu r.r.hog u.jiv.q.hog] sky))
?~ mux +.$
$(s.orb hog(kyq.q mux))
?~ gam.q.hog
=^ lez +.$ (grok | u.pux.q.hog u.kyq.q.hog)
?~ lez +.$
$(s.orb hog(gam.q [~ q.u.lez]))
%- grin :_ hog
%- mong :_ sky
[fapp:zu u.gam.q.hog u.ran.q.hog]
::
%r :: running
?~ p.hog +.$
?: =(~ r.orb)
?: =(~ q.orb) +.$
=^ pud q.orb ~(get to q.orb)
abet:(pong:(ox p.p.pud) q.p.pud)
=^ pud r.orb ~(get to r.orb)
(grin (mong [fane:zu [p.p.pud q.p.pud u.p.hog]] sky) hog)
::
%t :: transform
?: =(~ q.orb) +.$
=^ neb q.orb ~(get to q.orb)
=+ pun=q.p.neb
?> ?=(%pipe -.pun)
?~ p.pun
2013-09-29 00:21:18 +04:00
=. +.$ (gybe ~)
$(s.orb [%r ~])
%+ grid (mong [slit -.p.hog p.u.p.pun] sky)
2014-01-04 11:28:16 +04:00
|= noy=tutu
2013-09-29 00:21:18 +04:00
=| zil=(list)
|- ^+ +.^^$
?~ q.u.p.pun
2013-09-29 00:21:18 +04:00
(gybe ~ noy (flop zil))
%+ grid (mong [slam [p.hog [p.u.p.pun i.q.u.p.pun]]] sky)
2013-12-15 09:42:27 +04:00
|= zom=*
2013-09-29 00:21:18 +04:00
^$(q.u.p.pun t.q.u.p.pun, zil [+.zom zil])
==
::
++ grok :: extend config
2013-12-15 09:42:27 +04:00
|= [sot=? pax=path boy=coal]
2013-09-29 00:21:18 +04:00
^- [(unit ,[p=? q=coal]) _+>]
=+ wiz=(~(get by p.pyr) wer pax boy)
?^ wiz [[~ & u.wiz] +>.$]
2013-09-29 00:21:18 +04:00
=^ gar +>.$ (gray (mong [fuss:zu sot pax] sky))
?~ gar [~ +>.$]
=> .(gar ((hard (unit ,[p=@uvI q=*])) u.gar))
?~ gar [[~ | boy] +>.$]
=+ wex=(~(get by q.pyr) wer p.u.gar boy)
?^ wex [[~ & u.wex] +>.$]
=+ xow=(~(get by r.pyr) q.u.gar boy)
?^ xow [[~ & u.xow] +>.$]
=^ yeq +>.$ (gray (mong [slap boy q.u.gar] sky))
?~ yeq [~ +>.$]
:- [~ & u.yeq]
%= +>.$
p.pyr (~(put by p.pyr) [wer pax boy] u.yeq)
q.pyr (~(put by q.pyr) [wer p.u.gar boy] u.yeq)
r.pyr (~(put by r.pyr) [q.u.gar boy] u.yeq)
==
::
++ grim
2013-12-15 09:42:27 +04:00
|= [paw=(list path) boy=coal]
2013-09-29 00:21:18 +04:00
^- [(unit ,[p=(list path) q=coal]) _+>]
?~ paw [[~ ~ boy] +>.$]
=^ wuh +>.$ (grok & i.paw boy)
?~ wuh [~ +>.$]
=^ hyq +>.$ $(paw t.paw, boy q.u.wuh)
?~ hyq [~ +>.$]
?. p.u.wuh [hyq +>.$]
[[~ [i.paw p.u.hyq] q.u.hyq] +>.$]
::
++ grow
2013-12-15 09:42:27 +04:00
|= [mod=(list ,@tas) pax=path]
2013-09-29 00:21:18 +04:00
^- [(unit coal) _+>]
=+ ^= paw ^- (list path)
=+ :* mog=`path`~[hox %main wen]
2013-09-29 00:21:18 +04:00
rim=(scag 2 pax)
==
:* (weld (scag 3 pax) `path`[%con ~])
(weld mog `path`[%nat rim])
2013-12-15 09:42:27 +04:00
(turn mod |=(a=@tas (weld mod `path`[%alt a rim])))
2013-09-29 00:21:18 +04:00
==
=+ sho=(scag 4 pax)
=+ boy=(grub pax)
|- ^- [(unit coal) _+>.^$]
=^ hyq +>.^$ (grim paw boy)
?~ hyq [~ +>.^$]
?~ sho [[~ q.u.hyq] +>.^$]
%= $
sho t.sho
boy q.u.hyq
2013-12-21 06:35:33 +04:00
paw (turn paw |=(a=path (weld a `path`[i.sho ~])))
2013-09-29 00:21:18 +04:00
==
::
++ grub :: initial compose
2013-12-15 09:42:27 +04:00
|= pax=path ^- coal
2013-09-29 00:21:18 +04:00
:- [%cell [%cell [%atom %p] pah.typ] -.nub]
[[who pax] +.nub]
::
++ guff :: kill all depends
^+ .
=+ yop=(~(tap by p.orb) *(list ,[p=@ud q=kite]))
|- ^+ ..guff
?~ yop ..guff
%= $
yop t.yop
..guff (gulf (bist %au (scot %ud p.i.yop) ~) q.i.yop)
==
::
2013-09-29 00:21:18 +04:00
++ gull :: request control
2013-12-15 09:42:27 +04:00
|= [tea=wire him=ship ryf=riff]
2013-09-29 00:21:18 +04:00
(gram ~[/c [%b tea]] [%warp him ryf])
::
++ gulf :: stop request
2013-12-15 09:42:27 +04:00
|= [tea=wire kit=kite]
2013-09-29 00:21:18 +04:00
(gull tea r.kit [s.kit ~])
::
++ gulp :: start request
2013-12-15 09:42:27 +04:00
|= [tea=wire kit=kite]
2013-09-29 00:21:18 +04:00
%^ gull tea
r.kit
^- riff
[s.kit ~ %& p.kit q.kit t.kit]
::
++ gump :: message server
2013-12-15 09:42:27 +04:00
|= [ton=? cav=@ta gyp=@ud ted=@ud lap=wire]
2013-09-29 00:21:18 +04:00
^+ +>
=+ ^= yes ^- (set ,[p=@ud q=@ud r=wire])
=+ yes=(~(get by sev) cav)
2013-09-29 00:21:18 +04:00
?~(yes ~ u.yes)
%_ +>.$
sev
%+ ~(put by sev) cav
2013-09-29 00:21:18 +04:00
?: ton
(~(put in yes) gyp ted lap)
(~(del in yes) gyp ted lap)
==
::
++ gush
2013-12-15 09:42:27 +04:00
|= [wak=@da gyp=@ud ted=@ud lap=wire]
2013-09-29 00:21:18 +04:00
^+ +>
+>.$(tem (~(put by tem) [gyp ted lap] wak))
::
++ gust
2013-12-15 09:42:27 +04:00
|= [gyp=@ud ted=@ud lap=wire]
2013-09-29 00:21:18 +04:00
+>.$(tem (~(del by tem) [gyp ted lap]))
::
++ gybe :: pipe forward
2014-01-04 11:28:16 +04:00
|= pun=(unit ,[p=tutu q=(list)])
2013-09-29 00:21:18 +04:00
^+ +>
?~ nex
?~ pun +>
2013-12-15 09:42:27 +04:00
(gran (turn q.u.pun |=(a=* [~ (gyve p.u.pun a)])))
2013-09-29 00:21:18 +04:00
+>.$(..ra abet:(glob:(past u.nex) ~ [%pipe pun]))
::
++ gyve :: print vase
2014-01-04 11:28:16 +04:00
|= [toy=tutu val=*] ^- card
2013-09-29 00:21:18 +04:00
=+ caf=((hard calf) (need (mang [felt:zu toy] sky)))
2013-12-08 05:10:14 +04:00
:: ?: =([~ [%atom %t]] caf)
:: [%tell ((hard ,@t) val) ~]
:: ?: =([~ %wall] caf)
:: [%tell ((hard (list ,@t)) val)]
2013-09-29 00:21:18 +04:00
[%talk (dish:ut caf val)]
::
++ haft :: process gift
2013-12-15 09:42:27 +04:00
|= guf=gilt
2013-09-29 00:21:18 +04:00
^+ +>
?- -.guf
2014-01-04 11:28:16 +04:00
%$ (gybe ~ +<.guf +>.guf ~)
%mu (gybe ~ +<.guf ((hard (list)) +>.guf))
2013-09-29 00:21:18 +04:00
::
%va
=+ tey=((hard ,[p=@tas q=(unit)]) +.guf)
%= +>.$
war ?~(q.tey (~(del by war) p.tey) (~(put by war) p.tey u.q.tey))
==
::
*
=+ gud=((hard gift) guf)
|- ^+ +>.^$
?- -.gud
%$ !!
%cc ?~ p.gud +>.^$(loq p.gud)
~& [%cc p.gud]
=+ hyz=(sky %cy gasp(loq p.gud))
?~ hyz ~|(%case-none !!)
+>.^$(loq p.gud)
2013-09-29 00:21:18 +04:00
%ck +>.^$(cwd p.gud)
%cs +>.^$(cws p.gud)
%de (gram ~ %note '#' q.gud)
%ex =. +>.^$ guff
+>.^$(s.orb [%n p.gud *claw q.gud])
%ha (gram ~ %crud %soft [p.gud ~])
%ho (gram ~ %crud %soft p.gud)
%la (gram ~ %talk p.gud)
2013-12-15 09:42:27 +04:00
%lo (gran (turn p.gud |=(a=tank [~ %talk a])))
2013-09-29 00:21:18 +04:00
%mu !!
%mx |- ^+ +>.^^$
?~ p.gud +>.^^$
$(p.gud t.p.gud, +>.^^$ ^$(gud i.p.gud))
%ok (gram [/c ~] %info who p.gud q.gud)
%sc good:+>.^$(sac ?~(p.gud ?~(sac ~ +.sac) [u.p.gud sac]))
%sp !!
%sq =+ tea=(bist %ma r.gud)
(gram [/a [%b tea] ~] [%want p.gud [%q q.gud %b tea] s.gud])
%sr (gram [/a /b ~] [%want p.gud [%r q.gud] r.gud])
2013-09-29 00:21:18 +04:00
%te (gram ~ %tell p.gud)
%th (gram [/e ~] %that p.gud q.gud)
2013-10-27 07:55:53 +04:00
%tq =+ tea=(bist %ma p.gud)
(gram [/e [%b tea] ~] [%them ~ q.gud])
2013-09-29 00:21:18 +04:00
%va !!
%xx (gram ~ p.gud)
%xy (gram [p.gud /b ~] q.gud)
==
2013-09-29 00:21:18 +04:00
==
::
++ hale :: process gifts
2013-12-15 09:42:27 +04:00
|= guz=(list gilt)
2013-09-29 00:21:18 +04:00
^+ +>
?~(guz +> $(guz t.guz, +> (haft i.guz)))
::
++ haul :: process success
2013-12-15 09:42:27 +04:00
|= bof=beef
2013-09-29 00:21:18 +04:00
^+ +>
=. s.orb r.bof
=. +> (hale p.bof)
(gird q.bof)
::
++ loss :: stop goal
2013-12-15 09:42:27 +04:00
|= [lap=wire gal=goal]
2013-09-29 00:21:18 +04:00
^+ +>
?- -.gal
%$ +>
%do +>
%eg (gulf (bist %ma lap) p.gal)
%es :: ~& %es-loss
(gull (bist %ma lap) p.gal q.gal ~)
2013-10-27 07:55:53 +04:00
%hp +>
2013-09-29 00:21:18 +04:00
%ht (gram [/e [%b (bist [%ma lap])] ~] [%band who ~])
%lq (gump | p.gal gyp ted lap)
%ow +>
%rt +>
2013-09-29 00:21:18 +04:00
%up +>(..ra (hoop lap ted))
%wa (gust gyp ted lap)
==
::
++ moor :: start goal
2013-12-15 09:42:27 +04:00
|= [lap=wire gal=goal]
2013-09-29 00:21:18 +04:00
^+ +>
?- -.gal
%$ +>
%do !!
%eg (gulp (bist %ma lap) p.gal)
%es :: ~& %es-moor
(gull (bist %ma lap) p.gal q.gal [~ r.gal])
2013-10-27 07:55:53 +04:00
%hp +>
2013-09-29 00:21:18 +04:00
%ht (gram [/e [%b (bist [%ma lap])] ~] [%band who p.gal])
%lq (gump & p.gal [gyp ted lap])
%ow +>
%rt +>
2013-09-29 00:21:18 +04:00
%up +>(..ra (hoot lap ted p.gal))
%wa (gush p.gal gyp ted lap)
==
::
++ ox :: per delivery
2013-12-15 09:42:27 +04:00
|= lap=wire :: per request
2013-09-29 00:21:18 +04:00
=+ gul=(~(get by loz) lap)
=+ lug=gul
|%
++ abet :: resolve
^+ +>.$
?~ lug
?~ gul +>.$
(loss(loz (~(del by loz) lap)) lap u.gul)
?~ gul
(moor(loz (~(put by loz) lap u.lug)) lap u.lug)
?: =(u.lug u.gul) +>.$
=. +>.$ (loss(loz (~(del by loz) lap)) lap u.gul)
(moor(loz (~(put by loz) lap u.lug)) lap u.lug)
::
2013-12-15 09:42:27 +04:00
++ pane |=(gal=goal %_(. lug [~ gal])) :: set goal
2013-09-29 00:21:18 +04:00
++ pang %_(. lug ~) :: delete goal
++ pong :: accept card
2013-12-15 09:42:27 +04:00
|= fav=card
2013-09-29 00:21:18 +04:00
^+ +>
?> ?=(^ lug)
?- -.u.lug
~
?> ?=(%pipe -.fav)
+>.$(+>.$ (glib lap [%$ p.fav]))
::
%do !!
::
%eg
?> ?=(%writ -.fav)
+>.$(lug ~, +>.$ (glib lap [%eg +.fav]))
::
%es
?> ?=(%writ -.fav)
=+ ^= goh ^- (unit goal)
?~ p.fav `(unit goal)`~
?- -.r.u.lug
%& ~
%|
^- (unit goal)
:- ~
?> ?=(%ud -.q.p.u.p.fav)
%= u.lug
p.p.r
?> ?| !=(%ud -.p.p.r.u.lug)
2013-09-29 00:21:18 +04:00
=(p.p.p.r.u.lug p.q.p.u.p.fav)
==
[%ud +(p.q.p.u.p.fav)]
==
==
=. loz ?~(goh (~(del by loz) lap) (~(put by loz) lap u.goh))
%= +>.$
lug goh
gul goh
+>.$ (glib lap [%eg +.fav])
==
2013-10-27 07:55:53 +04:00
::
%hp
?> ?=(%thou -.fav)
+>.$(+>.$ (glib lap [%hp +.fav]))
2013-09-29 00:21:18 +04:00
::
%ht
?> ?=(%thee -.fav)
+>.$(+>.$ (glib lap [%ht +.fav]))
::
%lq
?> ?=(%wart -.fav)
+>.$(+>.$ (glib lap [%lq p.fav r.fav s.fav]))
::
%rt
?: ?=(%went -.fav)
?. ?=(%dead q.fav) +>.$
+>.$(+>.$ (glib lap [%rt ~]))
?> ?=(%waft -.fav)
+>.$(+>.$ (glib lap [%rt ~ q.fav]))
2013-09-29 00:21:18 +04:00
::
%up
?> ?=(%line -.fav)
+>.$(+>.$ (glib lap [%up +.fav]))
::
%ow
?> ?=(%went -.fav)
+>.$(+>.$ (glib lap [%ow q.fav]))
2013-09-29 00:21:18 +04:00
::
%wa
2013-09-29 00:21:18 +04:00
?> ?=(%wake -.fav)
+>.$(+>.$ (glib lap [%wa ~]))
==
--
--
--
::
++ lo :: command parsers
|%
++ coax :: parse flags
2013-12-15 11:07:57 +04:00
|= coo=tape ^- twig
2013-09-29 00:21:18 +04:00
:+ %cnts [[~ 1] ~]
2013-12-15 13:48:16 +04:00
|- ^- tray
2013-09-29 00:21:18 +04:00
?~ coo ~
:_ $(coo t.coo)
?: &((gte i.coo 'a') (lte i.coo 'z'))
2014-01-05 07:56:33 +04:00
[[i.coo ~] [%dtzy %f &]]
2013-09-29 00:21:18 +04:00
?> &((gte i.coo 'A') (lte i.coo 'Z'))
2014-01-05 07:56:33 +04:00
[[(sub i.coo 32) ~] [%dtzy %f |]]
2013-09-29 00:21:18 +04:00
::
++ cone :: parse conf
%+ cook
2013-12-15 09:42:27 +04:00
|= a=(list (list ^cone))
2013-09-29 00:21:18 +04:00
?~ a ~
?~(i.a $(a t.a) [i.i.a $(i.a t.i.a)])
%- star
;~ pose
;~(plug (ifix [kel ker] (stag %| (most ace sym))) (easy ~))
::
;~ plug
2013-09-29 00:21:18 +04:00
(ifix [sel ser] (stag %& (stag %cltr (most ace wide:vez))))
(easy ~)
==
::
%+ ifix [gal gar]
;~ pose
;~ plug
(stag %& (cook coax (plus ;~(pose low hig))))
;~ pose
;~ pfix ;~(plug sem ace)
;~ plug
2013-12-15 09:42:27 +04:00
%+ cook |=(a=^cone a)
2013-12-15 13:48:16 +04:00
(stag %& (stag %cnts (stag [[~ 1] ~] lobo:vez)))
2013-09-29 00:21:18 +04:00
(easy ~)
==
==
(easy ~)
==
==
::
;~ plug
2013-12-15 13:48:16 +04:00
(stag %& (stag %cnts (stag [[~ 1] ~] lobo:vez)))
2013-09-29 00:21:18 +04:00
(easy ~)
==
==
==
::
++ lark :: parse lark
2013-12-15 09:42:27 +04:00
%+ cook |=(a=(unit ^lark) a)
2013-09-29 00:21:18 +04:00
;~ pose
(cold ~ ;~(plug col col (star (shim 32 126))))
%+ ifix [(star ace) (star ace)]
%+ stag ~
%+ stag ~
;~ pose
lute
::
;~ pfix tis
;~ pose
%+ cook
2013-12-15 11:07:57 +04:00
|= [a=@tas b=(list twig)]
2013-09-29 00:21:18 +04:00
^- (list lath)
:~ [%1 [%cltr b]]
2014-01-05 07:56:33 +04:00
[%0 %0 [%& %set] ~ [[%clsg [%dtzy %tas a] ~]]]
2013-09-29 00:21:18 +04:00
==
;~(plug sym (star ;~(pfix ace wide:vez)))
::
%+ cook
2013-12-15 09:42:27 +04:00
|= a=@tas
2013-12-16 05:15:04 +04:00
:~ [%0 %0 [%& %none] ~ [%bczp %null]]
2014-01-05 07:56:33 +04:00
[%0 %0 [%& %set] ~ [%clsg [%dtzy %tas a] ~]]
2013-09-29 00:21:18 +04:00
==
;~(pfix tis sym)
==
==
==
gay
==
::
++ lamb
2013-12-15 09:42:27 +04:00
%+ cook |=(a=^lamb a)
2013-09-29 00:21:18 +04:00
;~ pose
(stag %& sym)
(stag %| (stag %clsg poor:vez))
==
::
++ loth
2013-12-15 09:42:27 +04:00
%+ cook |=(a=lath a)
2013-09-29 00:21:18 +04:00
;~ pfix col
%+ stag %0
;~ plug
;~(pose ;~(pfix zap ;~(pose (cold %2 zap) (easy %1))) (easy %0))
lamb
cone
(stag %clsg (star ;~(pfix ace wide:vez)))
==
==
::
++ lute
%+ cook
2013-12-15 09:42:27 +04:00
|= a=(list lath) ^+ a
2013-09-29 00:21:18 +04:00
=+ b=(flop a)
?.(&(?=(^ b) ?=(2 -.i.b)) b [[%1 p.i.b] t.b])
;~ plug
;~(pose (stag %2 wide:vez) loth)
2013-09-29 00:21:18 +04:00
%- star
;~ pose
;~(pfix ;~(plug sem ace) (stag %2 wide:vez))
;~(pfix ace loth)
==
==
--
::
++ zu :: user level
|%
++ fane :: deliver note
2013-12-15 09:42:27 +04:00
|= [pux=path nog=nose tas=vase]
2013-09-29 00:21:18 +04:00
^- vase
%+ slam tas
;: slop
[[%atom %da] now]
[pah.typ pux]
2013-09-29 00:21:18 +04:00
[noq.typ nog]
==
::
++ fapp :: launch app
2013-12-15 09:42:27 +04:00
|= [gum=vase arg=vase]
2013-09-29 00:21:18 +04:00
^- vase
%+ slam
%+ slam gum
%+ slop
[[%atom %da] now]
2013-09-29 00:21:18 +04:00
[[%atom %$] (shax :(mix eny now (shax p.god)))]
arg
::
++ felt :: type to calf
2013-12-15 09:42:27 +04:00
|= typ=type ^- calf
2013-09-29 00:21:18 +04:00
~(dole ut typ)
::
++ food :: standard subject
2013-12-15 09:42:27 +04:00
|= [war=(map ,@ta vase) vax=vase]
2013-09-29 00:21:18 +04:00
^- vase
;: slop
;: slop
%+ slop
[[%atom %da] now]
[[%atom %ta] ~(rent co [~ %da now])]
::
%+ slop
[[%atom %p] who]
[[%atom %ta] hox]
::
[liz.typ q.hit]
==
::
=+ voy=(~(tap to q.sur) ~)
|- ^- vase
?~(voy [[%atom %n] ~] (slop i.voy $(voy t.voy)))
::
2013-09-29 00:21:18 +04:00
?~ war
vax
%- slop
:_ vax
|- ^- vase
?+ war !! :: XX some inference weirdness here?
[* ~ ~] [[%face p.n.war p.q.n.war] q.q.n.war]
[* ~ ^] (slop $(r.war ~) $(war r.war))
[* ^ ~] (slop $(l.war ~) $(war l.war))
[* ^ ^] :(slop $(r.war ~, l.war ~) $(war l.war) $(war r.war))
==
==
::
++ fuel
2013-12-15 09:42:27 +04:00
|= [zul=(list cone) vax=vase]
2013-09-29 00:21:18 +04:00
=+ [hed=(slot 2 vax) tal=(slot 3 vax)]
|- ^- vase
?~ zul (slop hed tal)
?- -.i.zul
& $(tal (slap tal p.i.zul))
| $(zul t.zul)
==
::
2013-12-15 11:07:57 +04:00
++ fuss :: twig and hash
2013-12-15 09:42:27 +04:00
|= [sot=? pax=path]
2013-12-15 11:07:57 +04:00
^- (unit ,[p=@uvI q=twig])
2013-12-21 06:35:33 +04:00
=+ haw=(weld pax `path`/hoon)
2013-09-29 00:21:18 +04:00
=+ arc=((hard arch) .^(%cy haw))
?: &(sot ?=(~ q.arc)) ~
=+ mot=((hard ,@) .^(%cx haw))
:+ ~ ?~(q.arc (sham mot) u.q.arc)
(scan (trip mot) (ifix [gay gay] tall:vez(wer pax)))
--
--
--
2014-01-04 11:28:16 +04:00
. ==
2013-09-29 00:21:18 +04:00
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 4bC, shell vane ::
::
=| $: dez=(map duct brim) :: state by ship
== ::
2013-12-15 09:42:27 +04:00
|= [now=@da eny=@ sky=_|+(* *(unit))] :: current invocation
2013-09-29 00:21:18 +04:00
^? :: opaque core
|% :: poke/peek pattern
++ beat :: process move
2013-12-15 09:42:27 +04:00
|= [wru=(unit writ) tea=wire hen=duct fav=curd]
=+ vaf=(card fav)
?. =(vaf fav)
~& [%fav fav]
~& [%vaf vaf]
!!
2013-09-29 00:21:18 +04:00
=> .(fav ((hard card) fav))
^- [p=(list move) q=vane]
?: ?=([%crud *] fav)
[[[wru [/d hen] [%flog fav]] ~] ..^$]
?: ?=(%wake -.fav)
=+ ^= fiy
=| fiy=(list ,[p=duct q=ship r=[p=@ud q=@ud r=wire]])
2013-09-29 00:21:18 +04:00
|- ^+ fiy
?~ dez fiy
=. fiy $(dez l.dez)
=. fiy $(dez r.dez)
|- ^+ fiy
?~ q.n.dez fiy
%= $
q.n.dez t.q.n.dez
fiy
|- ^+ fiy
?~ tem.q.i.q.n.dez fiy
=. fiy $(tem.q.i.q.n.dez l.tem.q.i.q.n.dez)
=. fiy $(tem.q.i.q.n.dez r.tem.q.i.q.n.dez)
?. (lte q.n.tem.q.i.q.n.dez now) fiy
[[p.n.dez p.i.q.n.dez p.n.tem.q.i.q.n.dez] fiy]
2013-09-29 00:21:18 +04:00
==
=| wam=(list move)
|- ^- [p=(list move) q=vane]
?~ fiy [wam ..^^$]
=+ dos=(need (~(get by dez) p.i.fiy))
=+ suy=|-(`brad`?~(dos !! ?.(=(q.i.fiy p.i.dos) $(dos t.dos) q.i.dos)))
=+ geb=((be [[q.i.fiy bred] suy]) now eny sky)
2013-11-14 06:44:14 +04:00
=+ ^= yub ^- [p=(list move) q=brat]
?. (fang:geb r.i.fiy)
~& [%time-lost r.i.fiy]
[~ abet:(flub:geb r.i.fiy)]
(lake:geb p.i.fiy r.i.fiy)
2013-09-29 00:21:18 +04:00
%= $
fiy t.fiy
wam (weld p.yub wam)
2013-12-24 00:49:15 +04:00
dez.^^$ (~(put by dez.^^$) p.i.fiy [[q.i.fiy +.q.yub] +.dos])
2013-09-29 00:21:18 +04:00
==
=+ dus=(~(get by dez) hen)
?~ dus
?+ -.fav
2013-09-29 00:21:18 +04:00
~& [%beat-none -.fav tea hen]
~|([%beat-none -.fav] !!)
::
%init
=+ bos=(sein p.fav)
=. bos ?.(=(bos p.fav) bos ~zod)
?~ wru !!
:- :- [wru hen fav]
?: =(bos p.fav) ~
:_ ~
[wru [/b hen] [%line (rap 3 ":{(scow %p bos)}/main=/bin/update")]]
2013-09-29 00:21:18 +04:00
..^$(dez (~(put by dez) hen [[q.u.wru (bard q.u.wru)] ~]))
::
?(%loin %make %sith)
[[[wru [/a [%b tea] hen] fav] ~] ..^$]
==
?> ?=(^ u.dus)
?+ -.fav
=> ?. ?=(%writ -.fav) .
:: ~& [%batz-writ tea]
.
2013-09-29 00:21:18 +04:00
?~ wru
=+ ade=(adit hen)
=+ hem=`helm`?-(ade %lead [%lead p.i.u.dus], %iron %iron, %gold %gold)
[[[[~ hem p.i.u.dus] [[%b tea] hen] fav] ~] ..^$]
=+ beg=`brat`[[p.i.u.dus bred] q.i.u.dus]
=+ yub=(leap:((be beg) now eny sky) tea hen fav)
:- p.yub
..^$(dez (~(put by dez) hen [[p.i.u.dus +.q.yub] t.u.dus]))
::
%init
=+ bos=(sein p.fav)
=. bos ?.(=(bos p.fav) bos ~zod)
?~ wru !!
:- :* [wru hen fav]
2013-09-29 00:21:18 +04:00
[wru [[%b tea] hen] [%hail ~]]
?: =(bos p.fav) ~
:_ ~
[wru [/b hen] [%line (rap 3 ":{(scow %p bos)}/main=/bin/update")]]
2013-09-29 00:21:18 +04:00
==
..^$(dez (~(put by dez) hen [[q.u.wru (bard q.u.wru)] u.dus]))
::
%limn
2013-12-21 06:35:33 +04:00
$(fav [%hail ~], dez (~(put by dez) hen (weld t.u.dus `brim`[i.u.dus ~])))
2013-09-29 00:21:18 +04:00
==
::
++ come
2013-12-15 09:42:27 +04:00
|= old=vase
2013-09-29 00:21:18 +04:00
^- vane
~|(%load-nest-bede !!)
::
++ doze
2013-12-15 09:42:27 +04:00
|= [now=@da hen=duct]
2013-09-29 00:21:18 +04:00
^- (unit ,@da)
=| doz=(unit ,@da)
|- ^+ doz
?~ dez doz
=. doz $(dez l.dez)
=. doz $(dez r.dez)
|- ^+ doz
?~ q.n.dez doz
%= $
q.n.dez t.q.n.dez
doz
|- ^+ doz
?~ tem.q.i.q.n.dez doz
=. doz $(tem.q.i.q.n.dez l.tem.q.i.q.n.dez)
=. doz $(tem.q.i.q.n.dez r.tem.q.i.q.n.dez)
(hunt doz ~ q.n.tem.q.i.q.n.dez)
==
::
++ flee stay
++ load
2013-12-15 09:42:27 +04:00
|= new=vase
2013-09-29 00:21:18 +04:00
^- vane
2014-01-04 11:28:16 +04:00
?. (~(nest ut -:!>(dez)) & p.new) (come new)
2013-09-29 00:21:18 +04:00
..^$(dez ((map duct brim) q.new))
::
++ raze
2013-09-29 00:21:18 +04:00
^- vane
..$(dez ~)
::
++ scry
2013-12-15 09:42:27 +04:00
|= [our=ship ren=@tas his=ship syd=disc lot=coin tyl=path]
2013-09-29 00:21:18 +04:00
^- (unit)
~
::
++ stay `vase`!>(dez)
--