comp.lang.ada
 help / color / mirror / Atom feed
From: Dennis Reimer <dreimer@slb.isd.csc.com>
Subject: Re: tagged type auto-"Use", was Re: Ada Java question => clarification
Date: 1997/03/10
Date: 1997-03-10T00:00:00+00:00	[thread overview]
Message-ID: <33245A3C.2D3F@slb.isd.csc.com> (raw)
In-Reply-To: 3322353F.1633@bix.com


Tom Moran wrote:
> 
> Given:
> with root;
> package body x is
>   type y is new root.some_tagged_type with ...
> 
> A reference to root.some_inherited_procedure refers to just that, and
> takes root.xxx as a parameter.  In order to take something of type y as
> a parameter one must say
>   some_inherited_procedure(some_y_thing...
> which has many of the disadvantages (can't see where something came
> from) of a 'use' clause.  OTOH, if some programming guidelines said "no
> USE clauses", this would be an easy way around the rule.
>   As someone who rarely uses use, I find this troubling.  Comments?

It doesn't have to be a tagged type either.  Any type that is derived
will inherit the primitive operations of the parent type.  This feature
also existed in Ada 83 and was referred to as derived subprograms.
I have seen it used several times in Ada 83 programs to get around the
"no USE clauses" rule.  It also avoids having to rename some of the
commonly used basic operations such as "=" when 'use' clauses are not
permitted.




  reply	other threads:[~1997-03-10  0:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-26  0:00 Ada Java question Kendal Van Dyke
1997-02-27  0:00 ` Tucker Taft
1997-02-28  0:00   ` Ada Java question => clarification Kendal Van Dyke
1997-02-28  0:00     ` Tucker Taft
1997-02-28  0:00       ` Brad Balfour
1997-02-28  0:00         ` Kendal Van Dyke
1997-02-28  0:00           ` Norman H. Cohen
1997-03-01  0:00             ` David Taylor
1997-03-02  0:00               ` Robert Dewar
1997-03-06  0:00                 ` David Taylor
1997-03-08  0:00                   ` tagged type auto-"Use", was " Tom Moran
1997-03-10  0:00                     ` Dennis Reimer [this message]
1997-03-09  0:00                   ` Robert Dewar
1997-03-09  0:00                     ` Larry Kilgallen
1997-03-09  0:00                       ` Robert Dewar
1997-03-15  0:00                         ` Matthew Heaney
1997-03-01  0:00           ` Fergus Henderson
1997-02-28  0:00         ` Ada Java question => oops!! Kendal Van Dyke
1997-03-02  0:00         ` Ada Java question => clarification Robert Dewar
1997-03-03  0:00           ` Brad Balfour
1997-03-05  0:00             ` Robert Dewar
1997-03-05  0:00               ` Brad Balfour
1997-02-28  0:00 ` Ada Java question Tom Halliley
replies disabled

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