comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Questions on an 83->95 porting detail
Date: 1997/01/25
Date: 1997-01-25T00:00:00+00:00	[thread overview]
Message-ID: <E4KLoA.Iu4@world.std.com> (raw)
In-Reply-To: 9701242001.AA16557@most


In article <9701242001.AA16557@most>,
W. Wesley Groleau (Wes) <wwgrol@PSESERV3.FW.HAC.COM> wrote:
>Yes, I've seen the answers in print, but I'm having trouble finding it
>again... :-)
>
>1. Since a NOTE is not a rule, but only a "consequence of [a] rule
>defined elsewhere," what is/are the rule(s) that 12.5.1(28) is a
>consequence of?

The first sentence follows from the fact that there's no rule forbidding
it.  The second sentence follows from 12.5.1(6).  (By the way, in many
cases the AARM can help answer this sort of question.  Not in this case,
though, unless you consider 12.5.1(6.a) to be helpful.)

>...  12.5.1(17) says I need a member of the "class of
>all types"

Yes, and you do.

>... but 12.5.1(28) says, "No, you need a member of the
>class of all definite types."

That doesn't make sense -- there's no such thing as "the class of all
definite types", because "definite" is an adjective describing subtypes,
not types.  The actual *type* has to be in a certain class determined by
the formal, and the actual *subtype* has to be definite if the formal
has no discrim_part.  Two separate requirements.

(It's not hard to get confused between types and subtypes, since there's
something that looks like "type T is ...", and that thing is called a
type_declaration, but it does *not* declare a type called T.  That's
ridiculous, IMHO.  One of several cases in which Ada's terminology is
truly awful.)

>2. What is the smallest change to the Ada-83 code for
>Heap_Management.Unconstrained so that all of its clients will compile
>with Ada 95?  (I'd prefer to change the first generic instead of
>over fifty instantiations!)

Add an unknown_discriminant_part:

    type Item(<>) is limited private;

>3. What would be the minimum change to the same code so that all its
>clients will work properly with Ada 95?

See above.

>4. Extra credit if the result is still legal, working Ada-83.... :-)

Sorry, I don't get the extra credit -- the unknown_discrim_part is
needed in Ada 95, but illegal in Ada 83.  Sigh.

- Bob




  reply	other threads:[~1997-01-25  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-01-24  0:00 Questions on an 83->95 porting detail W. Wesley Groleau (Wes)
1997-01-25  0:00 ` Robert A Duff [this message]
1997-01-27  0:00 ` Keith Allan Shillington
replies disabled

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