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,FREEMAIL_FROM autolearn=ham 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 Path: g2news2.google.com!postnews.google.com!a7g2000yqk.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Re: Hiding the value of Constants Date: Tue, 7 Jul 2009 09:26:49 -0700 (PDT) Organization: http://groups.google.com Message-ID: 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> NNTP-Posting-Host: 86.75.149.50 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1246984009 28303 127.0.0.1 (7 Jul 2009 16:26:49 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 7 Jul 2009 16:26:49 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a7g2000yqk.googlegroups.com; posting-host=86.75.149.50; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6884 Date: 2009-07-07T09:26:49-07:00 List-Id: On 7 juil, 17:51, 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. I believe the same > There are additional bonuses, such as being able to use an > enumeration literal as the actual for a generic instantiation that > expects a function. =A0How useful that is in practice, I don't know. I do not see right away neither, but I don't minde, as it is clear cristal and as there is nothing of a kind of hack in there. > I'm not sure why you would want enumeration literals to be treated > like constants, though. My words were probably clumsy, beceause I was to suggest the opposite : treat constants like enumeration literals are. This would not break any actual code, as actual restrictions on constants are narrower than the restrictions on enumeration literals. > If you mean that you'd like > constants to be treated like static functions, so that you can > overload them: > > =A0 =A0 Max : constant Integer :=3D 15; > =A0 =A0 Max : constant Float :=3D 15.0; That was this one idea, yes :) > that's an intriguing idea. =A0Not intriguing enough for me to have to > make all the necessary changes to our compiler, but intriguing > nonetheless.... Oops... I apologize, as I'm not a compiler writer (just played with a tiny-little language of my own, some years ago), I cannot figure out the amount of difficulty this would involve.