Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!gatech!psuvax1!psuvm!cunyvm!byuvax!hallidayd From: hallidayd@yvax.byu.edu Newsgroups: comp.lang.fortran Subject: Re: Is this a correct Fortran 88 subroutine? Message-ID: <790hallidayd@yvax.byu.edu> Date: 8 Sep 89 02:05:17 GMT Lines: 33 Steve Correll (sjc@key.COM), as per your message (<1018@key.COM>) concerning the legality of the construct > SUBROUTINE X(L) > LOGICAL L > IF: IF ( L ) THEN > ELSEIF ! This is not an ELSEIF statement > ENDIF IF > END in Fortran 8x --- the answer is YES in fixed form, where blanks are not significant; NO in free form, where a blank would have to appear between the ELSE and IF in the marked statement (even if the blank were inserted, the statement would be no less confusing to the human reader). See syntax rules R802 to R806 (section 8.1.2.1, p. 8-2), along with the syntax rule, R801, for block (section 8.1, p. 8-1) which alows empty blocks. This _may_ show a ``failing'' in the way the if-construct-name is alowed to be used in Fortran 8x. This construct is still unambiguous, by the syntax rules, since an else-if-stmt must include `(scalar-logical-expr)THEN', which the above does not, however, this is a confusing construct for the human reader. The question is: if the syntax alows all legal constructs to be parsed unambiguously, is it necessary for the syntax rules to exclude all constructs which can be confusing to human readers, regardless of how contrived such constructs may be? _____________________________________________________________________ / David Halliday \ | | | Internet: hallidayd@yvax.byu.edu or hallidayd@acoust.byu.edu | | BITNET: hallidayd@byuvax or hallidayd%acoust.byu.edu@utahcca | | Us Mail: BYU Physics Department | | 296 ESC | | Provo, UT 84602 | \_____________________________________________________________________/