Dear Gabriel,

 

The current implementation happens to allow them, but this does not mean that they are "valid programs".

I see what you mean: since I can’t put both modules into a single file without changing the two let into let rec / and or using recursive modules, it is not valid OCaml, although the compiler accepts it if presented separately.

 

Let me see what I can do here. The mutual dependent part is a large part of both modules so it wouldn’t be very nice to put them into one file. But if it is the only option to get a valid OCaml program, I will look into it.

 

Still I think it is unfortunate that OCaml doesn’t support this. It makes it harder to structure software in an aspect oriented way. For simple data structures it is fine to bundle all aspects into a single module or file. For a data structure like a C AST, the module / file will get quite large. I can separate off the statements easily, but this is only a small part of the AST. The largest part are expressions and types, and these are recursively dependent on each other.

 

Best regards,

 

Michael

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928