__marius__ has quit [Remote host closed the connection]
__marius__ has joined #ocaml
arubin has quit [Quit: arubin]
joewilliams_away is now known as joewilliams
sebz has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
ulfdoz has quit [Ping timeout: 255 seconds]
junsuijin has quit [Quit: Leaving.]
joewilliams is now known as joewilliams_away
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
sebz has quit [Client Quit]
joewilliams_away is now known as joewilliams
sebz has joined #ocaml
bitbckt has quit [Ping timeout: 244 seconds]
bitbckt has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
Snark has joined #ocaml
joewilliams is now known as joewilliams_away
thomasga has joined #ocaml
sebz has joined #ocaml
larhat has joined #ocaml
edwin has joined #ocaml
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
ttamttam has joined #ocaml
Lor has quit [Remote host closed the connection]
avsm has joined #ocaml
<f[x]>
hcarty, yes, this is the way I've discovered, except that it has to be 'a. 'a T.t -> unit for some reason
<f[x]>
but this is not very pretty, cause record is exposed in api - it cannot be abstracted
<f[x]>
I expected 3.12 explicit universal polymorphism annotation to work, but it doesn't even parse - let apply t (f : 'a. 'a T.t -> unit) =
<f[x]>
thanks anyway!
bobry has quit [Quit: Leaving.]
bitbckt has quit [Quit: out]
Kakadu has joined #ocaml
everyonemines has joined #ocaml
avsm has quit [Quit: Leaving.]
bitbckt has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
avsm has joined #ocaml
asmanur has joined #ocaml
asmanur_ has quit [Ping timeout: 260 seconds]
ikaros has joined #ocaml
rwmjones has quit [Ping timeout: 256 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
rwmjones has joined #ocaml
sebz has joined #ocaml
ttamttam has quit [Quit: ttamttam]
Skolem has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
<edwin>
hmm ocamlbuild silences syntax errors when computing dependencies
<edwin>
it calls ocamlfind ocamldep -pp camlp4r, which shows an error, but all I get when running ocamlbuild is that it exited with code 2
<edwin>
and then I have to go to _build and rerun command manually to find out why...
<edwin>
are there any workaround for this?
sebz has joined #ocaml
ttamttam has joined #ocaml
ttamttam has quit [Read error: Connection reset by peer]
ttamttam has joined #ocaml
emmanuelux has joined #ocaml
ttamttam has quit [Client Quit]
ttamttam has joined #ocaml
ttamttam has quit [Remote host closed the connection]
ttamttam has joined #ocaml
ttamttam has left #ocaml []
ttamttam has joined #ocaml
lopex has joined #ocaml
<f[x]>
edwin, maybe -classic-display?
<flux>
indeed, it's bloody annoying
<flux>
and iirc -classic-display doesn't help
<flux>
because it's not compiling at that point
<flux>
I think I may have used ocamlbuild -v though to find the erring file
<flux>
but it doesn't give out the error position unless I run manually ocamldep in the _build directory
<Skolem>
I expect this function to internally raise Not_found and return false, but it doesn't even compile. I get a syntax error at "-> false" saying "This expression should have type unit." What am I doing wrong?
<Skolem>
let test () = try for a = 0 to 3 do if a = 2 then raise Not_found done with Not_found -> false; true
<f[x]>
is there a bug in mantis on this?
<flux>
skolem, so what should it return if it doesn't raise Not_found?
<flux>
(the code inside the for loop that is)
<flux>
oh, right, you have that there, but it's in the wrong place
<flux>
your code is like:
<flux>
let test () = (try (for a = 0 to 3 do if a = 2 then raise Not_found done) with Not_found -> (false; true))
<flux>
skolem, all branches of a try..with.. must have the same type
_andre has joined #ocaml
seafood has joined #ocaml
bitbckt has quit [Quit: out]
seafood has quit [Quit: seafood]
bitbckt has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
seafood has joined #ocaml
sebz has joined #ocaml
lopex has quit [Ping timeout: 252 seconds]
bitbckt has quit [Quit: out]
<Skolem>
Ah.
<Skolem>
It's still not clear to me how I'd fix it. I tried changing "done with" to "done; true with" but it didn't help.
<Skolem>
I don't really know what a "branch" of a try/with is. I think ther's only one branch of the "with", and it has type bool.
<flux>
try branch1 with x -> branch2
<Skolem>
How do I make the "try" branch have type bool, I guess is my question.
<flux>
so what's your code now?
<Skolem>
let is_assoc op set = try for a = 0 to 3 do if a = 2 then raise Not_found done; true with Not_found -> false; true
<Skolem>
And I get an error at the same point as before, at "-> false".
<Skolem>
ignore the is_assoc op set part... I was trying something else.
<flux>
well actually this is indeed the original problem
<flux>
but what you solved what a different problem
<flux>
what is false; true supposed to do?
<Skolem>
Well, it is, except, as I said, I tried changing "done with" to "done; true with". But it didn't help.
<flux>
you don't anymore get an error, do you? but a warning?
<Skolem>
I was hoping that false;true would actually be two statements. I was hoping that the "false;" would end the try/with block, and if it got past that, it would return true.
<Skolem>
I do, I get an error.
<flux>
what error?
<flux>
I don't get an error from that..
<Skolem>
Ha, wait a sec, I may not have saved before re-compiling.
<flux>
Warning S: this expression should have type unit.
<flux>
val is_assoc : 'a -> 'b -> bool = <fun>
<Skolem>
Yes, that's exactly what I get now too.
<flux>
but neither of these make sense to me: try .. with x -> (false; true) nor (try .. with x -> false); true
<Skolem>
Oh, why doesn't the latter make sense to you?
<flux>
in any case, it is being interpreted as the first one
<Skolem>
I know that's not a good question, but it makes sense to me and I'm not sure what I'm thinking that's wrong.
<flux>
skolem, you make a value and then just ignore it
<Skolem>
Oh, I see. The false would never get returned.
<flux>
if the type is 'unit' then it assumes it is done for its side effects
<Skolem>
So how do I have the code return one thing if an exception is raised and another thing if one isn't?
<flux>
hm, you're doing it already, no?
<flux>
just drop the last '; true'
<flux>
try do something with x -> (* exception was thrown, do and return something here *) "hello"
<Skolem>
Ah, so I am. :)
<Skolem>
Awesome, now it's working. I understand better what's going on. Thanks very much.
<flux>
no problem. happy hacking :)
seafood has quit [Quit: seafood]
Metapioca has joined #ocaml
Skolem has quit [Quit: Skolem]
avsm1 has joined #ocaml
avsm has quit [Ping timeout: 248 seconds]
bitbckt has joined #ocaml
ttamttam has quit [Remote host closed the connection]
ttamttam has joined #ocaml
mnabil has joined #ocaml
<edwin>
flux/f[x]: -classic-display doesn't help. I can see which file the problem is in, I just don't see the error message: ocamlbuild eats it for some reason (3.12.0)
<flux>
yeah, that's what I experienced as well
<edwin>
is this something new in 3.12.0? I don't remember this much trouble with 3.11
<edwin>
or maybe I wrote less syntax errors there :D
<flux>
could well be
<f[x]>
I am using 3.11 and I didn't notice such behavior, and I am using quite a bit of syntax extensions
<flux>
because I have the same feeling
<edwin>
happens without syntax extensions too I think
<edwin>
semantic errors are fine as those allow ocamldep to move on, and then the error shows up during compilation and it is printed
lopex has joined #ocaml
ttamttam has quit [Quit: ttamttam]
<hcarty>
f[x]: I think the record restriction is due to rank-2 polymorphism only being supported through records(?) in OCaml
<hcarty>
f[x]: This is the explanation I received when I ran into the same issue