Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!umd5!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!uiucdcs!uxc.cso.uiuc.edu!uxe.cso.uiuc.edu!hirchert From: hirchert@uxe.cso.uiuc.edu Newsgroups: comp.lang.fortran Subject: Re: F8X: a call to action Message-ID: <50500028@uxe.cso.uiuc.edu> Date: 16 Feb 88 22:34:00 GMT References: <15208@beta.UUCP> Lines: 29 Nf-ID: #R:beta.UUCP:15208:uxe.cso.uiuc.edu:50500028:000:1544 Nf-From: uxe.cso.uiuc.edu!hirchert Feb 16 16:34:00 1988 On the subject of the proposed Fortran 8x CASE construct 1. The suggested alternative syntax would probably fit well in a Pascal-like language with reserved words, significant blanks, etc. I suspect it would be a nightmare to parse in the context of Fortran. 2. With the exception of the assignment statement and the statement function (which looks syntactically like an assignment statement), all statements in Fortran begin with a keyword. Hence, the keyword CASE was used in the "case labels". 3. Many of the keywords used for executable statements are verbs. Hence, the keyword SELECT was included in the initial statement. 4. Note that CASE DEFAULT is different from CASE(DEFAULT). The latter is for a case identified by a symbolic constant named DEFAULT. The suggested alternative syntax does not make this distinction. 5. When the actions involve only a single statement, the new source form can be used to readably reduce the number of lines involved: SELECT CASE(N) CASE(:-1);SIGNUM=-1 CASE(0); SIGNUM=0 CASE(1:); SIGNUM=1 END SELECT In answer to the question about how this compares to the C switch statement, this construct guarantees that only a single CASE block will be executed. In other words, it is like switch with all the necessary break statements included. In still other words, it is like a Pascal case statement (but with a default case capability that is a nonstandard Pascal extension). Kurt W. Hirchert National Center for Supercomputing Applications