diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-09-17 16:35:11 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-09-17 16:35:11 -0400 |
commit | ae83d3e44959b43c167ba83736055bf94ace3113 (patch) | |
tree | 9d7a2e3bc1dff89e7399d555415ffae5c45c8b52 /src/core_untangle.sml | |
parent | bf1a78ce9a5d60f8f4c40d0087f6caf90c10a796 (diff) |
Basic tail recursion introduction seems to be working
Diffstat (limited to 'src/core_untangle.sml')
-rw-r--r-- | src/core_untangle.sml | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/core_untangle.sml b/src/core_untangle.sml index 480ec7a4..f00bd95b 100644 --- a/src/core_untangle.sml +++ b/src/core_untangle.sml @@ -38,19 +38,20 @@ structure IM = IntBinaryMap fun default (k, s) = s fun exp thisGroup (e, s) = - case e of - ENamed n => - if IS.member (thisGroup, n) then - IS.add (s, n) - else - s - | EClosure (n, _) => - if IS.member (thisGroup, n) then - IS.add (s, n) - else - s - - | _ => s + let + fun try n = + if IS.member (thisGroup, n) then + IS.add (s, n) + else + s + in + case e of + ENamed n => try n + | EClosure (n, _) => try n + | EServerCall (n, _, _, _, _) => try n + | ETailCall (n, _, _, _, _) => try n + | _ => s + end fun untangle file = let |