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

On my tour of Hell...

I saw a man being continually beaten with a carpenter's hammer, blow after merciless blow. "How can this be just?" I asked ...