comp.lang.ada
 help / color / mirror / Atom feed
From: mab@wdl39.wdl.loral.com (Mark A Biggar)
Subject: Re: Classes vs Tagged Types - Terminology
Date: 5 Apr 93 23:04:19 GMT
Date: 1993-04-05T23:04:19+00:00	[thread overview]
Message-ID: <1993Apr5.230419.20525@wdl.loral.com> (raw)
In-Reply-To: 1993Apr5.155419.8598@evb.com

In article <1993Apr5.155419.8598@evb.com> jgg@evb.com (John Goodsen) writes:
>In <1993Mar25.155650.16244@inmet.camb.inmet.com> 
>stt@spock.camb.inmet.com (Tucker Taft) writes:
>
>>
>>In Ada 9X, it is only class-wide types (named "T'Class") that provide
>>subclass matching.
>>                      ^^^^^^^^^^^^^^^^^
>                       Didn't you mean "tagged types" :-)

No he meant Class-wide.  The class-wide type T'class is a type whose
value set includes the union of the value sets of tagged type T and
all tagged types derived from T (even including those that havn't
been defined yet).  If I have a procedure with the header:

procedure FOO(X: T);

the only a member of tagged type T can the used as an actual without 
using a type conversion.  If the header was:

procedure FOO(X: T'CLASS);

then any member of tagged type T or any tagged type derived from
T can be used as an actual and inside FOO the parameter X retains
its tag, unlike the first case, where if you passed a parameter of
a type derived from T (using a type conversion) X stiil has the
tag of tagged type T.

One other case should be mentioned, If I call the first FOO above
with an actual of type T'CLASS, then the system does dynamic dispatch
to the body corresponding to the actual tag of the value contained in
class-wide actual.

--
Mark Biggar
mab@wdl1.wdl.loral.com



  reply	other threads:[~1993-04-05 23:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-04-05 15:54 Classes vs Tagged Types - Terminology John Goodsen
1993-04-05 23:04 ` Mark A Biggar [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-04-07 13:49 pipex!uknet!warwick!zaphod.crihan.fr!univ-lyon1.fr!scsing.switch.ch!sicsu
1993-04-06 16:46 mcsun!julienas!newsserver!geant!bruniau
1993-04-06 16:36 Harry Koehnemann
1993-03-22 11:46 Charles Lindsey
1993-03-24  7:42 ` Richard A. O'Keefe
1993-03-25 15:56   ` Tucker Taft
1993-03-26 11:02     ` Stephen J Bevan
1993-03-30 14:34       ` Tucker Taft
1993-03-31 16:21         ` Stephen J Bevan
1993-03-31 20:46         ` Robert I. Eachus
1993-03-24  8:58 ` Robb Nebbe
1993-03-25  0:15   ` David Emery
1993-03-29  9:26     ` Robb Nebbe
replies disabled

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