Order in type definitions, output_value on abstract values

From: Pascal Brisset (brisset@recherche.enac.fr)
Date: Tue Jul 22 1997 - 10:01:35 MET DST


Message-Id: <199707220801.KAA04834@indigo.recherche.enac.fr>
Date: Tue, 22 Jul 1997 10:01:35 +0200
From: Pascal Brisset <brisset@recherche.enac.fr>
To: caml-list@inria.fr
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



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:11 MET