From b301e0c0e6b54dceecbe4ee1ef8f610411015c30 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 27 Jan 2018 00:28:51 -0800 Subject: 4200 Forgot to set up exuberant_ctags_rc as .ctags on new laptop. --- html/same-fringe.mu.html | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'html/same-fringe.mu.html') diff --git a/html/same-fringe.mu.html b/html/same-fringe.mu.html index 556af75a..379762b2 100644 --- a/html/same-fringe.mu.html +++ b/html/same-fringe.mu.html @@ -66,32 +66,32 @@ if ('onhashchange' in window) { 6 # (i.e. that the two given trees x and y have the same leaves, in the same 7 # order from left to right) 8 - 9 container tree:_elem [ + 9 container tree:_elem [ 10 val:_elem -11 left:&:tree:_elem -12 right:&:tree:_elem +11 left:&:tree:_elem +12 right:&:tree:_elem 13 ] 14 -15 def main [ +15 def main [ 16 local-scope 17 # x: ((a b) c) 18 # y: (a (b c)) -19 a:&:tree:num <- new-tree 3 -20 b:&:tree:num <- new-tree 4 -21 c:&:tree:num <- new-tree 5 -22 x1:&:tree:num <- new-tree a, b -23 x:&:tree:num <- new-tree x1, c -24 y1:&:tree:num <- new-tree b, c -25 y:&:tree:num <- new-tree a, y1 -26 result:bool <- same-fringe x, y +19 a:&:tree:num <- new-tree 3 +20 b:&:tree:num <- new-tree 4 +21 c:&:tree:num <- new-tree 5 +22 x1:&:tree:num <- new-tree a, b +23 x:&:tree:num <- new-tree x1, c +24 y1:&:tree:num <- new-tree b, c +25 y:&:tree:num <- new-tree a, y1 +26 result:bool <- same-fringe x, y 27 $print result 10/newline 28 ] 29 -30 def same-fringe a:&:tree:_elem, b:&:tree:_elem -> result:bool [ +30 def same-fringe a:&:tree:_elem, b:&:tree:_elem -> result:bool [ 31 local-scope 32 load-inputs -33 k1:continuation <- call-with-continuation-mark 100/mark, process, a -34 k2:continuation <- call-with-continuation-mark 100/mark, process, b +33 k1:continuation <- call-with-continuation-mark 100/mark, process, a +34 k2:continuation <- call-with-continuation-mark 100/mark, process, b 35 { 36 k1, x:_elem, a-done?:bool <- call k1 37 k2, y:_elem, b-done?:bool <- call k2 @@ -105,25 +105,25 @@ if ('onhashchange' in window) { 45 ] 46 47 # harness around traversal -48 def process t:&:tree:_elem [ +48 def process t:&:tree:_elem [ 49 local-scope 50 load-inputs 51 return-continuation-until-mark 100/mark # initial -52 traverse t +52 traverse t 53 zero-val:&:_elem <- new _elem:type 54 return-continuation-until-mark 100/mark, *zero-val, 1/done # final 55 assert 0/false, [continuation called past done] 56 ] 57 58 # core traversal -59 def traverse t:&:tree:_elem [ +59 def traverse t:&:tree:_elem [ 60 local-scope 61 load-inputs 62 return-unless t -63 l:&:tree:_elem <- get *t, left:offset -64 traverse l -65 r:&:tree:_elem <- get *t, right:offset -66 traverse r +63 l:&:tree:_elem <- get *t, left:offset +64 traverse l +65 r:&:tree:_elem <- get *t, right:offset +66 traverse r 67 return-if l 68 return-if r 69 # leaf @@ -133,14 +133,14 @@ if ('onhashchange' in window) { 73 74 # details 75 -76 def new-tree x:_elem -> result:&:tree:_elem [ +76 def new-tree x:_elem -> result:&:tree:_elem [ 77 local-scope 78 load-inputs 79 result <- new {(tree _elem): type} 80 put *result, val:offset, x 81 ] 82 -83 def new-tree l:&:tree:_elem, r:&:tree:_elem -> result:&:tree:_elem [ +83 def new-tree l:&:tree:_elem, r:&:tree:_elem -> result:&:tree:_elem [ 84 local-scope 85 load-inputs 86 result <- new {(tree _elem): type} -- cgit 1.4.1-2-gfad0