caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] An elementary question about ocamlmktop
@ 2002-11-28  7:44 Ching-Tsun Chou
  2002-11-30 19:28 ` Chris Hecker
  0 siblings, 1 reply; 2+ messages in thread
From: Ching-Tsun Chou @ 2002-11-28  7:44 UTC (permalink / raw)
  To: caml-list


I'm sure this question of mine has a simple answer, but, alas, I
couldn't figure it out myself after many trials!

Suppose I have a subdirectory "zzz" under my home directory which
contains a file "foo.ml" whose content is:

$ cat zzz/foo.ml

let hello () = Printf.printf "Hello, world!\n"

where "$ " is the shell prompt.  Now I do the following:

$ cd zzz
$ ocamlmktop foo.ml -o foo
$ ./foo 
        Objective Caml version 3.06

# Foo.hello () ;;
Hello, world!
- : unit = ()

So far, so good.  But now I do the following:

$ cd
$ zzz/foo
        Objective Caml version 3.06

# Foo.hello () ;;
Characters 0-9:
  Foo.hello () ;;
  ^^^^^^^^^
Unbound value Foo.hello

I think the problem is that ocamlrun can't find "foo.cmi", since the
same problem occurs even in "zzz" if "foo.cmi" is removed (removing
"foo.cmo" apparently has no effect).  However, if I do:

$ zzz/foo -I ~/zzz
        Objective Caml version 3.06

# Foo.hello () ;;
Hello, world!
- : unit = ()

then everything works again (assuming "zzz/foo.cmi" is still there).

My question is: Is there any way to generate a toplevel "foo" that
contains the information in "foo.cmi", so that it can (so to speak)
exists by itself?

Many thanks in advance!

- Ching Tsun
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] An elementary question about ocamlmktop
  2002-11-28  7:44 [Caml-list] An elementary question about ocamlmktop Ching-Tsun Chou
@ 2002-11-30 19:28 ` Chris Hecker
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Hecker @ 2002-11-30 19:28 UTC (permalink / raw)
  To: Ching-Tsun Chou, caml-list


>My question is: Is there any way to generate a toplevel "foo" that
>contains the information in "foo.cmi", so that it can (so to speak)
>exists by itself?

Nope, not right now.  This is a problem for dynlinking modules, too.  The 
cmis all have to be there.  You can -pack them, but that has other 
issues.  This is an FAQ, search the list archives.

Chris

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-11-30 19:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-28  7:44 [Caml-list] An elementary question about ocamlmktop Ching-Tsun Chou
2002-11-30 19:28 ` Chris Hecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).