[comp.lang.fortran] Fortran 8x, INTERNAL procedures

jlg@a.UUCP (Jim Giles) (03/24/88)

> The criterion for Fortran 8x features (in my opinion) should be to
> certify existing practice or to extend the language in a significant
> way.  I will use this criterion throughout this discussion.

Internal procedures are a useful addition to the Fortran language.  There
are many Fortran environments that have internal procedures (even if only
through the mechanism of a preprocessor).  Internal procedures fit both
my inclusion criteria.

The present proposal is not without its problems though.

1) Internal procedures should be allowed to be nested.  This would allow
   more careful modularization of a program.

2) Many people have complained that the internal procedure definition
   should not appear at the end of the host procedure.  I disagree (the
   cluttering up of the beginning of a program with nit-picky internal
   details makes code harder to read).  However, to accomodate these
   people, I think that the internal procedures should be allowed anywhere
   the user desires to put them.

3) Most implementations of internal procedures will probably offer compiler
   directives that allow the user to specify whether the procedure is to be
   expanded in-line or left seperate and referenced through a return jump
   when called.  I think the standard should recognize this distinction and
   provide for it in the standard syntax (perhaps by calling some routines
   INLINE procedures instead of INTERNAL).

4) The use of the INTERNAL keyword to declare MODULE procedures is
   misleading since most implementations will probably group module
   procedures in a subroutine library and all references to them would be
   handled as external calls.  The implementation doesn't HAVE to do it
   this way, but it doesn't have to expand them as regular internal
   procedures either.  Since the standard makes an explicit distinction
   between INTERNAL and MODULE procedures (section 12.1.2.2), the
   the syntax should reflect this distinction.

J. Giles
Los Alamos