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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:aed:2d87:: with SMTP id i7mr19145460qtd.291.1591535688386; Sun, 07 Jun 2020 06:14:48 -0700 (PDT) X-Received: by 2002:a9d:4c0a:: with SMTP id l10mr13158387otf.276.1591535688170; Sun, 07 Jun 2020 06:14:48 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 7 Jun 2020 06:14:47 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=2a02:1206:4544:3750:6166:5721:3f9a:5e9d; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG NNTP-Posting-Host: 2a02:1206:4544:3750:6166:5721:3f9a:5e9d References: <2d4d6645-7055-4564-a854-6da5fc83af4eo@googlegroups.com> <9c45012c-a4b5-416d-bf1e-c2a8479ec641o@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Q: discrete_subtype_definition: static only cases? From: gautier_niouzes@hotmail.com Injection-Date: Sun, 07 Jun 2020 13:14:48 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:59004 Date: 2020-06-07T06:14:47-07:00 List-Id: On Sunday, June 7, 2020 at 3:02:56 PM UTC+2, Jeffrey R. Carter wrote: > On 6/7/20 2:13 PM, gautier_niouzes@hotmail.com wrote: > >> No. The basic principle is that types are static (they determine the > >> underlying representation) and subtypes are dynamic. > > > > Well, there are obviously exceptions to that basic principle: > > > > procedure SD2 is > > begin > > for I in 1 .. 3 loop > > declare > > type T is array (1 .. I) of Integer; -- I is a variable > > B: T; > > begin > > null; > > end; > > end loop; > > end; > > Conceptually, this declaration is equivalent to > > type /anon/ is array (Integer range <>) of Integer; > subtype T is /anon/ (1 .. I); > > So the (anonymous) type is static, but the (first-named) subtype is not. ...plus, the keyword "type" is used and not "subtype". And /anon/ could itself be dynamic (an array of a named dynamic (sub)type). So basically types are static, except when they aren't ;-)