comp.lang.ada
 help / color / mirror / Atom feed
From: magnus@lglsun.epfl.ch (Magnus Kempe)
Subject: Re: Ada 9X _has_ "class"
Date: 29 Mar 93 07:11:58 GMT
Date: 1993-03-29T07:11:58+00:00	[thread overview]
Message-ID: <1993Mar29.085902@lglsun.epfl.ch> (raw)
In-Reply-To: 1993Mar25.102730.10202@cenatls.cena.dgac.fr

In article <1993Mar25.102730.10202@cenatls.cena.dgac.fr>, bruniau@cenatls.cena.dgac.fr (Christophe Bruniau) writes:
: 
: What does an instance of a class look like ?

Given a tagged type T and two derived types T1 and T2, you get the
following:  T1'class and T2'class are subclasses of T'class.
Any object belonging to the specific type T1 is thus an instance of
T1'class and of T'class.  Same for T2, mutatis mutandis.  Any object
belonging to the specific type T is an instance of T'class (but not of
T1'class, of course). Thus:
	X : T;  -- instance of T'class
	Y : T1; -- instance of T1'class and T'class
	Z : T2; -- instance of T2'class and T'class

In Ada 9X, to "be an instance of class such-and-such" is a property of
all objects belonging to the types in that class.  Most of the time you
want to program with specific types, and sometimes you want to use class-
wide programming techniques.  Ada 9x gives you both, with strong typing.

-- 
Magnus Kempe                "No nation was ever drunk when wine was cheap."
magnus@lglsun.epfl.ch                                   -- Thomas Jefferson



  reply	other threads:[~1993-03-29  7:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-03-19 21:34 Ada 9X _has_ "class" John Goodsen
1993-03-24 16:16 ` Magnus Kempe
1993-03-25 10:27   ` Christophe Bruniau
1993-03-29  7:11     ` Magnus Kempe [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-03-18 17:34 Magnus Kempe
replies disabled

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