diff src/mono_util.sml @ 2221:278e10629ba1

Basic field-resolution invalidation.
author Ziv Scully <ziv@mit.edu>
date Sat, 29 Nov 2014 03:37:59 -0500
parents f7113855f3b7
children 25874084bf1f
line wrap: on
line diff
--- a/src/mono_util.sml	Mon Nov 24 20:47:38 2014 -0500
+++ b/src/mono_util.sml	Sat Nov 29 03:37:59 2014 -0500
@@ -314,7 +314,7 @@
                      fn es' =>
                         (EClosure (n, es'), loc))
 
-              | EQuery {exps, tables, state, query, body, initial} =>
+              | EQuery {exps, tables, state, query, body, initial, sqlcacheInfo} =>
                 S.bind2 (ListUtil.mapfold (fn (x, t) =>
                                               S.map2 (mft t,
                                                       fn t' => (x, t'))) exps,
@@ -334,15 +334,20 @@
                                                                                  RelE ("acc", dummyt)))
                                                                           body,
                                                                    fn body' =>
-                                                                      S.map2 (mfe ctx initial,
+                                                                      (* ASK: is this the right thing to do? *)
+                                                                      S.bind2 (mfe ctx initial,
                                                                            fn initial' =>
-                                                                              (EQuery {exps = exps',
-                                                                                       tables = tables',
-                                                                                       state = state',
-                                                                                       query = query',
-                                                                                       body = body',
-                                                                                       initial = initial'},
-                                                                               loc)))))))
+                                                                              S.map2 (mfe (bind (ctx, RelE ("queryResult", dummyt)))
+                                                                                          sqlcacheInfo,
+                                                                                    fn sqlcacheInfo' =>
+                                                                                       (EQuery {exps = exps',
+                                                                                                tables = tables',
+                                                                                                state = state',
+                                                                                                query = query',
+                                                                                                body = body',
+                                                                                                initial = initial',
+                                                                                                sqlcacheInfo = sqlcacheInfo},
+                                                                                        loc))))))))
 
               | EDml (e, fm) =>
                 S.map2 (mfe ctx e,