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,63ed09fc54092c73 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.66.89.135 with SMTP id bo7mr2225102pab.16.1359769241108; Fri, 01 Feb 2013 17:40:41 -0800 (PST) X-Received: by 10.50.7.244 with SMTP id m20mr66186iga.14.1359769241045; Fri, 01 Feb 2013 17:40:41 -0800 (PST) Path: 6ni29466pbd.1!nntp.google.com!f6no13790799pbd.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 1 Feb 2013 17:40:40 -0800 (PST) In-Reply-To: <8f7b509f-c92d-48b0-8322-cdc48baf4846@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ NNTP-Posting-Host: 66.126.103.122 References: <6d66d1c4-ed22-446b-a9d7-dc806ae1ef8f@googlegroups.com> <5ab43474-0ce2-425c-836b-ff4c97587958@googlegroups.com> <8f7b509f-c92d-48b0-8322-cdc48baf4846@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <18239154-6753-455c-b00e-4caf876e03ff@googlegroups.com> Subject: Re: When is a rename not a rename? From: Adam Beneschan Injection-Date: Sat, 02 Feb 2013 01:40:41 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2013-02-01T17:40:40-08:00 List-Id: On Friday, February 1, 2013 10:31:06 AM UTC-8, ytomino wrote: > How is my previous post? >=20 > First, >=20 > package XXX is > type T is private; > function "=3D" (Left, Right : T) return Boolean; > end XXX; >=20 > declare > use XXX; > use type T; > A, B : T; > begin > if A =3D B then -- legal >=20 > Then, ready new package YYY renaming XXX. >=20 > with XXX; > package YYY is > subtype T is XXX.T; > function "=3D" (Left, Right : T) return Boolean renames XXX."=3D"; > end YYY; >=20 > And, replace. >=20 > declare > use YYY; -- change here > use type T; > A, B : T; > begin > if A =3D B then -- error !! I can understand why this would be annoying. It seems like a problem. I d= on't know if it's enough of a problem to consider fixing the language. It = wouldn't be trivial. Perhaps 8.6(30) could be modified to add some concept= of two acceptable interpretations that are essentially the same because th= e usage names end up denoting the same entity via renaming. It seems hard = to get the wording right. Plus you have to deal with things like this: package XXX is type T is private; procedure Operation (Obj : in out T; Offset : Integer :=3D 0); end XXX; package YYY is subtype T renames XXX.T; procedure Operation (Obj : in out T; Offset : Integer :=3D -1)=20 renames XXX.Operation; end YYY; ... use YYY; use type T; Z : T; Operation(Z); Although the two Operation's that could be denoted by this actually refer t= o the same declaration after renaming is considered, it's still ambiguous s= ince we don't know what should be passed for Offset. Parameter names can a= lso be different in a subprogram rename, which can pose another problem. T= he language rules would have to be written to allow the case you're interes= ted in but disallow examples like mine. Not easy. -- Adam