> Sébastien Hinderer [Fri, 8 Apr 2005]: > Dear all, > > (How) is it possible to include syntactically a file a.ml in a file > b.ml ? > > One method that seems to w)rk is to rename b.ml to b.ml.c, > and then have in b.ml.c a line saying > #include "a.ml" > And with this, gcc -E b.ml.c > b.ml > produces a file that ocamlc can apparently handle. > > But is this considered a good solution, not really : IIRC ocaml doesn't follow the same syntactic conventions as C and the C preprocessor could report errors on valid caml code > or is some better solution available ? you could use camlp4 : the attached syntax extension does this. (Mind that it works only for parsing, the printer apparently gets confused). -- Olivier