Ratfor

From Wikipedia, the free encyclopedia

Ratfor (short for RATional FORtran) is a programming language implemented as a preprocessor for Fortran. It provides modern control structures to replace Fortran's GOTOs and statement numbers.

Ratfor was first described in the book "Software Tools" (Kernighan and Plauger, 1976) and was implemented at about this time, when the authors were with Bell Telephone Laboratories.

Ratfor provides the following kinds of flow-control statements, described by Kernighan and Plauger as "shamelessly stolen from the language C, developed for the UNIX operating system by D.M. Ritchie" ("Software Tools", p. 318):

  • statement grouping with braces
  • if-else, switch, while, for, do, repeat-until controls
  • "free-form" statements, i.e., not rigidly restricted by lines of code
  • <,>,>=... in place of .GT., .GE..
  • break, next, return,
  • ... and some other convenient features.

Ratfor is itself written in Ratfor, and inasmuch as its own translation to Fortran is available, it can be ported to any Fortran system, and surely has been.

[edit] External links

[edit] See also

In other languages