comparison src/core_util.sml @ 338:e976b187d73a

SQL sequences
author Adam Chlipala <adamc@hcoop.net>
date Sun, 14 Sep 2008 11:02:18 -0400
parents 42dfb0d61cf0
children 075b36dbb1a4
comparison
equal deleted inserted replaced
337:18d5affa790d 338:e976b187d73a
629 | DExport _ => S.return2 dAll 629 | DExport _ => S.return2 dAll
630 | DTable (x, n, c, s) => 630 | DTable (x, n, c, s) =>
631 S.map2 (mfc ctx c, 631 S.map2 (mfc ctx c,
632 fn c' => 632 fn c' =>
633 (DTable (x, n, c', s), loc)) 633 (DTable (x, n, c', s), loc))
634 | DSequence _ => S.return2 dAll
634 | DDatabase _ => S.return2 dAll 635 | DDatabase _ => S.return2 dAll
635 636
636 and mfvi ctx (x, n, t, e, s) = 637 and mfvi ctx (x, n, t, e, s) =
637 S.bind2 (mfc ctx t, 638 S.bind2 (mfc ctx t,
638 fn t' => 639 fn t' =>
714 foldl (fn ((x, n, t, e, s), ctx) => bind (ctx, NamedE (x, n, t, NONE, s))) 715 foldl (fn ((x, n, t, e, s), ctx) => bind (ctx, NamedE (x, n, t, NONE, s)))
715 ctx vis 716 ctx vis
716 | DExport _ => ctx 717 | DExport _ => ctx
717 | DTable (x, n, c, s) => 718 | DTable (x, n, c, s) =>
718 let 719 let
719 val t = (CApp ((CFfi ("Basis", "table"), #2 d'), c), #2 d') 720 val t = (CApp ((CFfi ("Basis", "sql_table"), #2 d'), c), #2 d')
721 in
722 bind (ctx, NamedE (x, n, t, NONE, s))
723 end
724 | DSequence (x, n, s) =>
725 let
726 val t = (CFfi ("Basis", "sql_sequence"), #2 d')
720 in 727 in
721 bind (ctx, NamedE (x, n, t, NONE, s)) 728 bind (ctx, NamedE (x, n, t, NONE, s))
722 end 729 end
723 | DDatabase _ => ctx 730 | DDatabase _ => ctx
724 in 731 in
768 | DDatatype (_, n, _, _) => Int.max (n, count) 775 | DDatatype (_, n, _, _) => Int.max (n, count)
769 | DVal (_, n, _, _, _) => Int.max (n, count) 776 | DVal (_, n, _, _, _) => Int.max (n, count)
770 | DValRec vis => foldl (fn ((_, n, _, _, _), count) => Int.max (n, count)) count vis 777 | DValRec vis => foldl (fn ((_, n, _, _, _), count) => Int.max (n, count)) count vis
771 | DExport _ => count 778 | DExport _ => count
772 | DTable (_, n, _, _) => Int.max (n, count) 779 | DTable (_, n, _, _) => Int.max (n, count)
780 | DSequence (_, n, _) => Int.max (n, count)
773 | DDatabase _ => count) 0 781 | DDatabase _ => count) 0
774 782
775 end 783 end
776 784
777 end 785 end