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!cleanfeed1-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:53:18 +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: fr Content-Transfer-Encoding: 8bit Message-ID: <5ff05eaf$0$16182$426a74cc@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 02 Jan 2021 12:53:19 CET NNTP-Posting-Host: 82.65.30.55 X-Trace: 1609588399 news-3.free.fr 16182 82.65.30.55:63415 X-Complaints-To: abuse@proxad.net Xref: reader02.eternal-september.org comp.lang.ada:61008 List-Id: Le 01/01/2021 à 14:20, Dmitry A. Kazakov a écrit : > On 2021-01-01 13:39, DrPi wrote: > >> Reading all the answers, I understand that : >>      X : Float renames Random (Seed); >> is equivalent to : >>      X : constant Float := Random (Seed); >> >> Right ? > > You must keep in mind that renaming ignores subtype contraints. So: > >    X : Integer := -1; >    Y : Positive renames X; -- Let's fool ourselves > begin >    Put_Line ("A positive number " & Integer'Image (Y)); > > Will happily print "A positive number -1." > Interresting. Thanks.