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,a41c4a2c795dbe34 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!postnews.google.com!f2g2000yqh.googlegroups.com!not-for-mail From: AdaMagica Newsgroups: comp.lang.ada Subject: Re: Will "renames" increase program size? Date: Wed, 15 Jun 2011 23:59:35 -0700 (PDT) Organization: http://groups.google.com Message-ID: <316ac8ed-1ded-43d0-98d1-36bb2c0221ad@f2g2000yqh.googlegroups.com> References: <46294109-f07d-49c0-8e81-65a369a05ced@z15g2000prn.googlegroups.com> <1ayjsy885qg2b$.13bmeo97hbau1$.dlg@40tude.net> NNTP-Posting-Host: 91.7.78.59 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1308207575 23279 127.0.0.1 (16 Jun 2011 06:59:35 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 16 Jun 2011 06:59:35 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f2g2000yqh.googlegroups.com; posting-host=91.7.78.59; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.0; rv:2.0.1) Gecko/20100101 Firefox/4.0.1,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:19866 Date: 2011-06-15T23:59:35-07:00 List-Id: On 15 Jun., 15:15, "Dmitry A. Kazakov" wrote: > On Wed, 15 Jun 2011 13:24:52 +0200, Yannick Duch=C3=AAne (Hibou57) wrote: > > Le Wed, 15 Jun 2011 07:37:22 +0200, Randy Brukardt =C2=A0 > > a =C3=A9crit: > >> Some examples where there probably would be some overhead: > > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Obj : Natural renames = My_Array (Some_Variable).all; > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Obj2 : Float renames S= ome_Function (A, B); > > > Yes, because this is more an aliasing (in the symbolic sense) than a = =C2=A0 > > proper renaming. > > Yes, Ada's renaming is not renaming. Consider this: > > =C2=A0 =C2=A0Line : String renames Get_Line; > > It calls Get_Line once and keeps the result object. In fact it is an > equivalent to: > > =C2=A0 =C2=A0 : constant String :=3D Get_Line; > =C2=A0 =C2=A0Line : properly renames ; > > Consider also the effect of renaming on the visibility rules: > > =C2=A0 =C2=A0package P1 is > =C2=A0 =C2=A0 =C2=A0 End_Error : exception renames Ada.Text_IO.End_Error; > =C2=A0 =C2=A0end P1; > =C2=A0 =C2=A0package P2 is > =C2=A0 =C2=A0 =C2=A0 End_Error : exception renames Ada.Text_IO.End_Error; > =C2=A0 =C2=A0end P2; > =C2=A0 =C2=A0use P1, P2; > > =C2=A0 =C2=A0exception > =C2=A0 =C2=A0 =C2=A0 when End_Error =3D> -- End_Error is hidden! > > Ada's "renames" does not rename here, it copies, creates objects. There a= re > three End_Error here, all of them are equal, but not same: > > exception > =C2=A0 =C2=A0when Ada.Text_IO.End_Error =3D> > =C2=A0 =C2=A0 =C2=A0 ... > =C2=A0 =C2=A0when P1.End_Error =3D> -- Error! P1.End_Error has the same v= alue > =C2=A0 =C2=A0 =C2=A0 ... > =C2=A0 =C2=A0when P2.End_Error =3D> > =C2=A0 =C2=A0 =C2=A0 ... > > A proper renaming would create identical (x=E2=89=A1y) entities, Ada's re= naming > sometimes creates only equal ones (x=3Dy). > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de That's not correct. A renaming does not copy nor somehow create new entities, it only creates new names for the same thing. Since visibility is via names, you arrive at unresolvability issues.