Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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]

Imagine I have a file named containing

> module C = struct
>   include B
> end

and a file named 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