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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border2.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!news.etla.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Functions vs constants Date: Mon, 21 Jul 2014 18:23:05 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1405984985 4574 69.95.181.76 (21 Jul 2014 23:23:05 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 21 Jul 2014 23:23:05 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: number.nntp.dca.giganews.com comp.lang.ada:187772 Date: 2014-07-21T18:23:05-05:00 List-Id: "Niklas Holsti" wrote in message news:c35fbuF747qU1@mid.individual.net... > On 14-07-22 00:18 , Victor Porton wrote: ... >>, but I propose it: Make in a future specification of Ada constants >> overloadable (moreover, make constants argument-less functions). > > Others have also suggested this, and even wider overloading (including > variables). Arguments against the idea relied on subjective opinion, if > I remember correctly. Right. I've worked out the implications (it was in relation to problems with an AI that was later dropped). It doesn't make sense to allow overloading of constants but not variables because the line between constants and variables is very fuzzy. And it doesn't matter anyway, as the problem in either case is one of compatibility. If one allows overloading, then some legal programs would become illegal (because of ambiguity, usually involving nesting), and worse, a very few programs would change meaning (because of use clauses). That's generally considered too dangerous to consider for Ada - certainly not without it fixing a major problem. Otherwise, I think all objects (including exceptions) should allow overloading. Had that been done from the beginning, a lot of the maintenance hazards of use clauses would have been avoided (and my opinion of them would not be so negative). But it's too late now for Ada; perhaps if a new Ada-like language was constructed, it would be possible there. [Note when I say "it's too late now", I mean that it's very unlikely that we'd have the will to make a change with such far-reaching consequences, all of which could never be understood. I have been surprised before (the fix to untagged record equality is a similar problem that I thought we'd never fix because of the compatibility concerns - but we did fix it in Ada 2012).] Randy.