-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get rid of stdcompat
#1191
Get rid of stdcompat
#1191
Conversation
30f1171
to
ead131b
Compare
We do not need to use `stdcompat` because we only need to support few new functions from `stdlib`. This PR removes the `stdcompat` dependency and create a new module `compat` which contains all the functions we need to compile on OCaml 4.08. I also rename `Lists` to `my_list` and `myUnix` to `my_unix` and now `my_list` only contains extra functions (which are not part of any stdlib versions).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You asked for review but kept the PR as draft, is this intended?
Looks fine overall.
src/bin/common/parse_command.ml
Outdated
@@ -462,13 +462,13 @@ let mk_theory_opt () no_contracongru | |||
no_fm no_nla no_tcp no_theory restricted tighten_vars | |||
_use_fpa (theories) | |||
= | |||
set_no_ac (not (Lists.mem Theories.equal Theories.AC theories)); | |||
set_no_ac (not (My_list.mem Theories.equal Theories.AC theories)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I think we could get rid of My_list.mem
everywhere with List.exists (Theories.equal Theories.AC) theories
. Not sure we want to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
src/lib/reasoners/records.ml
Outdated
@@ -322,7 +322,7 @@ module Shostak (X : ALIEN) = struct | |||
| Record (lbs, ty) -> | |||
Record (List.map (fun (n,e') -> n, subst_access x s e') lbs, ty) | |||
| Access (lb, e', _) when compare_mine x e' = 0 -> | |||
Lists.assoc Uid.equal lb s | |||
Compat.List.assoc Uid.equal lb s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compat.List.assoc Uid.equal lb s | |
My_list.assoc Uid.equal lb s |
src/lib/util/my_list.ml
Outdated
(* The Alt-Ergo theorem prover *) | ||
(* *) | ||
(* Sylvain Conchon, Evelyne Contejean, Francois Bobot *) | ||
(* Mohamed Iguernelala, Stephane Lescuyer, Alain Mebsout *) | ||
(* *) | ||
(* CNRS - INRIA - Universite Paris Sud *) | ||
(* *) | ||
(* --------------------------------------------------------------- *) | ||
(* *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to stay since we simply rename the file while keeping the existing code.
src/lib/util/my_list.mli
Outdated
(* CNRS - INRIA - Universite Paris Sud *) | ||
(* *) | ||
(* --------------------------------------------------------------- *) | ||
(* *) | ||
(* More details can be found in the directory licenses/ *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, needs to stay.
src/lib/util/my_list.mli
Outdated
(** Lists utilies | ||
|
||
This modules defines some helper functions on lists | ||
*) | ||
|
||
(** {3 Misc functions} *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove this?
src/lib/util/compat.ml
Outdated
end | ||
|
||
module Bytes = struct | ||
include Bytes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would argue it would be better to do open Bytes
at the beginning of the module, and include Bytes
at the end (with [@@@ocaml.warning "-32-33"]
at the top of the file). This way, we would use the stdlib version when it is available and only fall back to our version if its not.
(Same for the List
, Array
, etc. in this module)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was looking for such trick in fact, thanks :)
The syntax used for silencing warning in OCamlPro#1191 is incorrect.
The syntax used for silencing warning in #1191 is incorrect.
The syntax used for silencing warning in OCamlPro#1191 is incorrect.
We do not need to use
stdcompat
because we only need to support few new functions fromstdlib
. This PR removes thestdcompat
dependency and create a new modulecompat
which contains all the functions we need to compile on OCaml 4.08.I also rename
Lists
tomy_list
andmyUnix
tomy_unix
and nowmy_list
only contains extra functions (which are not part of any stdlib versions).