home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.edu:1391 comp.lang.fortran:3261
- Path: sparky!uunet!cis.ohio-state.edu!ucbvax!dog.ee.lbl.gov!hellgate.utah.edu!lanl!cochiti.lanl.gov!jlg
- From: jlg@cochiti.lanl.gov (Jim Giles)
- Newsgroups: comp.edu,comp.lang.fortran
- Subject: Re: Small Language Wanted
- Keywords: modular programming
- Message-ID: <1992Aug28.161000.6930@newshost.lanl.gov>
- Date: 28 Aug 92 16:10:00 GMT
- References: <1992Aug25.095623.18808@news.Hawaii.Edu> <8749@amsaa-cleo.brl.mil>
- Sender: news@newshost.lanl.gov
- Distribution: na
- Organization: Los Alamos National Laboratory
- Lines: 33
-
-
- In article <8749@amsaa-cleo.brl.mil>, mcohen@amsaa-cleo.brl.mil (Marty Cohen) writes:
- |> [...]
- |> >And if the elimination of computed GO TOs will
- |> >help make FORTRAN more structured, then you can simply not use them.
- |> In Fortran 77 there is no way to code a while loop without using a GOTO.
-
- In *NO* language is it possible to write a WHILE loop without a GOTO.
- In most languages, this GOTO is *spelled* END WHILE (or in some similar
- way). To be sure, this is a much better spelling*(footnote). But
- semantically, a WHILE loop *IS* the following:
-
- 10 IF (cond) THEN !WHILE
- ... body of loop ...
- GOTO 10
- ENDIF !END WHILE
-
- Proper commentary will elucidate this further, and you should never
- use the label as the target of any *other* GOTO.
-
- This whole debate about GOTOs is irrelevant to the question of whether
- Fortran programs (or those in any other language) are structured or not.
-
- *(footnote): As I have stated before, it is my opinion that syntax
- is probably the *most* important aspect of a language's design. And
- the lack of a WHILE loop is a very serious weakness to standard Fortran 77
- (which is why most implementations - on mainframes anyway - already allow
- DO WHILE --- ENDDO as an extension). In spite of this weakness, Fortran
- has syntactic *advantages* over other languages for scientific/numerical
- work which offset it.
-
- --
- J. Giles
-