git.annexia.org
/
goals.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
utils: Add unique () function.
[goals.git]
/
src
/
utils.ml
diff --git
a/src/utils.ml
b/src/utils.ml
index
50adfb4
..
3d1b0c5
100644
(file)
--- a/
src/utils.ml
+++ b/
src/utils.ml
@@
-24,6
+24,8
@@
let failwithf fs = ksprintf failwith fs
let (//) = Filename.concat
let is_directory d = try Sys.is_directory d with Sys_error _ -> false
+let unique = let i = ref 0 in fun () -> incr i; !i
+
(* From OCaml 4.08 sources. We can remove this when we can
* depend on min OCaml 4.08.
*)