it compiles now

This commit is contained in:
Ted Blackman 2022-11-29 23:59:04 -06:00
parent 2b18091c28
commit 638b761e93
3 changed files with 329 additions and 238 deletions

View File

@ -1,38 +1,39 @@
/+ ska
/- *sock /- *sock
/- *gene /- *gene
/+ ska
|% |%
++ plot ++ plot
=| ski=farm =| ski=farm
|= ent=barn |= ent=barn
^- [boot farm] ^- [boot farm]
=/ ext (~(get by ski) ent) =/ ext (~(get by yard.ski) ent)
?. ?=(~ ext) [says.u.ext ski] ?. ?=(~ ext) [says.u.ext ski]
=; [res sku] [says.res sku(yard (~(put by yard.sku) ent res), wood [ent wood.sku]] =; [res=[does=nomm says=boot:ska] sku=farm]
=. ski ski(yard (~(put by yard.ski) ent [[%zer 0 %.n] [%risk %toss ~]])) :: blackhole, guard recursion [says.res sku(yard (~(put by yard.sku) ent res), wood [ent wood.sku])]
|- :: blackhole, guard recursion
^- [[does=nomm says=boot:ska] farm] =. ski ski(yard (~(put by yard.ski) ent [[%zer 0 %.n] [%risk %toss ~]]))
|- ^- [[does=nomm says=boot:ska] farm]
=< =<
?+ for.ent bomb ?+ for.ent bomb
[[* *] *] [[* *] *]
=^ [doth sath] ski $(for.ent -.for.ent) =^ [doth=nomm sath=boot:ska] ski $(for.ent -.for.ent)
?: ?=([%boom ~] sath) bomb ?: ?=([%boom ~] sath) bomb
=^ [toes tays] ski $(for.ent +.for.ent) =^ [toes=nomm tays=boot:ska] ski $(for.ent +.for.ent)
?: ?=([%boom ~] tays) bomb ?: ?=([%boom ~] tays) bomb
:_ ski :_ ski
:_ (cobb:ska sath tays) :_ (cobb:ska sath tays)
[%par doth sath] [%par doth toes]
:: ::
[%0 @] [%0 @]
:: we can decompose the axis into two axes, a safe axis which can :: we can decompose the axis into two axes, a safe axis which can
:: be implemented unchecked, and an unsafe axis which must be :: be implemented unchecked, and an unsafe axis which must be
:: checked. We then compose these two axes into safe %zer and :: checked. We then compose these two axes into safe %zer and
:: unsafe %zer composed by %sev :: unsafe %zer composed by %sev
=/ [saf rik ken] (punt:ska +.for.ent sub.ent) =+ [saf rik ken]=(punt:ska +.for.ent sub.ent)
?: =(0 saf) bomb ?: =(0 saf) bomb
:_ ski
?: =(1 rik) [[%zer saf %.y] [%safe ken]] ?: =(1 rik) [[%zer saf %.y] [%safe ken]]
?: =(1 saf) [[%zer rik %.n] [%risk ken]] ?: =(1 saf) [[%zer rik %.n] [%risk ken]]
:_ ski
:_ [%risk ken] :_ [%risk ken]
[%sev [%zer saf %.y] [%zer rik %.n]] [%sev [%zer saf %.y] [%zer rik %.n]]
:: ::
@ -40,11 +41,11 @@
:_ ski :_ ski
:_ [%safe %know +.for.ent] :_ [%safe %know +.for.ent]
[%one +.for.ent] [%one +.for.ent]
:: ::
[%2 * *] [%2 * *]
=^ [dost sass] ski $(for.ent +<.for.ent) =^ [dost=nomm sass=boot:ska] ski $(for.ent +<.for.ent)
?: ?=([%boom ~] sass) bomb ?: ?=([%boom ~] sass) bomb
=^ [doff faff] ski $(for.ent +>.for.ent) =^ [doff=nomm faff=boot:ska] ski $(for.ent +>.for.ent)
?: ?=([%boom ~] faff) bomb ?: ?=([%boom ~] faff) bomb
=/ skun =/ skun
?- sass ?- sass
@ -64,16 +65,16 @@
:_ ski :_ ski
:_ [%risk %toss ~] :_ [%risk %toss ~]
[%two dost doff skun ~ %.n] [%two dost doff skun ~ %.n]
:: ::
[%3 *] [%3 *]
=^ [deft koob] ski $(for.ent +.for.ent) =^ [deft=nomm koob=boot:ska] ski $(for.ent +.for.ent)
?: ?=([%boom ~] koob) bomb ?: ?=([%boom ~] koob) bomb
:_ ski :_ ski
:_ (ques:ska koob) :_ (ques:ska koob)
[%thr deft] [%thr deft]
:: ::
[%4 *] [%4 *]
=^ [dink sink] ski $(for.ent +.for.ent) =^ [dink=nomm sink=boot:ska] ski $(for.ent +.for.ent)
?: ?=([%boom ~] sink) bomb ?: ?=([%boom ~] sink) bomb
=/ rink =/ rink
?- sink ?- sink
@ -83,76 +84,81 @@
:_ ski :_ ski
:_ (pile:ska sink) :_ (pile:ska sink)
[%fou dink ?|(?=([%dice ~] rink) ?=([%flip ~] rink) ?=([%know @] rink))] [%fou dink ?|(?=([%dice ~] rink) ?=([%flip ~] rink) ?=([%know @] rink))]
:: ::
[%5 * *] [%5 * *]
=^ [dome foam] ski $(for.ent +<.for.ent) =^ [dome=nomm foam=boot:ska] ski $(for.ent +<.for.ent)
?: ?=([%boom ~] foam) bomb ?: ?=([%boom ~] foam) bomb
=^ [doot foot] ski $(for.ent +>.for.ent) =^ [doot=nomm foot=boot:ska] ski $(for.ent +>.for.ent)
?: ?=([%boom ~] foot) bomb ?: ?=([%boom ~] foot) bomb
:_ ski :_ ski
:_ (bopp:ska foam foot) :_ (bopp:ska foam foot)
[%fiv dome doot] [%fiv dome doot]
:: ::
[%6 * * *] [%6 * * *]
=^ [dawn sond] ski $(for.ent +<.for.ent) =^ [dawn=nomm sond=boot:ska] ski $(for.ent +<.for.ent)
?: ?=([%safe %know %0] sond) $(for.ent +>-.for.ent) ?: ?=([%safe %know %0] sond) $(for.ent +>-.for.ent)
?: ?=([%safe %know %1] sond) $(for.ent +>+.for.ent) ?: ?=([%safe %know %1] sond) $(for.ent +>+.for.ent)
?: ?=([%safe %know *] sond) bomb ?: ?=([%safe %know *] sond) bomb
?: ?=([%safe %bets *] sond) bomb ?: ?=([%safe %bets *] sond) bomb
?: ?=([%safe %flip ~] sond) ?: ?=([%safe %flip ~] sond)
=^ [drew slew] ski $(for.ent +>-.for.ent) =^ [drew=nomm slew=boot:ska] ski $(for.ent +>-.for.ent)
=^ [darn song] ski $(for.ent +>+.for.ent) =^ [darn=nomm song=boot:ska] ski $(for.ent +>+.for.ent)
:_ ski :_ ski
:_ (gnaw:ska slew song) :_ (gnaw:ska slew song)
[%six dawn slew song] [%six dawn drew darn]
?: ?=([%risk %know %0] sond) ?: ?=([%risk %know %0] sond)
=^ [drew slew] ski $(for.ent +>-.for.ent) =^ [drew=nomm slew=boot:ska] ski $(for.ent +>-.for.ent)
:_ ski :_ ski
:_ (dare:ska slew) :_ (dare:ska slew)
[%sev [dawn drew] [%zer 3 %.y]] :: run dawn in case it crashes, but throw it away
[%sev [%par dawn drew] [%zer 3 %.y]]
?: ?=([%risk %know %1] sond) ?: ?=([%risk %know %1] sond)
=^ [darn song] ski $(for.ent +>+.for.ent) =^ [darn=nomm song=boot:ska] ski $(for.ent +>+.for.ent)
:_ ski :_ ski
:_ (dare:ska song) :_ (dare:ska song)
[%sev [dawn darn] [%zer 3 %.y]] :: run dawn in case it crashes, but throw it away
?: ?=([%risk %know *] sond) bomb [%sev [%par dawn darn] [%zer 3 %.y]]
?: ?=([%risk %bets *] sond) bomb ?: ?=([%risk %know *] sond) bomb
=^ [drew slew] ski $(for.ent +>-.for.ent) ?: ?=([%risk %bets *] sond) bomb
=^ [darn song] ski $(for.ent +>+.for.ent) =^ [drew=nomm slew=boot:ska] ski $(for.ent +>-.for.ent)
=^ [darn=nomm song=boot:ska] ski $(for.ent +>+.for.ent)
:_ ski :_ ski
:_ (dare:ska (gnaw:ska slew song)) :_ (dare:ska (gnaw:ska slew song))
[%six dawn drew darn] [%six dawn drew darn]
:: ::
[%7 * *] [%7 * *]
=^ [deck keck] ski $(for.ent +<.for.ent) =^ [deck=nomm keck=boot:ska] ski $(for.ent +<.for.ent)
?: ?=([%boom ~] keck) bomb ?: ?=([%boom ~] keck) bomb
=/ news =/ news
?- keck ?- keck
[%safe *] sure.keck [%safe *] sure.keck
[%risk *] hope.keck [%risk *] hope.keck
== ==
=^ [dest zest] ski $(sub.ent news, for.ent +>.for.ent) =^ [dest=nomm zest=boot:ska] ski $(sub.ent news, for.ent +>.for.ent)
?: ?=([%boom ~] zest) bomb ?: ?=([%boom ~] zest) bomb
:_ ski :_ ski
:_ ?: ?=([%safe *] keck) zest (dare:ska zest) :_ ?: ?=([%safe *] keck) zest (dare:ska zest)
[%sev deck dest] [%sev deck dest]
:: ::
[%8 * *] [%8 * *]
=^ [pink pest] ski $(for.ent +<.for.ent) =^ [pink=nomm pest=boot:ska] ski $(for.ent +<.for.ent)
?: ?=([%boom ~] pest) bomb ?: ?=([%boom ~] pest) bomb
=/ nest =/ nest
?- pest ?- pest
[%safe *] sure.pest [%safe *] sure.pest
[%risk *] hope.pest [%risk *] hope.pest
== ==
=^ [dest zest] ski $(sub.ent (knit nest sub.ent), for.ent +>.for.ent) =^ [dest=nomm zest=boot:ska] ski
$(sub.ent (knit:ska nest sub.ent), for.ent +>.for.ent)
?: ?=([%boom ~] zest) bomb ?: ?=([%boom ~] zest) bomb
:_ ski :_ ski
:_ ?: ?=([%safe *] pest) zest) (dare:ska zest) :_ ?: ?=([%safe *] pest)
zest
(dare:ska zest)
[%eig pink dest] [%eig pink dest]
:: ::
[%9 @ *] [%9 @ *]
=^ [lore sore] ski $(for.ent +>.for.ent) =^ [lore=nomm sore=boot:ska] ski $(for.ent +>.for.ent)
?: ?=([%boom ~] sore) bomb ?: ?=([%boom ~] sore) bomb
=/ news =/ news
?- sore ?- sore
@ -163,7 +169,9 @@
?: ?=([%safe %know *] fork) ?: ?=([%safe %know *] fork)
=^ ret ski ^$(ent [news know.sure.fork]) =^ ret ski ^$(ent [news know.sure.fork])
:_ ski :_ ski
:_ ?: ?=([%safe *] sass) ret (dare:ska ret) :_ ?: ?=([%safe *] sore)
ret
(dare:ska ret)
[%nin +<.for.ent lore news (some know.sure.fork) %.y] [%nin +<.for.ent lore news (some know.sure.fork) %.y]
?: ?=([%risk %know *] fork) ?: ?=([%risk %know *] fork)
=^ ret ski ^$(ent [news know.hope.fork]) =^ ret ski ^$(ent [news know.hope.fork])
@ -173,244 +181,326 @@
:_ ski :_ ski
:_ [%risk %toss ~] :_ [%risk %toss ~]
[%nin +<.for.ent lore news ~ ?=([%safe *] fork)] [%nin +<.for.ent lore news ~ ?=([%safe *] fork)]
:: ::
[%10 [@ *] *] [%10 [@ *] *]
=^ [neat seat] ski $(for.ent +>.for.ent) =^ [neat=nomm seat=boot:ska] ski $(for.ent +>.for.ent)
?: ?=([%boom ~] seat) bomb ?: ?=([%boom ~] seat) bomb
=^ [pace spat] ski $(for.ent +<+.for.ent) =^ [pace=nomm spat=boot:ska] ski $(for.ent +<+.for.ent)
?: ?=([%boom ~] spat) bomb ?: ?=([%boom ~] spat) bomb
=/ teak =/ teak
?- seat ?- seat
[%safe *] sure.seat [%safe *] sure.seat
[%risk *] hope.seat [%risk *] hope.seat
== ==
=/ [saf rik ken] (punt +<-.for.ent teak) =+ [saf rik ken]=(punt:ska +<-.for.ent teak)
?: =(0 saf) bomb ?: =(0 saf) bomb
:_ ski
:_ (welt:ska +<-.for.ent spat seat)
?: =(1 rik) ?: =(1 rik)
:_ [(welt +<-.for.ent spat seat) ski] [%ten [+<-.for.ent pace] neat %.y]
:_ [%ten [+<-.for.ent pace] neat %.y] ^- nomm
:_ [(welt +<-.for.ent spat seat) ski] :+ %sev [%par neat pace]
:_ [%sev [neat pace] %ten [saf %ten [rik %zer 3 %.n] [%zer (peg 2 saf) %.y] %.y] [%zer 2 %.y] %.y] :+ %ten
:: [saf %ten [rik %zer 3 %.n] [%zer (peg saf 2) %.y] %.y]
[[%zer 2 %.y] %.y]
::
[%11 @ *] [%11 @ *]
=^ [real seal] ski $(for.ent +>.for.ent) =^ [real=nomm seal=boot:ska] ski $(for.ent +>.for.ent)
?: ?=([%boom ~] seal) bomb ?: ?=([%boom ~] seal) bomb
:_ [seal ski] ^- [[does=nomm says=boot:ska] farm]
:_ [%els +<.for.ent real] [[[%els +<.for.ent real] seal] ski]
:: ::
[%11 [@ *] *] [%11 [@ *] *]
=^ [fake sake] ski $(for.ent +<+.for.ent) =^ [fake=nomm sake=boot:ska] ski $(for.ent +<+.for.ent)
?: ?=([%boom ~] sake) bomb ?: ?=([%boom ~] sake) bomb
=^ [real seal] ski $(for.ent +>.for.ent) =^ [real=nomm seal=boot:ska] ski $(for.ent +>.for.ent)
?: ?=([%boom ~] seal) bomb ?: ?=([%boom ~] seal) bomb
:_ ski :_ ski
?: ?=([%safe *] sake) ?: ?=([%safe *] sake)
[[%eld [+<-.for.ent fake] real %.y] seal] [[%eld [+<-.for.ent fake] real %.y] seal]
[[%eld [+<-.for.ent fake] real %.n] seal] [[%eld [+<-.for.ent fake] real %.n] seal]
:: ::
[%12 * *] [%12 * *]
=^ [fear sear] ski $(for.ent +<.for.ent) =^ [fear=nomm sear=boot:ska] ski $(for.ent +<.for.ent)
?: ?=([%boom ~] sear) bomb ?: ?=([%boom ~] sear) bomb
=^ [pack sack] ski $(for.ent +>.for.ent) =^ [pack=nomm sack=boot:ska] ski $(for.ent +>.for.ent)
?: ?=([%boom ~] sack) bomb ?: ?=([%boom ~] sack) bomb
:_ [[%risk %toss ~] ski] :_ ski
:_ [%risk %toss ~]
[%twe fear pack] [%twe fear pack]
== ==
|% |%
++ bomb [[%zer 0 %.n] [%boom ~] ski] ++ bomb
^- [[nomm boot:ska] farm]
[[[%zer 0 %.n] [%boom ~]] ski]
-- --
++ till ++ till
=| burg=town =| burg=town
|= =farm |= =farm
^- town ^- town
=/ work (flop (skip wood.farm ~(has in ~(key by burg)))) =/ work (flop (skip wood.farm ~(has in ~(key by land.burg))))
=< burg |- ^+ burg
|- ?~ work burg
^- _this =/ next i.work
?: =(~ work) this
=^ next work work
=+ ~| %next-miss (~(got by yard.farm) next) =+ ~| %next-miss (~(got by yard.farm) next)
:: now we have the nock-- in does :: now we have the nock-- in does
=/ dock [lamb=lamb.burg lake=*lake] =/ dock [lamb=lamb.burg lake=*lake]
=| flow=line =| flow=line
=/ axle=@ 1 =/ axle=@ 1
=/ fawn=does =/ fawn does
=+ =- =. lamb.burg lamb.dock
=< =. land.burg
|- %+ ~(put by land.burg) next
^- [[hat=sans her=berm] dock] :_ says
?- fawn :- (~(put by lake.dock) ~ [~ %hop her])
[%par * *] |- ^- (list @)
=^ [one two her] dock twin ?- -.hat
=^ [bat bit] dock $(fawn +>.fawn, axle (peg axle 3), flow [%dab her two]) %fork (weld $(hat left.hat) $(hat rite.hat))
=^ [hat hit] dock $(fawn +<.fawn, axle (peg axle 2), flow [%dab bit one]) %tine [+.hat]~
(copy hat bat hit) %disc ~
:: ==
[%zer *] $(work t.work)
?- flow |^ ^- [[hat=plow her=berm] dock=_dock]
[%moat *] ?- fawn
[%par * *]
=^ [one=plow two=plow her=berm] dock twin
=^ [bat=plow bit=berm] dock
$(fawn +>.fawn, axle (peg axle 3), flow [%moat her two])
=^ [hat=plow hit=berm] dock
$(fawn +<.fawn, axle (peg axle 2), flow [%moat bit one])
(copy hat bat hit)
::
[%zer *]
?- -.flow
%moat
=/ slow (take +<.fawn what.flow +>.fawn) =/ slow (take +<.fawn what.flow +>.fawn)
?~ slow ?~ slow
=^ hole dock bomb fail
:_ dock
[[%disc ~] hole]
:_ dock :_ dock
[u.slow wher.flow] [u.slow wher.flow]
:: ::
[%one *] %rift
(bang +.fawn) =^ miff dock wean
:: =/ slow (take +<.fawn [%tine miff] +>.fawn)
[%two *] ?~ slow
~| %todo !! fail
:: =^ her dock (mend %miff ~ [%brn miff [troo fals]:flow])
:_ dock
[u.slow her]
::
%pond
=^ tend dock wean
=/ slow (take +<.fawn [%tine tend] +>.fawn)
?~ slow
fail
=^ her dock (mend %tend ~ [%don tend])
:_ dock
[u.slow her]
== ==
|% ::
++ bang [%one *]
|= non=* (bang +.fawn)
^- [[hat=plow her=berm] _dock] ::
?- flow [%two *]
[%pond ~] ~| %todo !!
=^ ret dock wean ::
=^ her dock (mend %rime ~[[%imm +.fawn ret]] [%don ret]) [%thr *]
:_ dock ?- -.flow
[[%disc ~] her] %moat
:: ?- -.what.flow
[%rift *] %fork fail
?: =(0 +.fawn) [[[%disc ~] troo.flow] dock] %disc $(fawn +.fawn, axle (peg axle 3))
?: =(1 +.fawn) [[[%disc ~] fals.flow] dock] %tine
=^ hole dock bomb :: XX maybe we should assert that SKA should have caught this? =^ pear dock (mend %pear [%imm 0 +.what.flow]~ [%hop wher.flow])
:_ dock =^ bock dock (mend %bock [%imm 1 +.what.flow]~ [%hop wher.flow])
[[%disc ~] hole] =^ noon dock wean
:: =^ keck dock (mend %keck ~ [%clq noon pear bock])
[%moat *] $(fawn +.fawn, axle (peg axle 3), flow [%moat keck [%tine noon]])
=/ what what.flow
=/ mitt
|-
^- (unit (list bran))
?- what
[%disc ~]
(some ~)
::
[%tine @]
(some ~[[%imm non +.what]])
::
[%fork *]
?@ non
?: safe.what
~| %safe-axis-atom !!
~
(clap $(what left.what, non -.non) $(what rite.what, non +.non) weld)
==
?~ mitt
=^ hole dock bomb
:_ dock
[[%disc ~] hole]
=^ rock dock (mend %toil u.mitt [%hop wher.flow])
:_ dock
[[%disc ~] rock]
== ==
++ take :: axis ::
|= [sax=@ tow=plow row=?] :: axis, destination, safety %rift
^- plow :: nullary case = crash =^ noon dock wean
?: =(0 sax) ~ =^ keck dock (mend %keck ~ [%clq noon [troo fals]:flow])
%- some $(fawn +.fawn, axle (peg axle 3), flow [%moat keck [%tine noon]])
|- ::
?: =(1 sax) tow %pond
?- (cap sax) =^ tend dock wean
%2 [%fork $(sax (mas sax)) [%disc ~] row] =^ pear dock (mend %pear [%imm 0 tend]~ [%don tend])
%3 [%fork [%disc ~] $(sax (mas sax)) row] =^ bock dock (mend %bock [%imm 1 tend]~ [%don tend])
== =^ noon dock wean
++ milk :: local label =^ keck dock (mend %keck ~ [%clq noon pear bock])
|= gen=@ $(fawn +.fawn, axle (peg axle 3), flow [%moat keck [%tine noon]])
^- berm ==
[sub.does for.does axle gen] ::
++ wean :: fresh ssa [%sev *]
^- [@ _dock] =^ [hit=plow his=berm] dock $(fawn +>.fawn, axle (peg axle 7))
[lamb.dock dock(lamb .+(lamb.dock))] $(fawn +<.fawn, axle (peg axle 6), flow [%moat his hit])
++ copy :: replicate values to two destinations ::
|= [hat=plow bat=plow her=berm] *
^- [[hat=plow her=berm] _dock] ~| %todo !!
=^ [tog moot] dock ==
|- ++ fail
^- [[tog=plow moot=(list tins)] _dock] ^- [[hat=plow her=berm] dock=_dock]
?: ?=([%disc ~] hat) [[bat ~] dock] =^ hole dock bomb
?: ?=([%disc ~] bat) [[hat ~] dock] :_ dock
?- hat [[%disc ~] hole]
++ bang
|= non=*
^- [[hat=plow her=berm] _dock]
?- flow
[%pond ~]
=^ ret dock wean
=^ her dock (mend %rime ~[[%imm +.fawn ret]] [%don ret])
:_ dock
[[%disc ~] her]
::
[%rift *]
?: =(0 +.fawn) [[[%disc ~] troo.flow] dock]
?: =(1 +.fawn) [[[%disc ~] fals.flow] dock]
:: XX maybe we should assert that SKA should have caught this?
=^ hole dock bomb
:_ dock
[[%disc ~] hole]
::
[%moat *]
=/ what what.flow
=/ mitt
|- ^- (unit (list bran))
?- what
[%disc ~]
(some ~)
::
[%tine @] [%tine @]
?- bat (some ~[[%imm non +.what]])
[%tine @] ::
?: =(+.hat +.bat)
[[hat ~] dock]
[[hat ~[[%mov +.hat +.bat]]] dock]
::
[%fork *]
=^ one dock wean
=^ two dock wean
=^ [hog hoot] dock $(hat [%tine one], bat hed.bat)
=^ [log loot] dock $(hat [%tine two], bat tal.bat)
[[[%fork hog log safe.bat] [[%con one two +.hat] (weld hoot loot)]] dock]
==
::
[%fork *] [%fork *]
?- bat ?@ non
[%tine @] ?: safe.what
=^ one dock wean ~| %safe-axis-atom !!
=^ two dock wean ~
=^ [hog hoot] dock $(hat hed.hat, bat [%ssa one]) (clap $(what left.what, non -.non) $(what rite.what, non +.non) weld)
=^ [log loot] dock $(hat tal.hat, bat [%ssa two])
[[[%fork hog log safe.hat] [[%con one two +.bat] (weld hoot loot)]] dock]
::
[%fork *]
=^ [hog hoot] dock $(hat hed.hat, bat hed.bat)
=^ [log loot] dock $(hat tal.hat, bat tal.bat)
[[%fork hog log ?&(safe.hat safe.bat)] (weld hoot loot)] dock]
==
== ==
=/ blab (milk %copy) ?~ mitt
:_ dock(pond (~(put by pond) blab [moot %hop her]))
[tog blab]
++ twin :: split sans from flow
^- [[plow plow berm] _dock]
?- flow
[%rift *]
=^ hole dock bomb =^ hole dock bomb
:_ dock :_ dock
[[%disc ~] [%disc ~] hole] [[%disc ~] hole]
:: =^ rock dock (mend %toil u.mitt [%hop wher.flow])
[%pond ~] :_ dock
=^ one dock wean [[%disc ~] rock]
=^ two dock wean ==
=^ ret dock wean ++ take :: axis
=^ her dock (mend %taco ~[[%con one two ret]] [%don ret]) |= [sax=@ tow=plow row=?] :: axis, destination, safety
:_ dock ^- (unit plow) :: nullary case = crash
[[%tine one] [%tine two] her] ?: =(0 sax) ~
:: %- some
[%moat *] |- ^- plow
?- what.flow ?: =(1 sax) tow
[%fork *] ?- (cap sax)
:_ dock %2 [%fork $(sax (mas sax)) [%disc ~] row]
[left.what.flow rite.what.flow wher.flow] %3 [%fork [%disc ~] $(sax (mas sax)) row]
:: ==
[%disc ~] ++ milk :: local label
:_ dock |= gen=@
[[%disc ~] [%disc ~] wher.flow] ^- berm
~! next
[sub.next for.next axle gen]
++ wean :: fresh ssa
^- [@ _dock]
[lamb.dock dock(lamb .+(lamb.dock))]
++ copy :: replicate values to two destinations
|= [hat=plow bat=plow her=berm]
^- [[hat=plow her=berm] _dock]
=^ [tog=plow moot=(list bran)] dock
|-
^- [[tog=plow moot=(list bran)] _dock]
?: ?=([%disc ~] hat) [[bat ~] dock]
?: ?=([%disc ~] bat) [[hat ~] dock]
?- hat
[%tine @]
?- bat
[%tine @] [%tine @]
:_ dock ?: =(+.hat +.bat)
[[hat ~] dock]
[[hat ~[[%mov +.hat +.bat]]] dock]
::
[%fork *]
=^ one dock wean =^ one dock wean
=^ two dock wean =^ two dock wean
=^ her dock (mend %cons ~[[%con one two +.what.flow]] [%hop wher.flow]) =^ [hog=plow hoot=(list bran)] dock
$(hat [%tine one], bat left.bat)
=^ [log=plow loot=(list bran)] dock
$(hat [%tine two], bat rite.bat)
:_ dock :_ dock
[[%tine one] [%tine two] her] :- ^- plow
[%fork hog log safe.bat]
[`bran`[%con one two +.hat] (weld hoot loot)]
==
::
[%fork *]
?- bat
[%tine @]
=^ one dock wean
=^ two dock wean
=^ [hog=plow hoot=(list bran)] dock
$(hat left.hat, bat [%tine one])
=^ [log=plow loot=(list bran)] dock
$(hat rite.hat, bat [%tine two])
:_ dock
[[%fork hog log safe.hat] [%con one two +.bat] (weld hoot loot)]
::
[%fork *]
=^ [hog=plow hoot=(list bran)] dock $(hat left.hat, bat left.bat)
=^ [log=plow loot=(list bran)] dock $(hat rite.hat, bat rite.bat)
:_ dock
[[%fork hog log ?&(safe.hat safe.bat)] (weld hoot loot)]
== ==
== ==
++ mend =/ blab (milk %copy)
|= [gen=@ =lock] :_ dock(lake (~(put by lake.dock) `blab [moot %hop her]))
^- [berm _dock] [tog blab]
=/ curb (milk gen) ++ twin :: split sans from flow
:- curb ^- [[plow plow berm] _dock]
dock(pond (~(put by pond.dock) berm lock)) ?- flow
++ bomb [%rift *]
^- [berm _dock] =^ hole dock bomb
(mend %boom ~ [%bom ~]) :_ dock
-- [[%disc ~] [%disc ~] hole]
::
[%pond ~]
=^ one dock wean
=^ two dock wean
=^ ret dock wean
=^ her dock (mend %taco ~[[%con one two ret]] [%don ret])
:_ dock
[[%tine one] [%tine two] her]
::
[%moat *]
?- what.flow
[%fork *]
:_ dock
[left.what.flow rite.what.flow wher.flow]
::
[%disc ~]
:_ dock
[[%disc ~] [%disc ~] wher.flow]
::
[%tine @]
=^ one dock wean
=^ two dock wean
=^ her dock
(mend %cons ~[[%con one two +.what.flow]] [%hop wher.flow])
:_ dock
[[%tine one] [%tine two] her]
==
==
++ mend
|= [gen=@ =lock]
^- [berm _dock]
=/ curb (milk gen)
:- curb
dock(lake (~(put by lake.dock) `curb lock))
++ bomb
^- [berm _dock]
(mend %boom ~ [%bom ~])
--
-- --

