Add ++mold synonym for $-(* *)

This is to aid the readability of higher-order molds. Now one can have

|*  a/mold
{p/a q/a}

instead of using $- directly.

The old arvo ++mold becomes ++wind. Cards are like the mathematical dual
to stack frames - they're instructions on whether to wind or unwind the
implicit stack.
This commit is contained in:
Raymond Pasco 2016-03-04 21:10:38 -05:00
parent d553156290
commit 96b39223a5
9 changed files with 56 additions and 54 deletions

View File

@ -4,7 +4,7 @@
=> =~ => =~
:: structures :: structures
|% |%
++ move {p/duct q/(mold note gift-ames)} :: local move ++ move {p/duct q/(wind note gift-ames)} :: local move
++ note :: out request $-> ++ note :: out request $->
$? $: $d :: to %dill $? $: $d :: to %dill
$% {$flog p/flog} :: $% {$flog p/flog} ::

View File

@ -19,7 +19,7 @@
{$wake $~} :: timer activate {$wake $~} :: timer activate
{$wegh $~} :: report memory {$wegh $~} :: report memory
== :: == ::
++ move {p/duct q/(mold note gift)} :: local move ++ move {p/duct q/(wind note gift)} :: local move
++ note $~ :: out request $-> ++ note $~ :: out request $->
++ sign $~ :: in result $<- ++ sign $~ :: in result $<-
++ clok (broq @da duct) :: stored timers ++ clok (broq @da duct) :: stored timers

View File

@ -49,7 +49,7 @@
$merge $build $checkout $ergo :: waiting for? $merge $build $checkout $ergo :: waiting for?
== :: == ::
++ moot {p/case q/case r/path s/(map path lobe)} :: stored change range ++ moot {p/case q/case r/path s/(map path lobe)} :: stored change range
++ move {p/duct q/(mold note gift)} :: local move ++ move {p/duct q/(wind note gift)} :: local move
++ nako $: gar/(map aeon tako) :: new ids ++ nako $: gar/(map aeon tako) :: new ids
let/aeon :: next id let/aeon :: next id
lar/(set yaki) :: new commits lar/(set yaki) :: new commits

View File

@ -43,7 +43,7 @@
++ mess :: ++ mess ::
$% {$dill-belt p/(hypo dill-belt)} :: $% {$dill-belt p/(hypo dill-belt)} ::
== :: == ::
++ move {p/duct q/(mold note gift)} :: local move ++ move {p/duct q/(wind note gift)} :: local move
++ note-ames :: weird ames move ++ note-ames :: weird ames move
$% {$make p/(unit @t) q/@ud r/@ s/?} :: $% {$make p/(unit @t) q/@ud r/@ s/?} ::
{$sith p/@p q/@uw r/?} :: {$sith p/@p q/@uw r/?} ::

View File

@ -6,7 +6,7 @@
|% :: interfaces |% :: interfaces
++ gift gift-eyre :: out result <-$ ++ gift gift-eyre :: out result <-$
++ kiss kiss-eyre :: in request ->$ ++ kiss kiss-eyre :: in request ->$
++ move {p/duct q/(mold note gift)} :: local move ++ move {p/duct q/(wind note gift)} :: local move
++ note :: out request $-> ++ note :: out request $->
$% $: $a :: to %ames $% $: $a :: to %ames
$% {$wont p/sock q/{path *}} :: $% {$wont p/sock q/{path *}} ::

View File

@ -9,7 +9,7 @@
++ gift gift-ford :: out result <-$ ++ gift gift-ford :: out result <-$
++ heel path :: functional ending ++ heel path :: functional ending
++ kiss kiss-ford :: in request ->$ ++ kiss kiss-ford :: in request ->$
++ move {p/duct q/(mold note gift)} :: local move ++ move {p/duct q/(wind note gift)} :: local move
++ note :: out request $-> ++ note :: out request $->
$% $: $c :: to %clay $% $: $c :: to %clay
$% {$warp p/sock q/riff} :: $% {$warp p/sock q/riff} ::
@ -37,7 +37,7 @@
jav/(map * calx) :: cache jav/(map * calx) :: cache
== :: == ::
++ bolt :: gonadic edge ++ bolt :: gonadic edge
|* a/$-(* *) :: product clam |* a/mold :: product clam
$: p/cafe :: cache $: p/cafe :: cache
$= q :: $= q ::
$% {$0 p/(set beam) q/a} :: depends+product $% {$0 p/(set beam) q/a} :: depends+product
@ -47,7 +47,7 @@
== :: == ::
:: :: :: ::
++ burg :: gonadic rule ++ burg :: gonadic rule
|* {a/$-(* *) b/$-(* *)} :: 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

