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,183a4dcac8cf6632 X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: Q: on redefinition of equal Date: 1996/04/05 Message-ID: #1/1 X-Deja-AN: 145959672 references: <9604031559.AA05644@most> <4k131kINN2ac@thalamus.cis.ohio-state.edu> organization: The Mitre Corp., Bedford, MA. newsgroups: comp.lang.ada Date: 1996-04-05T00:00:00+00:00 List-Id: In article <4k131kINN2ac@thalamus.cis.ohio-state.edu> dgibson@thalamus.cis.ohio-state.edu (david scott gibson) writes: > In article <9604031559.AA05644@most>, > W. Wesley Groleau (Wes) wrote: > >How much will it cost over the life cycle to have maintenance programmers > >replacing > > if (A = B) = True then > >with > > if A = B then > >only to (attempt to) compile and then change it back? > Well, of course, this is only one of the problems with such a > strategy. BTW, I consider > if Is_True(A = B) then > preferable to using two different ='s since appears a little less > confusing. Note that I'm only exploring possibilities at this point! > >Of course, with GNAT you can change the compiler to accept the standard > >form with your new type Bool :-) First, a big suprise for all you Ada users: RM95 5.3(4): "A condition is expected to be of any boolean type." The rule in Ada 83 is the same. If Bool is derived directly or indirectly from Standard.Boolean, then it is a boolean type. This is very useful if you want to provide an enumeration representation clause to match hardware. However if you need a three valued type, may I suggest that if...then...else be replaced with: case X is when True => .... when False => .... when others => end case; -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...