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: "Tarjei Tj�stheim Jensen" Subject: Re: Disallowing Pre-Defined Operations Date: 2000/03/11 Message-ID: <38CA05AF.7E77790D@online.no>#1/1 X-Deja-AN: 596005704 Content-Transfer-Encoding: 7bit References: <8a9eeg$qtv$1@newpoisson.nosc.mil> <8ababr$c3u$1@wanadoo.fr> Content-Type: text/plain; charset=us-ascii X-Complaints-To: news-abuse@online.no X-Trace: news1.online.no 952763790 130.67.225.217 (Sat, 11 Mar 2000 09:36:30 MET) Organization: Jensen programvareutvikling MIME-Version: 1.0 NNTP-Posting-Date: Sat, 11 Mar 2000 09:36:30 MET Newsgroups: comp.lang.ada Date: 2000-03-11T00:00:00+00:00 List-Id: Jean-Pierre Rosen wrote: > 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.) > > Not only was it considered - it's there. [snip] > function "/" (L, R : Length) return length is abstract; That is really a workaround. I think both he and I would have preferred something like pragma disallow_predefined(operator => "/", a_type, a_type); pragma disallow_predefined(operator => all, all, a_type); pragma allow_predefined(operator => "+", a_type, a_type); pragma map_predefined_result(result_type => integer, operator => "/", a_type, a_type); I think that would be more readable and a lot less work. It will of course not work very well with a nonconforming compiler. Greetings,