View File

@ -24,8 +24,8 @@
{$send p/ship q/cush} :: {$send p/ship q/cush} ::
{$hiss p/(unit knot) q/mark r/cage} :: {$hiss p/(unit knot) q/mark r/cage} ::
== :: == ::
++ cove (pair bone (mold cote cuft)) :: internal move ++ cove (pair bone (wind cote cuft)) :: internal move
++ move {p/duct q/(mold note-arvo gift-arvo)} :: typed move ++ move {p/duct q/(wind note-arvo gift-arvo)} :: typed move
-- :: -- ::
|% :::::::::::::::::::::::::::::::::::::::::::::::::::::: %gall state |% :::::::::::::::::::::::::::::::::::::::::::::::::::::: %gall state
:::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::

View File

@ -25,7 +25,7 @@
~ ~
|% :: |% ::
++ abel typo :: original sin: span ++ abel typo :: original sin: span
++ ache |* {a/$-(* *) b/$-(* *)} :: either a or b ++ ache |* {a/mold b/mold} :: either a or b
$%({$| p/b} {$& p/a}) :: b default $%({$| p/b} {$& p/a}) :: b default
++ atom @ :: just an atom ++ atom @ :: just an atom
++ axis @ :: tree address ++ axis @ :: tree address
@ -72,7 +72,7 @@
++ date {{a/? y/@ud} m/@ud t/tarp} :: parsed date ++ date {{a/? y/@ud} m/@ud t/tarp} :: parsed date
++ dime {p/@ta q/@} :: ++ dime {p/@ta q/@} ::
++ dock (pair @p term) :: message target ++ dock (pair @p term) :: message target
++ each |* {a/$-(* *) b/$-(* *)} :: either a or b ++ each |* {a/mold b/mold} :: either a or b
$%({$& p/a} {$| p/b}) :: a default $%({$& p/a} {$| p/b}) :: a default
++ edge {p/hair q/(unit {p/* q/nail})} :: parsing output ++ edge {p/hair q/(unit {p/* q/nail})} :: parsing output
++ foot $% {$ash p/twig} :: dry arm, geometric ++ foot $% {$ash p/twig} :: dry arm, geometric
@ -81,7 +81,7 @@
++ gate $-(* *) :: general gate ++ gate $-(* *) :: general gate
++ hair {p/@ud q/@ud} :: parsing trace ++ hair {p/@ud q/@ud} :: parsing trace
++ knot @ta :: ASCII text ++ knot @ta :: ASCII text
++ like |* a/$-(* *) :: generic edge ++ like |* a/mold :: generic edge
|= b/_`*`[(hair) ~] :: |= b/_`*`[(hair) ~] ::
:- p=(hair -.b) :: :- p=(hair -.b) ::
^= q :: ^= q ::
@ -93,9 +93,9 @@
{$| p/@ud q/(unit term)} :: by name {$| p/@ud q/(unit term)} :: by name
== :: == ::
++ line {p/{$leaf p/odor q/@} q/tile} :: %kelp case ++ line {p/{$leaf p/odor q/@} q/tile} :: %kelp case
++ list |* a/$-(* *) :: null-term list ++ list |* a/mold :: null-term list
$@($~ {i/a t/(list a)}) :: $@($~ {i/a t/(list a)}) ::
++ lone |*(a/$-(* *) p/a) :: just one thing ++ lone |*(a/mold p/a) :: just one thing
++ mane $@(@tas {@tas @tas}) :: XML name+space ++ mane $@(@tas {@tas @tas}) :: XML name+space
++ manx {g/marx c/marl} :: XML node ++ manx {g/marx c/marl} :: XML node
++ marl (list manx) :: XML node list ++ marl (list manx) :: XML node list
@ -103,19 +103,20 @@
++ mart (list {n/mane v/tape}) :: XML attributes ++ mart (list {n/mane v/tape}) :: XML attributes
++ marx {n/mane a/mart} :: XML tag ++ marx {n/mane a/mart} :: XML tag
++ metl ?($gold $iron $zinc $lead) :: core variance ++ metl ?($gold $iron $zinc $lead) :: core variance
++ mold $-(* *) :: mold of a span
++ noun * :: any noun ++ noun * :: any noun
++ null $~ :: null, nil, etc ++ null $~ :: null, nil, etc
++ odor @ta :: atom format ++ odor @ta :: atom format
++ tarp {d/@ud h/@ud m/@ud s/@ud f/(list @ux)} :: parsed time ++ tarp {d/@ud h/@ud m/@ud s/@ud f/(list @ux)} :: parsed time
++ time @da :: galactic time ++ time @da :: galactic time
++ tree |* a/$-(* *) :: binary tree ++ tree |* a/mold :: binary tree
$@($~ {n/a l/(tree a) r/(tree a)}) :: $@($~ {n/a l/(tree a) r/(tree a)}) ::
++ nail {p/hair q/tape} :: parsing input ++ nail {p/hair q/tape} :: parsing input
++ numb @ :: just a number ++ numb @ :: just a number
++ pair |*({a/$-(* *) b/$-(* *)} {p/a q/b}) :: just a pair ++ pair |*({a/mold b/mold} {p/a q/b}) :: just a pair
++ quid |*({a/$-(* *) b/*} {a _b}) :: for =^ ++ quid |*({a/mold b/*} {a _b}) :: for =^
++ quip |*({a/$-(* *) b/*} {(list a) _b}) :: for =^ ++ quip |*({a/mold b/*} {(list a) _b}) :: for =^
++ wand |* a/(pole $-(* *)) :: hetero list ++ wand |* a/(pole mold) :: hetero list
|= b/* :: |= b/* ::
?~ a ~ :: ?~ a ~ ::
?@ b ~ :: ?@ b ~ ::
@ -130,10 +131,10 @@
++ pint {p/{p/@ q/@} q/{p/@ q/@}} :: line+column range ++ pint {p/{p/@ q/@} q/{p/@ q/@}} :: line+column range
++ palo (pair vein opal) :: wing trace, match ++ palo (pair vein opal) :: wing trace, match
++ pock (pair axis nock) :: changes ++ pock (pair axis nock) :: changes
++ pole |* a/$-(* *) :: nameless list ++ pole |* a/mold :: nameless list
$@($~ {a (pole a)}) :: $@($~ {a (pole a)}) ::
++ port (each palo (pair span nock)) :: successful match ++ port (each palo (pair span nock)) :: successful match
++ qual |* {a/$-(* *) b/$-(* *) c/$-(* *) d/$-(* *)} :: just a quadruple ++ qual |* {a/mold b/mold c/mold d/mold} :: just a quadruple
{p/a q/b r/c s/d} :: {p/a q/b r/c s/d} ::
++ ring @ :: private key ++ ring @ :: private key
++ rule _|=(nail *edge) :: parsing rule ++ rule _|=(nail *edge) :: parsing rule
@ -179,7 +180,7 @@
{$2 p/toga q/toga} :: cell toga {$2 p/toga q/toga} :: cell toga
== :: == ::
++ trap |*(a/_* _|?(*a)) :: makes perfect sense ++ trap |*(a/_* _|?(*a)) :: makes perfect sense
++ trel |* {a/$-(* *) b/$-(* *) c/$-(* *)} :: just a triple ++ trel |* {a/mold b/mold c/mold} :: just a triple
{p/a q/b r/c} :: {p/a q/b r/c} ::
++ tuna :: tagflow ++ tuna :: tagflow
$% {$a p/twig} :: plain text $% {$a p/twig} :: plain text
@ -388,11 +389,11 @@
== :: == ::
$% {$d p/@ud} :: blocklist $% {$d p/@ud} :: blocklist
== :: == ::
++ unce |* a/$-(* *) :: change part ++ unce |* a/mold :: change part
$% {$& p/@ud} :: skip[copy] $% {$& p/@ud} :: skip[copy]
{$| p/(list a) q/(list a)} :: p -> q[chunk] {$| p/(list a) q/(list a)} :: p -> q[chunk]
== :: == ::
++ unit |* a/$-(* *) :: maybe ++ unit |* a/mold :: maybe
$@($~ {$~ u/a}) :: $@($~ {$~ u/a}) ::
++ upas :: tree change (%d) ++ upas :: tree change (%d)
$^ {p/upas q/upas} :: cell $^ {p/upas q/upas} :: cell
@ -400,7 +401,7 @@
{$1 p/*} :: insert new {$1 p/*} :: insert new
{$2 p/axis q/udon} :: mutate! {$2 p/axis q/udon} :: mutate!
== :: == ::
++ urge |*(a/$-(* *) (list (unce a))) :: list change ++ urge |*(a/mold (list (unce a))) :: list change
++ vase {p/span q/*} :: span-value pair ++ vase {p/span q/*} :: span-value pair
++ vise {p/typo q/*} :: old vase ++ vise {p/typo q/*} :: old vase
++ wall (list tape) :: text lines (no \n) ++ wall (list tape) :: text lines (no \n)
@ -416,14 +417,14 @@
mit/(map (pair span twig) (pair span nock)) :: ++mint mit/(map (pair span twig) (pair span nock)) :: ++mint
== :: == ::
:: :: :: ::
++ map |* {a/$-(* *) b/$-(* *)} :: associative tree ++ map |* {a/mold b/mold} :: associative tree
$@($~ {n/{p/a q/b} l/(map a b) r/(map a b)}) :: $@($~ {n/{p/a q/b} l/(map a b) r/(map a b)}) ::
++ qeu |* a/$-(* *) :: queue ++ qeu |* a/mold :: queue
$@($~ {n/a l/(qeu a) r/(qeu a)}) :: $@($~ {n/a l/(qeu a) r/(qeu a)}) ::
++ set |* a/$-(* *) :: set ++ set |* a/mold :: set
$@($~ {n/a l/(set a) r/(set a)}) :: $@($~ {n/a l/(set a) r/(set a)}) ::
++ jar |*({a/$-(* *) b/$-(* *)} (map a (list b))) :: map of lists ++ jar |*({a/mold b/mold} (map a (list b))) :: map of lists
++ jug |*({a/$-(* *) b/$-(* *)} (map a (set b))) :: map of sets ++ jug |*({a/mold b/mold} (map a (set b))) :: map of sets
-- :: -- ::
:::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: :::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::: :::::: volume 2, Hoon libraries and compiler :::::: :::::: :::::: volume 2, Hoon libraries and compiler ::::::
@ -1256,7 +1257,7 @@
-- --
:: ::
++ stat :: positive counter ++ stat :: positive counter
|* a/$-(* *) |* a/mold
|= (trel ? a (map a @ud)) |= (trel ? a (map a @ud))
^+ r ^+ r
=+ (~(get by r) q) =+ (~(get by r) q)
@ -2215,8 +2216,8 @@
++ same |*(* +<) :: identity ++ same |*(* +<) :: identity
++ head |*(^ +<-) :: get head ++ head |*(^ +<-) :: get head
++ tail |*(^ +<+) :: get head ++ tail |*(^ +<+) :: get head
++ fore |*(a/$-(* *) |*(b/$-(* *) (pair a b))) :: pair before ++ fore |*(a/mold |*(b/mold (pair a b))) :: pair before
++ aftr |*(a/$-(* *) |*(b/$-(* *) (pair b a))) :: pair after ++ aftr |*(a/mold |*(b/mold (pair b a))) :: pair after
++ test |=(^ =(+<- +<+)) :: equality ++ test |=(^ =(+<- +<+)) :: equality
++ cork |*({a/_|=(* **) b/gate} (corl b a)) :: compose forward ++ cork |*({a/_|=(* **) b/gate} (corl b a)) :: compose forward
++ corl :: compose backwards ++ corl :: compose backwards
@ -2239,14 +2240,15 @@
|=({a/@ b/@} `(list @)`?:(=(a +(b)) ~ [a $(a +(a))])) |=({a/@ b/@} `(list @)`?:(=(a +(b)) ~ [a $(a +(a))]))
:: ::
++ hard :: force coerce to span ++ hard :: force coerce to span
|* han/$-(* *) |* han/mold
|= fud/* ^- han |= fud/* ^- han
~| %hard ~| %hard
=+ gol=(han fud) =+ gol=(han fud)
?>(=(gol fud) gol) ?>(=(gol fud) gol)
:: ::
++ soft :: maybe coerce to span ++ soft :: maybe coerce to span
|* han/$-(* *) |* han/mold
|= fud/* ^- (unit han) |= fud/* ^- (unit han)
=+ gol=(han fud) =+ gol=(han fud)
?.(=(gol fud) ~ [~ gol]) ?.(=(gol fud) ~ [~ gol])
@ -10486,7 +10488,7 @@
~% %arvo + ~ ~% %arvo + ~
|% |%
++ arch {fil/(unit @uvI) dir/(map @ta $~)} :: fundamental node ++ arch {fil/(unit @uvI) dir/(map @ta $~)} :: fundamental node
++ arvo (mold {p/term q/mill} mill) :: arvo card ++ arvo (wind {p/term q/mill} mill) :: arvo card
++ beam {{p/ship q/desk r/case} s/path} :: global name ++ beam {{p/ship q/desk r/case} s/path} :: global name
++ beak {p/ship q/desk r/case} :: garnish with beak ++ beak {p/ship q/desk r/case} :: garnish with beak
++ bone @ud :: opaque duct ++ bone @ud :: opaque duct
@ -10498,15 +10500,15 @@
== :: == ::
++ desk @tas :: ship desk case spur ++ desk @tas :: ship desk case spur
++ cage (cask vase) :: global metadata ++ cage (cask vase) :: global metadata
++ cask |*(a/$-(* *) (pair mark a)) :: global data ++ cask |*(a/mold (pair mark a)) :: global data
++ cuff :: permissions ++ cuff :: permissions
$: p/(unit (set monk)) :: can be read by $: p/(unit (set monk)) :: can be read by
q/(set monk) :: caused or created by q/(set monk) :: caused or created by
== :: == ::
++ curd {p/@tas q/*} :: spanless card ++ curd {p/@tas q/*} :: spanless card
++ duct (list wire) :: causal history ++ duct (list wire) :: causal history
++ hypo |*(a/$-(* *) (pair span a)) :: span associated ++ hypo |*(a/mold (pair span a)) :: span associated
++ hobo |* a/$-(* *) :: kiss wrapper ++ hobo |* a/mold :: kiss wrapper
$? $% {$soft p/*} :: $? $% {$soft p/*} ::
== :: == ::
a :: a ::
@ -10531,13 +10533,6 @@
++ mill (each vase milt) :: vase+metavase ++ mill (each vase milt) :: vase+metavase
++ milt {p/* q/*} :: metavase ++ milt {p/* q/*} :: metavase
++ monk (each ship {p/@tas q/@ta}) :: general identity ++ monk (each ship {p/@tas q/@ta}) :: general identity
++ mold :: new kernel action
|* {a/$-(* *) b/$-(* *)} :: forward+reverse
$% {$pass p/path q/a} :: advance
{$slip p/a} :: lateral
{$sick p/b} :: lame refactoring
{$give p/b} :: retreat
== ::
++ muse {p/@tas q/duct r/arvo} :: sourced move ++ muse {p/@tas q/duct r/arvo} :: sourced move
++ move {p/duct q/arvo} :: arvo move ++ move {p/duct q/arvo} :: arvo move
++ ovum {p/wire q/curd} :: spanless ovum ++ ovum {p/wire q/curd} :: spanless ovum
@ -10556,6 +10551,13 @@
pah/span :: -:!>(*path) pah/span :: -:!>(*path)
mev/span :: -:!>([%meta *vase]) mev/span :: -:!>([%meta *vase])
== :: == ::
++ wind :: new kernel action
|* {a/mold b/mold} :: forward+reverse
$% {$pass p/path q/a} :: advance
{$slip p/a} :: lateral
{$sick p/b} :: lame refactoring
{$give p/b} :: retreat
== ::
++ wire path :: event pretext ++ wire path :: event pretext
++ sloy ++ sloy
|= sod/slyd |= sod/slyd

View File

@ -40,7 +40,7 @@
[%nuke ~] :: erase subscriber [%nuke ~] :: erase subscriber
[%tell p=@uw q=(unit ,@da) r=path] :: save secret [%tell p=@uw q=(unit ,@da) r=path] :: save secret
== :: == ::
++ move ,[p=duct q=(mold note gift)] :: typed move ++ move ,[p=duct q=(wind note gift)] :: typed move
++ note :: out request $-> ++ note :: out request $->
$% $: %b :: to %behn $% $: %b :: to %behn
$% [%wait p=@da] :: $% [%wait p=@da] ::