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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,63ed09fc54092c73 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.224.72.199 with SMTP id n7mr13073955qaj.5.1360058000183; Tue, 05 Feb 2013 01:53:20 -0800 (PST) X-Received: by 10.49.75.9 with SMTP id y9mr2062689qev.9.1360058000162; Tue, 05 Feb 2013 01:53:20 -0800 (PST) Path: k2ni8440qap.0!nntp.google.com!p13no12361764qai.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 5 Feb 2013 01:53:19 -0800 (PST) In-Reply-To: <5ab43474-0ce2-425c-836b-ff4c97587958@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=130.240.232.139; posting-account=Rr9I-QoAAACS-nOzpA-mGxtAlZ46Nb6I NNTP-Posting-Host: 130.240.232.139 References: <6d66d1c4-ed22-446b-a9d7-dc806ae1ef8f@googlegroups.com> <5ab43474-0ce2-425c-836b-ff4c97587958@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <63885cee-5f48-4c96-850a-b56177a0de0e@googlegroups.com> Subject: Re: When is a rename not a rename? From: Ada novice Injection-Date: Tue, 05 Feb 2013 09:53:20 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2013-02-05T01:53:19-08:00 List-Id: On Friday, February 1, 2013 6:32:42 PM UTC+1, Adam Beneschan wrote: > Here's an example that may answer YC's question: > > package Pack1 is > > pragma Elaborate_Body; > > end Pack1; > > > > with Ada.Text_IO; > > package body Pack1 is > > begin > > Text_IO.Put_Line ("Pack1 is elaborated"); > > end Pack1; > > > > package Pack2 is > > end Pack2; > > > > with Pack1, Pack2; > > package Pack3 renames Pack2; > > > > with Pack2; -- with Pack3; <=== HERE > > procedure Test is > > begin > > null; > > end Test; > > > Another possible example is when a subprogram renames another one but changes a default parameter: > > > > procedure P1 (N1 : Integer; N2 : Integer := 0) is ... > > > > procedure P2 (N1 : Integer; N2 : Integer := 1) renames P1; > > > > P1(5); > > P2(5); > Thanks for these two very good examples. I shall be careful with renames from now on. Thanks YC