PL/I weirdness

Apparently, this was perfectly legal code in the programming language PL/I:

IF IF = THEN
    THEN THEN = ELSE
    ELSE ELSE = IF

The language just guessed when you wanted a string to be a keyword and when a variable, so that the second 'IF' was assumed to be an entirely different animal than the first one, and so on.

(Source: P. J. Plauger, Programming on Purpose III, p. 28)

No comments:

Post a Comment