Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Legality of using module types from .mli in .ml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Brown <caml-list@d...>
Subject: Re: [Caml-list] Re: Legality of using module types from .mli in .ml
On Wed, Jan 15, 2003 at 06:37:33PM +0100, Julien Signoles wrote:
> >     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

Would it no work to

  ~misc$ ocamlc -c a.mli
  ~misc$ cd defun/
  ~misc$ ocamlopt -c -I .. a.ml

Dave Brown
-------------------
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