Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
let x = ... in object ...
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Guillaume Hennequin <guillaume.hennequin@e...>
Subject: let x = ... in object ...
Dear list,

I was just wondering whether in

class a =
  let x = Array.make 10000 0. in
  val y = Array.copy x

x will be garbage collected or not.
(this is just an example, I know creating x and copying is just doesn't make
sense, but I wanted to point out that in my case, x doesn't need to be kept,
but just used during object creation. I would like it to be garbage
I roughly recall a previous post where I think the reply was "intermediate
values such as x are "kept" as members of the class", but I'm not sure.