cjeris changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/
dss has joined #ocaml
dss has left #ocaml []
Smerdyakov has quit ["Leaving"]
descender has joined #ocaml
rturner has quit [Remote closed the connection]
Zzompp has joined #ocaml
Nutssh has quit ["Client exiting"]
_JusSx_ has joined #ocaml
Nutssh has joined #ocaml
benny99 has joined #ocaml
swater has joined #ocaml
benny99 has left #ocaml []
skal has joined #ocaml
ygrek_ has joined #ocaml
ygrek_ is now known as ygrek
ygrek has quit []
ygrek has joined #ocaml
bsmith has left #ocaml []
cmvjk has quit [Read error: 60 (Operation timed out)]
ulfdoz has quit [Remote closed the connection]
reg has joined #ocaml
<reg>
hello
rturner has joined #ocaml
ulfdoz has joined #ocaml
<_JusSx_>
hello
pierre- has joined #ocaml
<pierre->
hello
pierre- has quit [Remote closed the connection]
smimou has quit ["bli"]
pango has quit [Remote closed the connection]
pango has joined #ocaml
<reg>
Little question : is there a lib to have reverse dns resolutions ?
<mrvn>
doesn't Unix have that?
Smerdyakov has joined #ocaml
<reg>
humf, probably gethostbyaddr
<reg>
sorry
<tree_>
hello, i have some newbie question
<tree_>
i'm writing a little project and have problem with multiple files
<tree_>
i have gui.mli in which the class ctrl is defined
<Smerdyakov>
You must mean "where the type of class ctrl is declared."
<tree_>
sorry about my english, i'm not native speaker...
<hcarty>
tree_: Don't mind him. Ask away.
<tree_>
in the file mail.ml i am trying to create an instance of this class
<Smerdyakov>
"Don't mind him"? This is an important difference.
<tree_>
let tmp = new Gui.ctrl
<tree_>
all i got is Unbound class Gui.control
<Smerdyakov>
It's very different to actually define a class vs. only provide its interface.
<tree_>
What should i do to define it?
<Smerdyakov>
OCaml has several compilation modes. You aren't saying how you're using these files, so the question is unanswerable.
<tree_>
i'm using OCamlMakefile
<Smerdyakov>
And you have a file ctrl.ml that defines the class?
<hcarty>
Smerdyakov: My apologies -- I started typing in the wrong window
<tree_>
gui.ml is the where i was trying do define it
<tree_>
the place*
<tree_>
there should be one .ml file for every class in .mli ?
<Smerdyakov>
tree_, so you have files saying contradictory things: ctrl.mli says the class is defined in module Ctrl, while gui.ml says it's define in Gui....
<Smerdyakov>
No, there should be one .ml file for every .mli file.
<Smerdyakov>
I don't mean to be rude, but you really need to read some documentation instead of guessing.
<tree_>
the clas declaration is in gui.mli
<Smerdyakov>
Oops, misread something.
<Smerdyakov>
And you are including the gui files _before_ the main files in the variables you're setting before including OCamlMakefile?
<tree_>
yes
<tree_>
in the main file i'm already using some function from Gui module
<tree_>
only the class make the problem
<Smerdyakov>
This is odd:
<Smerdyakov>
<tree_> let tmp = new Gui.ctrl
<Smerdyakov>
<tree_> all i got is Unbound class Gui.control
<Smerdyakov>
One says 'ctrl', other says 'control'...
<Smerdyakov>
You are declaring a class _type_ instead of a _class_ in gui.mli.
<tree_>
Smerdyakov: ouch, now I understand...
<tree_>
Smerdyakov: I have to write two copies of the same class definition in both files?
<Smerdyakov>
No. I don't really recall the best syntax for declaring classes, as I try to avoid using OO.
<Smerdyakov>
But you can definitely do it using the anonymous class type syntax.
<Smerdyakov>
Eh, probably not, actually.
<Smerdyakov>
Read the tutorial. :-)
<tree_>
I can just get rid of class and define submodule instead
<tree_>
Smerdyakov: thx for help and patience
<Smerdyakov>
Keep in mind that most OCaml programmers try to avoid classes whenever possible.
<Smerdyakov>
GUIs are one of the only cases where OO seems to work well, so you've probably made a good decision here, but don't let that set you off the track for future decisions. ;)
<mrvn>
Smerdyakov: how do you do a virtual function without class or wasting memory?
<Smerdyakov>
Huh? How does any old ML function not fit the bill?
<mrvn>
having a record of calosures for each instance wastes memory.
<mrvn>
With classes you have once record of closures for all instances combined.
<mrvn>
s/once/one/
<Smerdyakov>
Maybe we can conclude from what I said that real applications seldom call for sets of related functions passed around first-class, eh?
<mrvn>
GUI being a verry good counter example. You basically have a draw(), pos() and size() method for every widget.
<Smerdyakov>
Did you see me say that GUIs are one of the few cases where OO fits?
<mrvn>
yes. thats why I said it is such a good counter example.
<mrvn>
(agreeing with you)
<Smerdyakov>
I can't remember the last time I wrote a GUI program!
<mrvn>
I wrote a fractal program.
smimou has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
<mbishop>
Smerdyakov: Can you recommend a good SML book? (there's 3 or 4, is there a "SICP" of SML books?)
vital303 has joined #ocaml
vital303 has quit [Client Quit]
swater has quit ["Quat"]
slipstream-- has joined #ocaml
_JusSx__ has joined #ocaml
slipstream has quit [Read error: 110 (Connection timed out)]
<Smerdyakov>
mbishop, wrrrrrong channel. :P
smimou has quit [Remote closed the connection]
smimou has joined #ocaml
_JusSx_ has quit [Read error: 110 (Connection timed out)]
skal has quit [Read error: 104 (Connection reset by peer)]
moconnor has left #ocaml []
ygrek has quit []
benny_ has joined #ocaml
benny has quit [Read error: 110 (Connection timed out)]
jlouis_ has joined #ocaml
jlouis has quit [Read error: 104 (Connection reset by peer)]
<lucca>
is something wrong with caml.inria.fr?
<pango>
probably... I can ping the server but port 80 doesn't answer...
<lucca>
Are there any good mirrors? I tried pulling a copy of the ocaml-3.09.3.tar.gz from the debian project, but godi doesn't like the checksums...
<Smerdyakov>
lucca, you don't use Debian?
<lucca>
well the system I was trying to put it on is a mac...
<lucca>
okay, I've not used ocaml much since the 3.08 era... is godi still the way I should be approaching the problem in general?