keja has joined #ocaml
atom-z has quit ["Client Exiting"]
phubuh has quit ["Client exiting"]
phubuh has joined #ocaml
phubuh has quit [Remote closed the connection]
phubuh has joined #ocaml
keja has quit ["leaving"]
clog has quit [^C]
clog has joined #ocaml
clog has quit [^C]
clog has joined #ocaml
clog has quit [^C]
clog has joined #ocaml
asquii has joined #ocaml
asqui has quit [Read error: 60 (Operation timed out)]
asquii is now known as asqui
asquii has joined #ocaml
asqui has quit [Connection timed out]
asquii is now known as asqui
brwill|out is now known as brwill
det has quit [Remote closed the connection]
asquii has joined #ocaml
asqui has quit [Read error: 110 (Connection timed out)]
asquii is now known as asqui
det has joined #ocaml
themus has joined #ocaml
det has quit [Remote closed the connection]
ppp0 has joined #ocaml
ppp0 has left #ocaml []
docelic has joined #ocaml
m[kel[ has joined #ocaml
brwill is now known as brwill|zzz
smklsmkl has quit [Read error: 113 (No route to host)]
m[kel[ has quit [Read error: 113 (No route to host)]
noss has joined #ocaml
noss has left #ocaml []
TachYon has joined #ocaml
baader has joined #ocaml
docelic has quit ["Client Exiting"]
atom-z has joined #ocaml
atom-z has quit [Read error: 104 (Connection reset by peer)]
atom-z has joined #ocaml
<atom-z> where can i find some ocaml code examples?
<Riastradh> ocaml.org, the Caml Hump -- there's lots of code there you can browse.
<atom-z> Riastradh: ok
<atom-z> if i wanted to convert the following to ocaml, what would it look like? :
<atom-z> void recurseDB(FILE *fp){
<atom-z> char buffer[512];
<atom-z> fgets(buffer,sizeof buffer,fp);
<atom-z> printf(buffer);
<atom-z> }
<atom-z> the part where i'm having problems is assigning the result of input_line fp to a variable
<atom-z> i have tried:
systems has joined #ocaml
<atom-z> strvar -> input_line fp
<atom-z> let strvar -> input_line fp
<atom-z> err
<atom-z> let strvar = input_line fp
TachYon has quit ["Client Exiting"]
<mellum> in print_string strvar
<atom-z> mellum: what does that do?
<mellum> atom-z: what you want
<atom-z> well i'm (very) new to ocaml
<atom-z> and my function is broken and causes a compile error :|
<mellum> atom-z: you should probably read the tutorial then, or the book
<atom-z> i've read a tutorial, and from what i can tell my function should work (but doesnt)
<mellum> atom-z: what does the function look like?
<atom-z> let funct fp = function
<atom-z> one -> input_line i
<atom-z> output_line stdout one;;
<mellum> Hm, that doesn't make any sense to me
<atom-z> its that bad?
<mellum> "let funct fp = function" creates a function with two parameters. Is that what you want?
<atom-z> no
<mellum> and input_line is called with 4 parameters, i, output_line, stdout and one, which also doesn't look correct
<mellum> and where does i come from, anyway?
<atom-z> i should be fp, sorry
<mellum> you probably want let funct fp = let line = input_line fp in output_line stdout one;;
<mellum> erm, s,one,line,
<mellum> oh, and output_line is called output_string
<mellum> and there's print_string which just prints to stdout
<atom-z> ok that works
<atom-z> however i now do not understand it at all :|
<atom-z> do you know of a good ocaml tutorial?
<systems> what i understand is so : you received a line in a file handled by the variable fp and outputed a line one on the screen, the stdout
<systems> ocaml needs a good comprehensive book :(
<baader> i second that
<mellum> systems: you don't like the O'Reilly one?
<systems> not really
<baader> i second that, too
<mellum> why not?
<systems> many example are not really elaborated upon
<baader> too view simple examples
<baader> erm few
<mellum> Hm.
<systems> and the quick sort example, for example is explained wrongly
<baader> oc.tar.gz contains some good, short examples
<atom-z> ah thanks
docelic has joined #ocaml
systems has quit [Read error: 60 (Operation timed out)]
tortoise has joined #ocaml
docelic has quit [Read error: 60 (Operation timed out)]
systems has joined #ocaml
<baader> i don't quite understand the difference between this :
<baader> # let sum i = let sum2 j = i + j in sum2 ;;
<baader> val sum : int -> int -> int = <fun>
<baader> and this
<baader> # let sum i = let sum2 j = i + j in sum ;;
<baader> val sum : int -> int -> int -> int = <fun>
<systems> the missong 2 you mean
<baader> yes
<systems> missing
<baader> the function signature is different, i don't understand why tho
<systems> okay i understand the first one
<baader> yes, the 1st one makes sense, but how and why is the second one different
<baader> i think i'm having trouble to completely understand the use if the "in" keyword
<systems> hehe
<baader> hm heh
<systems> close the interactive interpreter
<baader> why would i want to close it ?
<systems> no not really
<systems> close it , open it again, type only the second one
<baader> oh ok
<systems> it doest work then
<baader> oh
<systems> the second won makes sum i = sum (define in the first one )
<systems> got it
<baader> yes
<baader> ok
<baader> ahh
<systems> they is why it take 3 arguments yet only add two like the first one
<baader> ah ok, thanks
<systems> sum2 in the second one is only evaluated better never really used
<systems> and since it got no side effect its useless
<systems> grrr, i am sleepy and do lots of typos
<baader> yes
<baader> np :)
<systems> ocaml is really fun right :)
<baader> its different !
<systems> is there a way to refresh the interactive interpreter without reopening it
<baader> heh i wouldn't know
<systems> i think there is, i remember i saw it somewhere, but dont recall where
docelic has joined #ocaml
vect has quit ["My damn controlling terminal disappeared!"]
vect has joined #ocaml
vect has left #ocaml []
vect has joined #ocaml
systems has quit [Read error: 60 (Operation timed out)]
lam has quit [Read error: 54 (Connection reset by peer)]
lam has joined #ocaml
tortoise has quit ["leaving"]
sylow has joined #ocaml
sylow is now known as tortoise
tortoise has quit [Client Quit]
sylow has joined #ocaml
sylow is now known as tortoise
tortoise has quit ["leaving"]
tortoise has joined #ocaml
asqui has quit [niven.freenode.net irc.freenode.net]
jlouis has quit [niven.freenode.net irc.freenode.net]
mellum has quit [niven.freenode.net irc.freenode.net]
Riastradh has quit [niven.freenode.net irc.freenode.net]
asqui has joined #ocaml
jlouis has joined #ocaml
mellum has joined #ocaml
Riastradh has joined #ocaml
docelic has quit ["l8r"]
mrvn has joined #ocaml
systems has joined #ocaml
mrvn_ has quit [Read error: 110 (Connection timed out)]
systems has quit [Read error: 110 (Connection timed out)]
vect has quit [niven.freenode.net irc.freenode.net]
reffie has quit [niven.freenode.net irc.freenode.net]
foxster has quit [niven.freenode.net irc.freenode.net]
wax has quit [niven.freenode.net irc.freenode.net]
vect has joined #ocaml
reffie has joined #ocaml
foxster has joined #ocaml
wax has joined #ocaml
<tortoise> ICFP'02 (1st prize)
<tortoise> ICFP'01 (3rd prize)
<tortoise> ICFP'00 (1st prize)
<tortoise> ICFP'00 (2nd prize)
<tortoise> ICFP'99 (1st prize)
<tortoise> ICFP'98 (2nd prize)
<tortoise> sorry wrong channel
docelic has joined #ocaml
mattam_ has joined #ocaml
asqui has quit ["Now I am gone..."]
tortoise is now known as porpoise
porpoise is now known as tortoise
mattam has quit [Read error: 110 (Connection timed out)]
asqui has joined #ocaml
asqui has quit ["Now I am gone..."]
polin8 has joined #ocaml
polin8 has quit ["Lost terminal"]
polin8 has joined #ocaml
asqui has joined #ocaml
brwill|zzz is now known as brwill
TimFreeman has joined #ocaml
TimFreeman has left #ocaml []
TimFreeman has joined #ocaml
TimFreeman has left #ocaml []
asqui has quit [Read error: 60 (Operation timed out)]
docelic has quit [" l8r"]
asqui has joined #ocaml