diff src/reduce.sml @ 1020:dfe34fad749d

RPC uses VM support for call/cc
author Adam Chlipala <adamc@hcoop.net>
date Sun, 25 Oct 2009 14:07:10 -0400
parents 68ba074e260f
children b2311dfb3158
line wrap: on
line diff
--- a/src/reduce.sml	Sun Oct 25 13:12:24 2009 -0400
+++ b/src/reduce.sml	Sun Oct 25 14:07:10 2009 -0400
@@ -409,102 +409,6 @@
                                     case #1 e of
                                         EApp
                                             ((EApp
-                                                  ((EApp ((ECApp ((ECApp ((ECApp ((EFfi ("Basis", "bind"), loc), _), _),
-                                                                          t1),
-                                                                   _), t2), _),
-                                                          (EFfi ("Basis", "transaction_monad"), _)), _),
-                                                   (EServerCall (n, es, (EAbs (_, _, _, ke), _), dom, ran), _)), _),
-                                             trans3) =>
-                                        let
-                                            val e' = (EFfi ("Basis", "bind"), loc)
-                                            val e' = (ECApp (e', (CFfi ("Basis", "transaction"), loc)), loc)
-                                            val e' = (ECApp (e', dom), loc)
-                                            val e' = (ECApp (e', t2), loc)
-                                            val e' = (EApp (e', (EFfi ("Basis", "transaction_monad"), loc)), loc)
-                                            val e' = (EApp (e', ke), loc)
-                                            val e' = (EApp (e', E.liftExpInExp 0 trans3), loc)
-                                            val e' = reassoc e'
-                                            val e' = (EAbs ("x", dom, t2, e'), loc)
-                                            val e' = (EServerCall (n, es, e', dom, t2), loc)
-                                        in
-                                            e'
-                                        end
-
-                                      | EApp
-                                            ((EApp
-                                                  ((EApp ((ECApp ((ECApp ((ECApp ((EFfi ("Basis", "bind"), loc), _), _),
-                                                                          t1),
-                                                                   _), t2), _),
-                                                          (EFfi ("Basis", "transaction_monad"), _)), _),
-                                                   (EServerCall (n, es, ke, dom, ran), _)), _),
-                                             trans3) =>
-                                        let
-                                            val e' = (EFfi ("Basis", "bind"), loc)
-                                            val e' = (ECApp (e', (CFfi ("Basis", "transaction"), loc)), loc)
-                                            val e' = (ECApp (e', dom), loc)
-                                            val e' = (ECApp (e', t2), loc)
-                                            val e' = (EApp (e', (EFfi ("Basis", "transaction_monad"), loc)), loc)
-                                            val e' = (EApp (e', exp (UnknownE :: env')
-                                                                    (EApp (E.liftExpInExp 0 ke, (ERel 0, loc)), loc)),
-                                                      loc)
-                                            val e' = (EApp (e', E.liftExpInExp 0 trans3), loc)
-                                            val e' = reassoc e'
-                                            val e' = (EAbs ("x", dom, t2, e'), loc)
-                                            val e' = (EServerCall (n, es, e', dom, t2), loc)
-                                        in
-                                            e'
-                                        end
-
-                                      | EApp
-                                            ((EApp
-                                                  ((EApp ((ECApp ((ECApp ((ECApp ((EFfi ("Basis", "bind"), loc), _), _),
-                                                                          t1),
-                                                                   _), t2), _),
-                                                          (EFfi ("Basis", "transaction_monad"), _)), _),
-                                                   (ETailCall (n, es, (EAbs (_, _, _, ke), _), dom, ran), _)), _),
-                                             trans3) =>
-                                        let
-                                            val e' = (EFfi ("Basis", "bind"), loc)
-                                            val e' = (ECApp (e', (CFfi ("Basis", "transaction"), loc)), loc)
-                                            val e' = (ECApp (e', dom), loc)
-                                            val e' = (ECApp (e', t2), loc)
-                                            val e' = (EApp (e', (EFfi ("Basis", "transaction_monad"), loc)), loc)
-                                            val e' = (EApp (e', ke), loc)
-                                            val e' = (EApp (e', E.liftExpInExp 0 trans3), loc)
-                                            val e' = reassoc e'
-                                            val e' = (EAbs ("x", dom, t2, e'), loc)
-                                            val e' = (ETailCall (n, es, e', dom, t2), loc)
-                                        in
-                                            e'
-                                        end
-
-                                      | EApp
-                                            ((EApp
-                                                  ((EApp ((ECApp ((ECApp ((ECApp ((EFfi ("Basis", "bind"), loc), _), _),
-                                                                          t1),
-                                                                   _), t2), _),
-                                                          (EFfi ("Basis", "transaction_monad"), _)), _),
-                                                   (ETailCall (n, es, ke, dom, ran), _)), _),
-                                             trans3) =>
-                                        let
-                                            val e' = (EFfi ("Basis", "bind"), loc)
-                                            val e' = (ECApp (e', (CFfi ("Basis", "transaction"), loc)), loc)
-                                            val e' = (ECApp (e', dom), loc)
-                                            val e' = (ECApp (e', t2), loc)
-                                            val e' = (EApp (e', (EFfi ("Basis", "transaction_monad"), loc)), loc)
-                                            val e' = (EApp (e', exp (UnknownE :: env')
-                                                                    (EApp (E.liftExpInExp 0 ke, (ERel 0, loc)), loc)),
-                                                      loc)
-                                            val e' = (EApp (e', E.liftExpInExp 0 trans3), loc)
-                                            val e' = reassoc e'
-                                            val e' = (EAbs ("x", dom, t2, e'), loc)
-                                            val e' = (ETailCall (n, es, e', dom, t2), loc)
-                                        in
-                                            e'
-                                        end
-
-                                      | EApp
-                                            ((EApp
                                                   ((EApp ((ECApp ((ECApp ((ECApp ((EFfi ("Basis", "bind"), loc), mt),
                                                                            _), _), _), t3), _),
                                                           me), _),
@@ -792,10 +696,7 @@
                           | ELet (x, t, e1, e2) =>
                             (ELet (x, con env t, exp env e1, exp (UnknownE :: env) e2), loc)
 
-                          | EServerCall (n, es, e, t1, t2) => (EServerCall (n, map (exp env) es, exp env e,
-                                                                            con env t1, con env t2), loc)
-                          | ETailCall (n, es, e, t1, t2) => (ETailCall (n, map (exp env) es, exp env e,
-                                                                        con env t1, con env t2), loc)
+                          | EServerCall (n, es, t) => (EServerCall (n, map (exp env) es, con env t), loc)
             in
                 (*if dangling (edepth' (deKnown env)) r then
                     (Print.prefaces "exp" [("e", CorePrint.p_exp CoreEnv.empty all),