Version française
Home     About     Download     Resources     Contact us    
Browse thread
Nesting Modules
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Oliver Bandel <oliver@f...>
Subject: Re: [Caml-list] Nesting Modules
On Tue, Nov 01, 2005 at 10:59:27AM -0600, Tom Hawkins wrote:
> Is it possible to nest modules defined in separate files?
> 
> For example, assume I have...
> 
>   top.ml
>   top.mli
>   bottom.ml
>   bottom.mli
> 

Do you look for something like this:

##############################################################
first:~/Programmierung/includes-in-ocaml oliver$ cat top.ml
let a = "Haha, I'm in top!"

module Bottom = struct include Bottom let c = "oiuh" end

first:~/Programmierung/includes-in-ocaml oliver$ cat bottom.ml
let b = "hello, this is the bottom!"
first:~/Programmierung/includes-in-ocaml oliver$ ocamlc -c bottom.ml
first:~/Programmierung/includes-in-ocaml oliver$ ocamlc -c top.ml   
first:~/Programmierung/includes-in-ocaml oliver$ ocamlc -i top.ml
val a : string
module Bottom : sig val b : string val c : string end
first:~/Programmierung/includes-in-ocaml oliver$ 
##############################################################

???

Ciao,
   Oliver