(j3.2006) (SC22WG5.4210) [ukfortran] RE: 43 Fortran compilers

N.M. Maclaren nmm1 at cam.ac.uk
Tue Mar 2 03:25:58 EST 2010


On Mar 1 2010, Bill Long wrote:
>
>Indeed, M77.  I looked at the manual and found that, in 1980, M77 had 
>the radical extension of A .op. B where op was and, or, xor, ... and A 
>and B were numeric type variables, with the operations bitwise.  Only 30 
>years ago.  Maybe this idea needs a bit more time to mature. :)

Or rot down?

It was a major nightmare - and I don't mean just for portability.
Even with a single compiler for a single architecture, bit-flipping
on REAL and the sign bit of integers is beyond the ability of almost
all programmers.  If I recall, those machines weren't twos complement,
either, but I didn't use them directly.

Restricting it to non-negative integers has worked in many languages,
but with the ongoing problem of priority.  A == B.OR.C has been a major
gotcha in every language that I know of that has allowed it.  Even using
two operators for the two priorities (and, to some extent, functionality)
helps only a little.

And, yes, I do mean that porting CDC Fortran wasn't JUST a matter of
changing its syntax - it was amazing how often one discovered that the
original programmer had made an error with bit twiddling due to the
above gotchas.

Regards,
Nick Maclaren.




More information about the J3 mailing list