100 FORMAT( HX)=(1+BX )
Recall, that prior to FORTRAN 90, FORTRAN had no reserved words.
Yes that does look weird at first sight.
The bigger problem is that it's absolutely ambiguous in the light of
CDC FTN syntax. It can legitimately mean either a FORMAT statement
with the Hollerith constant ")=)1+B" or an assignment to the HX-th
element of an array called FORMAT of the value obtained by evaluating
1+BX. The PTR ended up on the "deferred" list for quite a long time
as no one could think of an adequately airtight fix. Lots of work-
arounds were proposed, such as "well, if the statement number is
referenced in an I/O statement, then it's a FORMAT" or "if there's an
array called FORMAT, then it's an assignment". Unfortunately,
FORTRAN doesn't demand that FORMAT statements be referenced by an I/O
statement--"orphans" are perfectly legal. It was a real puzzle.
Thanks for that, I had completely missed what you were saying, though
I still don't know what a PTR is, except for a Paper Tape Reader or
an abbreviation for PoinTeR. A bug report?
If a FORMAT statement is not referenced by a READ or WRITE statement,
does it matter if it is compiled incorrectly?
Anyway, if they wanted an assign 1+BX, why put it in parentheses?
Still an interesting example though.
Smart*ss customers!
The usual way for FORTRAN compilers to work back then was to look at
the first word of a statement and attempt to parse it accordingly.
If that failed, then the statement was deemed to be an expression and
re-parsed.
I presume that's why some Basics needed LET before an assignment.
This is only one case where a vendor's language
extension got it into
trouble. Early on, most language standard specifications called out
the minimum subset of the language that had to be implemented and
remained silent on vendor extensions. Hence, you got scads of
differing dialects all claiming to be "FORTRAN IV". To my knowledge,
this persists in BASIC more than in any other language, ANSI X3.113
nothwithstanding.
Human languages are far worse of course.
Roger.