comp.lang.ada
 help / color / mirror / Atom feed
From: comar@cs.nyu.edu (Cyrille Comar)
Subject: Re: Overloading for T and T'Class
Date: 15 Nov 1994 00:01:46 -0500
Date: 1994-11-15T00:01:46-05:00	[thread overview]
Message-ID: <3a9fbq$27v@lang8.cs.nyu.edu> (raw)
In-Reply-To: 3a6goo$j7s@Starbase.NeoSoft.COM

dweller@Starbase.NeoSoft.COM (David Weller) writes:
: In article <Cz4H8G.MA@swlvx2.msd.ray.com>,
: John Volan <jgv@swl.msd.ray.com> wrote:
: >In Ada9X, is it legal to overload the same subprogram name for both
: >some tagged type T and its class-wide type T'Class?  For example:
: >
: >	package P is
: >	  type T is tagged ... ;
: >	  procedure Op (X : in out T);
: >	  procedure Op (X : in out T'Class);
: >	  ...
: >	end P;
: >
: 
: As a compiler, your declarations would confuse me, since the first Op
: says "I'm a primitive operation, and thus I may be extended and
: modified by descendants", and the second one says, "I'm a classwide
: operation, thus any descendant of my type (a member of T'Class) must
: execute this subprogram".  A contradiction, from my perspective.
: 
: I think GNAT (at the moment) permits this, further confusing the
: issue.

My understanding (without checking the RM...) is that the above declarations
are legal but that any USE of "Op" would be ambiguate, so it is really
useless... 
I am not completely sure though...




-- 
------------------------------------------------------------------------
Cyrille Comar,                                  E-mail: comar@cs.nyu.edu
Gnat Project                                    US phone: (212) 998-3489




  reply	other threads:[~1994-11-15  5:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-11-11 21:33 Overloading for T and T'Class John Volan
1994-11-14  2:07 ` David Weller
1994-11-15  5:01   ` Cyrille Comar [this message]
1994-11-15  2:22 ` Bob Duff
1994-11-16 11:33   ` Robert I. Eachus
     [not found] ` <3a6goo$j7s@starbase.neosoft.com>
1994-11-15  2:35   ` Tucker Taft
1994-11-15 11:39     ` David Weller
1994-11-16  4:32       ` Brad Balfour
1994-11-16 14:34         ` John Volan
1994-11-15 14:15     ` Norman H. Cohen
1994-11-16  1:22 ` John Volan
1994-11-16 11:59   ` David Weller
1994-11-19  4:54   ` Cyrille Comar
replies disabled

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