gl changed the topic of #ocaml to: OCaml 3.07 ! -- Archive of Caml Weekly News: http://pauillac.inria.fr/~aschmitt/cwn , A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/ , A free book: http://cristal.inria.fr/~remy/cours/appsem, Mailing List (best ml ever for any computer language): http://caml.inria.fr/bin/wilma/caml-list | http://icfpcontest.org/ !!
er has joined #ocaml
er has quit [Client Quit]
vezenchio has joined #ocaml
shammah has joined #ocaml
gim has quit ["dodo"]
simon-_ has joined #ocaml
simon- has quit [Remote closed the connection]
bk_ has joined #ocaml
monotonom has quit ["Don't talk to those who talk to themselves."]
pb_ has joined #ocaml
pb_ has left #ocaml []
pb_ has joined #ocaml
karryall_ has joined #ocaml
karryall has quit [Read error: 104 (Connection reset by peer)]
cjohnson has quit [Read error: 60 (Operation timed out)]
cjohnson has joined #ocaml
pb_ has quit ["ChatZilla 0.8.23 [Mozilla rv:1.3/20030312]"]
psb has joined #ocaml
psb has quit [Client Quit]
psb_ has joined #ocaml
kinners has joined #ocaml
Nate75Sanders has joined #ocaml
Nate75Sanders has quit ["using sirc version 2.211+KSIRC/1.3.10"]
cjohnson has quit [Connection timed out]
cjohnson has joined #ocaml
psb_ has quit ["ChatZilla 0.8.23 [Mozilla rv:1.3/20030312]"]
psb_ has joined #ocaml
psb__ has joined #ocaml
psb__ has quit [Client Quit]
psb_ has quit [Read error: 54 (Connection reset by peer)]
psb has joined #ocaml
tyler has quit [Remote closed the connection]
<Lemmih> Is there a high level network library for ocaml? Directly accessing sockets seems so C like.
<psb> Isn't there an http library?
rcole has joined #ocaml
<Riastradh> psb, uh, that would be for HTTP sessions, not general high-level sockets.
<psb> OK. Haven't messed with it. Figured it might have what you need to send and received messages via http. That's usually what I want to do anyway.
<kinners> Lemmih: have you looked at the caml humps?
<Lemmih> kinners: Yeah, and I didn't find anything.
<Lemmih> A lot of encoding/decoding libraries and some protocol specific ones but nothing generic enough.
rcole has left #ocaml []
CiscoKid has joined #ocaml
polarType has joined #ocaml
<polarType> yop
det has joined #ocaml
_fab has quit [Read error: 110 (Connection timed out)]
otsuka has quit [Read error: 54 (Connection reset by peer)]
psb has quit ["ChatZilla 0.8.23 [Mozilla rv:1.3/20030312]"]
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
simon-_ is now known as simon-
cjohnson has quit [Read error: 60 (Operation timed out)]
bk_ has joined #ocaml
kinners has quit ["leaving"]
Snark has joined #ocaml
<Snark> slt
<shammah> heh
kosmikus|away is now known as kosmikus
<karryall_> Lemmih: have a look at 'pagoda core foundation' in the humps
shammah has quit ["Leaving"]
karryall_ has quit ["tcho"]
dobrek has joined #ocaml
CiscoKid has quit ["hacking"]
_fab has joined #ocaml
_fab has quit [Client Quit]
_fab has joined #ocaml
dobrek is now known as dobrek_
shawn has joined #ocaml
dobrek_ has quit ["ChatZilla 0.9.52B [Mozilla rv:1.6/20040113]"]
karryall has joined #ocaml
slashvar[lri] has quit ["reboot"]
dobrek has joined #ocaml
slashvar has joined #ocaml
Shammah has joined #ocaml
slashvar is now known as slashvar[lri]
Zaius has joined #ocaml
rox has quit [Read error: 60 (Operation timed out)]
gim has joined #ocaml
rox has joined #ocaml
mrt has joined #ocaml
mrt is now known as vague
__DL__ has joined #ocaml
<sundeep> hi
<Shammah> hi
<dobrek> hi
<sundeep> i get an Invalid_argument("out-of-bound array or string access") exception
<Shammah> sounds like you have a bounds error on an array or a string :)
<dobrek> it is prety selfexplanatory isn't it ? :))
<sundeep> ... when i run my program, but when i introduce a try statement outputting a failwith exception
<sundeep> ... i do not get failwith's output!!
<sundeep> here is the relevant code:
<sundeep> f index a.(interval.lo);
<Zaius> trying to catch an out-of-bound error is a bad idea anyway
<sundeep> that i think was the line out of which i got the exception
<sundeep> so introduce a try statement *before* the line like this:
<sundeep> try a.(interval.lo); () with _ -> failwith "HEEEYAAAAAAA";
<sundeep> i do not get "HEEYAAAAAAA" as i expect!
<dobrek> perhaps it is never evaluated ?
<sundeep> what was not evaluated?
<sundeep> actually in this case even though the former line, i do not get the out of bounds exception either
<sundeep> %s/former line/former line is still there/
<sundeep> guys, is my problem clear?
<dobrek> sundeep: There is no magic. Smth must be wrong. You don't evaluated this code which throws this exception or you changed smth before, IMHO.
<Zaius> for example: a.(interval.lo); () can be reduced to () by the compiler
<sundeep> dobrek: i haven't changed anything except to add the *seemingly harmless* try with statement before the line
<sundeep> Zaius: but in that case, the exception should still be thrown as i have the next line to be the offending line, right?
<dobrek> sundeep: you have code let a1 = a2.( 5 ) ;; and it doesn't work. You tel me that try let a1 = a2.( 5 ) with _ -> failwith "AA" ;; does am I right.
<sundeep> ok i 'll restate the problem again:
<Zaius> i think: if a.(interval.lo) raises an exception, ( a.(interval.lo); () ) need not, because failing is not a 'regular' side effect. i' not entirely sure on this though
<sundeep> f a.(5); hrows an exception but try a.(5); () with _ -> failwith "H"; f a.(5); does not
det has quit ["No matter what happens, there is always someone who knew it would."]
<dobrek> sundeep: And it is probably perfectly correct becouse compiler removed this try clousure.
<dobrek> sorry for spelling. :(
<sundeep> dobrek: in that case my point is that i should still get the former exception thrown, right?
<dobrek> sundeep: yep you have f a.( 5 ). So you are right, it is not what I thought it is.
<sundeep> i am at a loss:(
<dobrek> sundeep: but it is not any better, because then I don't know what it is.
det has joined #ocaml
<sundeep> should i put this down to an ocaml bug, or is the current implementation provably correct?
<sundeep> does anybody think otherwise?
<dobrek> provide a short explanatory example. If while preparing it you will not find what is wrong, send it to caml-list perhaps sambody smarter will answere.
det has quit [Client Quit]
vague has quit [Read error: 110 (Connection timed out)]
<Zaius> what is the actual value of try a.(5); () with _ -> failwith "H"; f a.(5); ?
<sundeep> Zaius: how do i find out? I am currenlty using ocamlopt to compile the files
det has joined #ocaml
<Zaius> if it raises no exception, it must have a value then, which you can print
<sundeep> well f evalutes to () anyway, so i would not be able to print it
<karryall> sundeep: out-of-bounds exception are a bit special (they are not the same for the bytecode and the native compiler). You should not try to catch them
<sundeep> why?
<karryall> that's what the manual recommends
<karryall> The best way to avoid running into those incompatibilities is to never trap the Division_by_zero, Stack_overflow and Invalid_argument("Array.get") exceptions, thus treating them as fatal errors both with the bytecode compiler and with the native-code compiler.
<sundeep> oic
<sundeep> fine then, i guess i'll have to find a way around it then
<sundeep> going on a tangent, i have another question: how do you partition an array *in-place* based on a predicate in a functional manner?
<det> that sound rather contradictory
<karryall> indeed
<det> how do you wish to parition it?
<sundeep> evaluate a predicate for the element of the array
<det> and how does the result determine it's nbew position?
<sundeep> all elements which return true are at the beginning and the rest at the end
<sundeep> basically it is like quicksort's partition with an externally supplied pivot
<sundeep> i ask this as i have to partition very large arrays and so i need to make it in-place in order to avoid a stack overflow
<sundeep> brb
<det> I dont see how non in-place sorts would cause a stack overflow
<karryall> bah, it can if you program it bad enough
<sundeep> det: i use the result of partition in a recursive function
<det> pointers are pointers
<det> but anyways
<sundeep> brb
<det> seems like you could iterate the array elements, keeping the index of the first false element (initially 0) and apply the predicate. If it is true swap it with the first false predicate and increment the first false element index, else ignore it. Would this work ?
Shammah has quit ["Leaving"]
<det> and have a special case for when the first false index = the current element if it is true to leave it alone
<sundeep> det: looks like that should work, i actually implemented an another imperative version but i was looking for a functional way to do it
<sundeep> to all those who replied: thank you!
cjohnson has joined #ocaml
cjohnson has quit [Connection timed out]
cjohnson has joined #ocaml
dobrek has quit ["leaving"]
mattam_ has joined #ocaml
Zaius has quit ["Miranda IM! Smaller, Faster, Easier. http://miranda-im.org"]
mattam has quit [Read error: 110 (Connection timed out)]
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
cjohnson has quit [Read error: 110 (Connection timed out)]
cjohnson has joined #ocaml
bk_ has joined #ocaml
skaller has joined #ocaml
<skaller> oo .. a few ppl here
sulu has joined #ocaml
<platypus> hi skaller
<platypus> ummm can anybody here explain states to me ?
<platypus> i can't understand the example in the oreilly book
<karryall> whadaya mean, states ?
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
bk_ has joined #ocaml
systems has joined #ocaml
systems has left #ocaml []
karryall has quit ["tcho"]
gim has quit [Read error: 54 (Connection reset by peer)]
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
gim has joined #ocaml
CiscoKid has joined #ocaml
mattam has joined #ocaml
fariseo has quit [Client Quit]
mattam_ has quit [Read error: 110 (Connection timed out)]
kosmikus is now known as kosmikus|away
Snark has quit [Read error: 54 (Connection reset by peer)]
Snark has joined #ocaml
blop_ronan has joined #ocaml
vezenchio has quit ["look at you, hacker, a pathetic creature of meat and bone, panting and sweating as you run through my corridors; how can you ]
blop_ronan has quit ["L'enfer, c'est les autres."]
Snark has quit ["Parti"]
__DL__ has quit [Remote closed the connection]
shawn has quit ["Leaving"]
shawn has joined #ocaml
dobrek has joined #ocaml
dobrek has quit ["leaving"]
kosmikus|away is now known as kosmikus
monotonom has joined #ocaml
det_ has joined #ocaml
det has quit [Read error: 60 (Operation timed out)]
det_ has quit [Read error: 60 (Operation timed out)]
sulu has quit [Read error: 60 (Operation timed out)]
det has joined #ocaml
monotonom has quit ["Don't talk to those who talk to themselves."]
kipton has joined #ocaml
kosmikus is now known as kosmikus|away
kipton has quit ["Snak 4.9.8 Unregistered copy. Evaluation period is over. Program will now quit. Thanks for using Snak."]