The foo preprocessor

The TONTO system is written in foo, a preprocessor which encourages a good object-oriented programming style. foo is closely related to Fortran95, and indeed, foo code currently translates into standard compliant Fortran95 code.

The following sections describe the rules for valid input to the foo preprocessor, and the actual transformation process performed by the preprocessor.

Although the rules are quite simple, and examples are given, it is probably easier to examine foo modules that have already been written. It should be possible to understand foo code without reading the formal rules, if you already have a basic knowledge of object-oriented programming techniques and syntax.

The most important element of the foo language is the introduction of a "dot notation". In this notation, a dot "." expands either into the Fortran95 "%" type separator symbol, or a procedure call, depending respectively on whether there is, or is not, a type component with the appropriate name defined in the type. Thus, using the dot notation, it is possible for the programmer to "hide" the detailed implementation of a type (and hence a module) from a casual user. In this way, the computer code becomes robust to future changes, sincethe distinction between a routine and actual data becomes blurred.

Note that you don't have to write your code in the foo language --- plain Fortran95 is fine, provided you stick to the guidelines in the previous chapter -- but foo has many advantages, and is worth the minimal effort required to learn it.

Key advantages of the foo preprocessor

If you do choose write your code in foo, then the following advantages are available to you:

Notes

[1]

But this makes it nearly mandatory to use indentation, which is good programming practice