flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.0 out now! Get yours from http://caml.inria.fr/ocaml/release.html
rhar has joined #ocaml
_JFT_ has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
_JFT_ has quit []
Associat0r has quit []
Associat0r has joined #ocaml
angerman has joined #ocaml
tripwyre has quit []
hkBst has quit [Read error: 104 (Connection reset by peer)]
Ched has quit ["Ex-Chat"]
prime2 has joined #ocaml
^authentic has joined #ocaml
authentic has quit [Connection timed out]
^authentic is now known as authentic
willb has joined #ocaml
rhar has quit [Read error: 110 (Connection timed out)]
tripwyre has joined #ocaml
willb has quit [Read error: 110 (Connection timed out)]
bohanlon has quit ["I fear that I must depart for now."]
willb has joined #ocaml
bohanlon has joined #ocaml
jeddhaberstro has quit []
rhar has joined #ocaml
rhar has quit [Client Quit]
seafood has quit [Read error: 110 (Connection timed out)]
tripwyre has quit []
Associat0r has quit []
Associat0r has joined #ocaml
angerman has quit []
sporkmonger has quit []
fibonacci2 has joined #ocaml
angerman has joined #ocaml
seafood has joined #ocaml
prime2 has quit [Remote closed the connection]
Associat0r has quit [Read error: 104 (Connection reset by peer)]
angerman has quit [Read error: 104 (Connection reset by peer)]
angerman has joined #ocaml
Alpounet has joined #ocaml
seafood has quit []
Camarade_Tux has joined #ocaml
<mbishop> neat
<Alpounet> really ?
<mbishop> really what?
<Alpounet> did you like this post ?
<mbishop> yes
<mbishop> I hope there are more :)
<Alpounet> As I've written it... :-)
<mbishop> Ah, well good work :P
<Alpounet> I'm just trying to push more people into Batteries
<verte> is that like a cube except made of chicken wire?
<Alpounet> will someone participate to JSSP ?
tripwyre has joined #ocaml
tripwyre has quit []
tripwyre has joined #ocaml
ikaros has joined #ocaml
_zack has joined #ocaml
s4tan has joined #ocaml
Hadaka has quit [brown.freenode.net irc.freenode.net]
ertai has quit [brown.freenode.net irc.freenode.net]
ertai has joined #ocaml
hkBst has joined #ocaml
tripwyre has quit []
itewsh has joined #ocaml
Ched has joined #ocaml
<_zack> I'm using emacs+tuareg and I cannot stend the intendation of the first expression after a series of let..in, is there any way to turn it off? my reading of the docs didn't find anything
<_zack> (of course "stand" and "indentation", urgh)
angerman has quit [Read error: 110 (Connection timed out)]
itewsh has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
<petchema> _zack: here's what I use: http://rafb.net/p/HSKEDV60.html
<_zack> petchema: thanks, do you know which setting is the one I need (somehow tuareg variable names are misleading)
<_zack> looks like it is tuareg-in-indent
<petchema> probably... I haven't touched that in ages...
<Alpounet> that much ?
<petchema> "if ain't broken don't fix it" ;)
itewsh has quit [Read error: 60 (Operation timed out)]
itewsh has joined #ocaml
Yoric[DT] has joined #ocaml
<Alpounet> :p
<Yoric[DT]> hi
s4tan has quit [Read error: 104 (Connection reset by peer)]
s4tan has joined #ocaml
kaustuv has quit [Read error: 60 (Operation timed out)]
kaustuv has joined #ocaml
Naked has joined #ocaml
Naked is now known as Hadaka
m3ga has joined #ocaml
m3ga has quit [Client Quit]
<Yoric[DT]> upvoted
<Yoric[DT]> Yeah, I've read that some time ago.
<Yoric[DT]> I don't think we can do that in our context.
<Yoric[DT]> I also don't think it's very useful.
<mfp> doesn't seem to integrate with Batteries' own generalization (over diff containers)
<Yoric[DT]> Yeah.
<Yoric[DT]> Mmmmhhh.....
<Yoric[DT]> Unrelated question: didn't you have something you wanted to submit to Batteries?
<mfp> probably one of those things that looks great on the paper, but is of little use in practice
<Yoric[DT]> Camarade_Tux: ping
<mfp> huh
<mfp> let me think
<Yoric[DT]> I vaguely seem to remember so.
<mfp> property lists?
<Yoric[DT]> But I'm not completely sure.
<Yoric[DT]> That would be older.
<Yoric[DT]> (at least older than your blog post on property lists)
<mfp> code of mine, or 3rd party code I happened to mention?
<Yoric[DT]> Sorry, can't remember.
<mfp> grep -2 batteries FreeNode-#ocaml.log | grep mfp to the rescue
<Yoric[DT]> :)
<Yoric[DT]> (should ignore case)
<mfp> we chatted about the exec size problem a couple weeks ago, maybe that's what you have on the back of your mind?
<Yoric[DT]> I don't think so.
<Yoric[DT]> Still, I have to go.
<Yoric[DT]> We'll chat later.
felixzero has joined #ocaml
<felixzero> hello ? bonjour ?
<verte> bonsoir, felixzero
<flx_> what does batteries generate with 0 -- (-2) ?
<felixzero> bon appétit ^^
<Yoric[DT]> flx_: empty
<flx_> good :)
<Yoric[DT]> 0 --- (-2) generates the decreasing enumeration, though
<flx_> does it always generate decreasing enumeration or does it depend on the arguments?
<flx_> it looks awfully similar to --, but I guess if I wanted to change it to, say, --!, I would need to submit a bug report and persuade a lot of folks :)
<Alpounet> Just get used to --- :-p
<Alpounet> that'll be much simpler
<flx_> I'm just saying mixing -- with --- can break or make a code in edge conditions
<Alpounet> It may, or not yes. You can IMO ask about it on the devel ML
<Alpounet> Thus, Batteries isn't at release stage, so discussions are still open.
<flx_> indeed
<flx_> I'm subscribed on the ml, but I haven't actually followed it :)
mehdid has quit [Read error: 110 (Connection timed out)]
<Alpounet> There are many subprojects you can contribute to, don't heistate ;)
mehdid has joined #ocaml
Alp_ has joined #ocaml
Alpounet has quit [Nick collision from services.]
Alp_ is now known as Alpounet
hkBst has quit [Read error: 104 (Connection reset by peer)]
^authentic has joined #ocaml
authentic has quit [Read error: 104 (Connection reset by peer)]
^authentic is now known as authentic
Demitar has quit [Connection timed out]
<felixzero> excuse me, i'd like to know when alloc_final call the finalisation function.
<felixzero> because this code : http://pastebin.com/m3f21c1aa, doesn't free the memory
slash_ has joined #ocaml
kaustuv has left #ocaml []
<mfp> felixzero: are you forcing a minor Gc run after that?
Demitar has joined #ocaml
<felixzero> how can i ?
slash_ has quit [Read error: 60 (Operation timed out)]
<mfp> Gc.minor ();;
<felixzero> ok thanks
<mfp> but you have to do make_sb () instead of let bidule = ... of course
<mfp> otherwise it won't be collected, since there's still a reference
<felixzero> but at the end of the program
<felixzero> the gc should free the memory
<felixzero> shouldn't it ?
<mfp> I'm not sure the finalizer is guaranteed to be called at exit
<felixzero> bad
<mfp> it'll be called when the value is GCed, but there's no need to GC at exit after all, as the mem is going to be released anyway
<felixzero> yes but i will be released quite violently
<felixzero> with errors :
<felixzero> AL lib: ALc.c:1302: exit() 1 device(s) and 1 context(s) NOT deleted
<felixzero> AL lib: alSource.c:2291: alcDestroyContext(): 1 Source(s) NOT deleted
<felixzero> AL lib: alBuffer.c:1097: exit() 1 Buffer(s) NOT deleted
<mfp> use at_exit
<mfp> the manual says this about Gc.finalise: [the finaliser for value v] will be called once (or never, if the program terminates before v becomes unreachable).
Alp_ has joined #ocaml
<felixzero> hello Alp
<mfp> felixzero: hmmm this is a bit tricky, you need to have a val finalise : thing -> unit to release the resources, and then use Gc.finalise plus at_exit (using Weak so that you don't keep a reference)
<felixzero> ok
<mfp> that way, either the finaliser is called when the GC runs, or on exit
<felixzero> can it conflicts with alloc_final ?
<felixzero> eg : 2 free
<mfp> oh, if the value is not reachable through a global root, just doing at_exit Gc.full_major might work
<mfp> if you use Weak in the at_exit handler, either the value is reachable and the finaliser hasn't run, or it isn't and you can obtain the value to finalise it
<mfp> ehm ... and you *cannot* obtain the value ...
<mfp> (to finalise it "again")
Alp__ has joined #ocaml
<felixzero> yes of course
Alp__ has quit [Read error: 104 (Connection reset by peer)]
Alp__ has joined #ocaml
<mrvn> saddly enough the GC isn't run at the end of program. Something I consider a bug.
<felixzero> and it is quite strange
<felixzero> a GC SHOULD free all the memory at the end
<mfp> I think I can see a reason for that
<mrvn> It assumes the OS will free all memory at the end or maybe it just blindly frees the heap. But it should call the finalize functions of all custom blocks.
<mfp> since you can register arbitrary finalisers, they could hold references to other roots
<mrvn> mfp: something I believe I have to do for fuse.
<mfp> e.g. module X = struct let s = "foo" let finalise x = Printf.printf "hoho %S\n" s end .... Gc.finalise X.finalise v
<mfp> it becomes involved as you have to keep all the roots reachable from the finalisers, GC, discard executed finalisers, loop
Alpounet has quit [Read error: 110 (Connection timed out)]
<mfp> that is, you cannot just execute all the finalisers blindly
<mrvn> mfp: execute them in the order the GC would normaly do.
<mfp> which means looping as described above
<mrvn> How does the GC handle loops by the way? Especially binding loops in the finalizers.
<mfp> loops are no pb, but refs held by finalisers will prevent GC
Alp_ has quit [Connection timed out]
<mrvn> so it just leaks the memory?
<mfp> let x = ... in Gc.finalise (fun _ -> ignore x) x -> never GCed
<mfp> this is documented in the manual IIRC
^authentic has joined #ocaml
paul424 has joined #ocaml
<Camarade_Tux> Yoric[DT], pong
<paul424> hey how to I set the correct type for parameter in the super class ... like this class queueFP =
<paul424> object(self)
<paul424> inherit printable as localPrintable
<paul424> inherit queueF<#toString> as localQueueF end;;
<Camarade_Tux> Yoric[DT], the stopper was basically api which could probably change to something with objects iirc
<paul424> I mEAN queue must have objest which use the method toString
authentic has quit [Connection timed out]
^authentic is now known as authentic
sirGrey has joined #ocaml
<paul424> could anyone refer me to the ocaml manual type arguments ?
Alp__ has quit [Read error: 110 (Connection timed out)]
felixzero has quit [Remote closed the connection]
<paul424> please please help me
* petchema never used OCaml's OO
felixzero has joined #ocaml
itewsh has quit [Read error: 60 (Operation timed out)]
itewsh has joined #ocaml
kaustuv has joined #ocaml
<tsuyoshi> freeing everything at the end of a program is stupid
<tsuyoshi> the os can do it much more quickly than the gc can
<felixzero> ^^
<mrvn> tsuyoshi: the point was to call the finalizers.
<mrvn> tsuyoshi: and not every OS can do it
<tsuyoshi> you shouldn't rely on the gc to do anything but handle memory
<felixzero> some libs need somes
<tsuyoshi> it simply doesn't work reliably in ocaml
<tsuyoshi> if you need that use atexit
* tsuyoshi learned this the hard way
<mrvn> tsuyoshi: problem is how do I remove the atexit again when the GC finalizes?
<tsuyoshi> well.. you can store a global list of what you need to finalize
<tsuyoshi> in the finalizer for a particular object, it should remove itself from the list
<mrvn> list has bad performance
<tsuyoshi> the atexit finalization should just go through the list
<tsuyoshi> whatever.. an array, a tree
<Camarade_Tux> Gc.full_major helps, as long as you don't call somewhere what you want to be finalized is still in sight...
<mrvn> I added an atexit function that makes a full GC sweep.
<tsuyoshi> well, that won't always work
<mrvn> works as long as you don't put the value in a global variable.
sporkmonger has joined #ocaml
<paul424> eehhh type arguments help
paul424 has quit ["ChatZilla 0.9.84 [Firefox 3.0.6/2009011913]"]
itewsh has quit [Read error: 60 (Operation timed out)]
itewsh has joined #ocaml
* Yoric[DT] is back.
<tsuyoshi> paul424: what are you asking for exactly?
Alpounet has joined #ocaml
_zack has quit ["Leaving."]
mfp has quit ["Leaving"]
mfp has joined #ocaml
verte has quit ["http://coyotos.org/"]
itewsh has quit [Connection timed out]
itewsh has joined #ocaml
itewsh has quit [Read error: 60 (Operation timed out)]
itewsh has joined #ocaml
sirGrey has quit ["Ухожу я от вас (xchat 2.4.5 или старше)"]
sirGrey has joined #ocaml
sirGrey has quit [Client Quit]
sirGrey has joined #ocaml
jlouis_ has joined #ocaml
jlouis has quit [Read error: 54 (Connection reset by peer)]
itewsh has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
<kaustuv> Yoric[DT]: your suggestion of using syntax extensions for pretty printing seems to already be present in camlp5 (http://pauillac.inria.fr/~ddr/camlp5/doc/html/pprintf.html)
<kaustuv> What is Batteries Included's opinion of camlp5 anyhow?
<Yoric[DT]> Well, we've started working with camlp4.
<Yoric[DT]> So we're not going to switch.
<Yoric[DT]> (at least not at this point)
slash_ has joined #ocaml
<kaustuv> I admit to being a camlp4/5 noob. What changed in the 5->4 switch?
<kaustuv> or old4->new4, as the case is
<Yoric[DT]> I believe it's more complex than this.
<Yoric[DT]> Yeah.
<Yoric[DT]> old4 -> new4 = general clean-up, functorization, OO-ization of map, fold, etc.
<Yoric[DT]> (I believe)
<Yoric[DT]> old4 -> 5 = general rewrite of the parser
<Yoric[DT]> (I believe)
itewsh has quit [Remote closed the connection]
<kaustuv> So neither subsumes the other then? That's unfortunate.
<kaustuv> Well, maybe I'll see if the pa_printf stuff can be ported to the new camlp4.
authentic has quit [Read error: 60 (Operation timed out)]
<Yoric[DT]> Check with Jérémie first.
<Yoric[DT]> He already has a prototype of his Camlp4-based printf.
<Yoric[DT]> This probably doesn't include pagination/pretty-printing, of course.
sirGrey has quit ["õÈÏÖÕ Ñ ÏÔ ×ÁÓ (xchat 2.4.5 ÉÌÉ ÓÔÁÒÛÅ)"]
sirGrey has joined #ocaml
authentic has joined #ocaml
pixel__ has quit ["leaving"]
pixel_ has joined #ocaml
Snark has joined #ocaml
<Yoric[DT]> Gottarun.
Yoric[DT] has quit ["Ex-Chat"]
ikaros_ has joined #ocaml
felixzero is now known as felixzero`away
paul424 has joined #ocaml
<paul424> heh how do I put the type arguments into the polymorphic class please please help me ......
<Alpounet> class ['a] stack =
<Alpounet> object [etc...] end;; for example ?
ikaros has quit [Read error: 110 (Connection timed out)]
s4tan has quit [Read error: 104 (Connection reset by peer)]
s4tan has joined #ocaml
Demitar has quit ["Burn the land and boil the sea. You can't take the sky from me."]
Cheshire has joined #ocaml
ikaros_ is now known as ikaros
thelema_ has joined #ocaml
Alpounet has quit [Read error: 110 (Connection timed out)]
willb has quit [Read error: 60 (Operation timed out)]
felixzero`away has left #ocaml []
_zack has joined #ocaml
Associat0r has joined #ocaml
Tux_ has joined #ocaml
Camarade_Tux has quit [Read error: 104 (Connection reset by peer)]
ikaros has quit ["Leave the magic to Houdini"]
Alpounet has joined #ocaml
Tux_ has quit ["Quitte"]
<Alpounet> re
s4tan has quit [Connection timed out]
willb has joined #ocaml
_zack has quit ["Leaving."]
love-pingoo has joined #ocaml
_zack has joined #ocaml
rhar has joined #ocaml
Alpounet has quit [Read error: 104 (Connection reset by peer)]
Alpounet has joined #ocaml
paul424 has quit ["ChatZilla 0.9.84 [Firefox 3.0.6/2009011913]"]
Alp_ has joined #ocaml
<kaustuv> .oart
<kaustuv> wth
kaustuv has quit ["ERC Version 5.3 (IRC client for Emacs)"]
_zack has quit ["Leaving."]
Alpounet has quit [Read error: 110 (Connection timed out)]
Amorphous has quit [Read error: 110 (Connection timed out)]
Cheshire has quit [Read error: 113 (No route to host)]
Cheshire has joined #ocaml
Amorphous has joined #ocaml
Alpounet has joined #ocaml
prime2 has joined #ocaml
kaustuv has joined #ocaml
Alp_ has quit [Read error: 110 (Connection timed out)]
prime2 has quit ["leaving"]
jeremiah has quit [Read error: 104 (Connection reset by peer)]
jeremiah has joined #ocaml
mrpingoo has joined #ocaml
love-pingoo has quit [Read error: 110 (Connection timed out)]
sporkmonger has quit []
sporkmonger has joined #ocaml
hkBst has joined #ocaml
Demitar has joined #ocaml
zeus has joined #ocaml
<zeus> Hi there,
Alpounet has quit [Read error: 54 (Connection reset by peer)]
_zack has joined #ocaml
Snark has quit ["Ex-Chat"]
kaustuv has quit [Remote closed the connection]
kaustuv has joined #ocaml
slash_ has quit [Read error: 110 (Connection timed out)]
Yoric[DT] has joined #ocaml
Demitar has quit [Remote closed the connection]
Demitar has joined #ocaml
slash_ has joined #ocaml
verte has joined #ocaml
r0bby_ is now known as r0bby
sporkmonger has quit []
Camarade_Tux has joined #ocaml
_zack has quit ["Leaving."]
seafood has joined #ocaml
sitaway has joined #ocaml
<sitaway> Hi, what is the quickest way to iterate over a record (say "type complex = { r: int ; i: int }") list, to get a list of reals please ? I'm trying to find something equivalent to fst (but not for tuple, for records)
<Camarade_Tux> List.map (fun your_record -> your_record.r) your_record_list ?
<sitaway> Camarade_Tux: yeah, exactly, but isn't there a shortcut ?
<Camarade_Tux> not that I know (I'd love to know one though)
<sitaway> Camarade_Tux: thanks
<mrvn> You have to copy the ints into list elements. No way around that.
slash_ has quit [Read error: 110 (Connection timed out)]
paul424 has joined #ocaml
<chicco> sitaway: if you are not afraid of ugly things, records and tuples are the same things in memory... with Obj.magic fst will work on tuples
<chicco> but it is really really ugly !
<mrvn> and I bet result is much more complex code.
sgnb` has joined #ocaml
<chicco> let fst x = fst ( Obj.magic x )
sgnb has quit [Read error: 104 (Connection reset by peer)]
<paul424> hey suppose I have class 'a queue, how do I make the instance of such class ? let local_queue = new <Int32> queueFP ????????????
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
<totom> you don't specify any type
<totom> the compiler will infer it for you
<totom> if you push ints into your local_queue then the compiler will understand it is an int queue
<paul424> not the true, while somwhere in code I assume that its elements have the toString method
mrpingoo has quit ["Connection reset by pear"]
<sitaway> chicco: eerk :/ I'll stick with (fun x -> x.attribute) :)
<paul424> totom: >??
<thelema_> sitaway: batteries will soon integrate some camlp4 that'll allow: (_ $1.attribute) (or something really similar)
<totom> yes?
<mrvn> is batteries the new perl?
<brendan> I don't know what that means, but it doesn't sound good
<chicco> with ocaml speed and type system
<mrvn> indeed
<sitaway> thelema_: k
<paul424> totom: I said I get: |"first"->print_string ((local_queue#first())#toString)
<paul424> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<paul424> This expression has type unit but is here used with type
<paul424> < toString : string > queueFP
<mrvn> paul424: #first() does not return a queueFP it seems.
<paul424> bingo
<thelema_> mrvn: you're right, $1 does remind me of perl (and other things) - I think we also worked out a (_ _.attribute) syntax that looks less like line noise ( "(_" indicates start of function with "_" as a placeholder)
<mrvn> (fun x -> x.attribute) already exists and is perfectly readable. Don't add duplicate syntaxes.
<brendan> +1
<chicco> using a $1 syntax also means that you can't change your type declaration
willb has quit ["Leaving"]
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
<Cheshire> why do you use (fun x -> x.attribute) ?
<Cheshire> instead of: attribute
<Cheshire> I never used a record in ocaml btw..
<Cheshire> only the types
Cheshire has quit [Read error: 113 (No route to host)]