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.206.195 with SMTP id fv3mr7891606qab.1.1359805413402; Sat, 02 Feb 2013 03:43:33 -0800 (PST) X-Received: by 10.49.24.14 with SMTP id q14mr1410289qef.17.1359805413227; Sat, 02 Feb 2013 03:43:33 -0800 (PST) Path: k2ni4456qap.0!nntp.google.com!p13no8084058qai.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 2 Feb 2013 03:43:33 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=91.7.74.201; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 91.7.74.201 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: <733da1ab-5b3a-4a24-a3d5-4c252d20a3c8@googlegroups.com> Subject: Re: When is a rename not a rename? From: AdaMagica Injection-Date: Sat, 02 Feb 2013 11:43:33 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2013-02-02T03:43:33-08:00 List-Id: On Saturday, February 2, 2013 1:42:29 AM UTC+1, Brian Drummond wrote: > On Fri, 01 Feb 2013 09:32:42 -0800, Adam Beneschan wrote: > The trick was something like renaming an object.method call to just > renamed_method. > > I forget the precise details but I recall it was legal; taking its access > was not (though astonishingly, it worked in current Gnat revisions) See http://en.wikibooks.org/wiki/Ada_Programming/Subprograms#Renaming package Some_Package is type Message_Type is tagged null record; procedure Print (Message: in Message_Type); end Some_Package; with Some_Package; procedure Main is Message: Some_Package.Message_Type; procedure Print renames Message.Print; -- this has convention intrinsic, see RM 6.3.1(10.1/2) Method_Ref: access procedure := Print'Access; -- thus taking 'Access should be illegal; GNAT GPL 2012 allows this begin -- All these calls are equivalent: Some_Package.Print (Message); -- traditional call without use clause Message.Print; -- Ada 2005 method.object call - note: no use clause necessary Print; -- Message.Print is a parameterless procedure and can be renamed as such Method_Ref.all; -- GNAT GPL 2012 allows illegal call via an access to the renamed procedure Print -- This has been corrected in the current version (as of Nov 22, 2012) end Main;