From: eachus@spectre.mitre.org (Robert I. Eachus)
Subject: Re: Q: on redefinition of equal
Date: 1996/04/05
Date: 1996-04-05T00:00:00+00:00 [thread overview]
Message-ID: <EACHUS.96Apr5103733@spectre.mitre.org> (raw)
In-Reply-To: 4k131kINN2ac@thalamus.cis.ohio-state.edu
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) <wwgrol@PSESERV3.FW.HAC.COM> 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...
prev parent reply other threads:[~1996-04-05 0:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-04-03 0:00 Q: on redefinition of equal W. Wesley Groleau (Wes)
1996-04-04 0:00 ` david scott gibson
1996-04-05 0:00 ` Brad Balfour
1996-04-05 0:00 ` david scott gibson
1996-04-05 0:00 ` Robert I. Eachus [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox