From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4e180de737833224 X-Google-Attributes: gid103376,public From: Dennis Reimer Subject: Re: tagged type auto-"Use", was Re: Ada Java question => clarification Date: 1997/03/10 Message-ID: <33245A3C.2D3F@slb.isd.csc.com>#1/1 X-Deja-AN: 224457704 References: <33167E7E.4351@fn3.freenet.tlh.fl.us> <33174046.4A25@fn3.freenet.tlh.fl.us> <33174B1A.5353@watson.ibm.com> <3322353F.1633@bix.com> Organization: Computer Sciences Corporation Newsgroups: comp.lang.ada Date: 1997-03-10T00:00:00+00:00 List-Id: 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.