In a message dated 9/11/98 4:48:22 AM, [log in to unmask] wrote:
>A simple (?) question:
>
>Why is the precedence of .EQV. the second lowest and not the same
>as ==? Naively I would consider A.eqv.B a relational expression
>with logical result.
>Would a higher precedence lead to ambiguities, hence the
>current rules are the only sensible ones, or are the Fortran rules
>just one possible definition?
I may be a rarity, but I prefer Fortran's rule, in this case, to that of other
languages. This ordering of precedences minimizes the amount of
parenthesization compared to the other languages. In other languages
A .EQ. B .EQV. C .EQ. D
would naturally be parsed as
( ( A .EQ. B ) .EQV. C) .EQ. D
which yields a type error (assuming C is not logical and the language does not
identify integers with logicals) so that the desired comparison has to be
explicitly parenthesized as
( A .EQ. B ) .EQV. ( C .EQ. D )
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|