From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 9EAA5BC37 for ; Tue, 26 May 2009 14:46:05 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqkAAN+BG0pCbwQZkGdsb2JhbACNa4oDAQEBAQkJDAcRBLUuhAsF X-IronPort-AV: E=Sophos;i="4.41,251,1241388000"; d="scan'208";a="40570047" Received: from out1.smtp.messagingengine.com ([66.111.4.25]) by mail4-smtp-sop.national.inria.fr with ESMTP; 26 May 2009 14:46:04 +0200 Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 031F0346679; Tue, 26 May 2009 08:46:03 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Tue, 26 May 2009 08:46:04 -0400 X-Sasl-enc: k6a4M8L2O1r+k5okTXrDi7psg67hBv0xdh9dNwg9u43/ 1243341963 Received: from [192.168.1.10] (ALyon-157-1-100-168.w90-41.abo.wanadoo.fr [90.41.203.168]) by mail.messagingengine.com (Postfix) with ESMTPSA id 2FFDB28952; Tue, 26 May 2009 08:46:03 -0400 (EDT) Message-ID: <4A1BE36C.70200@ens-lyon.org> Date: Tue, 26 May 2009 14:41:16 +0200 From: Martin Jambon User-Agent: Thunderbird 2.0.0.17 (X11/20081008) MIME-Version: 1.0 To: Guillaume Hennequin Cc: caml-list@inria.fr Subject: Re: [Caml-list] let x = ... in object ... References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ens-lyon:01 guillaume:01 val:01 endline:01 val:01 guillaume:01 beginner's:01 ocaml:01 bug:01 garbage:01 garbage:01 beginners:01 wrote:01 caml-list:01 caml-list:01 Guillaume Hennequin wrote: > Dear list, > > I was just wondering whether in > > class a = > let x = Array.make 10000 0. in > object > val y = Array.copy x > ... > end # class a = let () = print_endline "hello" in object end;; hello class a : object end Maybe you mean the following: 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. > > > ------------------------------------------------------------------------ > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs -- http://mjambon.com/