home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / edu / 1402 < prev    next >
Encoding:
Internet Message Format  |  1992-08-29  |  1.9 KB

  1. Xref: sparky comp.edu:1402 comp.lang.fortran:3270
  2. Newsgroups: comp.edu,comp.lang.fortran
  3. Path: sparky!uunet!gatech!hubcap!mjs
  4. From: mjs@hubcap.clemson.edu (M. J. Saltzman)
  5. Subject: Re: Small Language Wanted
  6. Message-ID: <1992Aug28.225600.7730@hubcap.clemson.edu>
  7. Keywords: modular programming
  8. Organization: Clemson University, Clemson SC
  9. References: <8749@amsaa-cleo.brl.mil> <1992Aug28.161000.6930@newshost.lanl.gov> <1992Aug28.200552.28137@ctr.columbia.edu>
  10. Distribution: na
  11. Date: Fri, 28 Aug 1992 22:56:00 GMT
  12. Lines: 33
  13.  
  14. In article <1992Aug28.200552.28137@ctr.columbia.edu> shenkin@avogadro.barnard.columbia.edu (Peter S. Shenkin) writes:
  15. >In article <1992Aug28.161000.6930@newshost.lanl.gov> jlg@cochiti.lanl.gov (Jim Giles) writes:
  16. >>
  17. >>semantically, a WHILE loop *IS* the following:
  18. >>
  19. >>   10 IF (cond) THEN              !WHILE
  20. >>         ... body of loop ...
  21. >>      GOTO 10
  22. >>      ENDIF                       !END WHILE
  23. >>
  24. >>Proper commentary will elucidate this further, and you should never
  25. >>use the label as the target of any *other* GOTO.  
  26. >
  27. >The authors of "Numerical Recipes" observed that it is not the GOTO that
  28. >is the problem -- it is the label.  When you see a GOTO, you know exactly 
  29. >what is supposed to happen.  But when you see a label, a branch to it could 
  30. >have come from anywhere.  Using GOTOs and labels as carefully as implied 
  31. >by Jim's last comment is one trick to writing clean, structured Fortran.
  32.  
  33. Reminds me (though I can't place the source) of the toungue-in-cheek
  34. proposal to add a COMEFROM statement.  When it appeared in your code, you
  35. were to assume that you arrived on a branch from a statement with the
  36. given label.  That reversed the usual problem, since you always knew
  37. how you could get to the statement you were looking at, but you
  38. couldn't tell what statement would follow a statement with a label.
  39. The implications were mind-boggling!
  40.  
  41.  
  42.  
  43. -- 
  44.         Matthew Saltzman
  45.         Clemson University Math Sciences
  46.         mjs@clemson.edu
  47.