For a toplevel, it can't manipulate functions in a .cmo without the
corresponding .cmi file being accessible in the path.
This is a design decision, since both ocaml, ocamlc, and ocamlopt
require the information present in the .cmi files -- which is all the
typing information, etc.
Since the toplevel needs type information, it needs the cmi. I'm not
currently aware of any way around that limitation.
Jonathan
On 1/28/07, roparzhhemon < roparzhhemon%40yahoo.com.br">roparzhhemon
yahoo.com.br> wrote:
> Hello all,
>
> in principle a module whose .cmo file is in a faraway directory
> should be treated no different from the other modules, as long
> as you provide the the OCaml compiler with the
> correct path. I have
> this problem, however :
>
> Say that the files MyMod.ml, MyMod.cmi and MyMod.cmo
> are in the subdirectory Special_dir/. Now, if I launch my
> customized toplevel defined with ocmalmktop (which
> includes Special_dir/MyMod.cmo in its definition),
>
> (1) It does not know about the MyMod module. (The
> module "MyMod" is unbound).
>
> (2) However, if I type
>
> #load "Special_dir/MyMod.cmo",
>
> the compiler does not complain. (but
> MyMod is still unbound after that!) This means that
> it found the .cmo file and read it correctly, right ?
>
> Ewan
>
>
>
>
>
> Archives up to November 11, 2006 are also downloadable at http://www.connettivo.net/cntprojects/ocaml_beginners/
> The archives of the very official ocaml list (the seniors' one) can be found at http://caml.inria.fr
> Attachments are banned and you're asked to be polite, avoid flames etc.
> Yahoo! Groups Links
>
>
>
>
.