Version française
Home     About     Download     Resources     Contact us    
Browse thread
Including code from a .cm[ox] into another .cm[ox]
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Guillaume Yziquel <guillaume.yziquel@c...>
Subject: Including code from a .cm[ox] into another .cm[ox]
Hello.

Imagine I have a file named a.ml containing

> module C = struct
>   include B
> end

and a file named b.ml containing the code

> let f x = x + 1

When I compile everything to .cmo files, I cannot load a.cmo from the 
toplevel without loading b.cmo beforehand.

Is there a way to make the 'include B' statement to include the code of 
the B module in the C submodule directly so that it is not required to 
load the b.cmo file before loading the a.cmo file?

That would be extremely useful to me...

All the best,

-- 
      Guillaume Yziquel
http://yziquel.homelinux.org/