Monday, June 08, 2015

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

Zeno for the computer age

If you wish to better understand Zeno's worry about the continuum, you could do worse than to consider loops in software. Case 1: You...