comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Ada 95 and Class attribute for none-tagged incomplete type
Date: Sat, 15 Aug 2009 10:33:43 -0400
Date: 2009-08-15T10:33:43-04:00	[thread overview]
Message-ID: <wcck515cfjs.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: h64sp7$hrm$1@munin.nbi.dk

"Randy Brukardt" <randy@rrsoftware.com> writes:

> "Robert A Duff" <bobduff@shell01.TheWorld.com> wrote in message 
> news:wcc3a7uusn8.fsf@shell01.TheWorld.com...
>> "Randy Brukardt" <randy@rrsoftware.com> writes:
>>
>>>...All this special rule eliminates is the need to declare
>>> an incomplete type in this one unusual case (the private type in cases 
>>> like
>>> this is best declared as tagged, so this shouldn't happen very often). 
>>> Seems
>>> like a pile of work for an implementation and for the language just to
>>> eliminate one line in a private part.
>>
>> The problem is that declaring that incomplete type is illegal.
>> Eliminating the need for one _illegal_ line isn't such a bad thing.  ;-)
>
> Why is it illegal? Doesn't seem like it ought to be on the face of it.

Umm... Because the RM says so?  7.3(4).  So why does the RM say so?
Because Jean Ichbiah wanted it that way, I guess, and nobody thought
it desirable or important enough to change during Ada 9X
or Ada 0X projects.

> Apparently, you haven't thought to hard about the semantics of limited 
> views. :-) *Every* private type that can be used in a limited view has (at 
> least) three views (the incomplete view from the limited view being the 
> third).

Good point, although at the time the rule we're talking about (allowing
Private_Type'Class before the full type) was invented, there were no
such things as limited views.

> I believe we (Tucker and I? On the ARG list? I don't remember) 

We discussed it in a telephone meeting.  No doubt also on ARG list.

>...were 
> discussing eliminating some of the restrictions on the declaration and 
> completion of incomplete types in order to make the use of "incomplete 
> instances" or "intgregated packages" or whatever we end up with more useful. 
> (Many of the "derivation" problems go away if you can simply declare an 
> incomplete type ahead of time to introduce the proper name for the type.)

Yes, I think that's a good direction to go, if we can make it work.
A language design goal should be: Never require the use of pointers,
except when reference semantics is desired.  Ada violates this principle
in several ways, and removing one of them one be a good thing.
(C violates this principle even more, and Java more still.)

- Bob



  reply	other threads:[~2009-08-15 14:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-02  6:55 Ada 95 and Class attribute for none-tagged incomplete type Hibou57 (Yannick Duchêne)
2009-08-03 15:26 ` Adam Beneschan
2009-08-03 18:45   ` Dmitry A. Kazakov
2009-08-13  1:50   ` Randy Brukardt
2009-08-13  8:18     ` Niklas Holsti
2009-08-13 13:16       ` Robert A Duff
2009-08-14  4:21         ` Randy Brukardt
2009-08-14 19:01           ` Robert A Duff
2009-08-14 23:41             ` Randy Brukardt
2009-08-15 14:33               ` Robert A Duff [this message]
2009-08-14  4:17       ` Randy Brukardt
replies disabled

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