<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)]
<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.
<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?
<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)
<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)]