From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.9 required=3.0 tests=BAYES_00,NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Is there a way to see if a value is declared as a constant Date: Mon, 13 Sep 2021 20:48:40 +0200 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 13 Sep 2021 18:48:42 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="7f8b54b110af01c1b098dacc1fee8aab"; logging-data="29857"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Wk0V03kObAB3LV2XuPTpegbJ9zWd4M30=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 Cancel-Lock: sha1:ZypVPceG5QDza6y9InTuuKPgSE4= In-Reply-To: Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:62723 List-Id: On 9/13/21 7:08 PM, ldries46 wrote: > > In what way do I test if C is a constant and not another record Item function X (C : in Record_Item) return Record_Item with Pre => C = C1 or C = C2 or C = C3 or C = C4 or C = C5; Of course, if you have a lot of constants with more descriptive names, the precondition will be hard to read. If you had a constant array it would be more readable: Pre => (for some A of Allowed_Values => C = A); -- Jeff Carter "You've got the brain of a four-year-old boy, and I bet he was glad to get rid of it." Horse Feathers 47