Version française
Home     About     Download     Resources     Contact us    
Browse thread
Order in type definitions, output_value on abstract values
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Pascal Brisset <brisset@r...>
Subject: Order in type definitions, output_value on abstract values

Two non related questions about Ocaml 1.05, one about type
signatures and one about a low-level implementation detail:

 - Why the order of labels and constructors in type definition is
relevant ?

# module M : sig type t = A | B end =
    struct type t = B | A end;;
Signature mismatch:
...
# module M : sig type t = {a : int; b : int} end =
    struct type t = {b : int; a : int} end;;
Signature mismatch:
...

 - Why is it not possible to output_value an abstract value if it is atomic ?

# output_value stdout (Hashtbl.create 1);;
¦¾ C@- : unit = ()
# output_value stdout stdout;;
Uncaught exception: Invalid_argument("output_value: abstract value")

--Pascal Brisset