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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,16f39b4f57339dcb X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!news.in2p3.fr!in2p3.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Constant as anonymous functions : the outer space beast is back Date: Fri, 5 Feb 2010 15:51:33 -0600 Organization: Jacob Sparre Andersen Message-ID: References: <3c43bf9d-75f1-4d09-9388-65b83cafb1d9@j14g2000yqm.googlegroups.com> <454c900f-85ed-4a40-ad13-a5b432261b99@c29g2000yqd.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1265406696 31131 69.95.181.76 (5 Feb 2010 21:51:36 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 5 Feb 2010 21:51:36 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5843 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Xref: g2news1.google.com comp.lang.ada:8921 Date: 2010-02-05T15:51:33-06:00 List-Id: "Hibou57 (Yannick Duch�ne)" wrote in message news:454c900f-85ed-4a40-ad13-a5b432261b99@c29g2000yqd.googlegroups.com... >On 30 jan, 09:45, AdaMagica wrote: >> And even if you make Count a function (overloadable), this example >> code is still illegal in Ada as is - and that's a good thing. >> >> package P is >> function Count return Float; >> end P; > >Yes, because the Count loop variant still hide the one from P. Right, but that wouldn't be true in your suggested semantics, as the Count object would be overloadable. Even if you restricted that only to constants (of which Count is one). It's clear that you haven't thought this through very well. Adam notes that you could just change the behavior of constants declared with "constant", but that makes no sense -- a renames of a constant object does not include the keyword constant. So such a "simple" rule wouldn't work. Moreover, it doesn't make sense to treat constants and variables differently. The only sane choice is to change the behavior of *all* objects -- there is nothing that special about constants. Treating constants and variables differently would introduce a major maintenance hazard. The current principle (and one that ever programmer would expect) is that changing a declaration from constant to variable (or the reverse) only changes whether or not it can be written. Otherwise it ought to behave identically. Making the visibility rules wildly different for constants and variables would not have that effect (it's quite likely changing a constant to a variable would make some if it's uses illegal using your rule). And it is bizarre to say that you are trying to increase consistency and then try to treat things syntactically declared one way from equivalent things declared in another way. How that could *increase* consistency is beyond my comprehension. I had seriously proposed making objects overloadable declarations for use clause purposes only (mainly to decrease the maintenance hazard inherent in use clauses - which is really what you are complaining about), but that idea didn't get any traction. So nothing is going to change in this area. Randy.