Banana changed the topic of #ocaml to: OCaml 3.08.1 available! | Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
judge has quit [Read error: 104 (Connection reset by peer)]
terpstra has quit ["Leaving"]
monochrom has joined #ocaml
kinners has quit ["leaving"]
_fab has quit [Remote closed the connection]
mlh has joined #ocaml
mlh has quit [Client Quit]
ianxek has quit ["Leaving"]
shammah has quit [Read error: 113 (No route to host)]
monochrom has quit ["hello"]
GreyLensman has quit ["Leaving"]
lus|wazz has joined #ocaml
vezenchio has quit [Read error: 110 (Connection timed out)]
vezenchio has joined #ocaml
lus|wazz has quit [Read error: 238 (Connection timed out)]
mlh has joined #ocaml
ejt has joined #ocaml
Submarine has joined #ocaml
ejt_ has joined #ocaml
ejt has quit [Read error: 113 (No route to host)]
mrsolo_ has quit [Read error: 242 (No route to host)]
mrsolo_ has joined #ocaml
ejt_ has quit [Read error: 104 (Connection reset by peer)]
smimou has joined #ocaml
mrvn has joined #ocaml
smimou has quit [Read error: 110 (Connection timed out)]
Submarine has quit ["Leaving"]
mrvn_ has quit [Read error: 110 (Connection timed out)]
srv has quit [Read error: 232 (Connection reset by peer)]
srv has joined #ocaml
_fab has joined #ocaml
mlh has quit [Client Quit]
Banana has quit [Read error: 104 (Connection reset by peer)]
Kevin has joined #ocaml
shawn_ has joined #ocaml
_shawn has quit [Read error: 104 (Connection reset by peer)]
themus has quit [tolkien.freenode.net irc.freenode.net]
Nutssh has quit [tolkien.freenode.net irc.freenode.net]
avlondono has quit [tolkien.freenode.net irc.freenode.net]
tewk has quit [tolkien.freenode.net irc.freenode.net]
oracle1_ has quit [tolkien.freenode.net irc.freenode.net]
mellum has quit [tolkien.freenode.net irc.freenode.net]
calvin_ has quit [tolkien.freenode.net irc.freenode.net]
tewk has joined #ocaml
oracle1 has joined #ocaml
avlondono has joined #ocaml
themus has joined #ocaml
Nutssh has joined #ocaml
calvin_ has joined #ocaml
oracle1_ has joined #ocaml
mellum has joined #ocaml
oracle1_ has quit [Read error: 113 (No route to host)]
calvin_ has quit [Success]
mellum has quit [Connection reset by peer]
mellum has joined #ocaml
calvin_ has joined #ocaml
Submarine has joined #ocaml
Kevin has quit ["Quit"]
Submarine has quit ["Leaving"]
mrsolo_ has quit [Connection reset by peer]
monochrom has joined #ocaml
dobrek has joined #ocaml
pango has quit [Nick collision from services.]
pango has joined #ocaml
Banana has joined #ocaml
mrsolo has joined #ocaml
budjet has joined #ocaml
dobrek has quit ["leaving"]
two-face has joined #ocaml
vezenchio has quit ["Deadpool still votes for Perot. Every time. Just in case."]
budjet has quit [Remote closed the connection]
mlh has joined #ocaml
pharx has quit [Read error: 110 (Connection timed out)]
Godeke has quit ["Leaving"]
two-face has left #ocaml []
budjet has joined #ocaml
budjet has quit [Remote closed the connection]
async_ has joined #ocaml
<async_> if you have fileA which calls functions from fileB, and fileB that calls functions from fileA, is there any way to compile that?
<async_> i dont think the ocaml compiler supports it
<async_> or is it just bad design?
<mrvn> async_: I thought you could compile fileA and fileB into a library and then link that to the main program. But then it gives an error again.
<mrvn> There are two things you can do:
<mrvn> 1.) fileA: let funA funB ... = and fileB: let funB funA ... = and the use them with "FileA.funA FileB.funB" or "FileB.funB FileA.funA".
<mrvn> 2.) fileAB: let rec funA ... = ... and funB ... = ... and fileA: let funA = FileAB.funA and fileB: let funB = FileAB.funb
<async_> mrvn: i see. the second approach seems to be more rational
<mrvn> Just putting them both into one file will work too of course.
<mrvn> You could also try "ocamlopt fileA.ml fileB.ml fileA.ml" but I am unsure what the result would be.
palomer has joined #ocaml
<palomer> what's the easiest way to make an (int,'a) dictionary with lg n insertion deletion and lookup?
<Demitar> Depends on what speeds Map and Hashtbl have. :) The humps most likely have something interesting otherwise.
<palomer> the humps?
<palomer> I've been asked to write a theorem prover in sml
<palomer> I think ill do it in ocaml
<palomer> Hashtbl takes a comparator?
<palomer> like, umm, how would I create this hashtbl?
<Demitar> let my_hash = Hashtbl.create <expected size of hashtbl>
<palomer> how will it know what key to take?
<palomer> and how to compare those keys?
<Demitar> It will infer the type as soon as you use the hash. And it uses structural equality iirc. (And cheats a bit to be able to create the hash on any object.)
<palomer> what about comparison?
<Demitar> What do you mean?
<mrvn> Map is probably O(log n) while Hash should be O(1)
<async_> unless you have a HashMap :)
<palomer> erm, yeah, how does it know what hash function to use?
<Demitar> palomer, as I said. It cheats. Using a C hash function. :)
<mrvn> It probably just takes the bit pattern of the key as big integer % hash size.
<palomer> so two objects which are structurally equal have the same hash code?
<palomer> heck, what do I care, I'm using ints
<mrvn> Given that you can only put one type of object into a hash those would be identical.
<Demitar> palomer, the hash only determines what list to store the item in.
<Demitar> Check the docs for exact details on collission handling (add shadows the previous, replace removes the previous but raises and exeption if no previous was found, etc)
buggs has quit [Read error: 232 (Connection reset by peer)]
<async_> do external val's in a .mli file have to be a c function?
<mrvn> just need c calling conventions.
<async_> can you specify an external function that is just an ocaml function in a different file?
<mrvn> That wouldn't be external.
<Smerdyakov> async, why would you want to do that?
<async_> well i have 2 files and i want to write one interface for both of those files
<async_> and i'd like to avoid creating another .ml which just does mapping
<Smerdyakov> I don't think that's possible, and I also don't see why it would be an issue.
<Smerdyakov> What's wrong with two separate interfaces?
<async_> because the two .ml files call functions from each other (they're mutually inclusive)
<async_> :)
<Smerdyakov> That's rather unorthodox. SML doesn't even allow that.
<async_> neither does ocaml
<async_> hehe
<async_> which is why i need to make a big container file
<Smerdyakov> No, OCaml does, or some readily available extension does.
<mrvn> Smerdyakov: it gives a linker error
shawn_ has quit [Read error: 104 (Connection reset by peer)]
<Smerdyakov> mrvn, I know there is a version of OCaml available with a recursive module system.
<async_> Smerdyakov: or you could just make a container interface
<async_> which combines both interfaces into one larger interface, and each file uses that big interface
<async_> but it's extra overhead