⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 m4

📁 unix v7是最后一个广泛发布的研究型UNIX版本
💻
字号:
.NHEXPERIENCE.SHGood Things.PP``It'sso much better than Fortran''is the most common response of userswhen asked how wellRatformeets their needs.Although cynics might consider this to be vacuous,it does seem to be true that decent control flow and cosmetics converts Fortranfrom a bad language into quite a reasonable one,assuming that Fortran data structures are adequatefor the task at hand..PPAlthough there are no quantitative results,users feel that coding inRatforis at least twice as fast as in Fortran.More important, debugging and subsequent revisionare much faster than in Fortran.Partly this is simply because the code can be.ulread.The looping statementswhich test at the top instead of the bottomseem to eliminate or at leastreduce the occurrence of a wide class ofboundary errors.And of course it is easy to do structured programming in Ratfor;this self-discipline also contributesmarkedly to reliability..PPOne interesting and encouraging fact is thatprograms written inRatfortend to be as readable as programswritten in more modern languageslike Pascal.Once one is freed from the shackles of Fortran'sclerical detail and rigid input format,it is easy to write code that is readable, even esthetically pleasing.For example,here is aRatforimplementation of the linear table search discussed byKnuth [7]:.P1A(m+1) = xfor (i = 1; A(i) != x; i = i + 1)	;if (i > m) {	m = i	B(i) = 1}else	B(i) = B(i) + 1.P2A large corpus (5400 lines) of Ratfor, including a subset ofthe Ratfor preprocessor itself,can be found in[8]..SHBad Things.PPThe biggest single problem is that many Fortran syntax errorsare not detected byRatforbut by the local Fortran compiler.The compiler then prints a messagein terms of the generated Fortran,and in a few cases this may be difficultto relate back to the offendingRatforline,especially if the implementation conceals the generated Fortran.This problem could be dealt withby tagging each generated line with some indicationof the source line that created it,but this is inherently implementation-dependent,so no action has yet been taken.Error message interpretationis actually not so arduous as might be thought.Since Ratfor generates no variables,only a simple pattern of.UC IF 'sand.UC GOTO 's,data-related errors like missing.UC DIMENSIONstatementsare easy to find in the Fortran.Furthermore, there has been a steady improvementin Ratfor's ability to catch trivial syntacticerrors like unbalanced parentheses and quotes..PPThere are a number of implementation weaknessesthat are a nuisance, especially to new users.For example,keywords are reserved.This rarely makes any difference, except for those hardy soulswho want to use an Arithmetic .UC IF .A few standard Fortranconstructions are not accepted by Ratfor,and this is perceived as a problem by users with a large corpusof existing Fortran programs.Protecting every line with a `%' is not really acomplete solution, although it serves as a stop-gap.The best long-term solution is provided by the programStruct [9],which converts arbitrary Fortran programs into Ratfor..PPUsers who export programs often complain that the generated Fortran is``unreadable'' because it is not tastefully formatted and contains extraneous.UC CONTINUEstatements.To some extent this can be ameliorated(Ratfor now has an option to copy Ratfor comments intothe generated Fortran),but it has always seemed that effort is better spenton the input language than on the output esthetics..PPOne final problem is partly attributable to success _since Ratfor is relatively easy to modify,there are now several dialects of Ratfor.Fortunately, so far most of the differences are in character set,or in invisible aspects like code generation.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -