J3/03-150 Date: 13 March 2003 To: J3 From: Nick Maclaren Subject: Recursive I/O ______________________________________ Summary ______________________________________ Some implementations of Fortran have supported recursive external I/O since the 1960s, and all experience is that it is both trivial to provide and immensely useful. Vastly the most useful aspect is the ability to call tracing and diagnostic I/O routines in a subprogram used within an I/O statement, and it seems extraordinary that Fortran still does not permit that. The only requirement is that the recursive I/O operations should be independent of one another, and most aspects of that are already required by Fortran. This caused considerable confusion with Fortran IV, where function calls were allowed in subscript expressions, unlike in the standard Fortran 66 language. Some compilers (e.g. IBM Fortran G and WATFIV) did not handle recursive I/O (or, indeed, recursive anything) and failed horribly, whereas others did. For that reason, Fortran 77 explicitly forbade recursive I/O (sections 6.6 and 12.11), but that decision has never been revisited. Fortran 90 reflected the modern acceptance of recursion, but this area seemed to have been missed. ____________________________________ Edits ______________________________________ _____________ 216:25-26 Replace: "an external unit" by: "an external unit that is identified by another I/O statement being executed"