ALGOL W

From Seo Wiki - Search Engine Optimization and Programming Languages

Jump to: navigation, search

ALGOL-W is a programming language. It was based on a proposal for ALGOL-X by Niklaus Wirth and Tony Hoare as a successor to ALGOL 60 in the IFIP Working Group 2.1. When the committee decided that the proposal was not a sufficient advance over ALGOL 60, the proposal was published Niklaus Wirth & C. A. R Hoare (1966). Wirth supervised a high quality implementation for the IBM/360 at Stanford University that was widely distributed.

It represented a relatively conservative modification of ALGOL 60, adding string, bitstring, complex number and reference to record datatypes and call-by-result passing of parameters, introducing the while statement, replacing switch with the case statement, and generally tightening up the language.

The implementation was written in PL/360, an ALGOL-like assembly language designed by Wirth. The implementation included influential debugging and profiling capabilities.

Syntax

ALGOL-W is small and statically typed (like most of Wirth's languages (including Pascal, Modula-2 and Oberon) but not Euler, which has dynamic types). The language that eventually became ALGOL 68 is much larger and more complex than ALGOL-W, and it differs more from ALGOL 60 than ALGOL-W does.

record PERSON (
    string NAME; 
    integer AGE; 
    logical MALE; 
    reference(PERSON) FATHER, MOTHER, YOUNGESTOFFSPRING, ELDERSIBLING
);

reference(PERSON) procedure YOUNGESTUNCLE (reference(PERSON) R);
    begin
        reference(PERSON) P, M;
        P := YOUNGESTOFFSPRING(FATHER(FATHER(R)));
        while (P ¬= null) and (¬ MALE(P)) or (P = FATHER(R)) do
            P := ELDERSIBLING(P);
        M := YOUNGESTOFFSPRING(MOTHER(MOTHER(R)));
        while (M ¬= null) and (¬ MALE(M)) do
            M := ELDERSIBLING(M);
        if P = null then 
            M 
        else if M = null then 
            P 
        else 
            if AGE(P) < AGE(M) then P else M
    end

External links

de:Algol W

fr:Algol W pt:Algol-W

Personal tools

Served in 0.076 secs.