aboutsummaryrefslogtreecommitdiffstats
path: root/caml/Camlcoq.ml
diff options
context:
space:
mode:
Diffstat (limited to 'caml/Camlcoq.ml')
-rw-r--r--caml/Camlcoq.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/caml/Camlcoq.ml b/caml/Camlcoq.ml
index 80ac5c0f..b0bb4ff9 100644
--- a/caml/Camlcoq.ml
+++ b/caml/Camlcoq.ml
@@ -19,6 +19,10 @@ let camlint_of_z = function
let camlint_of_coqint : Integers.int -> int32 = camlint_of_z
+let rec camlint_of_nat = function
+ | O -> 0
+ | S n -> camlint_of_nat n + 1
+
let rec nat_of_camlint n =
assert (n >= 0l);
if n = 0l then O else S (nat_of_camlint (Int32.sub n 1l))
@@ -57,7 +61,7 @@ let extern_atom a =
try
Hashtbl.find string_of_atom a
with Not_found ->
- "<unknown atom>"
+ Printf.sprintf "<unknown atom %ld>" (camlint_of_positive a)
(* Lists *)