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=0.8 required=3.0 tests=BAYES_50,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:ae9:f304:: with SMTP id p4mr3567199qkg.334.1631602699284; Mon, 13 Sep 2021 23:58:19 -0700 (PDT) X-Received: by 2002:a25:af49:: with SMTP id c9mr16957525ybj.432.1631602698803; Mon, 13 Sep 2021 23:58:18 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 13 Sep 2021 23:58:18 -0700 (PDT) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=87.88.29.208; posting-account=6yLzewoAAABoisbSsCJH1SPMc9UrfXBH NNTP-Posting-Host: 87.88.29.208 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <38d17a31-ef3a-4ff0-a05c-89a05c9d7e06n@googlegroups.com> Subject: Re: Is there a way to see if a value is declared as a constant From: Emmanuel Briot Injection-Date: Tue, 14 Sep 2021 06:58:19 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:62733 List-Id: > items are different. Not using an array means that the readability of > the of the package will be better. It won't, really. If you follow Bjorn's suggestion of using an enumeration type (user visible) and an array (in the body of your package, to get the associated constant), you have a very readable package, where users can only use one of your enumeration literals. With the approach you are trying to put in place, users could define their own constants that doesn't match the ones you provide. They would still be "constant", so even if it was possible to write a test like you were looking for, that test would pass.