systems 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
drWorm has quit [Read error: 60 (Operation timed out)]
drWorm has joined #ocaml
Vekza has quit ["Leaving"]
Riastradh has joined #ocaml
mfurr has joined #ocaml
maihem has quit ["Client exiting"]
cjohnson has quit ["Drawn beyond the lines of reason"]
Vekza has joined #ocaml
LordBrain has quit ["Leaving"]
Meta_ has joined #ocaml
reltuk has joined #ocaml
bk_ has quit ["I'll be back"]
Meta has quit [Read error: 60 (Operation timed out)]
Dybbuk has quit [kornbluth.freenode.net irc.freenode.net]
rox has quit [kornbluth.freenode.net irc.freenode.net]
teratorn has quit [kornbluth.freenode.net irc.freenode.net]
Meta_ has quit [kornbluth.freenode.net irc.freenode.net]
pattern has quit [kornbluth.freenode.net irc.freenode.net]
lus|wazze has quit [kornbluth.freenode.net irc.freenode.net]
mattam has quit [kornbluth.freenode.net irc.freenode.net]
zoidberg has quit [kornbluth.freenode.net irc.freenode.net]
Smerdyakov has quit [kornbluth.freenode.net irc.freenode.net]
mellum has quit [kornbluth.freenode.net irc.freenode.net]
Meta_ has joined #ocaml
pattern has joined #ocaml
Dybbuk has joined #ocaml
lus|wazze has joined #ocaml
mattam has joined #ocaml
zoidberg has joined #ocaml
teratorn has joined #ocaml
rox has joined #ocaml
Smerdyakov has joined #ocaml
mellum has joined #ocaml
det has quit [kornbluth.freenode.net irc.freenode.net]
det has joined #ocaml
Meta has joined #ocaml
Meta_ has quit [Read error: 110 (Connection timed out)]
lus|wazze has quit ["--- reality is that which, when you stop believing in it, doesn't go away ---"]
Vekza has quit ["Leaving"]
reltuk has left #ocaml []
reltuk has joined #ocaml
Alain_ has joined #ocaml
mfurr has quit ["zzZZzz"]
bk_ has joined #ocaml
Shammah has joined #ocaml
andrewb has joined #ocaml
vegai has quit ["Terminated with extreme prejudice - dircproxy 1.1.0"]
Maddas has joined #ocaml
vegai has joined #ocaml
<Maddas> Hi
<Maddas> Do Objective Caml programs never have run-time type dispatching?
<Maddas> Neglecting the OO features, I just mean for, say, union types
The-Fixer has joined #ocaml
<andrewb> There is no type information at runtime, so no.
<Maddas> Heh, ok.
<Maddas> How are union types handled, then?
<andrewb> Have a look at the assembly output generated by ocamlopt. ;-)
<Maddas> Heh.
<andrewb> Actually, there was a really good webpage which walked through some disassembly of ocaml programs.
<Maddas> Thanks
<andrewb> Anyhow, for unions there is a tag which tells the runtime which constructor was used.
<Maddas> So thre is run-time type dispatch? :)
<Maddas> there, even. I should learn some assembly.
<andrewb> There's certainly runtime decisions made based on tags, but the _types_ are all known in advance.
<Maddas> Yes, type dispatching was the wrong word, sorry.
<andrewb> That ocaml-disassembly webpage is really cool I think. I learned a lot from it.
<Banana> hello.
reltuk has left #ocaml []
<Banana> as andrewb said, type is known at compile type and the only thing you can do with union type in ocaml is filter them with a pattern matching.
<Banana> this is a runtime decision made on tag value.
* Maddas nods
vegai has left #ocaml []
<andrewb> btw, page 43 of the "ZINC experiment" paper gives an early view of this stuff
<Maddas> Heh, the ZINC experiment?
<andrewb> Early ancestor of caml .. http://pauillac.inria.fr/~xleroy/leroy.html
<Maddas> ok, thanks
<andrewb> It's heavy-going in parts, but bits of it are straightforwards
<yella> how can I circumvent the 'this expression has type t but is here used with type t'-problem mentionned on the caml.inria.fr Q&A page
__DL__ has joined #ocaml
<Banana> are you using the toplevel ?
<yella> i got the error there,yes. but im only testing some functions in the toplevel.
<Banana> if so, you defined a type t, then defined a function using type t, then changed type t then apply your function to something of the new type t.
<Banana> so juste restart the toplevel and it should be fine.
<yella> hm. so it shouldnt be a problem using a recursive function fun1, returning type t, and call fun1 in the recursive fun2 which also returns type t ?
<yella> well I try, thanks
__DL__ has quit [Client Quit]
<yella> I'd like to have a toplevel with history. arrow-up is so nice..
<Banana> use ledit.
<Banana> install ledit and just run "ledit ocaml"
<Banana> (or use the tuareg emacs mode, to run ocaml within emacs).
<yella> ledit is working, very nice.
<yella> thanks
<Banana> you can also ledit -h history.ml ocaml to keep track of what you typed in a file.
<yella> is it possible to use/import interface files in the toplevel?
mattam_ has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
Lemmi1 has joined #ocaml
avlondono has joined #ocaml
Lemmih has quit [Read error: 110 (Connection timed out)]
Lemmi1 is now known as Lemmih
<andrewb> yella: Why would you need to do that?
maihem has joined #ocaml
<lucifer> is it possible to get this working (without using a loop):
<lucifer> let rec j =
<lucifer> let x = Random.int (length l) in
<lucifer> if x = i then x else j
<lucifer> (i know the list l is of length >= 2, but the compiler refuses to let me compile it (let rec j =
<lucifer> let x = Random.int (length l) in
<lucifer> (doh darn windows)
<lucifer> i get "This kind of expression is not allowed as right-hand side of `let rec'"
<lucifer> basically, i just want two unequal random ints..
<andrewb> You can make j a function which takes a unit argument .. eg. let j () = ...
<andrewb> (and you probably want not-equals rather than equals too)
<lucifer> yeah saw that mistake just now :)
<andrewb> ;-)
<lucifer> but 'let j ()' cannot recurse..
<andrewb> let rec j () = let x = Random.int (List.length l) in if x <> i then x else j ();;
<lucifer> ah :) thnx
* andrewb ponders what "let rec" means for non-function bindings anyway
<lucifer> any 'keep trying to obtain a value' variable.. f.i. let rec getchar = match keypressed with None -> getchar | Key(k) -> k;;
<lucifer> not a very nice thing to do in functional languages :)
srv has quit [Read error: 113 (No route to host)]
<Banana> or you can use it as a trick to define circular lists.
<Banana> let rec l = 1::l
<Banana> but you have to define their contents implicitely = let rec l = 1::2::3::4::l
<Banana> you cannot add an element afterwards without breaking circularity.
srv has joined #ocaml
Shammah has quit ["ChatZilla 0.9.35 [Mozilla rv:1.5/20030925]"]
<Banana> s/implicitely/explicitely/ of course.
<andrewb> Cheers, I will play around with this later.
LordBrain has joined #ocaml
malte has joined #ocaml
<malte> are all ocaml's libraries free as in speech?
<LordBrain> i found out yesterday the nums library wasnt, but they're rewriting it.
<malte> ok :)
<Alain_> Banana, s/explicitely/explicitly ;-)
<Banana> true.
<Alain_> Well, actually, s|explicitly|explicitly/|
gl has left #ocaml []
gl has joined #ocaml
Shadoko has joined #ocaml
mattam_ is now known as mattam
Alain_ has left #ocaml []
smkl has joined #ocaml
yella has quit [Read error: 104 (Connection reset by peer)]
housetier has joined #ocaml
yella has joined #ocaml
zno has joined #ocaml
Axioplase has joined #ocaml
<Axioplase> Hi!
<malte> hi!
<Axioplase> argh. i hate those Exception: Invalid_argument "Array.get"
wazze has joined #ocaml
<zno> Axioplase: that would be much better than a segfault or bus error
<Axioplase> zno: yep!
<Axioplase> i m adding loads of try...with to get the guilty func....
<zno> it's probably an off by 1 error no?
<Axioplase> argh! i can't "try let foo=bar with XXX and try foo2=bar2 with YYY"
cjohnson has joined #ocaml
smkl has quit [Read error: 110 (Connection timed out)]
smklsmkl has joined #ocaml
<Axioplase> let le_plus_a_droite x y = let i= ref 0 in
<Axioplase> while (((x+ !i)<=(colonnes-1)) && (ecran.(x+ !i).(y)=ecran.(x).(y))) do i:=!i+1 done;
<Axioplase> why doesn t it stop when x+!i goes after (colonnes-1) ?
<Dybbuk> Wow, that's a whole lot of parens.
<Shadoko> well it should...
<Shadoko> why don't you use a for loop ?
<Axioplase> because, i don't kown when it will stop. either because, we hit the right border (colonnes-1), either because value is different from the first one.
<Shadoko> ah ok
<Axioplase> but it always goes on, until i get an array.get exception.
<Meta> Hi Shadoko ^_^
<Banana> Axioplase: just insert a Printf.printf "x+i = %i ; colonnes = %i\n" (x+!i) (colonnes) ;in your do .. done statement.
<Axioplase> i have done it.
<Axioplase> it crashes there: i=5, x+i=10 , y=5 Exception: Invalid_argument "Array.get".
<Axioplase> after a foo 5 5;; in a 10x10 matrix.
<Axioplase> where colonnes equals to 10, hence the (colonnes-1) in my test.
<Axioplase> damn i found out.
<Axioplase> make_matrix lines columns. i thought it was make_matrix columns lines. and my matrix wasn t square...
<Banana> :)
<Shadoko> 19:51 <Axioplase> after a foo 5 5;; in a 10x10 matrix. <- ???
<Axioplase> Shadoko: i though, but i just re-read the top of my source with the declaration of my matrix....
<Shadoko> ok :)
m[kel[ has joined #ocaml
smklsmkl has quit [Read error: 110 (Connection timed out)]
<Shadoko> let rec loop i = if (x + i < colonnes) && (ecran.(x + i).(y) = ecran.(x).(y)) then loop (i + 1) else i
pattern has quit [Read error: 110 (Connection timed out)]
<Shadoko> Personnally I would prefer this to using a while loop and a reference
Vekza has joined #ocaml
vegai has joined #ocaml
shrimpx has joined #ocaml
malte has quit [Remote closed the connection]
avlondono has quit ["ChatZilla 0.9.52B [Mozilla rv:1.6/20040312]"]
LordBrain has quit ["Leaving"]
pattern has joined #ocaml
Axioplase is now known as Axio|Axay
pattern has quit [Client Quit]
Axio|Axay is now known as Axio|Away
pattern has joined #ocaml
pattern has quit [Client Quit]
pattern has joined #ocaml
pattern has quit [Client Quit]
pattern has joined #ocaml
Axio|Away has quit ["error 8.6 (Connection reset by beer)"]
housetier has quit ["#breaks @ irc.highteq.de"]
housetier has joined #ocaml
reltuk has joined #ocaml
housetier has quit ["#breaks @ irc.highteq.de"]
housetier has joined #ocaml
Vekza has quit [Read error: 60 (Operation timed out)]
zno has left #ocaml []
reltuk has left #ocaml []
lodewijk has joined #ocaml
Vekza has joined #ocaml
Lemmih has quit ["Download Gaim: http://gaim.sourceforge.net/"]
lodewijk has quit ["Killed by gemini (Requested by panasync)"]
bk_ has quit ["I'll be back"]
bk_ has joined #ocaml
<Dybbuk> Hmmmm...anybody here have a favorite extended precision library?
<Dybbuk> Looks like Num, Numerix, and MLGMP are the three main choices, huh?
<Riastradh> Extended precision integer or float?
<Dybbuk> Integer.
mfurr has joined #ocaml
<Dybbuk> I suspect it'll be tough to beat GMP for speed.
<Dybbuk> Let's see if MLGMP supports integers, though.
wazze has quit ["--- reality is that which, when you stop believing in it, doesn't go away ---"]
maihem has quit ["Client exiting"]
Shadoko has quit ["++`+"]