Timeline for (In)significance of spaces in parsing Fortran IV
Current License: CC BY-SA 4.0
16 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
yesterday | comment | added | dave | Oh, I misread what you originally wrote - I read as if it compiled a proper format statement as a consequence of the PRINT referencing it. Apologies. | |
yesterday | comment | added | Leo B. | @dave Indeed, I used DIMENSION FORMAT(10) . Without it, nothing is formed out of the ambiguous statement, and even if it is labeled, the print statement complained about an undefined label. The compiler is FOREX by the Keldysh Institute of Applied Mathematics in Moscow (F O R E X ИПM AH CCCP 4.13 OT 11.09.85 ) | |
yesterday | comment | added | Leo B. | @dave It forms an assignment and gives the address of the machine code to the print operator as the address of the format string. | |
yesterday | vote | accept | Adrian McCarthy | ||
yesterday | comment | added | Adrian McCarthy | The second section of this answer clears it up for me. Thanks. | |
yesterday | comment | added | dave | @LeoB. - have you tried compiling DIMENSION FORMAT(10) \ X5H = 1 \ FORMAT(X5H)=... ? Does the DIMENSION statement nudge the compiler toward an assignment? (with illegal real subscript...) | |
yesterday | history | edited | dave | CC BY-SA 4.0 | added 322 characters in body |
yesterday | comment | added | dave | Why garbage? It was legal in FORTRAN IV to have a FORMAT with only hollerith and blank conversions, e.g. to print titles. So once you've decided it was a FORMAT and not an arithmetic statement, it should work. (I am not disbelieving you, I just don't get why that bug happens). What compiler? | |
yesterday | comment | added | Leo B. | @JohnDoty Out of 3 FORTRAN compilers I can try, two treat it as a FORMAT statement if it is labeled, but behave differently when it is not (one prints a warning as for any other unlabeled FORMAT statement, the other ignores the statement silently), and the third compiler compiles the statement as an assignment operator. If it is labeled and a PRINT statement refers to it, garbage in the output and I/O errors result. | |
2 days ago | comment | added | texdr.aft | here are pointers to the source code for FORTRAN I/II: texdraft.github.io/fortran/fortran-10.html#C0190-definition subroutine for getting next nonblank; texdraft.github.io/fortran/fortran-10.html#CB000-definition part of logic for statement classification | |
2 days ago | history | edited | dave | CC BY-SA 4.0 | added 4 characters in body |
2 days ago | comment | added | dave | True. Per the FORTRAN II logic, that would be classified as an arithmetic statement. | |
2 days ago | history | edited | dave | CC BY-SA 4.0 | added 684 characters in body |
2 days ago | comment | added | John Doty | There is the infamous FORMAT(X5H)=(1.), an ambiguous but improbable statement. | |
2 days ago | history | edited | dave | CC BY-SA 4.0 | added 85 characters in body |
2 days ago | history | answered | dave | CC BY-SA 4.0 |