let b = v1 <> mql_false in
if b && v2 <> mql_false then mql_false else
if b then v1 else v2
+
+(* numeric operations *******************************************************)
+
+exception NumberError of MathQL.result
+
+let int_of_set r =
+ try match r with
+ | [s, _] -> MQueryUtil.int_of_string s
+ | _ -> raise (Failure "int_of_string")
+ with Failure "int_of_string" -> raise (NumberError r)