smkl changed the topic of #ocaml to: OCaml 3.06 released: http://caml.inria.fr/ocaml/distrib.html | http://www.ocaml.org/ | http://caml.inria.fr/oreilly-book/ | http://icfp2002.cs.brown.edu/ | SWIG now supports OCaml
csharpener has joined #ocaml
csharpener has quit ["Advanced IRC 1.32: don't ask, don't tell."]
Grepninja has joined #ocaml
<Grepninja> Anybody home?
Grepninja has left #ocaml []
<mrvn> tss, waiting for under a minute if someone wakes up....
smkl has quit [Read error: 110 (Connection timed out)]
eivuokko has joined #ocaml
<pnou> plop
<eivuokko> *gulp*
<mrvn> Is there something like initializer thats called before an object is deleted? A destructor?
SYStems has joined #ocaml
SYStems has left #ocaml []
mrvn_ has joined #ocaml
gl has joined #ocaml
mrvn has quit [Read error: 110 (Connection timed out)]
gl has quit [Read error: 104 (Connection reset by peer)]
gl has joined #ocaml
gl has quit [Killed (NickServ (Ghost: foo_!~foo@du-212-17.nat.adsl.freesurf.fr))]
gl has joined #ocaml
thelema|away has quit [Read error: 110 (Connection timed out)]
<pnou> no mrvn_
<mrvn_> re
mrvn_ is now known as mrvn
thelema|away has joined #ocaml
<pnou> but i never felt the lack of destructor
<mrvn> I have to call some cleanup functions before a class can be deleted. I would like to have a destructor that checks if that has been done correctly.
<mrvn> So it complains if I loose an instance somewhere and don't call the cleanup functions.
<mrvn> Are file_descriptors closed automatically when they die?
<mrvn> type file_descr I mean
<pnou> i don't think so
<mrvn> Thats another thing I would want a destructor for
<pnou> yes i see your point
<pnou> but you don't really control when object are freed
<pnou> not like in C++
<pnou> this would make your program depend of the gc behaviour
<mrvn> They have it in java. The destructor might never be called but it is called before the memory is freed. If java doesn't run a gc the destrucor is never called.
<mrvn> You never know when the destructor is called so files might stay open for ages if not manually closed.
<pnou> well i'm not sure the caml team would appreciat that semantic :)
<mrvn> I would like to have it as control instance to check for resource leaks.
<pnou> yes, it would be useful
<mrvn> The only way I see now is to set a timer that checks regulary if a fd is still used and closes it if not (an reopens it if its used again).
<mrvn> Works for files but not with sockets where I might need a login and pass to restore a wrongly closed fd.
<pnou> you can make a control class that is used to create your object and check all you want every time you create an object
<mrvn> But I never know when its not needed anymore.
gl has quit [No route to host]
<mrvn> I have easily >300 file descriptors open after some time so debugging which are leaked is kind of hard.
gl has joined #ocaml
<pnou> but you know when you don't need anymore an object
<pnou> even if it's not when the gc free it
<pnou> so you could check here, no ?
<mrvn> If I knew when I don't need it anymore I would have closed the FD there.
<mrvn> The problem is that people reported that FDs leak so somewhere some don't get closed.
gl has quit [Killed (NickServ (Ghost: gl!~foo@du-212-17.nat.adsl.freesurf.fr))]
gl has joined #ocaml
gl has quit [Read error: 113 (No route to host)]
smkl has joined #ocaml
gl has joined #ocaml
SYStems has joined #ocaml
Good^2B^Free has joined #ocaml
thelema|away has quit [Read error: 104 (Connection reset by peer)]
Good^2B^Free has quit [Client Quit]
SYStems has quit [Read error: 110 (Connection timed out)]
thelema|away has joined #ocaml
Yurik has joined #ocaml
<Yurik> re
<pnou> re
<mrvn> hirsch
<mrvn> Is there some ready to use heap in ocaml?
<pnou> a heap data structure module ?
<mrvn> yep.
gl has quit [Read error: 104 (Connection reset by peer)]
Yurik has quit [Read error: 104 (Connection reset by peer)]
<mrvn> Or a balanced tree or priority queue
<pnou> Map or Set according to what you want
<pnou> no heap, no priority queue in the standard lib
<pnou> i wrote a quick implementation of priority queue and heap for the icfp
<pnou> it's a shame that there's nothing like that in the standard lib
thelema|away has quit [Read error: 110 (Connection timed out)]
<mrvn> heaps are more for languages where you use arrays a lot.
<mrvn> For ocaml a tree is probably more fficient.
<mrvn> +e
<mrvn> Did you use a set in your priorityqueue?
gl has joined #ocaml
<pnou> heap support min operation in 0(1) that's enough important to implement them
<pnou> in a non optimized version i use a Map, in a more optimized one i used a hashtbl
thelema|away has joined #ocaml
eivuokko has quit ["."]
<mrvn> Heaps have min operation in O(log n) if you remove it.
<mrvn> And sets should have min/max in O(1) if you don't remove it.
eivuokko has joined #ocaml
<pnou> they should :)
ocamlbot has quit [Remote closed the connection]
thelema|away has quit [Read error: 60 (Operation timed out)]
TimFreeman has joined #ocaml
TimFreeman has left #ocaml []
gl has quit [No route to host]
thelema|away has joined #ocaml
ocamlbot has joined #ocaml
thelema|away has quit [Read error: 104 (Connection reset by peer)]
ocamlbot has quit [Remote closed the connection]
ocamlbot has joined #ocaml
<pnou> .plugin add exec
spip has joined #ocaml
olczyk has joined #ocaml
<olczyk> I have a question about the nature of caml. I'm looking for a programming language to learn
<olczyk> for my next year loty project.
<olczyk> I was thinking of haskell, caml or erlang.
<olczyk> I've discovered that haskell delimits blocks ala Python, using changes in indentation.
<olczyk> I really hate that, and was wondering if the same is true of caml?
<pnou> not the same
TachYon25 has quit ["bez ki³y nie ma zaliczenia (z prawd studentek AM)"]
<pnou> you can ident like a pig if you want :)
<olczyk> Or not indent at all?
<pnou> yep
<olczyk> Cool.
<pnou> generally people prefer haskell syntax
<mrvn> If you use xemacs use the tuareg-mode
<olczyk> I use straight emacs.
<mrvn> I prefer it if <tab> indents correctly when programming
<mrvn> also syntax coloring is nice
<olczyk> Parts of the haskell syntax may be better, I don't know enough to judge, but I believe indentention
<olczyk> for delimiting blocks is error prone.
<olczyk> One time you accidentally hit a space, delete or tab can cause a lot of problems.
<olczyk> mrvn: And you say emacs doesn't do these things?
<mrvn> Esspecialy if you need to change the indentation, e.g. when adding another if somewhere.
<olczyk> It does them for most other languages that I know of.
<mrvn> exmacs does quite a good job on indentation.
<mrvn> Only the auto-fill-mode isn't realy helpfull for ocaml.
spip has quit ["Client Exiting"]
TimFreeman has joined #ocaml
TimFreeman has left #ocaml []
eivuokko has quit ["."]
thelema has joined #ocaml
thelema has left #ocaml []
smklsmkl has joined #ocaml
smkl has quit [Read error: 104 (Connection reset by peer)]
malc has joined #ocaml
MegaWatS has joined #ocaml
<MegaWatS> hi there :>
malc has quit [Read error: 110 (Connection timed out)]