by qubex · 6y ago · 0 comments
The original Ratfor brings FORTRAN 66 nearly up to the level of a respectable programming language.
It turns this:
if (a > b) {
max = a
} else {
max = b
}
Into this: IF(.NOT.(A.GT.B))GOTO 1
MAX = A
GOTO 2
1 CONTINUE
MAX = B
2 CONTINUE
... with proper columnization, of course.Going the opposite direction is pretty miraculous to me.
Ratfiv is the follow-on, which did the same to FORTRAN 77. However, FORTRAN 77 had control structures beyond the conditional GOTO, so Ratfiv was somewhat less necessary.
FORTRAN 77 would look like this:
IF (A .GT. B) THEN
MAX = A
ELSE
MAX = B
ENDIF
https://en.wikipedia.org/wiki/Ratfiv[0] https://www.goodreads.com/book/show/515603.Software_Tools