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,e19a809544945098 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.germany.com!newsfeed.straub-nv.de!feeder.erje.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: worrying behaviour Date: Fri, 2 May 2008 20:15:14 -0500 Organization: Jacob's private Usenet server Message-ID: References: NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1209777368 15525 69.95.181.76 (3 May 2008 01:16:08 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sat, 3 May 2008 01:16:08 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1914 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1914 Xref: g2news1.google.com comp.lang.ada:21177 Date: 2008-05-02T20:15:14-05:00 List-Id: "Adam Beneschan" wrote in message news:ea92a206-7617-4968-90c2-31fcc30d5e40@r9g2000prd.googlegroups.com... ... > I'm not sure that there's a good solution in Ada. If you really > wanted to make sure that the only operators available for My_Int are > the ones that you remembered to override, you could declare My_Int > private, but then you'd lose the ability to have numeric literals for > that type (in other packages). I suppose that having some sort of > language construct that says "kill all predefined operators for a > type" would be useful in your case. That's not available, but you can kill them one-by-one by declaring them abstract: function "-" (R : My_Int) return My_int is abstract; makes "-" effectively undefined for type My_Int. (This is new in Ada 2005, in Ada 95 it is defined and uncallable -- the difference is that it might conflict with some user-defined routine and cause trouble.) Randy.