summaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorFrançois Bobot <francois.bobot@cea.fr>2015-12-01 13:44:48 +0100
committerFrançois Bobot <francois.bobot@cea.fr>2016-01-25 08:33:55 +0100
commit9e85e6cb4db03d358de7fa690b19067ebd6c1f1e (patch)
tree23fc246a4dcde230fdef18b8a9364f0151c68535 /stdlib
parentdeb94edc0d7dfd701fc630122901700fd4f144da (diff)
downloadocaml-9e85e6cb4db03d358de7fa690b19067ebd6c1f1e.tar.gz
[Stdlib] Rename Obj.Ephemeron.eph in .t
An ugly obj_t is needed for the shadowing of Obj.t
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/ephemeron.ml6
-rw-r--r--stdlib/obj.ml30
-rw-r--r--stdlib/obj.mli33
3 files changed, 37 insertions, 32 deletions
diff --git a/stdlib/ephemeron.ml b/stdlib/ephemeron.ml
index 40a32bcae6..d4be722c27 100644
--- a/stdlib/ephemeron.ml
+++ b/stdlib/ephemeron.ml
@@ -338,7 +338,7 @@ let obj_opt : Obj.t option -> 'a option = fun x -> Obj.magic x
module K1 = struct
- type ('k,'d) t = ObjEph.eph
+ type ('k,'d) t = ObjEph.t
let create () : ('k,'d) t = ObjEph.create 1
@@ -394,7 +394,7 @@ module K1 = struct
end
module K2 = struct
- type ('k1, 'k2, 'd) t = ObjEph.eph
+ type ('k1, 'k2, 'd) t = ObjEph.t
let create () : ('k1,'k2,'d) t = ObjEph.create 1
@@ -479,7 +479,7 @@ module K2 = struct
end
module Kn = struct
- type ('k,'d) t = ObjEph.eph
+ type ('k,'d) t = ObjEph.t
let create n : ('k,'d) t = ObjEph.create n
let length (k:('k,'d) t) : int = ObjEph.length k
diff --git a/stdlib/obj.ml b/stdlib/obj.ml
index 8ca39a72ba..4777f584e0 100644
--- a/stdlib/obj.ml
+++ b/stdlib/obj.ml
@@ -82,26 +82,28 @@ let extension_id (slot : extension_constructor) =
(obj (field (repr slot) 1) : int)
module Ephemeron = struct
- type eph (** ephemeron *)
+ type obj_t = t
- external create: int -> eph = "caml_ephe_create"
+ type t (** ephemeron *)
+
+ external create: int -> t = "caml_ephe_create"
let length x = size(repr x) - 2
- external get_key: eph -> int -> t option = "caml_ephe_get_key"
- external get_key_copy: eph -> int -> t option = "caml_ephe_get_key_copy"
- external set_key: eph -> int -> t -> unit = "caml_ephe_set_key"
- external unset_key: eph -> int -> unit = "caml_ephe_unset_key"
- external check_key: eph -> int -> bool = "caml_ephe_check_key"
- external blit_key : eph -> int -> eph -> int -> int -> unit
+ external get_key: t -> int -> obj_t option = "caml_ephe_get_key"
+ external get_key_copy: t -> int -> obj_t option = "caml_ephe_get_key_copy"
+ external set_key: t -> int -> obj_t -> unit = "caml_ephe_set_key"
+ external unset_key: t -> int -> unit = "caml_ephe_unset_key"
+ external check_key: t -> int -> bool = "caml_ephe_check_key"
+ external blit_key : t -> int -> t -> int -> int -> unit
= "caml_ephe_blit_key"
- external get_data: eph -> t option = "caml_ephe_get_data"
- external get_data_copy: eph -> t option = "caml_ephe_get_data_copy"
- external set_data: eph -> t -> unit = "caml_ephe_set_data"
- external unset_data: eph -> unit = "caml_ephe_unset_data"
- external check_data: eph -> bool = "caml_ephe_check_data"
- external blit_data : eph -> eph -> unit = "caml_ephe_blit_data"
+ external get_data: t -> obj_t option = "caml_ephe_get_data"
+ external get_data_copy: t -> obj_t option = "caml_ephe_get_data_copy"
+ external set_data: t -> obj_t -> unit = "caml_ephe_set_data"
+ external unset_data: t -> unit = "caml_ephe_unset_data"
+ external check_data: t -> bool = "caml_ephe_check_data"
+ external blit_data : t -> t -> unit = "caml_ephe_blit_data"
end
diff --git a/stdlib/obj.mli b/stdlib/obj.mli
index 1fcd155992..23943f8421 100644
--- a/stdlib/obj.mli
+++ b/stdlib/obj.mli
@@ -89,38 +89,41 @@ val unmarshal : bytes -> int -> t * int
module Ephemeron: sig
(** Ephemeron with arbitrary arity and untyped *)
- type eph
+ type obj_t = t
+ (** alias for {!Obj.t} *)
+
+ type t
(** an ephemeron cf {!Ephemeron} *)
- val create: int -> eph
+ val create: int -> t
(** [create n] returns an ephemeron with [n] keys.
All the keys and the data are initially empty *)
- val length: eph -> int
+ val length: t -> int
(** return the number of keys *)
- val get_key: eph -> int -> t option
+ val get_key: t -> int -> obj_t option
(** Same as {!Ephemeron.K1.get_key} *)
- val get_key_copy: eph -> int -> t option
+ val get_key_copy: t -> int -> obj_t option
(** Same as {!Ephemeron.K1.get_key_copy} *)
- val set_key: eph -> int -> t -> unit
+ val set_key: t -> int -> obj_t -> unit
(** Same as {!Ephemeron.K1.set_key} *)
- val unset_key: eph -> int -> unit
+ val unset_key: t -> int -> unit
(** Same as {!Ephemeron.K1.unset_key} *)
- val check_key: eph -> int -> bool
+ val check_key: t -> int -> bool
(** Same as {!Ephemeron.K1.check_key} *)
- val blit_key : eph -> int -> eph -> int -> int -> unit
+ val blit_key : t -> int -> t -> int -> int -> unit
(** Same as {!Ephemeron.K1.blit_key} *)
- val get_data: eph -> t option
+ val get_data: t -> obj_t option
(** Same as {!Ephemeron.K1.get_data} *)
- val get_data_copy: eph -> t option
+ val get_data_copy: t -> obj_t option
(** Same as {!Ephemeron.K1.get_data_copy} *)
- val set_data: eph -> t -> unit
+ val set_data: t -> obj_t -> unit
(** Same as {!Ephemeron.K1.set_data} *)
- val unset_data: eph -> unit
+ val unset_data: t -> unit
(** Same as {!Ephemeron.K1.unset_data} *)
- val check_data: eph -> bool
+ val check_data: t -> bool
(** Same as {!Ephemeron.K1.check_data} *)
- val blit_data : eph -> eph -> unit
+ val blit_data : t -> t -> unit
(** Same as {!Ephemeron.K1.blit_data} *)
end