Version française
Home     About     Download     Resources     Contact us    
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
object
  val y = Array.copy x
  ...
end

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
collected).
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.

Thanks

Guillaume.