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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,46b760ffb623378c X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!news-2.dfn.de!news.dfn.de!news.uni-stuttgart.de!news.belwue.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Hiding the value of Constants Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <30696d63-16e8-44e2-a4a5-db5095d7cfec@m3g2000pri.googlegroups.com> <4a531837$0$30227$9b4e6d93@newsspool1.arcor-online.net> <5b49f256-f779-4030-a50d-5f31fd08ddff@26g2000yqk.googlegroups.com> <0549aae1-d200-4c81-aa92-8d18df6cf0d4@b25g2000prb.googlegroups.com> Date: Tue, 7 Jul 2009 20:48:02 +0200 Message-ID: <1dv621wlnwthy$.34p5zibbgti0.dlg@40tude.net> NNTP-Posting-Date: 07 Jul 2009 20:48:00 CEST NNTP-Posting-Host: af14117a.newsspool2.arcor-online.net X-Trace: DXC=Xa?YK?D7S6NKQ8hVQ4\X;gUfBA66oHk< X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:6885 Date: 2009-07-07T20:48:00+02:00 List-Id: On Tue, 7 Jul 2009 08:51:35 -0700 (PDT), Adam Beneschan wrote: > I believe the reason enumeration literals are actually functions is so > that you can use the same enumeration literal in more than one > enumeration type and not have to worry about name conflicts. It is a strange explanation to me. There is no obvious reason why rules about overloading named objects should be different for functions. The effect is same, so the syntactic form should be same. > The > overloading rules will allow the compiler to figure out which one is > meant. There are additional bonuses, such as being able to use an > enumeration literal as the actual for a generic instantiation that > expects a function. How useful that is in practice, I don't know. It is indeed useful, because sometimes it is impossible to declare a ting as an initialized constant. In such cases making it a function gives the desired effect. [...] > If you mean that you'd like > constants to be treated like static functions, so that you can > overload them: > > Max : constant Integer := 15; > Max : constant Float := 15.0; > > that's an intriguing idea. I think the idea is rather straightforward. But also X : Integer; X : Float; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de