diff options
author | letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2013-10-24 21:29:41 +0000 |
---|---|---|
committer | letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2013-10-24 21:29:41 +0000 |
commit | 6da011a8677676462b24940a6171fb22615c3fbb (patch) | |
tree | 0df385cc8b8d72b3465d7745d2b97283245c7ed5 /library/goptions.ml | |
parent | 133a2143413a723d1d4e3dead5ffa8458f61afa8 (diff) |
More monomorphic List.mem + List.assoc + ...
To reduce the amount of syntactic noise, we now provide
a few inner modules Int.List, Id.List, String.List, Sorts.List
which contain some monomorphic (or semi-monomorphic) functions
such as mem, assoc, ...
NB: for Int.List.mem and co we reuse List.memq and so on.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16936 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'library/goptions.ml')
-rw-r--r-- | library/goptions.ml | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/library/goptions.ml b/library/goptions.ml index 87c387080..7ceac2f6a 100644 --- a/library/goptions.ml +++ b/library/goptions.ml @@ -60,7 +60,7 @@ module MakeTable = let nick = nickname A.key let _ = - if List.mem_assoc nick !A.table then + if String.List.mem_assoc nick !A.table then error "Sorry, this table name is already used." module MySet = Set.Make (struct type t = A.t let compare = compare end) @@ -121,7 +121,7 @@ module MakeTable = let string_table = ref [] -let get_string_table k = List.assoc_f String.equal (nickname k) !string_table +let get_string_table k = String.List.assoc (nickname k) !string_table module type StringConvertArg = sig @@ -150,7 +150,7 @@ module MakeStringTable = let ref_table = ref [] -let get_ref_table k = List.assoc_f String.equal (nickname k) !ref_table +let get_ref_table k = String.List.assoc (nickname k) !ref_table module type RefConvertArg = sig @@ -210,8 +210,8 @@ let check_key key = try let _ = get_option key in error "Sorry, this option name is already used." with Not_found -> - if List.mem_assoc (nickname key) !string_table - || List.mem_assoc (nickname key) !ref_table + if String.List.mem_assoc (nickname key) !string_table + || String.List.mem_assoc (nickname key) !ref_table then error "Sorry, this option name is already used." open Libobject |