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"
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
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
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
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
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
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
__
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
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