aboutsummaryrefslogtreecommitdiff
path: root/interp
diff options
context:
space:
mode:
authorppedrot2013-06-12 21:07:40 +0000
committerppedrot2013-06-12 21:07:40 +0000
commitbea2a4f5fe5cab0abfc27492117c335a311a0c19 (patch)
treebbc934b7c6e0eb9baddf757b7f54d86776653f5d /interp
parent781f44a18cb5e2adbd0b2201d435e27938761af7 (diff)
Changing the type of Ltac values. Now they are toplevel generic
arguments. That way we will be able to define interpretation of tactics without referring to tactic values. Quite ad-hoc for now. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16574 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'interp')
-rw-r--r--interp/genarg.ml2
-rw-r--r--interp/genarg.mli4
2 files changed, 6 insertions, 0 deletions
diff --git a/interp/genarg.ml b/interp/genarg.ml
index eb5287b323..f9b5bee0a4 100644
--- a/interp/genarg.ml
+++ b/interp/genarg.ml
@@ -197,6 +197,8 @@ let app_pair f1 f2 = function
(u, Obj.repr (o1,o2))
| _ -> failwith "Genarg: not a pair"
+let has_type (t, v) u = argument_type_eq t u
+
let unquote x = x
type an_arg_of_this_type = Obj.t
diff --git a/interp/genarg.mli b/interp/genarg.mli
index 7f9d39907c..4f5dea7ec0 100644
--- a/interp/genarg.mli
+++ b/interp/genarg.mli
@@ -161,6 +161,10 @@ val out_gen : ('a, 'co) abstract_argument_type -> 'co generic_argument -> 'a
(** [out_gen t x] recovers an argument of type [t] from a generic argument. It
fails if [x] has not the right dynamic type. *)
+val has_type : 'co generic_argument -> ('a, 'co) abstract_argument_type -> bool
+(** [has_type v t] tells whether [v] has type [t]. If true, it ensures that
+ [out_gen t v] will not raise a dynamic type exception. *)
+
(** {6 Manipulation of generic arguments}
Those functions fail if they are applied to an argument which has not the right