View File

@ -3,7 +3,7 @@
:: Split an axis into a sock into safe and unsafe components :: Split an axis into a sock into safe and unsafe components
++ punt ++ punt
|= [axe=@ =sock] |= [axe=@ =sock]
^- [@ @ sock] ^- [@ @ ^sock]
?: =(0 axe) ?: =(0 axe)
[0 0 %toss ~] [0 0 %toss ~]
=/ saf 1 =/ saf 1
@ -30,7 +30,7 @@
++ pull ++ pull
|= arg=[@ sock] |= arg=[@ sock]
^- boot ^- boot
=/ [saf rik ken] (punt arg) =+ [saf rik ken]=(punt arg)
?: =(0 saf) [%boom ~] ?: =(0 saf) [%boom ~]
?: =(1 rik) [%safe ken] ?: =(1 rik) [%safe ken]
[%risk ken] [%risk ken]

View File

@ -3,6 +3,7 @@
+| %ska +| %ska
+$ barn [sub=sock for=*] +$ barn [sub=sock for=*]
+$ nomm :: SKA-analyzed nock +$ nomm :: SKA-analyzed nock
$~ [%one **]
$% [%par nomm nomm] $% [%par nomm nomm]
[%zer @ ?] :: safety-tagged lookup [%zer @ ?] :: safety-tagged lookup
[%one *] [%one *]