On 05/01/12 11:23 PM, Chuck Guzis wrote:
On 5 Jan 2012 at 22:52, Rich Alderson wrote:
From: Fred Cisin
Sent: Wednesday, January 04, 2012 7:54 PM
> Think of it as an old-style version of BASIC. WRITE is like
> PRINTUSING, with FORMAT being where you specify the print pattern.
> Any variable whose name starts with the letters I J K L M or N
> (alphabetic letters between I and N (which is the start of
> "INteger")) is assumed to be an int, unless you tell it otherwise.
> Many brands of it require giving a line number to every line. CALL
> instead of GOSUB, . . . There are so few differences that you can
> list them!
FORTRAN does not have line numbers, it has
*statement* numbers, and
they need not be sequential, nor increasing from beginning of program
to end. Certain constructs, such as the DO loop and the FORMAT-driven
I/O statements, *require* statement numbers:
DO 10 I=1,10
WRITE (7,100) I
10 CONTINUE
100 FORMAT (1X,1I3)
FORTRAN has restrictions about what you can and can't do in a DO
loop. For example, you are not permitted to change the value of the
index variable during the course of a loop. At the normal (rather
than a premature exit via GO TO) end, the value of the index variable
is undefined. Unlike BASIC, the terminal statement of a DO loop does
not specify which loop of a nested DO is being terminated--in fact,
the same terminal statement may be used for all members of a nested
DO. There are other restrictions about transfer in and out of DOs.
The devil's in the details and FORTRAN has a considerable number of
them.
There were other "simplified FORTRANs'' running around at about the
same time as K&K were working on BASIC. For example, there was
IITRAN (Illinois Institute of Technology), primarily intended for
students on TTYs, first implemented on a 7040 in 1964.
Here's a sample:
http://99-bottles-of-beer.net/language-iitran-1899.html
Note that the "==" is the assignment and "=" is the relational
operator.
And there were other "simplified FORTRANs", such as PUFFT, an ultra-
forgiving compile-and-go FORTRAN from Purdue, Waterloo had WATFOR,
and so forth.
Some preprocessors added significant value, such as Ratfor, which was
used to demonstrate the clarity of structured programming in The
Elements of Programming Style (Brian W. Kernighan and P.J. Plauger, 2nd
ed, 1978), which drily explains:
"A preprocessor is a program which translates a Fortran* dialect with
adequate control flow statements into pure Fortran; ideally you never
need to look at the generated Fortran. (The 'pseudo-code' that we will
present in the next sections is based on Ratfor ... it is described in
Software Tools, by Brian W. Kernighan and P.J. Plauger, Addison-Wesley,
1976.)
"A third possibility is to think out your code in a decent language,
then translate into Fortran when it comes time to start transcribing the
code into machine-readable form. This requires no software, just
discipline. To see how it works in practice, consider the following
quadratic equation solver, in which IF statements come so thick and fast
as to baffle the reader. ..."
--Toby
* - Following the book's orthography.
All mostly because machine time was expensive and students
appreciated instant gratification.
--Chuck