From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.0 required=3.0 tests=BAYES_40 autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:ac8:714c:: with SMTP id h12mr55534263qtp.361.1609416621706; Thu, 31 Dec 2020 04:10:21 -0800 (PST) X-Received: by 2002:a25:9902:: with SMTP id z2mr80538180ybn.339.1609416621488; Thu, 31 Dec 2020 04:10:21 -0800 (PST) Path: eternal-september.org!reader02.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 31 Dec 2020 04:10:21 -0800 (PST) In-Reply-To: <5fedba8b$0$6186$426a74cc@news.free.fr> Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=173.71.207.183; posting-account=JSxOkAoAAADa00TJoz2WZ_46XrZCdXeS NNTP-Posting-Host: 173.71.207.183 References: <5fedba8b$0$6186$426a74cc@news.free.fr> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <3f5ff494-837e-446f-a621-ff1dd8414ea0n@googlegroups.com> Subject: Re: renames usage From: John Perry Injection-Date: Thu, 31 Dec 2020 12:10:21 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:60985 List-Id: No. Assignment copies the object, and changes to the copy don't affect the original, while renaming obtains a reference to the object. This program will illustrate it: with Ada.Text_IO; use Ada.Text_IO; procedure Test_Renames is S: String := "hello world"; T: String := S; U: String renames S; begin Put_Line(S); T(T'First) := 'y'; Put_Line(S); -- still "hello world" U(U'First) := 'y'; Put_Line(S); -- "yello world" end Test_Renames;