Lecture Notes – September 20th
A reserved word is a word that can’t be used as an identifier
Pre-defined terms can be used in a different context, but lose access to their original context when they are redefined.
Pascal has three loop constructs |
FORTRAN IV has only 1 |
Pascal has two selection constructs |
FORTRAN IV had 4 (or 5, depending on whether you count the END= and ERR= as separate ones) |
Pascal has mod as an operator |
FORTRAN IV had MOD as a function |
Pascal has 2 distinct division operators |
FORTRAN IV has only 1 |
Pascal has 36 reserved words |
FORTRAN IV has none |
Pascal uses and, or, not |
FORTRAN IV uses .AND. .OR. .NOT. |
Pascal’s and takes precedence over its or |
FORTRAN IV … |
|
|
Pascal has a function for exponentiation |
FORTRAN IV has an operator for raising a number to a power ** |
Pascal can pass parameters by reference or by value |
FORTRAN IV passes all parameters by reference |
Pascal has two types of subprograms FUNCTION and PROCEDURE |
FORTRAN IV has two types of subprograms – FUNCTION and SUBROUTINE |
|
FORTRAN has a much richer set of built-in functions |
Pascal’s standard input and output devices are referenced by INPUT, OUTPUT |
FORTRAN’s standard input and output devices are referenced by numbers (usually 5 and 6 respectively) |
Pascal requires that the subprograms precede the BEGIN in a program. |
FORTRAN let you place your subprograms at the top of the main program or after it. - |
Pascal did not have separate compilation units |
FORTRAN has separate compilation units |
Pascal requires that you declare every variable |
FORTRAN has default declarations |
Pascal labels are 1 to 4 digits |
FORTRAN labels are numbers |
Pascal assignment operator is := |
FORTRAN assignment operator = |
|
|