fixed OCaml bug
authorhaftmann
Mon Aug 13 21:22:40 2007 +0200 (2007-08-13)
changeset 24251ae3eb1766e56
parent 24250 c59c09b09794
child 24252 4eb5bc6af008
fixed OCaml bug
src/Tools/code/code_target.ML
     1.1 --- a/src/Tools/code/code_target.ML	Mon Aug 13 21:22:39 2007 +0200
     1.2 +++ b/src/Tools/code/code_target.ML	Mon Aug 13 21:22:40 2007 +0200
     1.3 @@ -687,11 +687,12 @@
     1.4                | fillup_parm x (i, NONE) = x ^ string_of_int i;
     1.5              fun fish_parms vars eqs =
     1.6                let
     1.7 -                val raw_fished = fold (map2 fish_parm) eqs (replicate (length (hd eqs)) NONE);
     1.8 -                val x = Name.variant (map_filter I raw_fished) "x";
     1.9 -                val fished = map_index (fillup_parm x) raw_fished;
    1.10 -                val vars' = CodeName.intro_vars fished vars;
    1.11 -              in map (CodeName.lookup_var vars') fished end;
    1.12 +                val fished1 = fold (map2 fish_parm) eqs (replicate (length (hd eqs)) NONE);
    1.13 +                val x = Name.variant (map_filter I fished1) "x";
    1.14 +                val fished2 = map_index (fillup_parm x) fished1;
    1.15 +                val fished3 = fold_rev (fn x => fn xs => Name.variant xs x :: xs) fished2 [];
    1.16 +                val vars' = CodeName.intro_vars fished3 vars;
    1.17 +              in map (CodeName.lookup_var vars') fished3 end;
    1.18              fun pr_eq (ts, t) =
    1.19                let
    1.20                  val consts = map_filter