module Generic_util_obj:sig
..end
Unless marked otherwise, all functions are safe in the sense that
they will not cause a segfault. Please report a bug otherwise.
val dup_if_block : Obj.t -> Obj.t
type
tag =
| |
Constructor of |
| |
Lazy |
| |
Closure |
| |
Object |
| |
Infix |
| |
Forward |
| |
Abstract |
| |
String |
| |
Double |
| |
Double_array |
| |
Custom |
| |
Unaligned |
| |
Out_of_heap |
| |
Int |
Generic_util_obj.tag
that is more descriptive.type
obj =
| |
Int of |
| |
Block of |
val view : Obj.t -> obj
val tag_view : int -> tag
Obj.tag
to a more descriptive type.Invalid_argument
when the integer is not one of the known tag.typecon_id =
bool * int
Generic_util_obj.con_id
val con_id : 'a -> con_id
con_id
.
The function doesn't discriminate the constructors of
extensible variants.val is_con : Obj.t -> bool
val gsize : Obj.t -> int
0
for an immediate
value.val fields_all2 : (Obj.t -> Obj.t -> bool) -> Obj.t -> Obj.t -> bool
fields_all p x y
holds iff x
and y
are both be block of the same size,
and the binary predicate p
holds for all their fields:
fields_all2 p x y <==> forall i . p (x.i, y.i)
val listify : Obj.t -> Obj.t
(x0,...xn)
,
computes a nested product (x0, (x1, (..., xn) ...))
Invalid_argument
if the argument is not a tuple (a block with tag zero).val is_ext_con : Obj.t -> bool
val ext_con : Obj.t -> Obj.t
Invalid_argument
when the value is not an extensible variant.
Property. is_ext_con (ext_con x)
val ext_con_name : Obj.t -> string
Invalid_argument
when the value is not an extensile variant.val ext_con_id : Obj.t -> int
Invalid_argument
when the value is not an extensile variant.val poly_hash : 'a -> int
Invalid_argument
if the argument is not a polymorphic variantval custom_identifier : 'a -> string