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=2.1 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY,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: dmitry6243@my-deja.com Subject: Re: Disallowing Pre-Defined Operations Date: 2000/03/13 Message-ID: <8aibjl$egt$1@nnrp1.deja.com>#1/1 X-Deja-AN: 596769609 References: <8a9eeg$qtv$1@newpoisson.nosc.mil> <8ababr$c3u$1@wanadoo.fr> <38CA05AF.7E77790D@online.no> X-Http-Proxy: 1.0 x21.deja.com:80 (Squid/1.1.22) for client 212.79.192.251 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Mon Mar 13 09:15:35 2000 GMT X-MyDeja-Info: XMYDJUIDdmitry6243 Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.7 [en] (WinNT; I) Date: 2000-03-13T00:00:00+00:00 List-Id: In article <38CA05AF.7E77790D@online.no>, "Tarjei Tj�stheim Jensen" wrote: > > > 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. I do not think that using pragmas (there are already too many of them) is a right way. Anyway a more general solution is required. Some time ago I proposed explicit operation hiding, something like: package Unordered_Numbers is type Unordered is new Integer; function ">" (Left, Right : Unordered) return Boolean is null; function ">=" (Left, Right : Unordered) return Boolean is null; function "<" (Left, Right : Unordered) return Boolean is null; function "<=" (Left, Right : Unordered) return Boolean is null; end Unordered_Numbers; It was considered too complex to implement. Regards, Dmitry Sent via Deja.com http://www.deja.com/ Before you buy.