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=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!cleanfeed2-b.proxad.net!nnrp1-1.free.fr!not-for-mail Subject: Re: renames usage Newsgroups: comp.lang.ada References: <5fedba8b$0$6186$426a74cc@news.free.fr> <5fedf478$0$21621$426a74cc@news.free.fr> <5fef180c$0$19476$426a74cc@news.free.fr> From: DrPi <314@drpi.fr> Date: Sat, 2 Jan 2021 12:55:43 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Message-ID: <5ff05f40$0$16182$426a74cc@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 02 Jan 2021 12:55:44 CET NNTP-Posting-Host: 82.65.30.55 X-Trace: 1609588544 news-3.free.fr 16182 82.65.30.55:63415 X-Complaints-To: abuse@proxad.net Xref: reader02.eternal-september.org comp.lang.ada:61009 List-Id: Le 01/01/2021 à 15:46, Jeffrey R. Carter a écrit : > On 1/1/21 1:39 PM, DrPi wrote: >> >> Reading all the answers, I understand that : >>      X : Float renames Random (Seed); >> is equivalent to : >>      X : constant Float := Random (Seed); > > Technically, the renames gives a name to the anonymous temporary object > returned by the function. The constant declaration makes a constant copy > of it. So they're equivalent, but not identical. > > However, the compiler is free to optimize the copy away, and I'd be > surprised if there are any compilers that don't (except GNAT with -O0). > Effectively, the copy can be of importance in some situations. Thanks.