comparison src/core_util.sml @ 754:8688e01ae469

A view query works
author Adam Chlipala <adamc@hcoop.net>
date Tue, 28 Apr 2009 15:04:37 -0400
parents acb8537f58f0
children 6271f0e3c272
comparison
equal deleted inserted replaced
753:d484df4e841a 754:8688e01ae469
944 fn ce' => 944 fn ce' =>
945 S.map2 (mfc ctx cc, 945 S.map2 (mfc ctx cc,
946 fn cc' => 946 fn cc' =>
947 (DTable (x, n, c', s, pe', pc', ce', cc'), loc)))))) 947 (DTable (x, n, c', s, pe', pc', ce', cc'), loc))))))
948 | DSequence _ => S.return2 dAll 948 | DSequence _ => S.return2 dAll
949 | DView (x, n, s, e, c) =>
950 S.bind2 (mfe ctx e,
951 fn e' =>
952 S.map2 (mfc ctx c,
953 fn c' =>
954 (DView (x, n, s, e', c'), loc)))
949 | DDatabase _ => S.return2 dAll 955 | DDatabase _ => S.return2 dAll
950 | DCookie (x, n, c, s) => 956 | DCookie (x, n, c, s) =>
951 S.map2 (mfc ctx c, 957 S.map2 (mfc ctx c,
952 fn c' => 958 fn c' =>
953 (DCookie (x, n, c', s), loc)) 959 (DCookie (x, n, c', s), loc))
1080 let 1086 let
1081 val t = (CFfi ("Basis", "sql_sequence"), #2 d') 1087 val t = (CFfi ("Basis", "sql_sequence"), #2 d')
1082 in 1088 in
1083 bind (ctx, NamedE (x, n, t, NONE, s)) 1089 bind (ctx, NamedE (x, n, t, NONE, s))
1084 end 1090 end
1091 | DView (x, n, s, _, c) =>
1092 let
1093 val loc = #2 d'
1094 val ct = (CFfi ("Basis", "sql_view"), loc)
1095 val ct = (CApp (ct, c), loc)
1096 in
1097 bind (ctx, NamedE (x, n, ct, NONE, s))
1098 end
1085 | DDatabase _ => ctx 1099 | DDatabase _ => ctx
1086 | DCookie (x, n, c, s) => 1100 | DCookie (x, n, c, s) =>
1087 let 1101 let
1088 val t = (CApp ((CFfi ("Basis", "http_cookie"), #2 d'), c), #2 d') 1102 val t = (CApp ((CFfi ("Basis", "http_cookie"), #2 d'), c), #2 d')
1089 in 1103 in
1152 | DVal (_, n, _, _, _) => Int.max (n, count) 1166 | DVal (_, n, _, _, _) => Int.max (n, count)
1153 | DValRec vis => foldl (fn ((_, n, _, _, _), count) => Int.max (n, count)) count vis 1167 | DValRec vis => foldl (fn ((_, n, _, _, _), count) => Int.max (n, count)) count vis
1154 | DExport _ => count 1168 | DExport _ => count
1155 | DTable (_, n, _, _, _, _, _, _) => Int.max (n, count) 1169 | DTable (_, n, _, _, _, _, _, _) => Int.max (n, count)
1156 | DSequence (_, n, _) => Int.max (n, count) 1170 | DSequence (_, n, _) => Int.max (n, count)
1171 | DView (_, n, _, _, _) => Int.max (n, count)
1157 | DDatabase _ => count 1172 | DDatabase _ => count
1158 | DCookie (_, n, _, _) => Int.max (n, count) 1173 | DCookie (_, n, _, _) => Int.max (n, count)
1159 | DStyle (_, n, _) => Int.max (n, count)) 0 1174 | DStyle (_, n, _) => Int.max (n, count)) 0
1160 1175
1161 end 1176 end