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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c7ea1cb7a2beb2ee X-Google-Attributes: gid103376,public From: "Steven Hovater" Subject: Re: Disallowing Pre-Defined Operations Date: 2000/03/12 Message-ID: #1/1 X-Deja-AN: 596283822 References: <8a9eeg$qtv$1@newpoisson.nosc.mil> <38C851B6.4AB3878E@Raytheon.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 X-Complaints-To: abuse@mediaone.net X-Trace: typhoon.ne.mediaone.net 952824401 24.147.125.64 (Sat, 11 Mar 2000 20:26:41 EST) Organization: Road Runner X-MSMail-Priority: Normal NNTP-Posting-Date: Sat, 11 Mar 2000 20:26:41 EST Newsgroups: comp.lang.ada Date: 2000-03-12T00:00:00+00:00 List-Id: And if you're using Apex, this kind of checking is already in the tool. It's called the "code rule checker", and is online, with source, and can be end-user (e.g. customer)configured. It's not automatic,however; the code rule checker would have to be explicitly invoked, and is similar to what Mr. Harris describes. Steve -- Steven Hovater svh@rational.com Technical Representative Phone/fax:781-676-2565/2500 Rational Software Pager: 888-906-2209 83 Hartwell Ave, Lexington, MA Amateur radio: AA1YH "Samuel T. Harris" wrote in message news:38C851B6.4AB3878E@Raytheon.com... > "Charles H. Sampson" wrote: > > > > During the deliberations that led to Ada 95, was a mechanism for > > disallowing the pre-defined operations of a type considered? By "disal- > > lowing" I mean some way of informing the compiler that an attempt to use > > a certain pre-defined operation is a compile-time error. Did anyone > > even ask for it? (Obviously I didn't, even though I've thought since > > the mid-eighties that it would be a useful capability to have.) > > > > One could use a derived type and overload the undesired operators > to simply raise some appropriate exception. Perhaps Operation_Error. > That will give you runtime checks on "improper" usage. > > As to compile time checks, one can develop an ASIS program > which hunts for the offending operators. You can even > create you own pragma to denote which operators are not > to be referenced. Other compilers may complain about > an unsupported or unrecognized pragma, but they should > allow compilation. The ASIS program can recognize such > pragmas and use them to key in on which operators > should not be used. > > -- > Samuel T. Harris, Principal Engineer > Raytheon, Aerospace Engineering Services > "If you can make it, We can fake it!"