comp.lang.ada
 help / color / mirror / Atom feed
From: Emmanuel Briot <briot.emmanuel@gmail.com>
Subject: Re: Is there a way to see if a value is declared as a constant
Date: Mon, 13 Sep 2021 23:58:18 -0700 (PDT)	[thread overview]
Message-ID: <38d17a31-ef3a-4ff0-a05c-89a05c9d7e06n@googlegroups.com> (raw)
In-Reply-To: <nnd$06effbf5$6aa68ebd@010391d1f6c084ba>

> 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.

  reply	other threads:[~2021-09-14  6:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13 17:08 Is there a way to see if a value is declared as a constant ldries46
2021-09-13 17:27 ` Björn Lundin
2021-09-13 18:48 ` Jeffrey R. Carter
2021-09-13 19:00 ` Dmitry A. Kazakov
2021-09-14  6:47 ` ldries46
2021-09-14  6:58   ` Emmanuel Briot [this message]
2021-09-14 23:47 ` Shark8
2021-09-18  5:54 ` ldries46
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox