[Caml-list] Re: understanding weak

2008-10-31 Thread Rémi Vanicat
Alain Frisch <[EMAIL PROTECTED]> writes: > Warren Harris wrote: >> On Oct 30, 2008, at 11:48 AM, CUOQ Pascal - [EMAIL PROTECTED] wrote: >>> In short: don't use weak pointers to make caches. >> >> Thanks for the advice -- but I thought this was exactly what weak >> hash tables were intended for. >

Re: [Caml-list] understanding weak

2008-10-31 Thread Daniel Bünzli
Le 31 oct. 08 à 03:14, Martin Jambon a écrit : Warren Harris wrote: I'd like to understand better how ocaml's weak pointers operate. First, although it doesn't seem to be specified in the documentation, I assume that weak pointers will *not* be reclaimed (e.g. from a weak hash table) if t

Re: [Caml-list] Private types

2008-10-31 Thread Dario Teixeira
Hi, > Your intuition is correct that it would theoretically be possible to > try subtyping in place of unification in some cases. The trouble is > that thoses cases are not easy to specify (so that it would be hard > for the programmer to known when he can remove a coercion), and that > subtyping

Re: [Caml-list] understanding weak

2008-10-31 Thread Martin Jambon
Daniel Bünzli wrote: > > Le 31 oct. 08 à 03:14, Martin Jambon a écrit : > >> Warren Harris wrote: >>> I'd like to understand better how ocaml's weak pointers operate. First, >>> although it doesn't seem to be specified in the documentation, I assume >>> that weak pointers will *not* be reclaimed

Re: [Caml-list] understanding weak

2008-10-31 Thread Daniel Bünzli
Le 31 oct. 08 à 15:57, Martin Jambon a écrit : (fst x) would certainly cause funny effects if x were GC'ed at an arbitrary time after it has been added to the weak array. You are confusing reclaiming the weak pointer (the Some x) and reclaiming what the weak pointer refers to (the x). It's

Re: [Caml-list] let rec and environment sharing

2008-10-31 Thread Daniel Bünzli
Le 31 oct. 08 à 16:43, Philippe Wang a écrit : I believe the answer is no. Note that your example is not the same as mine, I do create a new closure (the inner m1') which doesn't refer to bla in the code and the pointer to the original m1 closure is overwritten. And I'd prefer a non emp

[Caml-list] announce : Yacfe 0.2

2008-10-31 Thread Yoann Padioleau
Dear list, I am pleased to announce the first release of Yacfe, Yet Another C/C++ Front-End, which is an OCaml API to write style-preserving source-to-source transformations such as refactorings on C or C++ source code. The goal of Yacfe is to parse the code as-is, and to represent it internally

Re: [Caml-list] understanding weak

2008-10-31 Thread Martin Jambon
Daniel Bünzli wrote: > > Le 31 oct. 08 à 15:57, Martin Jambon a écrit : > >> (fst x) would certainly cause funny effects if x were GC'ed at an >> arbitrary time after it has been added to the weak array. > > You are confusing reclaiming the weak pointer (the Some x) and > reclaiming what the wea

Re: [Caml-list] understanding weak

2008-10-31 Thread Aleksey Nogin
On 31.10.2008 07:57, Martin Jambon wrote: > let x = (1, 2);; > let wa = Weak.create 10;; > Weak.set wa 0 (Some x);; > ... > print_int (fst x);; > > (fst x) would certainly cause funny effects if x were GC'ed at an > arbitrary time after it has been added to the weak array. > > An object can be r

Re: [Caml-list] understanding weak

2008-10-31 Thread Martin Jambon
Aleksey Nogin wrote: > On 31.10.2008 07:57, Martin Jambon wrote: > >> let x = (1, 2);; >> let wa = Weak.create 10;; >> Weak.set wa 0 (Some x);; >> ... >> print_int (fst x);; >> >> (fst x) would certainly cause funny effects if x were GC'ed at an >> arbitrary time after it has been added to the wea

Re: [Caml-list] understanding weak

2008-10-31 Thread Martin Jambon
Aleksey Nogin wrote: > On 31.10.2008 07:57, Martin Jambon wrote: > >> let x = (1, 2);; >> let wa = Weak.create 10;; >> Weak.set wa 0 (Some x);; >> ... >> print_int (fst x);; >> >> (fst x) would certainly cause funny effects if x were GC'ed at an >> arbitrary time after it has been added to the wea

[Caml-list] Re: let rec and environment sharing

2008-10-31 Thread Zheng Li
Hi Daniel Bünzli wrote: Hello, Is the closure's environment of definitions introduced by let rec shared between the definitions ? AFAIK, the answer is yes. - I once saw this on a teaching slide of Xavier Leroy (I don't remember which one, but you can probably find it on his webpage) -

Re: [Caml-list] ocamlopt performance in 3.11

2008-10-31 Thread Jon Harrop
On Monday 20 October 2008 09:15:28 Alain wrote: > David Allsopp wrote: > > OK, so I've tried using the -nodynlink option with all calls to ocamlopt > > and spotted *no* timing difference. A quick binary comparison of the EXE > > produced reveals that ocamlopt -nodynlink is making ABSOLUTELY NO > >

Re: [Caml-list] RE: understanding weak

2008-10-31 Thread Jon Harrop
On Thursday 30 October 2008 18:48:26 CUOQ Pascal wrote: > Warren Harris <[EMAIL PROTECTED]> wrote: > > I'd like to understand better how ocaml's weak pointers operate. > > You will be interested in the following important article: > http://portal.acm.org/citation.cfm?id=1411308 Is this freely avai

Re: [Caml-list] What does Jane Street use/want for an IDE? What about you?

2008-10-31 Thread Jon Harrop
On Monday 20 October 2008 14:19:40 Kuba Ober wrote: > what do you guys use for your development environment? I use Emacs but I hate it. > What would be the minimal set of functionality that would make you happy for > an IDE? . Written in OCaml using OCaml's own lexer and parser to save effort an

Re: [Caml-list] Private types

2008-10-31 Thread Edgar Friendly
Jacques Garrigue wrote: > Your intuition is correct that it would theoretically be possible to > try subtyping in place of unification in some cases. The trouble is > that thoses cases are not easy to specify (so that it would be hard > for the programmer to known when he can remove a coercion),