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
Alpounet has quit ["Ex-Chat"]
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
jeddhaberstro has joined #ocaml
vuln has quit [Read error: 110 (Connection timed out)]
catechu has joined #ocaml
Camarade_Tux has quit ["Quitte"]
gildor has quit [Read error: 104 (Connection reset by peer)]
gildor has joined #ocaml
Associat0r has quit []
seafood has quit []
maxote has quit [Read error: 110 (Connection timed out)]
maxote has joined #ocaml
Camarade_Tux has joined #ocaml
seafood has joined #ocaml
Camarade_Tux has quit ["Quitte"]
jonasb has quit [Remote closed the connection]
seafood has quit []
ched_ has joined #ocaml
Ched has quit [Read error: 110 (Connection timed out)]
<tsuyoshi> gah... found a bug in camlzip
catechu has quit [Read error: 110 (Connection timed out)]
catechu has joined #ocaml
catechu has quit [Client Quit]
prime2 has joined #ocaml
m3ga has joined #ocaml
verte has joined #ocaml
kaustuv has left #ocaml []
Mr_Awesome has quit ["aunt jemima is the devil!"]
jeddhaberstro has quit []
kaustuv has joined #ocaml
prime2 has quit [Remote closed the connection]
vovkaii has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
_zack has joined #ocaml
mishok13 has joined #ocaml
weechat2 has joined #ocaml
chicco has quit [Read error: 54 (Connection reset by peer)]
_zack has quit ["Leaving."]
_zack has joined #ocaml
bluestorm has joined #ocaml
Camarade_Tux has joined #ocaml
Camarade_Tux has quit ["Quitte"]
hkBst has joined #ocaml
<tsuyoshi> yeah, definitely a bug in camlzip
sanehe has joined #ocaml
<sanehe> hi ; is there an easy way to create a module implementing the ocaml lists in which we can add an element at the end in O(1) ?
<bluestorm> you can use functional queues and have amortized O(1) easily, and constant O(1) with a bit of implementation complexity
<bluestorm> type 'a queue = ('a list, 'a list)
<bluestorm> let enqueue elem (front, back) = (elem :: front, back)
<tsuyoshi> the Queue modul,e basically does that
<tsuyoshi> iirc
<bluestorm> tsuyoshi: but you can't add at the front
<tsuyoshi> oh, right
<tsuyoshi> I was just thinking, internally it's implemented as a list with a pointer
<bluestorm> in an imperative setting, a circular linked list would do the job
<tsuyoshi> yeah, that's exactly how Queue is implemented
<tsuyoshi> you could add a Queue.to_list function without too much effort
<tsuyoshi> destroying the queue in the process
<tsuyoshi> or you could use Cf_deque
<sanehe> ok thanks
<sanehe> bluestorm: i did not understand your type ; the real list would be (back @ (rev front)) ?
<bluestorm> yes
<bluestorm> hm
<bluestorm> or front @ rev back
<bluestorm> let rec dequeue = function ([], []) -> failwith "empty queue" | (front, elem::back) -> elem, (front, back) | (front, []) -> dequeue ([], List.rev front)
<bluestorm> that's the usual functional queue implementation
<bluestorm> in this setting it's quite easy to add or take at both ends
<bluestorm> (you should probably choose more symmetrical names)
<bluestorm> though i'm not exactly sure the amortized O(1) bound still holds if you can take from both ends
<sanehe> thanks a lot
<bluestorm> you're welcome
<sanehe> i think i'll use Queue, as i need exactly a fifo and not a list where i can add on both ends
sysfault has joined #ocaml
Cheshire has joined #ocaml
sysfault has left #ocaml []
Camarade_Tux has joined #ocaml
Yoric[DT] has joined #ocaml
Demitar has joined #ocaml
verte has quit ["http://coyotos.org/"]
Camarade_Tux has quit ["Quitte"]
Camarade_Tux has joined #ocaml
Associat0r has joined #ocaml
jamii has joined #ocaml
Waleee has joined #ocaml
_zack has quit ["Leaving."]
Camarade_Tux has quit ["Quitte"]
<hcarty> tsuyoshi: What is the camlzip bug?
sporkmonger has joined #ocaml
mishok13 has quit ["Stopping IRC chat... [OK]"]
<kaustuv> xb
<kaustuv> oops
* kaustuv rewires erc to send only on C-return
slash_ has joined #ocaml
Waleee has quit ["http://www.mibbit.com ajax IRC Client"]
^authentic has joined #ocaml
authentic has quit [Read error: 110 (Connection timed out)]
^authentic is now known as authentic
Snark has joined #ocaml
vpalle has joined #ocaml
Narrenschiff has joined #ocaml
<det> I have a bug with camlzip too (memory leak), but I havent had time to track it down yet.
<det> The new add_entry_generator api will take 1GB of memory when creating a 60MB zip and never release it until the program is closed.
Narrenschiff has quit []
Camarade_Tux has joined #ocaml
Camarade_Tux has quit [Client Quit]
Camarade_Tux has joined #ocaml
Waleee has joined #ocaml
prime2 has joined #ocaml
vpalle has quit ["Leaving"]
Camarade_Tux has quit ["Quitte"]
jlouis has quit [Read error: 54 (Connection reset by peer)]
jlouis has joined #ocaml
<jamii> Hi
<jamii> Whats the usual way of grabbing ocaml packages? I already found findlib, caml-get, godi. Is there a community favourite?
Associat0r has quit [Connection timed out]
Associat0r has joined #ocaml
pierre_ has joined #ocaml
pierre_ is now known as PierreN
<PierreN> hi
<PierreN> does anybody knows why it is missing one bit in caml integer please ?
<bluestorm> PierreN: tag for the GC
<PierreN> huh is it really useful ? / how does it use it ?
<bluestorm> PierreN: to collect memory, you have to inspect the values to know what to keep
<bluestorm> and you have to know what's an integer, and what's a pointer to another value you've got to inspect
<bluestorm> the tag bit is used to differentiate "real pointers" and integer values
<PierreN> ok
<PierreN> hum i'm wonder how java have implemented this
<bluestorm> well they're various way
<bluestorm> you could box integer and have the tag apart
<bluestorm> (slow integer operations)
<bluestorm> or you could have a "conservative GC" wich doesn't know what's a real pointer and, in doubt, consider every integer as a potential pointer
<PierreN> ok
<bluestorm> there are probably more sophisticated method i'm not aware of (i've also heard you could keep a pointer_or_integer map somewhere)
<bluestorm> but I believe OCaml choice is the best compromise reasonably available
<bluestorm> if you want exact integers you have NativeInt, Int32 and Int64 (boxer, slower operations) and Big_int
<PierreN> yep ok (i don't need those for now it was just to know why)
<PierreN> thanks
<thelema> hi
xian has quit [Remote closed the connection]
prime2 has quit [Read error: 104 (Connection reset by peer)]
Ariens_Hyperion has joined #ocaml
Guest44293 has joined #ocaml
Guest44293 has quit ["Verlassend"]
jonasb has joined #ocaml
Ariens_Hyperion has quit []
bluestorm has quit [Read error: 104 (Connection reset by peer)]
bluestorm has joined #ocaml
bluestorm has quit [Read error: 104 (Connection reset by peer)]
bluestorm has joined #ocaml
bluestorm has quit [Read error: 104 (Connection reset by peer)]
bluestorm has joined #ocaml
bluestorm has quit [Read error: 104 (Connection reset by peer)]
bluestorm has joined #ocaml
ched_ has quit ["Ex-Chat"]
Ched has joined #ocaml
Ched has quit [Client Quit]
Ched has joined #ocaml
Anarchos has joined #ocaml
<Anarchos> i want to parse C comments with ocamllex/ocamlyacc, and use the comment string. How can i do ?
Snark has quit [Read error: 113 (No route to host)]
<bluestorm> Anarchos: do you allow for nested comments ? if not, the lexer can handle that
<Anarchos> bluestorm it is for C comments so i don't know if C allows nested comments or not. But i can disable it as i have some limited sources files to pass to the analyzer
Mr_Awesome has joined #ocaml
PierreN has quit ["leaving"]
<Anarchos> bluestorm how to get with ocamllex a string delimited by /* and */ ?
Ariens_Hyperion has joined #ocaml
<Cheshire> C doesn't allow nested comments
_zack has joined #ocaml
jeddhaberstro has joined #ocaml
Ariens_Hyperion has left #ocaml []
<bluestorm> Anarchos: i was just thinking "that's a regexp" but it's actually not so easy with the limited lookup
<det> Anarchos, you probably need to use "lexer states"
<Anarchos> bluestorm yes : i tried /* [.]* */ but it doesn't work
<det> I don't know if ocamllex supports that
<det> I've done it with C lex
<Anarchos> i saw that ocamlyacc uses special rules to parse comments in the ocaml source
<Anarchos> i will try like that tomorrow, good night to all
Anarchos has quit ["Vision[0.8.5-0418]: i've been blurred!"]
slash__ has joined #ocaml
hkBst has quit [Read error: 104 (Connection reset by peer)]
Demitar has quit [Read error: 60 (Operation timed out)]
_zack has left #ocaml []
slash_ has quit [Read error: 110 (Connection timed out)]
kaustuv has left #ocaml []
verte has joined #ocaml
Amorphous has quit [Read error: 104 (Connection reset by peer)]
Ariens_Hyperion has joined #ocaml
Ariens_Hyperion has left #ocaml []