From: Martin Jambon <martin.jambon@ens-lyon.org>
To: Guillaume Hennequin <guillaume.hennequin@epfl.ch>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] let x = ... in object ...
Date: Tue, 26 May 2009 14:41:16 +0200 [thread overview]
Message-ID: <4A1BE36C.70200@ens-lyon.org> (raw)
In-Reply-To: <d8e32b760905260520g15d12decm5f82c519eb514d17@mail.gmail.com>
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/
next prev parent reply other threads:[~2009-05-26 12:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-26 12:20 Guillaume Hennequin
2009-05-26 12:41 ` Martin Jambon [this message]
2009-05-26 13:06 ` [Caml-list] " Guillaume Hennequin
2009-05-26 13:30 ` Martin Jambon
2009-05-27 1:46 ` Jacques Garrigue
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A1BE36C.70200@ens-lyon.org \
--to=martin.jambon@ens-lyon.org \
--cc=caml-list@inria.fr \
--cc=guillaume.hennequin@epfl.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox