Produce different behaviour in all versions of your language Write a program that:


if a compiled language is used, compiles without errors
if an interpreted language is used, runs without syntax errors


for every major release of your language, and produces different output for every major release under which it is compiled/run. (It may produce the same or different output for versions within the same major release, as long as it varies among major releases.) You may not output or use any part of the language version in your program.

A "major release" of a language is defined to be a publicly available release that added to the major version number. For example, C# has had 6 major releases, C has had 3 (K&amp;R is not a numbered version and does not contribute to the count), and Ruby has also had 3 (due to version 0.95). What number constitutes the major version number can change over time (Java has had 8 major releases).

Any language used in this challenge must have:


At least three major releases, and
A dedicated Wikipedia article.
Python

if 2 + 2 is 4:
    # Lies must be abolished

    try:
        fact = '2 + 2 = %r' % 5
        exec('True = False')
        exec('assert (2 + 2 == 5) is True')
    except ValueError:
        print('War is peace.')    
    except NameError:
        print('Freedom is slavery.')
    except SyntaxError:
        print('Ignorance is strength.')

else:
    # All is good
    print('Big Brother is watching you.')


(Edit: Had to make a change because string formatting was actually introduced in... 0.9.9)

Tested on the following versions:


0.9.1: Prints Big Brother is watching you. because 2 + 2 is 5.*
1.5: Prints War is peace. since %r string formatting is unavailable, raising a ValueError,
2.1: Prints Freedom is slavery. since True is not defined, raising a NameError,
3.4: Prints Ignorance is strength. since True cannot be assigned to, raising a SyntaxError.


As a bonus, Python 2.3 to 2.7 gives no output, since the assertion passes.

Note that there are four spaces on both "blank" lines, and the file also needs to have a trailing newline.

* is checks object equality, and only from 1.0.0 onwards were small integers shared. You can still see the effect today by trying larger numbers, e.g. 999 + 1 is 1000 gives False.