comp.lang.ada
 help / color / mirror / Atom feed
From: Ada novice <shai.lesh@gmx.com>
Subject: Re: When is a rename not a rename?
Date: Tue, 5 Feb 2013 01:53:19 -0800 (PST)
Date: 2013-02-05T01:53:19-08:00	[thread overview]
Message-ID: <63885cee-5f48-4c96-850a-b56177a0de0e@googlegroups.com> (raw)
In-Reply-To: <5ab43474-0ce2-425c-836b-ff4c97587958@googlegroups.com>

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



  parent reply	other threads:[~2013-02-05  9:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-29  1:24 When is a rename not a rename? Adam Beneschan
2013-01-30  0:28 ` Randy Brukardt
2013-01-30  0:52   ` Adam Beneschan
2013-01-30  9:31     ` Dmitry A. Kazakov
2013-01-30 14:35       ` ytomino
2013-02-01 10:44 ` Ada novice
2013-02-01 11:27   ` Dmitry A. Kazakov
2013-02-01 17:32     ` Adam Beneschan
2013-02-01 18:31       ` ytomino
2013-02-02  1:40         ` Adam Beneschan
2013-02-02 12:24           ` ytomino
2013-02-02 14:26           ` Robert A Duff
2013-02-02 17:11             ` Shark8
2013-02-02  0:42       ` Brian Drummond
2013-02-02 11:43         ` AdaMagica
2013-02-03 11:50           ` Brian Drummond
2013-02-03 12:16             ` AdaMagica
2013-02-05  9:53       ` Ada novice [this message]
2013-02-01 17:48     ` Ada novice
replies disabled

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