Skip to main content
Added explanation of polymorphic construct
Source Link

The point to note here is the double parentheses. This is because print is a function that takes a single argument which is a variable length array of the union of all types. The inner parenthesis are the array constructor. This is how polymorphism is handled in this strongly typed language.

In case stropping mode:

In case stropping mode:

The point to note here is the double parentheses. This is because print is a function that takes a single argument which is a variable length array of the union of all types. The inner parenthesis are the array constructor. This is how polymorphism is handled in this strongly typed language.

In case stropping mode:

Subtle fixes to font stropping for any pedants reading
Source Link

     ¢ we can define our own operators in Algol 68 ¢
     op % = ( int a, b) int:
          ((b == 0 ||
               a
          ||
               b % (a mod b)
          ));
     int i,j;
     read((i,j));
     print(( i % j , newline))

     ¢ we can define our own operators in Algol 68 ¢
     op % = ( int a, b) int:
          ((b = 0 |
               a
          |
               b % (a mod b)
          ));
     int i,j;
     read((i,j));
     print(( i % j , newline))

     ¢ we can define our own operators in Algol 68 ¢
     op % = ( int a, b) int:
          ((b = 0 |
               a
          |
               b % (a mod b)
          ));
     int i,j;
     read((i,j));
     print(( i % j , newline))

Updated to properly show concrete stropping modes
Source Link

Some features that modern programmers may find different, is that empty statements are not permitted. You cannot just add ; everywhere. You have to use the SKIP statement if you want to explicitly have nothing. It also was designedpermitted the coding of concurrent programs very easily. Algol 68 also, notably, used backwards keywords as terminators, such as esac, od, fi etc.

The language had a representation used for havingwriting the code that used many fonts in the input, so representing keywords could be in in bold, and identifiers in italic, for example. At the time, but to my knowledgeand probably still, no compiler implemented this feature of the design. It alsoThe language permitted the codingseveral different concrete representations of concurrent programs very easilyusing stropping modes. This allowed programs to be prepared using limited character sets, such as might be found in computers in the 1960s. Consider the a short program fragment, which would be represented as:

if i < 0 then skip fi

This could be prepared for a compiler in prime stropping mode as:

'IF' I 'LT' 0 'THEN' 'SKIP' 'FI'

In dot stropping mode this would be:

.IF I .LT 0 .THEN .SKIP .FI

In case stropping mode this would be:

IF i < 0 THEN SKIP FI

print (("Algol 68 was made in 1968!", newline))

In case stropping mode:

     int n;
     read ((n));
     for i from 1 to n do
          for j from 1 to n do
               ¢ here we use an abbreviated IF clause ¢
               print (( ( j = 1 OR j = i OR j = n |
                    "N"
               |
                    " "
               ) ))
          od ;
     print ((newline))
     od

In case stropping mode:

#Task 3#

     ¢ we can define our own operators in Algol 68 ¢
     op % = ( int a, b) int:
          ((b = 0 |
               a
          |
               b % (a mod b)
          ));
     int i,j;
     read((i,j));
     print(( i % j , newline))

In case stropping mode:

Some features that modern programmers may find different, is that empty statements are not permitted. You cannot just add ; everywhere. You have to use the SKIP statement if you want to explicitly have nothing. It also was designed for having many fonts in the input, so keywords could be in bold, and identifiers in italic, for example, but to my knowledge, no compiler implemented this feature of the design. It also permitted the coding of concurrent programs very easily.

#Task 3#

Some features that modern programmers may find different, is that empty statements are not permitted. You cannot just add ; everywhere. You have to use the SKIP statement if you want to explicitly have nothing. It also permitted the coding of concurrent programs very easily. Algol 68 also, notably, used backwards keywords as terminators, such as esac, od, fi etc.

The language had a representation used for writing the code that used many fonts representing keywords in bold, and identifiers in italic, for example. At the time, and probably still, no compiler implemented this feature of the design. The language permitted several different concrete representations of programs using stropping modes. This allowed programs to be prepared using limited character sets, such as might be found in computers in the 1960s. Consider the a short program fragment, which would be represented as:

if i < 0 then skip fi

This could be prepared for a compiler in prime stropping mode as:

'IF' I 'LT' 0 'THEN' 'SKIP' 'FI'

In dot stropping mode this would be:

.IF I .LT 0 .THEN .SKIP .FI

In case stropping mode this would be:

IF i < 0 THEN SKIP FI

print (("Algol 68 was made in 1968!", newline))

In case stropping mode:

     int n;
     read ((n));
     for i from 1 to n do
          for j from 1 to n do
               ¢ here we use an abbreviated IF clause ¢
               print (( ( j = 1 OR j = i OR j = n |
                    "N"
               |
                    " "
               ) ))
          od ;
     print ((newline))
     od

In case stropping mode:

#Task 3#

     ¢ we can define our own operators in Algol 68 ¢
     op % = ( int a, b) int:
          ((b = 0 |
               a
          |
               b % (a mod b)
          ));
     int i,j;
     read((i,j));
     print(( i % j , newline))

In case stropping mode:

Source Link
Loading