From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA02273; Wed, 15 Jan 2003 18:50:43 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA02633 for caml-list@pauillac.inria.fr; Wed, 15 Jan 2003 18:50:43 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA01263 for ; Wed, 15 Jan 2003 17:59:53 +0100 (MET) Received: from wptx49.physik.uni-wuerzburg.de (wptx49.physik.uni-wuerzburg.de [132.187.40.49]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h0FGxqr12825 for ; Wed, 15 Jan 2003 17:59:52 +0100 (MET) Received: from wptx47.physik.uni-wuerzburg.de (wptx47.physik.uni-wuerzburg.de [132.187.40.47]) by wptx49.physik.uni-wuerzburg.de (8.10.0/8.10.0.Beta6) with ESMTP id h0FGxn507398; Wed, 15 Jan 2003 17:59:49 +0100 (MET) Received: (from ohl@localhost) by wptx47.physik.uni-wuerzburg.de (8.10.0.Beta12/8.10.0.Beta12) id h0FGxnC24563; Wed, 15 Jan 2003 17:59:49 +0100 From: Thorsten Ohl Message-ID: <15909.37765.318147.247156@wptx47.physik.uni-wuerzburg.de> Date: Wed, 15 Jan 2003 17:59:49 +0100 To: Julien Signoles Cc: caml-list@inria.fr Subject: [Caml-list] Re: Legality of using module types from .mli in .ml In-Reply-To: <3E258C30.9999165E@lri.fr> References: <15908.25011.52235.354636@wptx47.physik.uni-wuerzburg.de> <3E258C30.9999165E@lri.fr> X-Mailer: VM 6.84 under Emacs 20.7.1 Reply-To: ohl@physik.uni-wuerzburg.de Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Julien Signoles writes: > The previous example doesn't break my defunctorizer : > > $ ocamldefun --version > 1.02 > $ ocamldefun a.mli a.ml > $ cat a.ml > module type T = A.T > module M = struct let n = 42 end > > That's ok (normal because a.mli is still in the ocamldefun environment > when a.ml is defunctorized)... The O'Caml compiler will later not be able to resolve A.T if you use the `-d' option: ohl@wptx47:~misc$ ocamldefun -v 1.02 ohl@wptx47:~misc$ cat a.mli module type T = sig val n : int end module M : T ohl@wptx47:~misc$ cat a.ml module type T = A.T module M : T = struct let n = 42 end ohl@wptx47:~misc$ ocamldefun -d defun a.mli a.ml ohl@wptx47:~misc$ cd defun/ ohl@wptx47:~defun$ ls a.cmd a.ml ohl@wptx47:~defun$ cat a.ml module type T = A.T module M = struct let n = 42 end ohl@wptx47:~defun$ ocamlopt a.ml File "a.ml", line 1, characters 16-19: Unbound module type A.T I could ignore appendix B of the manual and create a a.cmi: ohl@wptx47:~defun$ cp ../a.mli . ohl@wptx47:~defun$ ocamlc a.mli ohl@wptx47:~defun$ ocamlopt a.ml but I'm not supposed to do that, am I? BTW: given the (currently) uncertain semantics, I have started to remove the construct from my applications. -- Thorsten Ohl, Physics Dept., Wuerzburg Univ. -- ohl@physik.uni-wuerzburg.de http://theorie.physik.uni-wuerzburg.de/~ohl/ [<=== PGP public key here] ------------------- 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