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=-0.5 required=5.0 tests=BAYES_00,INVALID_MSGID, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,c7ea1cb7a2beb2ee X-Google-Attributes: gid103376,public From: "Jean-Pierre Rosen" Subject: Re: Disallowing Pre-Defined Operations Date: 2000/03/10 Message-ID: <8ababr$c3u$1@wanadoo.fr>#1/1 X-Deja-AN: 595754582 References: <8a9eeg$qtv$1@newpoisson.nosc.mil> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 X-Complaints-To: abuse@wanadoo.fr X-Trace: wanadoo.fr 952708283 12414 193.250.32.157 (10 Mar 2000 17:11:23 GMT) Organization: Adalog X-MSMail-Priority: Normal NNTP-Posting-Date: 10 Mar 2000 17:11:23 GMT Newsgroups: comp.lang.ada Date: 2000-03-10T17:11:23+00:00 List-Id: Charles H. Sampson a �crit dans le message : 8a9eeg$qtv$1@newpoisson.nosc.mil... > 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.) Not only was it considered - it's there. > As an example of what I'm talking about, consider a package that > implements three distinct floating-points types for measuring length, > area, and volume. The pre-defined "+" and "-" are acceptable and there > are obvious redefinitions of "*" and "/" in some cases. However, the > pre-defined "/" for operands of the same type don't make sense and it > would be nice to get a compile-time warning if one of them is used. function "/" (L, R : Length) return length is abstract; (but yes, the predefined one may reappear in generics, but that's a good thing; it allows you to use predefined math libs for example). -- --------------------------------------------------------- J-P. Rosen (Rosen.Adalog@wanadoo.fr) Visit Adalog's web site at http://pro.wanadoo.fr/adalog