firstein has joined #ocaml
firstein has quit [Read error: 104 (Connection reset by peer)]
firstein has joined #ocaml
docelic is now known as docelic|sleepo
jao has joined #ocaml
Pythagoras has joined #ocaml
Pythagoras has left #ocaml []
jao is now known as jao|zZzZ
firstein_ has joined #ocaml
firstein has quit [Read error: 110 (Connection timed out)]
Verbed has joined #ocaml
lament has joined #ocaml
rhil is now known as rhil_ontheroad
firstein__ has joined #ocaml
firstein_ has quit [Read error: 60 (Operation timed out)]
Smerdyakov has quit ["reconnect"]
Smerdyakov has joined #ocaml
Kinners has joined #ocaml
lament has left #ocaml []
firstein_ has joined #ocaml
firstein__ has quit [Read error: 110 (Connection timed out)]
TachYon has joined #ocaml
jao|zZzZ has quit ["leaving"]
Smerdyakov has quit ["sleep"]
Kinners has left #ocaml []
firstein__ has joined #ocaml
docelic|sleepo is now known as docelic
docelic has quit [Read error: 54 (Connection reset by peer)]
firstein_ has quit [Read error: 60 (Operation timed out)]
docelic has joined #ocaml
TachYon has quit [Remote closed the connection]
mattam_ has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
d-bug has joined #ocaml
TachYon26 has joined #ocaml
firstein has joined #ocaml
firstein__ has quit [Read error: 110 (Connection timed out)]
mrvn has joined #ocaml
mrvn_ has quit [Read error: 60 (Operation timed out)]
firstein has quit ["Client exiting"]
d-bug is now known as d-bugd
stef_ has joined #ocaml
stefp has quit [Read error: 110 (Connection timed out)]
kvs has joined #ocaml
<
Riastradh>
Er, whoops, bye.
Slackwarrior has joined #ocaml
<
Slackwarrior>
hello
<
Slackwarrior>
may i ask a question?
<
mrvn>
No, this channel is for the silent admiration of ocaml.
<
Slackwarrior>
how come when i do:
<
Slackwarrior>
huh?
<
Slackwarrior>
let a=string_of_int(Sys.argv.(0));;
<
Slackwarrior>
it answers
<
Slackwarrior>
This expression has type string but is here used with type int
<
Slackwarrior>
this makes no sense
<
mrvn>
because its a string and you try to use it as int
<
mrvn>
don#t you mean int_of_string?
<
Slackwarrior>
so it's like an exception isnt it?
<
mrvn>
Slackwarrior: No, its a type error.
<
Slackwarrior>
ummm i want to convert a string into an int
<
mrvn>
but you treid to convert int to string
<
Slackwarrior>
aaahhh
<
Slackwarrior>
now ive understood :)
<
Slackwarrior>
thanks
<
Slackwarrior>
ummm
<
Slackwarrior>
now i compiled it and says:
<
Slackwarrior>
Warning: this expression should have type unit.
<
Slackwarrior>
now i launch it
<
Slackwarrior>
Fatal error: exception Stack_overflow
<
Slackwarrior>
mrvn: can i send you my short program? it's just mergesort in ocaml
<
Slackwarrior>
i cant write a good main() function
<
mrvn>
The warning means you compute a value and don#t use it. if its correct use "ignore".
<
mrvn>
And the stack overflow comes from too deep recursions (or endless recursion)
<
Slackwarrior>
i just wanna catch the arguments of the program and convert them into a list
<
Slackwarrior>
so i can order it with my mergesort function (that works correctly)
<
Slackwarrior>
once i studies standard ml but there are a lot of differences...
<
mrvn>
Array.to_list Sys.argv
<
Slackwarrior>
studied
<
Slackwarrior>
wow!
<
Slackwarrior>
thanks!
<
mrvn>
Maybe even Array.fold (fun accu x -> (int_of_string x)::accu) Sys.argv
<
Slackwarrior>
umm i can compile it with no warnings but i still get Stack_overflow
<
mrvn>
add some debug output to your sort function. Its probably endless recursion
<
Slackwarrior>
but i get no error when i lauch the function into ocaml interpreter...
<
mrvn>
The interpreter has more stack I think.
<
Slackwarrior>
can i paste the mergesort function here?
<
Slackwarrior>
16 lines
<
mrvn>
Why not use the List.sort or Array.sort function?
<
Slackwarrior>
cos it's just an exercise :)
<
mrvn>
The finding the error is left as an exercise to you :)
<
Slackwarrior>
but it works in the interpreter....
<
Slackwarrior>
huh?
<
Slackwarrior>
it doesnt work anymore!
<
Slackwarrior>
hehe i forgot to write the base case of the recursion :)
<
Slackwarrior>
now it works
<
Slackwarrior>
so if i put something different from an int as argument i get an exception...
<
Slackwarrior>
how i catch the exception (like in java)?
<
Slackwarrior>
now i get an error in compilation that i dont get in the interpreter
<
Slackwarrior>
weird things...
<
Slackwarrior>
how can i transform an entire list of strings into a list of integers?
<
mrvn>
and execptions work with try <something> with <exception> -> <something> | <other exception> -> <something else>
Smerdyakov has joined #ocaml
<
Slackwarrior>
ah ok
<
Slackwarrior>
thanks
lus|wazze has joined #ocaml
PsionV has joined #ocaml
Smerdyakov has quit [Killed (NickServ (Nickname Enforcement))]
PsionV is now known as Smerdyakov
emu has quit [Read error: 60 (Operation timed out)]
Smerdyakov has quit [Client Quit]
Smerdyakov has joined #ocaml
emu has joined #ocaml
lus|wazze has quit ["Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Unive"]
mattam_ is now known as mattam
Slackwarrior has quit ["X-Chat 2.0.0 for Linux"]
lus|wazze has joined #ocaml
lam has quit [Read error: 54 (Connection reset by peer)]
docelic is now known as docelic|away
kvs has quit ["[BX] Reserve your copy of BitchX-1.0c19 for the PalmPilot today!"]
d-bugd has joined #ocaml
themus_ has quit ["Client Exiting"]
themus has joined #ocaml
systems has joined #ocaml
systems has quit ["Client Exiting"]
TachYon26 has quit [Remote closed the connection]
PsionV has joined #ocaml
Smerdyakov has quit [Killed (NickServ (Nickname Enforcement))]
PsionV is now known as Smerdyakov
Smerdyakov has quit [Client Quit]
TachYon has joined #ocaml
TachYon has quit [Remote closed the connection]
Smerdyakov has joined #ocaml
Smerdyakov has quit ["eat"]
d-bugd has left #ocaml []
docelic|away has quit [Remote closed the connection]
Smerdyakov has joined #ocaml
Smerdyakov has quit ["brb"]