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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fc52c633190162e0 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!usenet-fr.net!gegeweb.org!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Erasing inappropriate operations (was: why learn C?) Date: Tue, 3 Apr 2007 18:44:55 -0500 Organization: Jacob's private Usenet server Message-ID: References: <1172144043.746296.44680@m58g2000cwm.googlegroups.com> <1172161751.573558.24140@h3g2000cwc.googlegroups.com> <546qkhF1tr7dtU1@mid.individual.net> <5ZULh.48$YL5.40@newssvr29.news.prodigy.net> <1175215906.645110.217810@e65g2000hsc.googlegroups.com> <1175230700.925143.28490@n59g2000hsh.googlegroups.com> <1btkgzzj6zimp.acsq8mkzqz1w$.dlg@40tude.net> <1175488143.324741.283480@y80g2000hsf.googlegroups.com> <1lxqyx4ognsed$.ait5qqwujfo8$.dlg@40tude.net> <1175501959.751535.23190@d57g2000hsg.googlegroups.com> <1175604129.583861.40720@q75g2000hsh.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1175643803 29544 69.95.181.76 (3 Apr 2007 23:43:23 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 3 Apr 2007 23:43:23 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Xref: g2news1.google.com comp.lang.ada:14773 Date: 2007-04-03T18:44:55-05:00 List-Id: "Ludovic Brenta" wrote in message news:1175604129.583861.40720@q75g2000hsh.googlegroups.com... > Randy Brukardt: > > the Amendment fixed the most important problem in Ada 95: > > the inability to "erase" an inappropriate operation from a unit type > > package. > > Could you please explain what you mean by this? A quick perusal of the > Ada 2005 rationale failed to enlighten me. In Ada 95, abstract operators of untagged types are considered in resolution. So, you still might call them;then get an error message. That is especially problematical if an appropriate operator is defined somewhere else, because the expression might be ambiguous. (It's also a problem with literals). The Amendment 1 changed that so that they do not participate in resolution. Thus, they no longer clog up resolution. For instance, if you had: type F1 is digits 3; type F2 is digits 3; function "*" (Left : F1, Right : F2) return F2; function "*" (Left, Right : F2) return F2 is abstract; -- Don't want this operator. A : F1 := 1.0; B : F2 := A * 1.0; -- (1) The expression (1) is ambiguous in Ada 95 (even though one of the possible operators is illegal). But Amendment 1 makes it OK; you'll get the intended operator without interference from the predefined ones you don't want. Randy.