[Caml-list] A copy/paste buffer

2009-06-25 Thread Jacques Le Normand
Hello caml-list, I want to implement a copy/paste buffer for arbitrary polymorphic variants. Is the following code safe? " let buffer : 'a = Obj.magic (ref None) let _ = buffer := Some `Foo let _ = buffer := Some `Bar let _ = match !buffer with Some (`Bar x) -> print_endline "matches"

[Caml-list] ignoring toplevel phrases?

2009-06-25 Thread Roland Zumkeller
Hi, Is it possible to modify the toplevel's behavior such that it silently ignores any re-definitions of already bound identifiers (without recompiling)? I would like to achieve the following: # let x = 0;; val x : int = 0 # let x = 1;; # x;; - : int = 0 The following code is supposed to replace

Re: [Caml-list] Re: Mastering the garbage collector

2009-06-25 Thread Christophe Raffalli
Tiphaine Turpin a écrit : > Sylvain Le Gall a écrit : > >> You need to do a "Gc.compact" to size down. A full_major will collect but I >> am not sure it will free allocated page. >> >> > But if it is just a matter of compaction, then > > (Gc.stat ()).Gc.live_words > > should give me a co

RE: [Caml-list] ocamlgraph

2009-06-25 Thread David Allsopp
You need to say #directory "ocamlgraph";; Before you #use your file so that the toploop can find graph.cmi David From: caml-list-boun...@yquem.inria.fr [mailto:caml-list-boun...@yquem.inria.fr] On Behalf Of Ligia Nistor Sent: 25 June 2009 18:00 To: caml-list@yquem

[Caml-list] ocamlgraph

2009-06-25 Thread Ligia Nistor
Hi, I am trying to use ocamlgraph, but I am getting the error "Unbound module Graph". I have the file demo.ml(from the site http://ocamlgraph.lri.fr/) which contains the line "open Graph". I write in the interpreter "#load ocamlgraph/graph.cmo" and it finds it. But then when I write #use "demo.ml

Re: [Caml-list] Mastering the garbage collector

2009-06-25 Thread Julien Signoles
Hello, More generally, is there a specification of the notion of root used by the garbage collector somewhere ? I recommend you the following article. You should find what you want inside. @inproceedings{DBLP:conf/ml/CuoqD08, author= {Pascal Cuoq and Damien Doligez}, ti

Re: [Caml-list] Re: Mastering the garbage collector

2009-06-25 Thread Tiphaine Turpin
Sylvain Le Gall a écrit : > You need to do a "Gc.compact" to size down. A full_major will collect but I > am not sure it will free allocated page. > But if it is just a matter of compaction, then (Gc.stat ()).Gc.live_words should give me a correct (small) result, no ? Tiphaine __

[Caml-list] Re: Mastering the garbage collector

2009-06-25 Thread Sylvain Le Gall
On 25-06-2009, Tiphaine Turpin wrote: > Hi, > > I have difficulties with the garbage colloector. I have a program that > use a lot of memory to build a small result, before doing something > else. I expected all the memory but the result to be collected when > doing a full_major, but this is not t

[Caml-list] Mastering the garbage collector

2009-06-25 Thread Tiphaine Turpin
Hi, I have difficulties with the garbage colloector. I have a program that use a lot of memory to build a small result, before doing something else. I expected all the memory but the result to be collected when doing a full_major, but this is not the case. I have tried to encapsulate all reference