Camarade_Tux has quit [Remote closed the connection]
Camarade_Tux has joined #ocaml
Camarade_Tux has quit [Client Quit]
Associat0r has quit []
Camarade_Tux has joined #ocaml
Ched- has quit [Remote closed the connection]
Ched- has joined #ocaml
Ched- has quit [Read error: 104 (Connection reset by peer)]
Ched- has joined #ocaml
Snark has quit ["Ex-Chat"]
Camarade_Tux has left #ocaml []
Linktim has quit [Read error: 113 (No route to host)]
Camarade_Tux has joined #ocaml
Camarade_Tux has quit [Client Quit]
Camarade_Tux has joined #ocaml
guillem_ has joined #ocaml
Linktim has joined #ocaml
asmanur has quit [Read error: 110 (Connection timed out)]
jderque has left #ocaml []
sporkmonger_ has quit []
Philonous has quit [Remote closed the connection]
Philonous has joined #ocaml
Linktim_ has quit [Read error: 110 (Connection timed out)]
aoeu has joined #ocaml
aoeu has quit [Remote closed the connection]
Myoma has quit [Nick collision from services.]
Myoma has joined #ocaml
asmanur has joined #ocaml
Linktim_ has joined #ocaml
Associat0r has joined #ocaml
Linktim has quit [Read error: 113 (No route to host)]
<Camarade_Tux>
I'd need mingw-compiled ocaml executables (especially libcamlrun.a in fact), could anyone send me one (I can provide the hosting if needed)
<Camarade_Tux>
(I'm giving a try at cross-compilation, I'm sure it won't work but I'm wondering at what point it will fail)
<Camarade_Tux>
In fact the ones from caml.inria.fr should be alright but I can't extract the needed files and have to stay on linux for a while
hkBst has quit [Read error: 104 (Connection reset by peer)]
<Camarade_Tux>
hum, forget it, I'm leaving and should be able to find a windows computer to extract the inria's installer by the time I get back on this computer
maattd has quit [Remote closed the connection]
<Yoric[DT]>
Good luck.
* Yoric[DT]
completely gave up on OCaml under Windows.
<lorph>
I was just reading how ocaml was made for speed, so where is the explicit return
<bluestorm>
lorph: where is the logical link between "made for speed" and "explicit return" ?
tomh_-_ has joined #ocaml
<bluestorm>
there is no explicit return in OCaml (but you can use exceptions if you want to break the control flow), and that's not related to speed
<lorph>
because in other langugaes, an explicit return translates to a jmp or ret asm code, while inplicit return probably forces you to run the rest of the function
<flux>
rest of the function would in the case of place that requires 'return' be very little
<bluestorm>
lorph: declarative style don't use explicit return
<bluestorm>
and there is usually no need for it
<bluestorm>
at some places it can make the style a bit lighter and you can use exceptions to achieve the same effect
<bluestorm>
lorph: do you have an example of code using explicit return for a net win in clarity and efficiency ?
Linktim_ has quit [Read error: 113 (No route to host)]
<lorph>
well say you want to run a long series of tests on an integer, if any of them fail, then you would like to short circuit the function right
Axioplase is now known as Axioplase_
<jlouis>
that is not the best example
<lorph>
it would be more succinct to use a return if any of them fail instead of wrapping the whole statement with try with and then doing a raise at the end of each test
<jlouis>
as it will often be compiled to be efficient anyway
<jlouis>
lorph, it is not as if you write a lot of that kind of code in ocaml anyway
<psnively>
And even if you do, what's wrong with the existing conditionals?
<jlouis>
note that common lisp of course added them ;)
<jlouis>
(return and return-from)
<bluestorm>
hm
<bluestorm>
t1 n && t2 n && t3 n && ... ?
<mrvn>
An explicit return seems only helpfull for the imperative features, like for/while loops.
<mrvn>
In other cases you are just at the leaf of the code flow tree and end with the return value.
<mrvn>
Does ocamlc/opt optimize out exceptions within a function?
<mrvn>
e.g. let x = try if y then raise Foo else 1 with Foo -> 0?
<mrvn>
It wouldn't have to install and invoke the exception handler there but could translate that into jumps.
<mrvn>
lorph: A place where I sometimes miss explicit returns is with cascading if statements: if foo then do_foo (); else begin do_bar; if baz then do_baz (); else begin do_buzz (); if blurb then .... end end end end end
<mrvn>
You can incurr a lot of indentation with those.
svenl has quit [Remote closed the connection]
svenl has joined #ocaml
<lorph>
I'm just reading about ocaml. I know someone who likes ocaml because its functional and very fast
<mrvn>
you have to get into the spirit of functional programming to like it.
<mrvn>
For C programmers passing functions just like any other variable takes getting used to.
<tomh_-_>
how they call that again, currying right?
<mrvn>
no. currying has to do with partial application.
<mrvn>
Giving a function needing two argument only one to get another function.
<tomh_-_>
oh ye
<tomh_-_>
have to refresh my memory again before school starts :P
<mrvn>
"In computer science, currying, invented by Moses Schönfinkel and Gottlob Frege, is the technique of transforming a function that takes multiple arguments (or more accurately an n-tuple as argument) in such a way as it can be called as a chain of functions each with a single argument."
<mrvn>
ocaml actualy does not quite do currying.
<tomh_-_>
ok, never used ocaml
<tomh_-_>
dunno what im actually doing here :P
<mrvn>
Unless you call "fun x y z ->" equivalent to "function (x,y,z) ->" but curried.
<mrvn>
I think in ocaml "fun x y z ->" already represents "function x -> (function y -> (function z -> ....))", i.e. that what currying would give you.
<mrvn>
I was thinking of something like module M = struct let level = ref 0 let tree = ref Tree.empty let insert key item = tree := Tree.insert !tree key item end
<mrvn>
Siganture would be just insert : Key.t -> Item.t -> unti