]> matita.cs.unibo.it Git - helm.git/commitdiff
Whithout List.hd error
authornatile <??>
Wed, 2 Oct 2002 16:28:43 +0000 (16:28 +0000)
committernatile <??>
Wed, 2 Oct 2002 16:28:43 +0000 (16:28 +0000)
helm/ocaml/mathql_interpreter/mqint.ml

index 89c180abeed619cd3d507f2da64aa8e180260eb9..ba7d0713a592a3fd7b7a034d44ff833e45d465be 100644 (file)
@@ -329,9 +329,12 @@ and exec_boole_exp c = function
 and exec_val_exp c = function
    | MathQL.Const x -> let ol = List.sort compare x in 
                        let rec edup = function
+                       
                           [] -> [] 
-                        | s::tl -> if s = (List.hd tl) then edup tl
-                                   else s::(edup tl)
+                        | s::tl -> if tl <> [] then  
+                                                if s = (List.hd tl) then edup tl
+                                                else s::(edup tl)
+                                   else s::[]
                        in
                         edup ol
    | MathQL.Record (rvar, vvar) -> List.assoc vvar (List.assoc rvar c.groups)