<fbvortex>
What is the correct way (syntactically, and from a compiling perspective) to use external libraries/modules in a module that I'm developing? If I want to do the equivalent of "open Blah" in the toploop in a module I'm using, what's the correct syntax and how should I invoke the compiler on such a module's source?
thermoplyae has joined #ocaml
<pango>
open Blah has nothing to do with compilation, it just adds a module namespace to the places identifiers will looked for
<pango>
so you're free to use or not to use 'open', in modules just like interactively
<Smerdyakov>
fbvortex, I don't understand what you mean by "toploop in a module I'm using."
hkBst has quit ["Konversation terminated!"]
<pango>
Smerdyakov: I think it should be parsed as (the equivalent of "open Blah" in the toploop) in a module I'm using
<Smerdyakov>
pango, ah, got it.
<fbvortex>
OK, please consider it a companion question then. I want to import the namespace of an external library into a module, I seem to get syntax errors if I just do "open Blah" in the module signature. Is that something I should only inside a module struct?
<Smerdyakov>
fbvortex, then you must be doing something else wrong.
<fbvortex>
And then what is the correct way to invoke the compiler knowing that it needs the info on the external library to resolve references to functions within my code?
<fbvortex>
BTW, I apologize for the "newbieness" of all these questions ahead of time
<Smerdyakov>
Never do that on IRC, assuming that you form understandable sentences.
mbishop_ has joined #ocaml
<Smerdyakov>
Just the fact that you think to apologize means you are probably better off than most who ask.
<pango>
fbvortex: modules needs to be compiled, then loaded (linked) in dependency order
<fbvortex>
Smerdyakov: thank you.
<fbvortex>
I'm still confused though, so let me try to separate my questions coherently. If I want to import a module's namespace into my own module, do I need the ;; after the open statement, or is the open "equivalent" to a let in the sense I don't need any semicolons?
<Smerdyakov>
You almost never need double-semicolons in OCaml.
<Smerdyakov>
This is not a case where you need them.
<Smerdyakov>
I think you only need them if you want to drop expressions into a .ml file, which I try to avoid all the time, anyway.
<fbvortex>
Is it OK to import a foreign module's namespace in the module signature, or should that only be done in the module struct?
<Smerdyakov>
It's OK.
<Smerdyakov>
And you should really say "use [open]" instead of "import a foreign module's namespace."
<fbvortex>
Assuming I *didn't* use open, but my module's functions used functions of the other module, would I still be able to individually compile just my module with ocamlc -c?
mbishop has quit [Read error: 113 (No route to host)]
<Smerdyakov>
Yes.
jdh30 has joined #ocaml
screwt8 has quit [Killed by christel ()]
ikaros has quit ["segfault"]
ikaros has joined #ocaml
ikaros has quit [Remote closed the connection]
ita has quit [Read error: 110 (Connection timed out)]
mbishop__ has joined #ocaml
mbishop_ has quit [Read error: 113 (No route to host)]
brooksbp has joined #ocaml
brooksbp has quit [Client Quit]
david_koontz has quit []
l_a_m_ has quit [Remote closed the connection]
brooksbp has joined #ocaml
eck has quit [Read error: 110 (Connection timed out)]
brooksbp has quit [Client Quit]
bzzbzz has joined #ocaml
jdh30 has quit [Remote closed the connection]
det has quit [Read error: 110 (Connection timed out)]
rillig has quit ["exit(EXIT_SUCCESS)"]
thermoplyae has left #ocaml []
brooksbp has joined #ocaml
brooksbp_ has joined #ocaml
mbishop_ has joined #ocaml
mbishop___ has joined #ocaml
mbishop_ has quit [Read error: 113 (No route to host)]
brooksbp has quit [Read error: 110 (Connection timed out)]
mbishop__ has quit [Read error: 113 (No route to host)]
mbishop_ has joined #ocaml
mbishop_ has quit [Read error: 113 (No route to host)]
FreshCat has joined #ocaml
mbishop___ has quit [Read error: 113 (No route to host)]
|Catch22| has joined #ocaml
rayno has quit [Connection timed out]
netx has quit ["Leaving"]
yminsky has joined #ocaml
richardw_ has joined #ocaml
richardw has quit [Read error: 104 (Connection reset by peer)]
yminsky has quit [Client Quit]
<fbvortex>
So I've written some code in a module that has fully qualified invocations of functions in a foreign module. When I try to use ocamlc -c myfile.ml, I get an error that the fully-qualified function name is unbound. I guess this kind of goes back to what I was asking before -- is there some way/need to do "forward declarations" like you would in C by including a .h file? If not, what should I do to try to compile this file?
david_koontz has joined #ocaml
jonathanv has joined #ocaml
jonathan has joined #ocaml
FreshCat has quit ["GURU MEDITATION ERROR"]
netx has joined #ocaml
jonafan has quit [Read error: 110 (Connection timed out)]
bzzbzz_ has joined #ocaml
jonathanv has quit [Read error: 110 (Connection timed out)]
bzzbzz has quit [Read error: 110 (Connection timed out)]
mbishop has joined #ocaml
rayno has joined #ocaml
rayno has quit [Connection timed out]
jonathanv has joined #ocaml
bzzbzz_ has quit [Read error: 110 (Connection timed out)]
Snark has joined #ocaml
jonafan has joined #ocaml
jonathan has quit [Read error: 110 (Connection timed out)]
CaTtleyA has joined #ocaml
jonathanv has quit [Read error: 110 (Connection timed out)]
__suri has quit []
david_koontz has quit []
m3ga has joined #ocaml
det has joined #ocaml
mbishop has quit [Read error: 113 (No route to host)]
|Catch22| has quit []
Abo-Marwan60 has quit [Remote closed the connection]