ALGOL: Algolithmic Language

[top]

  1. Actually so called RA60, Revised Algol-60.
  2. Ancestor of Pascal, Modula family, BCPL, C, C++, Simula and Ada.
  3. The first language defined formally by using BNF.
  4. Passing parameters by name.
  5. Example: Calculate 1*1 + 2*2 + 3*3 + ... + 10*10 = 385

    'begin'
        'comment'
             Example of call by name.
        ;
    
        'integer' 'array' data [1:10];
        'integer' i;
        'integer' sum;
    
        'integer' 'procedure' GPS(I, N, Z, V);
        'integer' I, N, Z, V;
        'begin'
        	'for' I := 1 'step' 1 'until' N 'do'
                Z := V;
            GPS := 1
        'end';
    
        'for' i := 1 'step' 1 'until' 10 'do'
            data[i] := i * i;
        sum := 0;
        GPS(i, 10, sum, sum + data[i]);
        vprint("Result is ", sum)
    'end'
    

  6. References:

[top]