comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Protected object which never get finalized
Date: Mon, 15 Feb 2010 12:44:13 -0800 (PST)
Date: 2010-02-15T12:44:13-08:00	[thread overview]
Message-ID: <cb3c6fb3-2dd2-407b-8996-aef62854421e@u19g2000prh.googlegroups.com> (raw)
In-Reply-To: nospam-2B414A.15231915022010@news.aioe.org

On Feb 15, 12:23 pm, "John B. Matthews" <nos...@nospam.invalid> wrote:
> In article <op.u76nzoymvwnd5a@garhos>,
>  Hibou57 (Yannick Duchêne) <yannick_duch...@yahoo.fr> wrote:
>
>
>
>
>
> > Le Sun, 14 Feb 2010 13:35:47 +0100, John B. Matthews  
> > <nos...@nospam.invalid> a écrit:
> > > Type A_Type has its own private part, and this seems more comparable to
> > > the declaration of protected type B_Type. Is there any reason to make
> > > A_Type more opaque?
>
> > Well, let say first I don't like the idea of designing with a
> > compiler bug  is mind, and secondly, this is not to be part of a
> > public part (I don't  really like private stuff in public part). When
> > I know a mostly clean workaround, that's Ok, but I do not like this  
> > one.
> > TBH, as was trying (as explained in the initial post), to workaround  
> > another bug when I meet this one. The interesting point to me, is
> > that you get the same, so it is not just  my compiler. This means for
> > me I should report the bug to AdaCore (as you  seem to have confirmed
> > the bug).
>
> I wish I could claim to understand it well enough to say one way or the
> other. Given the desired declaration,
>
>     package P is
>        type A_Type is limited private;
>     private
>        protected type A_Type is
>        private
>           Spy : Spies.Instance_Type
>             (Client_Name => new String'("P.A_Type"));
>        end;
>     end P;
>
> is "protected type A_Type" a valid completion of "type A_Type is limited
> private;" or is that irrelevant?

Yes, it's a valid completion.

For finalization, it doesn't matter whether a type is private or not.
The finalizations that need to be performed on an object need to be
done regardless of whether the full view of the type is visible at any
particular point.  So if finalization takes place as expected when the
protected type is public, but doesn't take place when it's private,
that's a clear indication that the compiler has blown it.

                                 -- Adam



  reply	other threads:[~2010-02-15 20:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-13  0:45 Protected object which never get finalized Hibou57 (Yannick Duchêne)
2010-02-14 12:35 ` John B. Matthews
2010-02-15 18:08   ` sjw
2010-02-15 19:22     ` Hibou57 (Yannick Duchêne)
2010-02-15 19:20   ` Hibou57 (Yannick Duchêne)
2010-02-15 20:23     ` John B. Matthews
2010-02-15 20:44       ` Adam Beneschan [this message]
2010-02-15 22:26       ` Hibou57 (Yannick Duchêne)
2010-02-16  0:23         ` John B. Matthews
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox