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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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.180.105.39 with SMTP id gj7mr420072wib.0.1359717959228; Fri, 01 Feb 2013 03:25:59 -0800 (PST) Path: bp2ni10058wib.1!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.83.MISMATCH!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!news.stack.nl!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: When is a rename not a rename? Date: Fri, 1 Feb 2013 12:27:02 +0100 Organization: cbb software GmbH Message-ID: References: <6d66d1c4-ed22-446b-a9d7-dc806ae1ef8f@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2013-02-01T12:27:02+01:00 List-Id: On Fri, 1 Feb 2013 02:44:21 -0800 (PST), Ada novice wrote: > If you have a minimal example that is proving the contrary, please post it here. Here is how renaming is not renaming: with Ada.IO_Exceptions; procedure Test is package P is End_Error : exception renames Ada.IO_Exceptions.End_Error; end P; use P, Ada.IO_Exceptions; begin null; exception when End_Error => -- Compile error, should be none null; end Test; This is "diamond diagram" constructed using renaming: procedure Test is package P is I : Integer; end P; package Q is J : Integer renames P.I; end Q; package R is J : Integer renames P.I; end R; use Q, R; X : Integer := J; -- Compile error, should be none begin null; end Test; [Diamond diagram is common-place bogus argument against MI] Yet another example when rename is something totally broken: with Ada.Text_IO; use Ada.Text_IO; procedure Test is X : Integer; Y : Positive renames X; begin Y := -1; Put_Line ("And today positive number is " & Integer'Image (Y)); end Test; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de