comp.lang.ada
 help / color / mirror / Atom feed
From: "Björn Persson" <spam-away@nowhere.nil>
Subject: Re: Is T an ancestor of T?
Date: Wed, 20 Oct 2004 16:18:24 GMT
Date: 2004-10-20T16:18:24+00:00	[thread overview]
Message-ID: <kdwdd.6637$d5.56044@newsb.telia.net> (raw)
In-Reply-To: <cl5r6c$632$1@a1-hrz.uni-duisburg.de>

Georg Bauhaus wrote:
> Christoph Karl Walter Grein <AdaMagica@web.de> wrote:
> : From: Georg Bauhaus <sb463ba@l1-hrz.uni-duisburg.de>
> : 
> :> I still don't know whether or not a type is an ancestor of itself,
> :> given that it is a descendant of itself.
> : 
> : Looking into RM Index for ancestor, you'll find the reference to RM 3.4.1(10) with the definition of ancestor and descendant:
> 
> Yes, descendant seem clearly defined in this paragraph.

Then I'd say "ancestor" is also clearly defined: "If a type T2 is a 
descendant of a type T1, then T1 is called an ancestor of T2." So if T 
is a descendant of T, then T is an ancestor of T.

> However,
> "The ultimate ancestor of a type is the
>  ancestor of the type that is not a descendant of any other type."

The one ancestor that isn't a descendant of any type other than itself, 
that is, the one that isn't derived, is the ultimate ancestor. At least 
that's how I read that.

Are you reading the annotated or non-annotated manual? The annotated one 
has a lot more to say about this, including some examples:

10
A specific type T2 is defined to be a descendant of a type T1 if T2 is 
the same as T1, or if T2 is derived (directly or indirectly) from T1. A 
class-wide type T2'Class is defined to be a descendant of type T1 if T2 
is a descendant of T1. Similarly, the universal types are defined to be 
descendants of the root types of their classes. If a type T2 is a 
descendant of a type T1, then T1 is called an ancestor of T2. The 
ultimate ancestor of a type is the ancestor of the type that is not a 
descendant of any other type.

10.a
Ramification: A specific type is a descendant of itself. Class-wide 
types are considered descendants of the corresponding specific type, and 
do not have any descendants of their own.

10.b
A specific type is an ancestor of itself. The root of a derivation class 
is an ancestor of all types in the class, including any class-wide types 
in the class.

10.c
Discussion: The terms root, parent, ancestor, and ultimate ancestor are 
all related. For example:

10.d
     * Each type has at most one parent, and one or more ancestor types; 
each type has exactly one ultimate ancestor. In Ada 83, the term 
``parent type'' was sometimes used more generally to include any 
ancestor type (e.g. RM83-9.4(14)). In Ada 95, we restrict parent to mean 
the immediate ancestor.

10.e
     * A class of types has at most one root type; a derivation class 
has exactly one root type.

10.f
     * The root of a class is an ancestor of all of the types in the 
class (including itself).

10.g
     * The type root_integer is the root of the integer class, and is 
the ultimate ancestor of all integer types. A similar statement applies 
to root_real.

-- 
Björn Persson                              PGP key A88682FD
                    omb jor ers @sv ge.
                    r o.b n.p son eri nu




  reply	other threads:[~2004-10-20 16:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-18  5:55 Is T an ancestor of T? Christoph Karl Walter Grein
2004-10-20 14:02 ` Georg Bauhaus
2004-10-20 16:18   ` Björn Persson [this message]
2004-10-20 21:41     ` Georg Bauhaus
2004-10-20 23:33       ` Björn Persson
2004-10-22  2:27         ` Georg Bauhaus
2004-10-23 16:55           ` Björn Persson
2004-10-26  0:37             ` Randy Brukardt
  -- strict thread matches above, loose matches on Subject: below --
2004-10-12  1:31 record extension aggregate for returned type legal? Georg Bauhaus
2004-10-12  8:04 ` Martin Krischik
2004-10-12 14:36   ` Georg Bauhaus
     [not found]     ` <1940150.rU8f1KaX3L@linux1.krischik.com>
2004-10-12 20:24       ` Georg Bauhaus
2004-10-13  7:52         ` Martin Krischik
     [not found]           ` <ckjlhm$2hh$1@a1-hrz.uni-duisburg.de>
     [not found]             ` <ukhbd.106086$dP1.396181@newsc.telia.net>
2004-10-14  0:29               ` Is T an ancestor of T? Georg Bauhaus
2004-10-14  8:54             ` Is T an ancestor of T? (was: Re: record extension aggregate for returned type legal?) Martin Krischik
     [not found]               ` <ckot3m$hek$1@a1-hrz.uni-duisburg.de>
2004-10-15 16:55                 ` Is T an ancestor of T? Martin Krischik
2004-10-15 17:19                   ` Georg Bauhaus
2004-10-16 14:37                     ` Martin Krischik
replies disabled

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