From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FROM_STARTS_WITH_NUMS autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:a24:7d91:: with SMTP id b139-v6mr8180861itc.6.1527604645141; Tue, 29 May 2018 07:37:25 -0700 (PDT) X-Received: by 2002:a9d:5608:: with SMTP id e8-v6mr1247726oti.5.1527604644907; Tue, 29 May 2018 07:37:24 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!news.redatomik.org!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!85.12.16.70.MISMATCH!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!u74-v6no6489582itb.0!news-out.google.com!f20-v6ni6117itd.0!nntp.google.com!v8-v6no6525281itc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 29 May 2018 07:37:24 -0700 (PDT) In-Reply-To: <55ce14eb-6b83-4ea0-a550-f9e1410d0b06@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.245.163.100; posting-account=rhqvKAoAAABpikMmPHJSZh4400BboHwT NNTP-Posting-Host: 85.245.163.100 References: <55ce14eb-6b83-4ea0-a550-f9e1410d0b06@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Strings with discriminated records From: Mehdi Saada <00120260a@gmail.com> Injection-Date: Tue, 29 May 2018 14:37:25 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 2383 X-Received-Body-CRC: 95431763 Xref: reader02.eternal-september.org comp.lang.ada:52763 Date: 2018-05-29T07:37:24-07:00 List-Id: Let's go half and half: how about making subtype indication in object renaming simply optional, and allow it for compatibility and in case of ambiguity ? A pragma would suffice if it doesn't exist yet (just wondering). I can see myself how renaming is broken: Some constraints in subprograms profile are taken in account, and some are not. The compiler will enforce this constraint: Function KI (JJ : in INTEGER := 5) return Integer is (JJ); function KKI (JJ : in Positive) return Positive renames KI; then put_line(KKi(-5)'img) will cause warnings. But this is ignored: procedure MMI (JJ : in Integer) renames MM;, the subtype in MM's declaration is used, and this is ignored too: declare procedure KI (JJ : out Integer) is begin JJ := -5; end KI; procedure KKI (JJ : out Positive) renames KI; M : Positive; begin KKI (M); end; Then you really obtain a M with a value out of range. What the fuck ? This is the worst thing and type security breach I saw in Ada until now. Fixing this in the next version is more important that adding new features, and it's worth incompatibilities.