diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-12-15 00:15:47 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-12-15 00:15:47 -0800 |
commit | 5059f32d0ddf36b9591ad0c14ee474ad5f2f8816 (patch) | |
tree | ebe215d694644fc519ad1c4dcee499d739138141 /same-fringe.mu | |
parent | 1cd833619e355c70d5d96a208cd67ba3a3ccb937 (diff) | |
download | mu-5059f32d0ddf36b9591ad0c14ee474ad5f2f8816.tar.gz |
4160 - named marks for delimited continuations
Hypothesis: this is needed to build McCarthy's amb operator. https://rosettacode.org/wiki/Amb
Diffstat (limited to 'same-fringe.mu')
-rw-r--r-- | same-fringe.mu | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/same-fringe.mu b/same-fringe.mu index 14719eb8..a1e619b7 100644 --- a/same-fringe.mu +++ b/same-fringe.mu @@ -30,8 +30,8 @@ def main [ def same-fringe a:&:tree:_elem, b:&:tree:_elem -> result:bool [ local-scope load-inputs - k1:continuation <- call-with-continuation-mark process, a - k2:continuation <- call-with-continuation-mark process, b + k1:continuation <- call-with-continuation-mark 100/mark, process, a + k2:continuation <- call-with-continuation-mark 100/mark, process, b { k1, x:_elem, a-done?:bool <- call k1 k2, y:_elem, b-done?:bool <- call k2 @@ -48,10 +48,10 @@ def same-fringe a:&:tree:_elem, b:&:tree:_elem -> result:bool [ def process t:&:tree:_elem [ local-scope load-inputs - return-continuation-until-mark # initial + return-continuation-until-mark 100/mark # initial traverse t zero-val:&:_elem <- new _elem:type - return-continuation-until-mark *zero-val, 1/done # final + return-continuation-until-mark 100/mark, *zero-val, 1/done # final assert 0/false, [continuation called past done] ] @@ -68,7 +68,7 @@ def traverse t:&:tree:_elem [ return-if r # leaf v:_elem <- get *t, val:offset - return-continuation-until-mark v, 0/not-done + return-continuation-until-mark 100/mark, v, 0/not-done ] # details |