mirror of
https://github.com/urbit/shrub.git
synced 2025-01-07 05:26:56 +03:00
Merge pull request #456 from ohAitch/cleaner-deco
clean up / improve coverage of :> :< implementation
This commit is contained in:
commit
ca0ad49ef1
@ -97,19 +97,18 @@
|
|||||||
:>
|
:>
|
||||||
:> models (molds) are functions that normalize nouns.
|
:> models (molds) are functions that normalize nouns.
|
||||||
:>
|
:>
|
||||||
:> arms producing molds are introduced with {+=}. for molds,
|
:> arms producing molds are introduced with {+=}. the
|
||||||
:> we decorate the mold rather than the arm. the compiler
|
:> compiler will copy the arm decoration onto its product
|
||||||
:> will copy the mold decoration onto the arm.
|
|
||||||
+|
|
+|
|
||||||
+= spot [p=@ q=@] :< a coordinate
|
+= spot [p=@ q=@] :< a coordinate
|
||||||
+= tops :> also a coordinate
|
+= tops :< also a coordinate
|
||||||
[p=@ q=@]
|
[p=@ q=@]
|
||||||
+= goof :> a simple tuple
|
+= goof :< a simple tuple
|
||||||
$: foo=@ :< something mysterious
|
$: foo=@ :< something mysterious
|
||||||
bar=@ :< go here for drink
|
bar=@ :< go here for drink
|
||||||
moo=(binary-tree juice) :< cows do this
|
moo=(binary-tree juice) :< cows do this
|
||||||
==
|
==
|
||||||
+= juice :> fruity beverage
|
+= juice :< fruity beverage
|
||||||
$% [%plum p=@] :< fresh prune
|
$% [%plum p=@] :< fresh prune
|
||||||
[%pear p=@ q=@] :< good for cider
|
[%pear p=@ q=@] :< good for cider
|
||||||
[%acai p=@] :< aztec superfood
|
[%acai p=@] :< aztec superfood
|
||||||
@ -142,7 +141,6 @@
|
|||||||
:> note that ++say-goodbye is the correct notation, even though
|
:> note that ++say-goodbye is the correct notation, even though
|
||||||
:> it's a {+-} arm.
|
:> it's a {+-} arm.
|
||||||
|%
|
|%
|
||||||
:> :> ++say-hello
|
|
||||||
++ say-hello :< say hi to someone
|
++ say-hello :< say hi to someone
|
||||||
:> friendly welcome message
|
:> friendly welcome message
|
||||||
:>
|
:>
|
||||||
@ -159,7 +157,7 @@
|
|||||||
:> ?: =(%hello %world)
|
:> ?: =(%hello %world)
|
||||||
:> %hello
|
:> %hello
|
||||||
:> %world
|
:> %world
|
||||||
:> :: ++say-goodbye
|
::
|
||||||
+- say-goodbye ::
|
+- say-goodbye ::
|
||||||
:> describe product of function
|
:> describe product of function
|
||||||
:>
|
:>
|
||||||
@ -175,8 +173,8 @@
|
|||||||
=/ bar (add (mul num foo) 2)
|
=/ bar (add (mul num foo) 2)
|
||||||
=/ moo (mul num bar) :< for all the cows
|
=/ moo (mul num bar) :< for all the cows
|
||||||
"goodbye and {(scot %ud moo)}, {(rip 3 txt)}"
|
"goodbye and {(scot %ud moo)}, {(rip 3 txt)}"
|
||||||
:> :> ++say-minimum
|
::
|
||||||
++ say-minimum :> minimal decoration
|
++ say-minimum :< minimal decoration
|
||||||
|= txt=term
|
|= txt=term
|
||||||
"nothing to say to {(rip 3 txt)}"
|
"nothing to say to {(rip 3 txt)}"
|
||||||
--
|
--
|
||||||
|
332
sys/hoon.hoon
332
sys/hoon.hoon
@ -2222,7 +2222,7 @@
|
|||||||
=+ ^= q %+ max
|
=+ ^= q %+ max
|
||||||
?: (gth m prc) (^sub m prc) 0 :: reduce precision
|
?: (gth m prc) (^sub m prc) 0 :: reduce precision
|
||||||
%- abs:si ?: =(den %i) --0 :: enforce min. exp
|
%- abs:si ?: =(den %i) --0 :: enforce min. exp
|
||||||
?: =((cmp:si e.a emn) -1) (dif:si emn e.a) --0
|
?: =((cmp:si e.a emn) -1) (dif:si emn e.a) --0
|
||||||
=^ b a :- (end 0 q a.a)
|
=^ b a :- (end 0 q a.a)
|
||||||
a(e (sum:si e.a (sun:si q)), a (rsh 0 q a.a))
|
a(e (sum:si e.a (sun:si q)), a (rsh 0 q a.a))
|
||||||
::
|
::
|
||||||
@ -4789,7 +4789,6 @@
|
|||||||
++ nix (boss 256 (star ;~(pose aln cab))) ::
|
++ nix (boss 256 (star ;~(pose aln cab))) ::
|
||||||
++ nud (shim '0' '9') :: numeric
|
++ nud (shim '0' '9') :: numeric
|
||||||
++ prn ;~(less (just `@`127) (shim 32 256)) :: non-control
|
++ prn ;~(less (just `@`127) (shim 32 256)) :: non-control
|
||||||
++ prz ;~(less (just `@`127) (shim 33 256)) :: non-trivial
|
|
||||||
++ qat ;~ pose :: chars in blockcord
|
++ qat ;~ pose :: chars in blockcord
|
||||||
prn
|
prn
|
||||||
;~(less ;~(plug (just `@`10) soz) (just `@`10))
|
;~(less ;~(plug (just `@`10) soz) (just `@`10))
|
||||||
@ -6557,8 +6556,8 @@
|
|||||||
=. wat ~
|
=. wat ~
|
||||||
:+ %ktls
|
:+ %ktls
|
||||||
|- ^- hoon
|
|- ^- hoon
|
||||||
?~ t.p.sec
|
?~ t.p.sec
|
||||||
^$(sec i.p.sec)
|
^$(sec i.p.sec)
|
||||||
[%wtcl [%bust %bean] $(p.sec t.p.sec) ^$(sec i.p.sec)]
|
[%wtcl [%bust %bean] $(p.sec t.p.sec) ^$(sec i.p.sec)]
|
||||||
%= $
|
%= $
|
||||||
sec
|
sec
|
||||||
@ -7111,7 +7110,7 @@
|
|||||||
:+ %brcn p.gen
|
:+ %brcn p.gen
|
||||||
=- [[0 [~ ~] -] ~ ~]
|
=- [[0 [~ ~] -] ~ ~]
|
||||||
(~(put by *(map term (pair what foot))) %$ ~ [%elm r.gen])
|
(~(put by *(map term (pair what foot))) %$ ~ [%elm r.gen])
|
||||||
{$brts *} :^ %brcb p.gen q.gen
|
{$brts *} :^ %brcb p.gen q.gen
|
||||||
=- [~ [[0 [~ ~] -] ~ ~]]
|
=- [~ [[0 [~ ~] -] ~ ~]]
|
||||||
(~(put by *(map term (pair what foot))) %$ ~ [%ash r.gen])
|
(~(put by *(map term (pair what foot))) %$ ~ [%ash r.gen])
|
||||||
{$brwt *} [%ktwt %brdt p.gen q.gen]
|
{$brwt *} [%ktwt %brdt p.gen q.gen]
|
||||||
@ -7722,18 +7721,18 @@
|
|||||||
=+ gil=*(set type)
|
=+ gil=*(set type)
|
||||||
|- ^- (unit)
|
|- ^- (unit)
|
||||||
?- sut
|
?- sut
|
||||||
{$atom *} q.sut
|
{$atom *} q.sut
|
||||||
{$cell *} %+ biff $(sut p.sut)
|
{$cell *} %+ biff $(sut p.sut)
|
||||||
|=(a/* (biff ^$(sut q.sut) |=(b/* `[a b])))
|
|=(a/* (biff ^$(sut q.sut) |=(b/* `[a b])))
|
||||||
{$core *} (biff $(sut p.sut) |=(* `[p.s.q.sut +<]))
|
{$core *} (biff $(sut p.sut) |=(* `[p.s.q.sut +<]))
|
||||||
{$face *} $(sut repo)
|
{$face *} $(sut repo)
|
||||||
{$fork *} ~
|
{$fork *} ~
|
||||||
{$help *} $(sut repo)
|
{$help *} $(sut repo)
|
||||||
{$hold *} ?: (~(has in gil) sut)
|
{$hold *} ?: (~(has in gil) sut)
|
||||||
~
|
~
|
||||||
$(sut repo, gil (~(put in gil) sut))
|
$(sut repo, gil (~(put in gil) sut))
|
||||||
$noun ~
|
$noun ~
|
||||||
$void ~
|
$void ~
|
||||||
==
|
==
|
||||||
++ bran
|
++ bran
|
||||||
=+ gil=*(set type)
|
=+ gil=*(set type)
|
||||||
@ -10001,112 +10000,94 @@
|
|||||||
==
|
==
|
||||||
++ docs
|
++ docs
|
||||||
|%
|
|%
|
||||||
|
::
|
||||||
:: above core
|
:: above core
|
||||||
::
|
::
|
||||||
++ apex
|
++ apex
|
||||||
%+ cook beer
|
|
||||||
;~ plug
|
;~ plug
|
||||||
=/ ron (punt (into noel))
|
=/ ron (punt (indo noel))
|
||||||
(punt (ifix [ron ron] (into (step head))))
|
(punt (ifix [ron ron] (into head))) :: label
|
||||||
;~(pfix (punt (into null)) (punt body))
|
::
|
||||||
(star fill)
|
=/ ron (punt (indo null))
|
||||||
|
(ifix [ron ron] (punt body)) :: body
|
||||||
|
::
|
||||||
|
(cook malt (star fill)) :: definitions
|
||||||
|
(easy ~) :: defs used (none)
|
||||||
==
|
==
|
||||||
|
::
|
||||||
:: backward line
|
:: backward line
|
||||||
::
|
::
|
||||||
++ apse
|
++ apse
|
||||||
;~ pose
|
;~ pose
|
||||||
%+ cook
|
%+ cook |=({a/term b/cord} %*(. *whit def (my [a b ~] ~)))
|
||||||
|= a/(each (pair term cord) cord)
|
(exit fine)
|
||||||
^- whit
|
::
|
||||||
?- -.a
|
%+ cook |=(a/cord %*(. *whit boy `[a ~]))
|
||||||
$& [~ ~ [[p.p.a [q.p.a ~]] ~ ~] ~]
|
(exit line)
|
||||||
$| [~ `[p.a ~] ~ ~]
|
::
|
||||||
==
|
|
||||||
(exit (step (pick fine line)))
|
|
||||||
(easy *whit)
|
(easy *whit)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
::
|
::
|
||||||
++ beer
|
++ beer
|
||||||
|= $: a/(unit term)
|
|= $: lab/(unit term)
|
||||||
b/(unit (pair cord (list sect)))
|
boy/(unit (pair cord (list sect)))
|
||||||
c/(list (pair (pair term cord) (list sect)))
|
def/(list (pair (pair term cord) (list sect)))
|
||||||
==
|
==
|
||||||
^- whit
|
^- whit
|
||||||
=/ d
|
=; def [lab boy (malt def) ~]
|
||||||
|- ^- (map term (pair cord (list sect)))
|
(turn def |=({{a/term b/cord} c/(list sect)} [a [b c]]))
|
||||||
?~ c ~
|
|
||||||
=/ e $(c t.c)
|
|
||||||
(~(put by e) p.p.i.c [q.p.i.c q.i.c])
|
|
||||||
[a b d ~]
|
|
||||||
::
|
::
|
||||||
::
|
::
|
||||||
++ body
|
++ body
|
||||||
;~ sfix
|
;~ pose
|
||||||
;~ pose
|
;~ plug :: can duplicate :>
|
||||||
;~ plug
|
(into ;~(pfix (punt ;~(plug null col gar step)) line))
|
||||||
(into ;~(pfix (punt ;~(plug (star ace) col gar)) (step line)))
|
(easy ~)
|
||||||
(easy ~)
|
==
|
||||||
==
|
;~ plug
|
||||||
;~ plug
|
(into ;~(pfix step line))
|
||||||
(into (dubs line))
|
(rant text)
|
||||||
(rant text)
|
|
||||||
==
|
|
||||||
==
|
==
|
||||||
(punt (into null))
|
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
:: null: blank line
|
++ text (pick line code) :: text line
|
||||||
:: line: prose line
|
++ line ;~(less ace (cook crip (star prn))) :: prose line
|
||||||
:: code: code line
|
++ code ;~(pfix step step (cook crip (star prn))) :: code line
|
||||||
:: text: text line
|
++ noel ;~(plug (punt ;~(pfix step hax)) null) :: header padding
|
||||||
:: fine: definition line
|
++ head ;~(pfix hax step cen sym) :: header line
|
||||||
|
++ null (cold ~ (star ace)) :: blank line
|
||||||
|
++ fine :: definition line
|
||||||
|
;~ (glue ;~(plug col ace))
|
||||||
|
sym
|
||||||
|
(cook crip (star prn))
|
||||||
|
==
|
||||||
::
|
::
|
||||||
++ line (cook crip ;~(plug prz (star prn)))
|
|
||||||
++ head ;~(pfix ;~(plug hax ace ace cen) sym)
|
|
||||||
++ text (pick line code)
|
|
||||||
++ code (cook crip (dubs (star prn)))
|
|
||||||
++ null (star ace)
|
|
||||||
++ noel ;~(pose (step ;~(sfix hax (star ace))) null)
|
|
||||||
++ fine ;~(plug sym (cook crip ;~(pfix ;~(plug col ace) (star prn))))
|
|
||||||
::
|
|
||||||
:: lean: line delimited
|
|
||||||
::
|
|
||||||
++ lean
|
|
||||||
|* gyf/rule
|
|
||||||
|* bod/rule
|
|
||||||
;~(pfix ;~(plug col gyf) bod)
|
|
||||||
::
|
::
|
||||||
:: step: indent
|
:: step: indent
|
||||||
::
|
:: into: :> and indent to end of line, consuming following space.
|
||||||
++ step
|
:: indo: :> to end of line, consuming following space.
|
||||||
|* fel/rule
|
|
||||||
;~(pfix ;~(plug ace ace) fel)
|
|
||||||
::
|
|
||||||
:: dubs: double-indent
|
|
||||||
::
|
|
||||||
++ dubs
|
|
||||||
|* fel/rule
|
|
||||||
;~(pfix ;~(plug ace ace ace ace) fel)
|
|
||||||
::
|
|
||||||
:: into: :> to end of line, consuming following space.
|
|
||||||
::
|
|
||||||
++ into
|
|
||||||
|* bod/rule
|
|
||||||
;~(sfix ((lean gar) bod) ;~(plug (just `@`10) (punt gap)))
|
|
||||||
::
|
|
||||||
:: exit: :< to end of line, not consuming following space.
|
:: exit: :< to end of line, not consuming following space.
|
||||||
::
|
::
|
||||||
|
++ step ;~(plug ace ace)
|
||||||
|
++ into |*(bod/rule (indo ;~(pfix step bod)))
|
||||||
|
::
|
||||||
|
++ indo
|
||||||
|
|* bod/rule
|
||||||
|
;~(pfix col gar ;~(sfix bod (just `@`10) (punt gap)))
|
||||||
|
::
|
||||||
++ exit
|
++ exit
|
||||||
|* bod/rule
|
|* bod/rule
|
||||||
;~(pfix (star ace) ((lean gal) bod))
|
;~(pfix (star ace) col gal step bod)
|
||||||
::
|
::
|
||||||
:: fill: full definition
|
:: fill: full definition
|
||||||
::
|
::
|
||||||
++ fill
|
++ fill
|
||||||
;~ sfix
|
%+ cook |=({{a/term b/cord} c/(list sect) (unit $~)} [a b c])
|
||||||
;~(plug (into (step fine)) (rant (step text)))
|
;~ plug
|
||||||
(punt (into null))
|
(into fine)
|
||||||
|
(rant ;~(pfix step text))
|
||||||
|
(punt (indo null))
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
:: rant: series of sections.
|
:: rant: series of sections.
|
||||||
@ -10115,8 +10096,8 @@
|
|||||||
|* sec/rule
|
|* sec/rule
|
||||||
%- star
|
%- star
|
||||||
;~ pfix
|
;~ pfix
|
||||||
(into null)
|
(indo null)
|
||||||
(plus (into (step sec)))
|
(plus (into sec))
|
||||||
==
|
==
|
||||||
--
|
--
|
||||||
::
|
::
|
||||||
@ -10131,19 +10112,6 @@
|
|||||||
?. ?=({$sand ?($ta $tas) @} a) ~ :: /foo constants
|
?. ?=({$sand ?($ta $tas) @} a) ~ :: /foo constants
|
||||||
`[q.a u.b]
|
`[q.a u.b]
|
||||||
::
|
::
|
||||||
++ pray
|
|
||||||
|= gen/hoon ~| %pray ^- (unit hoon)
|
|
||||||
~& [%pray-disabled gen]
|
|
||||||
!!
|
|
||||||
::
|
|
||||||
++ prey
|
|
||||||
|= gun/(list hoon) ^- (unit hoon)
|
|
||||||
?~ gun `[%$ 1]
|
|
||||||
=+ gup=(pray i.gun)
|
|
||||||
?~ gup ~
|
|
||||||
?~ t.gun gup
|
|
||||||
(bind $(gun t.gun) |=(a/hoon [%tsgr u.gup a]))
|
|
||||||
::
|
|
||||||
++ phax
|
++ phax
|
||||||
|= ruw/(list (list woof))
|
|= ruw/(list (list woof))
|
||||||
=+ [yun=*(list hoon) cah=*(list @)]
|
=+ [yun=*(list hoon) cah=*(list @)]
|
||||||
@ -10504,7 +10472,7 @@
|
|||||||
== ::
|
== ::
|
||||||
++ trig-style :: type of parsed line
|
++ trig-style :: type of parsed line
|
||||||
$% $: $end :: terminator
|
$% $: $end :: terminator
|
||||||
$? $done :: end of input
|
$? $done :: end of input
|
||||||
$stet :: == end of markdown
|
$stet :: == end of markdown
|
||||||
$dent :: outdent
|
$dent :: outdent
|
||||||
== == ::
|
== == ::
|
||||||
@ -10519,8 +10487,8 @@
|
|||||||
++ trig-new :: start a
|
++ trig-new :: start a
|
||||||
$? $lite :: + line item
|
$? $lite :: + line item
|
||||||
$lint :: - line item
|
$lint :: - line item
|
||||||
$head :: # heading
|
$head :: # heading
|
||||||
$bloc :: > block-quote
|
$bloc :: > block-quote
|
||||||
$poem :: [ ]{8} poem
|
$poem :: [ ]{8} poem
|
||||||
== ::
|
== ::
|
||||||
++ graf :: paragraph element
|
++ graf :: paragraph element
|
||||||
@ -10559,7 +10527,7 @@
|
|||||||
=| par/(unit (pair hair wall))
|
=| par/(unit (pair hair wall))
|
||||||
|_ {loc/hair txt/tape}
|
|_ {loc/hair txt/tape}
|
||||||
::
|
::
|
||||||
++ $ :: resolve
|
++ $ :: resolve
|
||||||
^- (like tarp)
|
^- (like tarp)
|
||||||
=> line
|
=> line
|
||||||
::
|
::
|
||||||
@ -10643,13 +10611,13 @@
|
|||||||
:: save byte and repeat
|
:: save byte and repeat
|
||||||
$(txt t.txt, q.loc +(q.loc), lin [i.txt lin])
|
$(txt t.txt, q.loc +(q.loc), lin [i.txt lin])
|
||||||
=. lin
|
=. lin
|
||||||
::
|
::
|
||||||
:: trim trailing spaces
|
:: trim trailing spaces
|
||||||
|- ^- tape
|
|- ^- tape
|
||||||
?: ?=({$' ' *} lin)
|
?: ?=({$' ' *} lin)
|
||||||
$(lin t.lin)
|
$(lin t.lin)
|
||||||
(flop lin)
|
(flop lin)
|
||||||
::
|
::
|
||||||
=/ eat-newline/nail [[+(p.loc) 1] t.txt]
|
=/ eat-newline/nail [[+(p.loc) 1] t.txt]
|
||||||
=/ saw look(+<.$ eat-newline)
|
=/ saw look(+<.$ eat-newline)
|
||||||
::
|
::
|
||||||
@ -10745,10 +10713,10 @@
|
|||||||
|(!=(%old -.sty.saw) (gth col.saw inr.ind))
|
|(!=(%old -.sty.saw) (gth col.saw inr.ind))
|
||||||
== ==
|
== ==
|
||||||
=> .(..$ close-par)
|
=> .(..$ close-par)
|
||||||
::
|
::
|
||||||
:: if column has retreated, adjust stack
|
:: if column has retreated, adjust stack
|
||||||
=. ..$ (back col.saw)
|
=. ..$ (back col.saw)
|
||||||
::
|
::
|
||||||
=^ col-ok sty.saw
|
=^ col-ok sty.saw
|
||||||
?+ (sub col.saw inr.ind) [| sty.saw] :: columns advanced
|
?+ (sub col.saw inr.ind) [| sty.saw] :: columns advanced
|
||||||
$0 [& sty.saw]
|
$0 [& sty.saw]
|
||||||
@ -10757,9 +10725,9 @@
|
|||||||
?. col-ok
|
?. col-ok
|
||||||
~? verbose [%columns-advanced col.saw inr.ind]
|
~? verbose [%columns-advanced col.saw inr.ind]
|
||||||
..$(err `[p.loc col.saw])
|
..$(err `[p.loc col.saw])
|
||||||
::
|
::
|
||||||
=. inr.ind col.saw
|
=. inr.ind col.saw
|
||||||
::
|
::
|
||||||
:: unless adding a matching item, close lists
|
:: unless adding a matching item, close lists
|
||||||
=. ..$
|
=. ..$
|
||||||
?: ?| &(?=($lunt p.cur) !?=($lint +.sty.saw))
|
?: ?| &(?=($lunt p.cur) !?=($lint +.sty.saw))
|
||||||
@ -10767,7 +10735,7 @@
|
|||||||
==
|
==
|
||||||
close-item
|
close-item
|
||||||
..$
|
..$
|
||||||
::
|
::
|
||||||
=< line(par `[loc ~]) ^+ ..$ :: continue with para
|
=< line(par `[loc ~]) ^+ ..$ :: continue with para
|
||||||
?- -.sty.saw
|
?- -.sty.saw
|
||||||
$one (read-one +.sty.saw) :: parse leaves
|
$one (read-one +.sty.saw) :: parse leaves
|
||||||
@ -10781,19 +10749,19 @@
|
|||||||
?. :: first line of container is legal
|
?. :: first line of container is legal
|
||||||
?~ q.u.par &
|
?~ q.u.par &
|
||||||
?- p.cur
|
?- p.cur
|
||||||
::
|
::
|
||||||
:: can't(/directly) contain text
|
:: can't(/directly) contain text
|
||||||
?($lord $lunt) ~|(bad-leaf-container+p.cur !!)
|
?($lord $lunt) ~|(bad-leaf-container+p.cur !!)
|
||||||
::
|
::
|
||||||
:: only one line in a header
|
:: only one line in a header
|
||||||
$head |
|
$head |
|
||||||
::
|
::
|
||||||
:: indented literals need to end with a blank line
|
:: indented literals need to end with a blank line
|
||||||
$poem (gte col.saw inr.ind)
|
$poem (gte col.saw inr.ind)
|
||||||
::
|
::
|
||||||
:: text tarps must continue aligned
|
:: text tarps must continue aligned
|
||||||
?($down $lunt $lime $lord $bloc) =(col.saw inr.ind)
|
?($down $lunt $lime $lord $bloc) =(col.saw inr.ind)
|
||||||
==
|
==
|
||||||
~? verbose bad-block-structure+[p.cur inr.ind col.saw]
|
~? verbose bad-block-structure+[p.cur inr.ind col.saw]
|
||||||
..$(err `[p.loc col.saw])
|
..$(err `[p.loc col.saw])
|
||||||
::
|
::
|
||||||
@ -10802,7 +10770,7 @@
|
|||||||
=. par par(q.u [lin.a q.u.par])
|
=. par par(q.u [lin.a q.u.par])
|
||||||
?^ fin.a ..$(err u.fin.a)
|
?^ fin.a ..$(err u.fin.a)
|
||||||
line
|
line
|
||||||
::
|
::
|
||||||
++ parse-block :: execute parser
|
++ parse-block :: execute parser
|
||||||
|= fel/$-(nail (like tarp)) ^+ +>
|
|= fel/$-(nail (like tarp)) ^+ +>
|
||||||
=/ vex/(like tarp) (fel loc txt)
|
=/ vex/(like tarp) (fel loc txt)
|
||||||
@ -11122,8 +11090,8 @@
|
|||||||
++ expr :: expression
|
++ expr :: expression
|
||||||
=> (sail &) :: tall-form
|
=> (sail &) :: tall-form
|
||||||
%+ ifix [(star ace) ;~(simu gap (easy))] :: look-ahead for gap
|
%+ ifix [(star ace) ;~(simu gap (easy))] :: look-ahead for gap
|
||||||
(cook drop-top top-level) :: list of tags
|
(cook drop-top top-level) :: list of tags
|
||||||
::
|
::
|
||||||
::
|
::
|
||||||
++ whit :: whitespace
|
++ whit :: whitespace
|
||||||
(cold ' ' (plus ;~(pose (just ' ') (just '\0a'))))
|
(cold ' ' (plus ;~(pose (just ' ') (just '\0a'))))
|
||||||
@ -11655,42 +11623,57 @@
|
|||||||
%+ cook
|
%+ cook
|
||||||
|= {a/whit b/term c/whit d/foot}
|
|= {a/whit b/term c/whit d/foot}
|
||||||
=+ e=(glom a c)
|
=+ e=(glom a c)
|
||||||
|
=? boy.e =(~ boy.e)
|
||||||
|
|-(?+(-.p.d ~ $dbug $(p.d q.p.d), %halo p.p.d, %docs `p.p.d))
|
||||||
|
=. p.d
|
||||||
|
|-
|
||||||
|
?+ p.d ?~(boy.e p.d [%docs u.boy.e p.d])
|
||||||
|
[%dbug ^] p.d(q $(p.d q.p.d))
|
||||||
|
[%docs ^] p.d
|
||||||
|
[%halo p=~ *] p.d(p boy.e)
|
||||||
|
==
|
||||||
[b boy.e d]
|
[b boy.e d]
|
||||||
|
::
|
||||||
;~ plug
|
;~ plug
|
||||||
apex:docs
|
apex:docs
|
||||||
;~ pfix lus
|
;~ pose
|
||||||
;~ pose
|
%+ cook
|
||||||
%+ cook
|
|
||||||
|=({a/$ash b/term c/whit d/hoon} [b c a d])
|
|=({a/$ash b/term c/whit d/hoon} [b c a d])
|
||||||
;~ plug
|
;~ plug
|
||||||
(cold %ash (just '+'))
|
(cold %ash (jest '++'))
|
||||||
;~(pfix gap ;~(pose (cold %$ buc) sym))
|
;~(pfix gap ;~(pose (cold %$ buc) sym))
|
||||||
apse:docs
|
apse:docs
|
||||||
;~(pfix gap loaf)
|
;~(pfix gap loaf)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
%+ cook
|
%+ cook
|
||||||
|=({a/$elm b/term c/whit d/hoon} [b c a d])
|
|=({a/$elm b/term c/whit d/hoon} [b c a d])
|
||||||
;~ plug
|
;~ plug
|
||||||
(cold %elm (just '-'))
|
(cold %elm (jest '+-'))
|
||||||
;~(pfix gap ;~(pose (cold %$ buc) sym))
|
;~(pfix gap ;~(pose (cold %$ buc) sym))
|
||||||
apse:docs
|
apse:docs
|
||||||
;~(pfix gap loaf)
|
;~(pfix gap loaf)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
%+ cook
|
%+ cook
|
||||||
|=({a/$ash b/term c/whit d/root} [b c a d])
|
|=({a/$ash b/term c/whit d/root} [b c a d])
|
||||||
;~ plug
|
;~ plug
|
||||||
(cold %ash (just '='))
|
(cold %ash (jest '+='))
|
||||||
;~(pfix gap sym)
|
;~(pfix gap sym)
|
||||||
apse:docs
|
apse:docs
|
||||||
;~(pfix gap loan)
|
;~(pfix gap loan)
|
||||||
==
|
|
||||||
==
|
==
|
||||||
==
|
==
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ whap :: chapter
|
++ whap :: chapter
|
||||||
|
%+ cook
|
||||||
|
|= a=(list (trel term what foot))
|
||||||
|
%+ roll a
|
||||||
|
|= [b=(trel term what foot) c=(map term [what foot])]
|
||||||
|
^+ c
|
||||||
|
=? p.r.b (~(has by c) p.b) [%eror "duplicate arm {<p.b>}"]
|
||||||
|
(~(put by c) b)
|
||||||
(most muck boog)
|
(most muck boog)
|
||||||
::
|
::
|
||||||
++ wasp :: $brcb aliases
|
++ wasp :: $brcb aliases
|
||||||
@ -11704,36 +11687,31 @@
|
|||||||
::
|
::
|
||||||
++ wisp :: core tail
|
++ wisp :: core tail
|
||||||
?. tol fail
|
?. tol fail
|
||||||
%+ sear
|
%+ cook
|
||||||
|= a/(list (pair whit (list (pair term (pair what foot)))))
|
|= a=(list (pair whit (map term [what foot]))) ^- (map @ tomb)
|
||||||
=| {b/(map @ tomb) c/@}
|
=< tos
|
||||||
|- ^- (unit (map @ tomb))
|
%+ roll a
|
||||||
?~ a `b
|
|= $: [wit=whit wap=(map term (pair what foot))]
|
||||||
=/ d
|
[all=(map term *) num=@ tos=(map @ tomb)]
|
||||||
=| e/(map term (pair what foot))
|
==
|
||||||
|- ^- (unit (map term (pair what foot)))
|
=. wap
|
||||||
?~ q.i.a `e
|
%- ~(urn by wap)
|
||||||
?: ?| (~(has by e) p.i.q.i.a)
|
|= b=(trel term what foot) ^+ +.b
|
||||||
|- ^- ?
|
?. (~(has by all) p.b) +.b
|
||||||
?: =(0 c) |
|
+.b(p.r [%eror "duplicate arm {<p.b>}"])
|
||||||
=. c (dec c)
|
::
|
||||||
|((~(has by q:(~(got by b) c)) p.i.q.i.a) $)
|
=. all (~(uni by all) `(map term *)`wap)
|
||||||
==
|
[all +(num) (~(put by tos) num [[lab boy]:wit wap])]
|
||||||
:: XX hokey, refactor this to produce %eror
|
::
|
||||||
::
|
|
||||||
~&(duplicate-arm+p.i.q.i.a ~)
|
|
||||||
$(q.i.a t.q.i.a, e (~(put by e) p.i.q.i.a q.i.q.i.a))
|
|
||||||
?~ d ~
|
|
||||||
=* hap `chap`[?~(lab.p.i.a ~ [~ u.lab.p.i.a]) boy.p.i.a]
|
|
||||||
$(a t.a, b (~(put by b) c [hap u.d]), c +(c))
|
|
||||||
;~ pose
|
;~ pose
|
||||||
dun
|
dun
|
||||||
;~ sfix
|
;~ sfix
|
||||||
;~ pose
|
;~ pose
|
||||||
(most muck ;~(plug apex:docs ;~(pfix ;~(plug lus bar gap) whap)))
|
(most muck ;~(plug apex:docs ;~(pfix (jest '+|') gap whap)))
|
||||||
;~(plug ;~(plug (easy *whit) whap) (easy ~))
|
;~(plug (stag *whit whap) (easy ~))
|
||||||
==
|
==
|
||||||
;~(plug gap dun)
|
gap
|
||||||
|
dun
|
||||||
==
|
==
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
@ -11809,7 +11787,7 @@
|
|||||||
++ exph |.((butt ;~(gunk rope rick))) :: wing, [tile hoon]s
|
++ exph |.((butt ;~(gunk rope rick))) :: wing, [tile hoon]s
|
||||||
++ expi |.((butt ;~(gunk loaf hank))) :: one or more hoons
|
++ expi |.((butt ;~(gunk loaf hank))) :: one or more hoons
|
||||||
++ expk |.(;~(gunk loaf ;~(plug loaf (easy ~)))) :: list of two hoons
|
++ expk |.(;~(gunk loaf ;~(plug loaf (easy ~)))) :: list of two hoons
|
||||||
++ expl |.(;~(gunk ;~(plug (easy ~) sym) loaf loaf)) :: term, two hoons
|
++ expl |.(;~(gunk (stag ~ sym) loaf loaf)) :: term, two hoons
|
||||||
++ expm |.((butt ;~(gunk rope loaf rick))) :: several [tile hoon]s
|
++ expm |.((butt ;~(gunk rope loaf rick))) :: several [tile hoon]s
|
||||||
++ expo |.(;~(gunk wise loaf loaf)) :: =;
|
++ expo |.(;~(gunk wise loaf loaf)) :: =;
|
||||||
++ expp |.(;~(gunk (butt rick) loaf)) :: [wing hoon]s, hoon
|
++ expp |.(;~(gunk (butt rick) loaf)) :: [wing hoon]s, hoon
|
||||||
@ -11871,7 +11849,7 @@
|
|||||||
::
|
::
|
||||||
++ hinb |.(;~(gunk bont loaf)) :: hint and hoon
|
++ hinb |.(;~(gunk bont loaf)) :: hint and hoon
|
||||||
++ hinc |. :: optional =en, hoon
|
++ hinc |. :: optional =en, hoon
|
||||||
;~(pose ;~(gunk bony loaf) ;~(plug (easy ~) loaf))
|
;~(pose ;~(gunk bony loaf) (stag ~ loaf)) ::
|
||||||
++ hind |.(;~(gunk bonk loaf bonz loaf)) :: jet hoon "bon"s hoon
|
++ hind |.(;~(gunk bonk loaf bonz loaf)) :: jet hoon "bon"s hoon
|
||||||
++ hine |.(;~(gunk bonk loaf)) :: jet-hint and hoon
|
++ hine |.(;~(gunk bonk loaf)) :: jet-hint and hoon
|
||||||
++ hinf |. :: 0-3 >s, two hoons
|
++ hinf |. :: 0-3 >s, two hoons
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
== ::
|
== ::
|
||||||
== ::
|
== ::
|
||||||
++ burg :: gonadic rule
|
++ burg :: gonadic rule
|
||||||
|* {a/mold b/mold} :: from and to
|
|* {a/mold b/mold} :: from and to
|
||||||
$-({c/cafe d/a} (bolt b)) ::
|
$-({c/cafe d/a} (bolt b)) ::
|
||||||
:: ::
|
:: ::
|
||||||
++ cafe :: live cache
|
++ cafe :: live cache
|
||||||
@ -248,7 +248,7 @@
|
|||||||
~&(dep-empty+hen +>.$)
|
~&(dep-empty+hen +>.$)
|
||||||
?: =(dep 0vtest) :: upstream testing
|
?: =(dep 0vtest) :: upstream testing
|
||||||
+>.$(mow ?.(ask mow :_(mow [hen %give %news dep])))
|
+>.$(mow ?.(ask mow :_(mow [hen %give %news dep])))
|
||||||
::
|
::
|
||||||
?. (~(has by def.deh.bay) dep)
|
?. (~(has by def.deh.bay) dep)
|
||||||
~&([%wasp-unknown dep] this)
|
~&([%wasp-unknown dep] this)
|
||||||
=/ bes (~(got by def.deh.bay) dep)
|
=/ bes (~(got by def.deh.bay) dep)
|
||||||
@ -341,10 +341,10 @@
|
|||||||
?+ van ~&(%camp-stub !!)
|
?+ van ~&(%camp-stub !!)
|
||||||
$g
|
$g
|
||||||
=/ tyl/path
|
=/ tyl/path
|
||||||
?. ?=($x ren)
|
?. ?=($x ren)
|
||||||
s.bem
|
s.bem
|
||||||
?> ?=(^ s.bem)
|
?> ?=(^ s.bem)
|
||||||
t.s.bem
|
t.s.bem
|
||||||
::
|
::
|
||||||
:+ %pass (camp-wire +<.$)
|
:+ %pass (camp-wire +<.$)
|
||||||
[%g [%deal [our p.bem] q.bem [%peer %scry ren (flop tyl)]]]
|
[%g [%deal [our p.bem] q.bem [%peer %scry ren (flop tyl)]]]
|
||||||
@ -590,7 +590,7 @@
|
|||||||
|= {lam/marv ram/marv nod/(unit {knot res})}
|
|= {lam/marv ram/marv nod/(unit {knot res})}
|
||||||
?^(nod [u.nod lam ram] (~(uni by lam) ram))
|
?^(nod [u.nod lam ram] (~(uni by lam) ram))
|
||||||
==
|
==
|
||||||
++ dash :: process cache
|
++ dash :: process cache
|
||||||
|= cof/cafe
|
|= cof/cafe
|
||||||
^+ +>
|
^+ +>
|
||||||
%_(+> jav.bay q.cof, deh.bay r.cof)
|
%_(+> jav.bay q.cof, deh.bay r.cof)
|
||||||
@ -799,13 +799,11 @@
|
|||||||
++ hoot
|
++ hoot
|
||||||
;~ plug
|
;~ plug
|
||||||
sym
|
sym
|
||||||
;~ pose
|
%- punt
|
||||||
%+ stag ~
|
;~(pfix fas ;~((glue fas) case ship))
|
||||||
;~(plug ;~(pfix fas case) ;~(pfix ;~(plug fas sig) fed:ag))
|
|
||||||
(easy ~)
|
|
||||||
==
|
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
|
++ ship ;~(pfix sig fed:ag)
|
||||||
++ hoof
|
++ hoof
|
||||||
%+ cook |=(a/^hoof a)
|
%+ cook |=(a/^hoof a)
|
||||||
;~ pose
|
;~ pose
|
||||||
@ -815,7 +813,7 @@
|
|||||||
::
|
::
|
||||||
++ hoop
|
++ hoop
|
||||||
;~ pose
|
;~ pose
|
||||||
(stag %| ;~(pfix ;~(plug fas fas gap) have))
|
(stag %| ;~(pfix fas fas gap have))
|
||||||
(stag %& tall:vez)
|
(stag %& tall:vez)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
@ -1157,7 +1155,7 @@
|
|||||||
|= {cof/cafe mal/(map mark $~)}
|
|= {cof/cafe mal/(map mark $~)}
|
||||||
?: (~(has by mal) for)
|
?: (~(has by mal) for)
|
||||||
(cope (lace cof for bem) (flux some))
|
(cope (lace cof for bem) (flux some))
|
||||||
=+ opt=(silt (turn ~(tap by mal) head)) :: XX asymptotics
|
=+ opt=(silt (turn ~(tap by mal) head)) :: XX asymptotics
|
||||||
%+ cope (find-translation-path cof for opt)
|
%+ cope (find-translation-path cof for opt)
|
||||||
|= {cof/cafe wuy/(list @tas)}
|
|= {cof/cafe wuy/(list @tas)}
|
||||||
?~ wuy (flue cof)
|
?~ wuy (flue cof)
|
||||||
@ -1239,14 +1237,14 @@
|
|||||||
=; gro/(burg (set mark) (list mark))
|
=; gro/(burg (set mark) (list mark))
|
||||||
%+ coop (gro cof too ~ ~) :: XX better grab layer
|
%+ coop (gro cof too ~ ~) :: XX better grab layer
|
||||||
~% %grab find-translation-path-jet ~
|
~% %grab find-translation-path-jet ~
|
||||||
|= cof/cafe
|
|= cof/cafe
|
||||||
%+ cool |.(leaf+"cast: finding grabbable grow destinations")
|
%+ cool |.(leaf+"cast: finding grabbable grow destinations")
|
||||||
%+ cope (fang cof too)
|
%+ cope (fang cof too)
|
||||||
|= {cof/cafe vax/vase} ^- (bolt (list mark))
|
|= {cof/cafe vax/vase} ^- (bolt (list mark))
|
||||||
?. (slob %grab p.vax) (flue cof)
|
?. (slob %grab p.vax) (flue cof)
|
||||||
%+ cope
|
%+ cope
|
||||||
(gro cof (silt (sloe p:(slap vax [%limb %grab]))))
|
(gro cof (silt (sloe p:(slap vax [%limb %grab]))))
|
||||||
(flux |=(a/path (welp a /[too])))
|
(flux |=(a/path (welp a /[too])))
|
||||||
|= {cof/cafe tag/(set mark)}
|
|= {cof/cafe tag/(set mark)}
|
||||||
=| $: war/(map mark (list mark))
|
=| $: war/(map mark (list mark))
|
||||||
pax/(list mark)
|
pax/(list mark)
|
||||||
@ -1325,7 +1323,7 @@
|
|||||||
;~ cope
|
;~ cope
|
||||||
;~ coax
|
;~ coax
|
||||||
|=({cof/cafe p/silk q/silk} (cope ^$(cof cof, kas p.kas) flay))
|
|=({cof/cafe p/silk q/silk} (cope ^$(cof cof, kas p.kas) flay))
|
||||||
|=({cof/cafe p/silk q/silk} (cope ^$(cof cof, kas q.kas) flay))
|
|=({cof/cafe p/silk q/silk} (cope ^$(cof cof, kas q.kas) flay))
|
||||||
== :: XX merge %tabl
|
== :: XX merge %tabl
|
||||||
::
|
::
|
||||||
|= {cof/cafe bor/cage heg/cage} ^- (bolt gage)
|
|= {cof/cafe bor/cage heg/cage} ^- (bolt gage)
|
||||||
@ -1645,7 +1643,7 @@
|
|||||||
?~ p.hon (flaw cof leaf+"ford: no match" >(en-beam how)< $:opt ~)
|
?~ p.hon (flaw cof leaf+"ford: no match" >(en-beam how)< $:opt ~)
|
||||||
?: =(p.i.p.hon (scag (lent p.i.p.hon) (flop s.how)))
|
?: =(p.i.p.hon (scag (lent p.i.p.hon) (flop s.how)))
|
||||||
^$(hon q.i.p.hon)
|
^$(hon q.i.p.hon)
|
||||||
$(p.hon t.p.hon)
|
$(p.hon t.p.hon)
|
||||||
::
|
::
|
||||||
$fscn $(hon p.hon, lit |)
|
$fscn $(hon p.hon, lit |)
|
||||||
$fspm
|
$fspm
|
||||||
@ -1698,8 +1696,8 @@
|
|||||||
==
|
==
|
||||||
::
|
::
|
||||||
$fszy
|
$fszy
|
||||||
=? arg lit many+~
|
=? arg lit many+~
|
||||||
(cope (make cof %bake q.hon arg how) flay)
|
(cope (make cof %bake q.hon arg how) flay)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ head :: consume structures
|
++ head :: consume structures
|
||||||
@ -1904,7 +1902,7 @@
|
|||||||
|= {@ baby}
|
|= {@ baby}
|
||||||
:~ =/ caches/(jar term *)
|
:~ =/ caches/(jar term *)
|
||||||
%- ~(rep by jav)
|
%- ~(rep by jav)
|
||||||
|=({{* a/{term *}} b/(jar term *)} (~(add ja b) -.a +.a))
|
|=({{* a/{term *}} b/(jar term *)} (~(add ja b) -.a +.a))
|
||||||
=/ cache-for |=(a/term [a %& (~(get ja caches) a)])
|
=/ cache-for |=(a/term [a %& (~(get ja caches) a)])
|
||||||
cache+[%| (turn `(list term)`/hood/bake/slit/slim/slap/slam cache-for)]
|
cache+[%| (turn `(list term)`/hood/bake/slit/slim/slap/slam cache-for)]
|
||||||
::
|
::
|
||||||
|
Loading…
Reference in New Issue
Block a user