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!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!cleanfeed2-a.proxad.net!nnrp1-1.free.fr!not-for-mail Newsgroups: comp.lang.ada References: <5fedba8b$0$6186$426a74cc@news.free.fr> <5fedf478$0$21621$426a74cc@news.free.fr> From: DrPi <314@drpi.fr> Subject: Re: renames usage Date: Fri, 1 Jan 2021 13:39:39 +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: <5fef180c$0$19476$426a74cc@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 01 Jan 2021 13:39:40 CET NNTP-Posting-Host: 82.65.30.55 X-Trace: 1609504780 news-3.free.fr 19476 82.65.30.55:61545 X-Complaints-To: abuse@proxad.net Xref: reader02.eternal-september.org comp.lang.ada:61000 List-Id: Le 31/12/2020 à 19:48, Dmitry A. Kazakov a écrit : > On 2020-12-31 16:55, DrPi wrote: >> Le 31/12/2020 à 15:49, Jeffrey R. Carter a écrit : >>> On 12/31/20 12:48 PM, DrPi wrote: >>>> >>>> Tag   : String renames Elements.Get_Tag_Name (Child); >>>> >>>> Is it equivalent to the following line ? >>>> >>>> Tag   : String := Elements.Get_Tag_Name (Child); >>> >>> No. A function result is a constant, so the 1st version gives you a >>> constant. The second gives you a variable with the same value. >>> >> Good to know. >> What disturbed me was the function call associated with "renames". > > Renaming a call to a function does not rename it in some > functional-programming manner. It renames only the result of. > That's what I've understood with Jeffrey's answer. > So if you do > >    X : Float renames Random (Seed); >    Y : array (1..10) of Float := (others => X); > > That would not give you ten pseudo-random numbers. But this will: > >    Z : array (1..10) of Float := (others => Random (Seed)); > Thanks for your detailed answer. Reading all the answers, I understand that : X : Float renames Random (Seed); is equivalent to : X : constant Float := Random (Seed); Right ?