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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Q: discrete_subtype_definition: static only cases? Date: Sun, 7 Jun 2020 12:40:09 +0200 Organization: Adalog Message-ID: References: <2d4d6645-7055-4564-a854-6da5fc83af4eo@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Sun, 7 Jun 2020 10:40:09 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="ee1b00cd9f5ec1570266576ef442d075"; logging-data="19976"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/vCTsdV2dazAGX8DNWb4G4" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 Cancel-Lock: sha1:y3nZpCa9BsyMhGA47bdVpTz7eL4= In-Reply-To: <2d4d6645-7055-4564-a854-6da5fc83af4eo@googlegroups.com> Content-Language: fr Xref: reader01.eternal-september.org comp.lang.ada:58998 Date: 2020-06-07T12:40:09+02:00 List-Id: Le 07/06/2020 à 11:27, gautier_niouzes@hotmail.com a écrit : > Are there cases in the Ada syntax where a discrete_subtype_definition (RM 3.6 (6)) is expected to be determined at compile-time? > > For instance, for array indices or "for" loops, it can be static or dynamic. > Same for subtypes. No. The basic principle is that types are static (they determine the underlying representation) and subtypes are dynamic. But nothing prevents a compiler from optimizing cases where the subtype is actually static... -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr