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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e5bfd51af02edca2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!cyclone1.gnilink.net!spamkiller.gnilink.net!gnilink.net!trnddc05.POSTED!20ae255c!not-for-mail Newsgroups: comp.lang.ada From: Anonymous Coward Subject: Re: Re-exporting primitive operations of a private type (like "-", and 'min) References: Message-Id: User-Agent: slrn/0.9.7.4 (Linux) Date: Tue, 01 Nov 2005 23:43:52 GMT NNTP-Posting-Host: 141.149.78.234 X-Complaints-To: abuse@verizon.net X-Trace: trnddc05 1130888632 141.149.78.234 (Tue, 01 Nov 2005 18:43:52 EST) NNTP-Posting-Date: Tue, 01 Nov 2005 18:43:52 EST Xref: g2news1.google.com comp.lang.ada:6097 Date: 2005-11-01T23:43:52+00:00 List-Id: In article , Jeffrey R. Carter wrote: > > You should be able to say (in the private part) > > function Subtract (Left, Right : in Public_Distance_Type) > return Public_Distance_Type renames "-"; > > type Private_Distance_Type is new Public_Distance_Type; > -- Subtract is defined for Private_Distance_Type. > > function "-" (Left, Right : in Private_Distance_Type) > return Private_Distance_Type renames Subtract; That would probably work as long as the definition of Subtract does a type conversion explicitly on the Left and Right to the parent types. But what are the advantages? Why would I define a Subtract operation and use a renames clause, when I can simply define a "-" operation directly? The "-" operation must still be replaced, and it still has to have a declaration in the public part. So in your case above, there would have to be a function "-" (Left, Right : in Private_Distance_Type) return Private_Distance_Type; in the public part.