home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!caen!hellgate.utah.edu!lanl!cochiti.lanl.gov!jlg
- From: jlg@cochiti.lanl.gov (J. Giles)
- Subject: Re: Logical operators and operands
- Message-ID: <1992Nov19.200731.13443@newshost.lanl.gov>
- Sender: news@newshost.lanl.gov
- Organization: Los Alamos National Laboratory
- References: <BxwrJC.GME@cs.uiuc.edu> <30476@nntp_server.ems.cdc.com> <30502@nntp_server.ems.cdc.com>
- Date: Thu, 19 Nov 1992 20:07:31 GMT
- Lines: 32
-
- In article <30502@nntp_server.ems.cdc.com>, mstemper@ems.cdc.com (Michael Stemper) writes:
- |> [...]
- |> This seems dumb! Why shouldn't the operators for equality and
- |> inequality be the same, no matter what type of operands are
- |> used? It seems to me that this is poor language design. Can
- |> somebody come up with a plausible excuse for this? Is it:
- |> a) Tradition
- |> b) History
- |> c) Easier to optimize compilers
- |> d) Grandfathered in
-
- I agree that it's dumb. I think I can say *why* it was done. There
- are a number of relations defined in the predecate calculus like
- equivalence, implication, AND, OR, NOT, etc.. These have inherently
- lower precedence than the relational operations on numeric types so
- that such relational expressions can be used as operands to the
- predecate calculus operations. However, this is a fairly weak
- connection since LOGICAL expressions are not predecate calculus:
- they don't define relationships between assertions but merely
- values. For example, if I say that assertion A is equivalent
- to assertion B, that means that they *always* have identical
- meaning. Whereas, the Fortran .EQV. operator can only tell
- you whether the expressions corresponding to the two assertions
- presently evaluate to the same truth-value. That's quite a
- difference.
-
- In any case, as long as we've got .EQV. and .NEQV. in the
- language, why not add .IMPLIES. as well? I need it rather
- more often than the others.
-
- --
- J. Giles
-