let cast_to_integer value = match value with | RIntegerValue(i) -> i | _ -> raise (EInvalidCast (string_of_value_type value,"integer"))