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!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: renames usage Date: Fri, 1 Jan 2021 15:46:39 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <5fedba8b$0$6186$426a74cc@news.free.fr> <5fedf478$0$21621$426a74cc@news.free.fr> <5fef180c$0$19476$426a74cc@news.free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Fri, 1 Jan 2021 14:46:41 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="6f6346ca4269162f222d5c56f80df63b"; logging-data="17631"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19qbW+oivr/Qm0sS/668FRRzGkrq3JMLL0=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 Cancel-Lock: sha1:cQL6nL5UTmpO9GyTUEhKHgssanA= In-Reply-To: <5fef180c$0$19476$426a74cc@news.free.fr> Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:61002 List-Id: 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). -- Jeff Carter "My legs are gray, my ears are gnarled, my eyes are old and bent." Monty Python's Life of Brian 81