jemfinch` changed the topic of #ocaml to: nob: it's not an option keyword. It's a datatype. 'a option. It can be either "None" or "Some data" -- it represents either data that's not there (None) or data that's there (Some data)
JGibson__ has quit ["WHAT, CLOWN?!"]
<scott>
does ocaml have exception handling?
<Verbed>
I believe so
<Verbed>
If you browse around caml.inria.fr, you'l find various links to tutorials and the OCaml Manual.
<gene9>
raise MyException...
JGibson has joined #ocaml
malc has quit ["no reason"]
gene9 is now known as gene9_afk
gene9_afk is now known as gene9
gene9 is now known as gene9-vodka_daet_o_sebe_znat
gene9-vodka_daet_o_sebe_znat is now known as gene9
GnuVince has joined #ocaml
<JGibson>
vince, how's the program going?
<GnuVince>
What program?
GnuVince has left #ocaml []
gene9 has quit []
gene9 has joined #ocaml
gene9 has quit []
scott has left #ocaml []
scott has joined #ocaml
<scott>
the ocaml docs are not very nice
<scott>
they do not even give examples of usage
<Taaus>
What are you having trouble with? :)
<scott>
trying to make a socket
<scott>
I want to use the high-level function open_connection but the docs only say what it accepts and there's no examples of it's usage on the caml list or c.l.ml
<Verbed>
I think the Unix library mirrors the C Socket interface pretty closely
<Verbed>
( same Args, etc )
<scott>
neither of those talk about how to use open_connection, only the low level socket stuff
<Verbed>
That's correct.
<Verbed>
About time you learned 'em anyways :P
<Verbed>
They may look a bit intimidating
<Verbed>
But they're not that bad
<Verbed>
I don't think O'Caml really has that user base geared towards ultra simple modules
<Verbed>
( Like Python and Perl )
<Verbed>
So, uh, good luck :P
<Verbed>
And you can always ask questions here :)
<scott>
I hope that the other ocaml libraries are not just C written in ocaml
<scott>
as much as I'd like to just use a high-level function, this tutorial is pretty dang cool, I'm learning what lots of things I've always heard actually mean
<Verbed>
Well, the Unix library has to wrap around the C Unix calls :P
<Verbed>
You need to get the low-level stuff somewhere :)
<scott>
yes, but the unix library actually has an open_connection high level function, yet no real examples of how to use it
<Verbed>
Oh, there is?
<Verbed>
I didn't notice.
<Verbed>
Just a second.
<scott>
yeah
<Verbed>
That's neat
<Taaus>
Looks pretty simple to me... :)
<Verbed>
I'd help you, but I don't know O'Caml :P
<JGibson>
Taaus: quick, write a web server with it, i'll expect a working program 5 minutes from now
<Taaus>
JGibson: I would... But it's 5:19 AM, and I'm kinda tired :)
<JGibson>
ok ok, next time
<scott>
Taaus, does open_connection (ADDR_INET (inet_addr_of_string "10.7.249.100",1000));; look right?
<Taaus>
Dunno.
<Taaus>
;)
<JGibson>
how about finding an app that uses sockets and use it for examples
<scott>
they most likely use the lowlevel stuff, which I have plenty of examples for
<Taaus>
I think that's the correct syntax....
<Verbed>
Hmm..
<Verbed>
Are you passing a tuple to inet_addr_of_string ?
<Verbed>
Logically, it should only accept one argument
<Verbed>
A string.
<Taaus>
Verbed: No, if he were, it would need parentheses.
<Taaus>
ADDR_INET is a tuple of inet_addr * int
<Verbed>
Hmm..
<Taaus>
inet_addr_of_string gobbles up the string, if I'm not mistaken :)
<Verbed>
:)
<JGibson>
you want examples of open_connection, right?
<scott>
right
<JGibson>
go to the hump and get ocamlnet, or i can dcc it to you
<JGibson>
it's got one in it
<JGibson>
in the examples/pop dir
<scott>
already got it, but thanks :)
<JGibson>
ya
<scott>
darn auto accept :)
<JGibson>
hehe
scott has quit ["thanks for the examples and networking tutorial, I'm reading them"]