Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] what does this mean?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nicolas barnier <barnier@r...>
Subject: Re: [Caml-list] what does this mean?
Garry Hodgson wrote:
> 
> no, i hadn't thought of that.  works fine now.  thanks!

After thinking about it, I figured out a better explanation for
this restriction. Suppose you have the following code:

let h = Hashtbl.create 10

module M = (struct
  type t = A
  let _ = Hashtbl.add h 0 A
end : sig end)

let t = Hashtbl.get h 0

then type t would be visible outside M, whereas module M,
restricted by its signature, does not export it. I think this
is the meaning of the error message: "The type constructor t
would escape its scope". So it rather is a safe restriction.

Regards

-- Nicolas
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners