From dda7d129dba6c90d642cd99cd989e5f13c0eb4b4 Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Wed, 3 Jul 2019 12:54:37 +0200 Subject: [core] [api] Support OCaml 4.08 The changes are large due to `Pervasives` deprecation: - the `Pervasives` module has been deprecated in favor of `Stdlib`, we have opted for introducing a few wrapping functions in `Util` and just unqualified the rest of occurrences. We avoid the shims as in the previous attempt. - a bug regarding partial application have been fixed. - some formatting functions have been deprecated, but previous versions don't include a replacement, thus the warning has been disabled. We may want to clean up things a bit more, in particular w.r.t. modules once we can move to OCaml 4.07 as the minimum required version. Note that there is a clash between 4.08.0 modules `Option` and `Int` and Coq's ones. It is not clear if we should resolve that clash or not, see PR #10469 for more discussion. On the good side, OCaml 4.08.0 does provide a few interesting functionalities, including nice new warnings useful for devs. --- plugins/micromega/sos_lib.ml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins/micromega/sos_lib.ml') diff --git a/plugins/micromega/sos_lib.ml b/plugins/micromega/sos_lib.ml index e3a9f6f60f..58d5d7ecf1 100644 --- a/plugins/micromega/sos_lib.ml +++ b/plugins/micromega/sos_lib.ml @@ -13,7 +13,7 @@ open Num (* Comparisons that are reflexive on NaN and also short-circuiting. *) (* ------------------------------------------------------------------------- *) -let cmp = Pervasives.compare (** FIXME *) +let cmp = compare (** FIXME *) let (=?) = fun x y -> cmp x y = 0;; let ( cmp x y < 0;; @@ -491,21 +491,21 @@ let temp_path = Filename.get_temp_dir_name ();; (* ------------------------------------------------------------------------- *) let strings_of_file filename = - let fd = try Pervasives.open_in filename + let fd = try open_in filename with Sys_error _ -> failwith("strings_of_file: can't open "^filename) in let rec suck_lines acc = - try let l = Pervasives.input_line fd in + try let l = input_line fd in suck_lines (l::acc) with End_of_file -> List.rev acc in let data = suck_lines [] in - (Pervasives.close_in fd; data);; + (close_in fd; data);; let string_of_file filename = String.concat "\n" (strings_of_file filename);; let file_of_string filename s = - let fd = Pervasives.open_out filename in + let fd = open_out filename in output_string fd s; close_out fd;; -- cgit v1.2.3