comp.lang.ada
 help / color / mirror / Atom feed
From: Jeremiah <jeremiah.breeden@gmail.com>
Subject: Re: Incomplete types used with generics
Date: Tue, 12 May 2015 04:46:26 -0700 (PDT)
Date: 2015-05-12T04:46:26-07:00	[thread overview]
Message-ID: <c2b2f20d-5e62-44b4-b21e-def0cb865085@googlegroups.com> (raw)
In-Reply-To: <mirlsq$msd$1@loke.gir.dk>

On Monday, May 11, 2015 at 9:43:55 PM UTC-4, Randy Brukardt wrote:
> You missed at least 6 months of wrestling with various AdaCore people about 
> this feature, specifically over some proposed ACATS tests. (Most of the 
> tests showed lovely GNAT bug boxes.) They were trying very hard to find 
> reasons that the tests were illegal, because there was an problem with the 
> design of their implementation that made the tests very hard to implement. 
> They managed to uncover some language problems that will probably be fixed 
> someday, but in particular, everyone eventually agreed that the test using 
> limited with (CC51010) is correct (now). I've heard that they've fixed the 
> compiler so that test works, so you'll probably be able to get that to work 
> at some future point (but surely not with GNAT GPL 2014, which clearly 
> predates the fixes).
Well that's definitely stinky.  Thanks for the info on that.

> I suspect that you ran afoul of the fact that the freezing rules differ for 
> tagged incomplete vs. untagged incomplete types, but even if you fixed that 
> you'd still be very likely to run into problems with current GNAT versions 
> unless you are a GNAT PRO user and can get a wavefront.
I'm definitely a novice at Ada compared to most here, so I will ask:  which freezing rules did I mess up on there with Node2_Type?  I am familiar with how freezing works to some extent (I usually mess it up but am able to tell when I can't override a procedure/function or use one as a primitive like I intended).  I was trying hard to not to invoke freezing too early.  I did the incomplete declaration, the access to it (should be good there?), and then assuming the compiler could do it (which you indicated it couldn't) I passed it as an incomplete type to a package instantiation.  Is there a better way to do that?  

Keep in mind my (previously unspecified) goal is to have a type that uses a smart access type (that's the generic) to reference itself.  Basically a node type that uses a smart access type to handle the references (with a weak reference to the parent of course).

Thanks again!


  parent reply	other threads:[~2015-05-12 11:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-11 22:37 Incomplete types used with generics Jeremiah
2015-05-12  1:43 ` Randy Brukardt
2015-05-12  7:33   ` Simon Wright
2015-05-12 11:48     ` Jeremiah
2015-05-12 11:46   ` Jeremiah [this message]
2015-05-12 21:49 ` Randy Brukardt
2015-05-12 23:19   ` Jeremiah
2015-05-14  1:14     ` Randy Brukardt
2015-05-14 20:48       ` Jeremiah
replies disabled

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