Version française
Home     About     Download     Resources     Contact us    
Browse thread
The sharing mechanism in the Marshal module
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Roland Zumkeller <roland.zumkeller@g...>
Subject: Re: [Caml-list] The sharing mechanism in the Marshal module
On 03/03/07, Deokhwan Kim <dk@ropas.snu.ac.kr> wrote:
> In addtion, what should I do if I really want the sharing of the c
> counter between incr and incr1?

It suffices to define "c" outside of "incr":

let c = ref 0;;

let incr () = c:= !c + 1 ; !c

-- 
http://www.lix.polytechnique.fr/~zumkeller/