Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!uwvax!tank!mimsy!eneevax!haven!umbc3!mbph!hybl From: hybl@mbph.UUCP (Albert Hybl Dept of Biophysics SM) Newsgroups: comp.lang.fortran Subject: An exercise in futility (was Results of the UGLY code) Keywords: Cumulative_Annual_Pocket_Part Message-ID: <583@mbph.UUCP> Date: 30 Dec 88 19:22:54 GMT Organization: University of Maryland, School of Medicine, Baltimore, MD 21201 Lines: 54 In message-ID: <1750@devsys.oakhill.UUCP>, Steven R Weintraub, Motorola Inc. Austin, Texas--cs.utexas.edu!oakhill!devsys!steve, summarized the results of his "UGLY" code problem run on about 24 different compilers. The test problem was: > K = 0 > DO 10 I = 1,10 > IF (I.EQ.1.OR.I.EQ.5) GOTO 10 > DO 10 J = 1,10 > IF (J.EQ.3) GOTO 10 > 10 K = K + 1 > PRINT *,K > END Half of the fortran implementations produced an ERROR diagnostic; the other half gave numeric answers having the disparate values 80, 82 or 92. Steve has shown that the USENET can be used to rapidly discover ambiguities in a language standard. Discussions in this newsgroup can propose corrective language to eliminate ambiguities from the standard. The real problem is how to incorporate the new language in a standard that has been chiseled in stone? Must we wait for FORTRAN8x? :-( After our law makers write and pass laws, the laws appear in a publication of state or federal statutes. The legislature will try to correct a discovered flaw or ambiguity in a law during their next session. In rare cases, a special session may be called to tackle the problem. Ambiguities in the law can also be resolved by the courts. All new laws, recently revised laws and notes of court cases are placed in the "Cumulative Annual Pocket Part" which is placed in the back of the appropriate volume of the statutes. The purpose of the Fortran ANSI X3.9 1978 standard "is to promote portability of FORTRAN programs for use on a variety of data processing systems." The result of Steve's survey shows that not even a simple double do loop is immune to ambiguity when tested for horizontal portability. His example and others (see Fortech Forum, Vol 2 pages 5-6; Fortran Forum, Vol 4 pages 19-20 and Fortran Forum Vol 6 pages 10-11) proves that computer language standards need a "Cumulative Annual Pocket Part." Without it, the hope for a horizontally portable standard is an exercise in futility. ---------------------------------------------------------------------- Albert Hybl, PhD. Office UUCP: uunet!mimsy!mbph!hybl Department of Biophysics Home UUCP: uunet!mimsy!mbph!hybl!ah University of Maryland CoSy: ahybl School of Medicine Baltimore, MD 21201 Phone: (301) 328-7940 (Office) ----------------------------------------------------------------------